@inspectr/app 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,149 @@
1
+ import{r as _I,g as II,b as y,a as g,Z as il}from"./index.Di-KY2rW.js";var Ht=_I();const DI=II(Ht);var PA={},Vu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var WE={exports:{}},Ou={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var UE;function LI(){if(UE)return Ou;UE=1;var e=y,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function i(s,l,c){var d,f={},m=null,p=null;c!==void 0&&(m=""+c),l.key!==void 0&&(m=""+l.key),l.ref!==void 0&&(p=l.ref);for(d in l)n.call(l,d)&&!a.hasOwnProperty(d)&&(f[d]=l[d]);if(s&&s.defaultProps)for(d in l=s.defaultProps,l)f[d]===void 0&&(f[d]=l[d]);return{$$typeof:t,type:s,key:m,ref:p,props:f,_owner:o.current}}return Ou.Fragment=r,Ou.jsx=i,Ou.jsxs=i,Ou}var KE;function RI(){return KE||(KE=1,WE.exports=LI()),WE.exports}var u=RI(),b0={exports:{}},FI=b0.exports,VE;function $I(){return VE||(VE=1,function(e,t){(function(r,n){e.exports=n()})(FI,function(){var r=function(w,E){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(P,A){P.__proto__=A}||function(P,A){for(var D in A)Object.prototype.hasOwnProperty.call(A,D)&&(P[D]=A[D])})(w,E)},n=function(){return(n=Object.assign||function(w){for(var E,P=1,A=arguments.length;P<A;P++)for(var D in E=arguments[P])Object.prototype.hasOwnProperty.call(E,D)&&(w[D]=E[D]);return w}).apply(this,arguments)};function o(w,E,P){for(var A,D=0,H=E.length;D<H;D++)!A&&D in E||((A=A||Array.prototype.slice.call(E,0,D))[D]=E[D]);return w.concat(A||Array.prototype.slice.call(E))}var a=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Vu,i=Object.keys,s=Array.isArray;function l(w,E){return typeof E!="object"||i(E).forEach(function(P){w[P]=E[P]}),w}typeof Promise>"u"||a.Promise||(a.Promise=Promise);var c=Object.getPrototypeOf,d={}.hasOwnProperty;function f(w,E){return d.call(w,E)}function m(w,E){typeof E=="function"&&(E=E(c(w))),(typeof Reflect>"u"?i:Reflect.ownKeys)(E).forEach(function(P){h(w,P,E[P])})}var p=Object.defineProperty;function h(w,E,P,A){p(w,E,l(P&&f(P,"get")&&typeof P.get=="function"?{get:P.get,set:P.set,configurable:!0}:{value:P,configurable:!0,writable:!0},A))}function b(w){return{from:function(E){return w.prototype=Object.create(E.prototype),h(w.prototype,"constructor",w),{extend:m.bind(null,w.prototype)}}}}var v=Object.getOwnPropertyDescriptor,x=[].slice;function k(w,E,P){return x.call(w,E,P)}function S(w,E){return E(w)}function j(w){if(!w)throw new Error("Assertion Failed")}function O(w){a.setImmediate?setImmediate(w):setTimeout(w,0)}function C(w,E){if(typeof E=="string"&&f(w,E))return w[E];if(!E)return w;if(typeof E!="string"){for(var P=[],A=0,D=E.length;A<D;++A){var H=C(w,E[A]);P.push(H)}return P}var Z=E.indexOf(".");if(Z!==-1){var Q=w[E.substr(0,Z)];return Q==null?void 0:C(Q,E.substr(Z+1))}}function N(w,E,P){if(w&&E!==void 0&&!("isFrozen"in Object&&Object.isFrozen(w)))if(typeof E!="string"&&"length"in E){j(typeof P!="string"&&"length"in P);for(var A=0,D=E.length;A<D;++A)N(w,E[A],P[A])}else{var H,Z,Q=E.indexOf(".");Q!==-1?(H=E.substr(0,Q),(Z=E.substr(Q+1))===""?P===void 0?s(w)&&!isNaN(parseInt(H))?w.splice(H,1):delete w[H]:w[H]=P:N(Q=!(Q=w[H])||!f(w,H)?w[H]={}:Q,Z,P)):P===void 0?s(w)&&!isNaN(parseInt(E))?w.splice(E,1):delete w[E]:w[E]=P}}function T(w){var E,P={};for(E in w)f(w,E)&&(P[E]=w[E]);return P}var M=[].concat;function I(w){return M.apply([],w)}var vt="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(I([8,16,32,64].map(function(w){return["Int","Uint","Float"].map(function(E){return E+w+"Array"})}))).filter(function(w){return a[w]}),_=new Set(vt.map(function(w){return a[w]})),R=null;function L(w){return R=new WeakMap,w=function E(P){if(!P||typeof P!="object")return P;var A=R.get(P);if(A)return A;if(s(P)){A=[],R.set(P,A);for(var D=0,H=P.length;D<H;++D)A.push(E(P[D]))}else if(_.has(P.constructor))A=P;else{var Z,Q=c(P);for(Z in A=Q===Object.prototype?{}:Object.create(Q),R.set(P,A),P)f(P,Z)&&(A[Z]=E(P[Z]))}return A}(w),R=null,w}var F={}.toString;function B(w){return F.call(w).slice(8,-1)}var U=typeof Symbol<"u"?Symbol.iterator:"@@iterator",$=typeof U=="symbol"?function(w){var E;return w!=null&&(E=w[U])&&E.apply(w)}:function(){return null};function z(w,E){return E=w.indexOf(E),0<=E&&w.splice(E,1),0<=E}var W={};function K(w){var E,P,A,D;if(arguments.length===1){if(s(w))return w.slice();if(this===W&&typeof w=="string")return[w];if(D=$(w)){for(P=[];!(A=D.next()).done;)P.push(A.value);return P}if(w==null)return[w];if(typeof(E=w.length)!="number")return[w];for(P=new Array(E);E--;)P[E]=w[E];return P}for(E=arguments.length,P=new Array(E);E--;)P[E]=arguments[E];return P}var q=typeof Symbol<"u"?function(w){return w[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},ft=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Pn=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(ft),J={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function V(w,E){this.name=w,this.message=E}function me(w,E){return w+". Errors: "+Object.keys(E).map(function(P){return E[P].toString()}).filter(function(P,A,D){return D.indexOf(P)===A}).join(`
10
+ `)}function X(w,E,P,A){this.failures=E,this.failedKeys=A,this.successCount=P,this.message=me(w,E)}function ce(w,E){this.name="BulkError",this.failures=Object.keys(E).map(function(P){return E[P]}),this.failuresByPos=E,this.message=me(w,this.failures)}b(V).from(Error).extend({toString:function(){return this.name+": "+this.message}}),b(X).from(V),b(ce).from(V);var oe=Pn.reduce(function(w,E){return w[E]=E+"Error",w},{}),Oe=V,te=Pn.reduce(function(w,E){var P=E+"Error";function A(D,H){this.name=P,D?typeof D=="string"?(this.message="".concat(D).concat(H?`
11
+ `+H:""),this.inner=H||null):typeof D=="object"&&(this.message="".concat(D.name," ").concat(D.message),this.inner=D):(this.message=J[E]||P,this.inner=null)}return b(A).from(Oe),w[E]=A,w},{});te.Syntax=SyntaxError,te.Type=TypeError,te.Range=RangeError;var Ne=ft.reduce(function(w,E){return w[E+"Error"]=te[E],w},{}),ve=Pn.reduce(function(w,E){return["Syntax","Type","Range"].indexOf(E)===-1&&(w[E+"Error"]=te[E]),w},{});function G(){}function ye(w){return w}function le(w,E){return w==null||w===ye?E:function(P){return E(w(P))}}function ge(w,E){return function(){w.apply(this,arguments),E.apply(this,arguments)}}function Ce(w,E){return w===G?E:function(){var P=w.apply(this,arguments);P!==void 0&&(arguments[0]=P);var A=this.onsuccess,D=this.onerror;this.onsuccess=null,this.onerror=null;var H=E.apply(this,arguments);return A&&(this.onsuccess=this.onsuccess?ge(A,this.onsuccess):A),D&&(this.onerror=this.onerror?ge(D,this.onerror):D),H!==void 0?H:P}}function Me(w,E){return w===G?E:function(){w.apply(this,arguments);var P=this.onsuccess,A=this.onerror;this.onsuccess=this.onerror=null,E.apply(this,arguments),P&&(this.onsuccess=this.onsuccess?ge(P,this.onsuccess):P),A&&(this.onerror=this.onerror?ge(A,this.onerror):A)}}function Ye(w,E){return w===G?E:function(P){var A=w.apply(this,arguments);l(P,A);var D=this.onsuccess,H=this.onerror;return this.onsuccess=null,this.onerror=null,P=E.apply(this,arguments),D&&(this.onsuccess=this.onsuccess?ge(D,this.onsuccess):D),H&&(this.onerror=this.onerror?ge(H,this.onerror):H),A===void 0?P===void 0?void 0:P:l(A,P)}}function Ve(w,E){return w===G?E:function(){return E.apply(this,arguments)!==!1&&w.apply(this,arguments)}}function $e(w,E){return w===G?E:function(){var P=w.apply(this,arguments);if(P&&typeof P.then=="function"){for(var A=this,D=arguments.length,H=new Array(D);D--;)H[D]=arguments[D];return P.then(function(){return E.apply(A,H)})}return E.apply(this,arguments)}}ve.ModifyError=X,ve.DexieError=V,ve.BulkError=ce;var Ze=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function rt(w){Ze=w}var nt={},ht=100,vt=typeof Promise>"u"?[]:function(){var w=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[w,c(w),w];var E=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[E,c(E),w]}(),ft=vt[0],Pn=vt[1],vt=vt[2],Pn=Pn&&Pn.then,Qt=ft&&ft.constructor,Je=!!vt,dt=function(w,E){sr.push([w,E]),Rr&&(queueMicrotask(Zh),Rr=!1)},Gt=!0,Rr=!0,ut=[],Wt=[],Fr=ye,wr={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:G,pgp:!1,env:{},finalize:G},ze=wr,sr=[],qo=0,sn=[];function We(w){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var E=this._PSD=ze;if(typeof w!="function"){if(w!==nt)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&hu(this,this._value))}this._state=null,this._value=null,++E.ref,function P(A,D){try{D(function(H){if(A._state===null){if(H===A)throw new TypeError("A promise cannot be resolved with itself.");var Z=A._lib&&Oa();H&&typeof H.then=="function"?P(A,function(Q,re){H instanceof We?H._then(Q,re):H.then(Q,re)}):(A._state=!0,A._value=H,gu(A)),Z&&Ca()}},hu.bind(null,A))}catch(H){hu(A,H)}}(this,w)}var lo={get:function(){var w=ze,E=Os;function P(A,D){var H=this,Z=!w.global&&(w!==ze||E!==Os),Q=Z&&!co(),re=new We(function(ae,se){Na(H,new Fd(Bd(A,w,Z,Q),Bd(D,w,Z,Q),ae,se,w))});return this._consoleTask&&(re._consoleTask=this._consoleTask),re}return P.prototype=nt,P},set:function(w){h(this,"then",w&&w.prototype===nt?lo:{get:function(){return w},set:lo.set})}};function Fd(w,E,P,A,D){this.onFulfilled=typeof w=="function"?w:null,this.onRejected=typeof E=="function"?E:null,this.resolve=P,this.reject=A,this.psd=D}function hu(w,E){var P,A;Wt.push(E),w._state===null&&(P=w._lib&&Oa(),E=Fr(E),w._state=!1,w._value=E,A=w,ut.some(function(D){return D._value===A._value})||ut.push(A),gu(w),P&&Ca())}function gu(w){var E=w._listeners;w._listeners=[];for(var P=0,A=E.length;P<A;++P)Na(w,E[P]);var D=w._PSD;--D.ref||D.finalize(),qo===0&&(++qo,dt(function(){--qo==0&&bu()},[]))}function Na(w,E){if(w._state!==null){var P=w._state?E.onFulfilled:E.onRejected;if(P===null)return(w._state?E.resolve:E.reject)(w._value);++E.psd.ref,++qo,dt(js,[P,w,E])}else w._listeners.push(E)}function js(w,E,P){try{var A,D=E._value;!E._state&&Wt.length&&(Wt=[]),A=Ze&&E._consoleTask?E._consoleTask.run(function(){return w(D)}):w(D),E._state||Wt.indexOf(D)!==-1||function(H){for(var Z=ut.length;Z;)if(ut[--Z]._value===H._value)return ut.splice(Z,1)}(E),P.resolve(A)}catch(H){P.reject(H)}finally{--qo==0&&bu(),--P.psd.ref||P.psd.finalize()}}function Zh(){Wo(wr,function(){Oa()&&Ca()})}function Oa(){var w=Gt;return Rr=Gt=!1,w}function Ca(){var w,E,P;do for(;0<sr.length;)for(w=sr,sr=[],P=w.length,E=0;E<P;++E){var A=w[E];A[0].apply(null,A[1])}while(0<sr.length);Rr=Gt=!0}function bu(){var w=ut;ut=[],w.forEach(function(A){A._PSD.onunhandled.call(null,A._value,A)});for(var E=sn.slice(0),P=E.length;P;)E[--P]()}function Es(w){return new We(nt,!1,w)}function Ft(w,E){var P=ze;return function(){var A=Oa(),D=ze;try{return fo(P,!0),w.apply(this,arguments)}catch(H){E&&E(H)}finally{fo(D,!1),A&&Ca()}}}m(We.prototype,{then:lo,_then:function(w,E){Na(this,new Fd(null,null,w,E,ze))},catch:function(w){if(arguments.length===1)return this.then(null,w);var E=w,P=arguments[1];return typeof E=="function"?this.then(null,function(A){return(A instanceof E?P:Es)(A)}):this.then(null,function(A){return(A&&A.name===E?P:Es)(A)})},finally:function(w){return this.then(function(E){return We.resolve(w()).then(function(){return E})},function(E){return We.resolve(w()).then(function(){return Es(E)})})},timeout:function(w,E){var P=this;return w<1/0?new We(function(A,D){var H=setTimeout(function(){return D(new te.Timeout(E))},w);P.then(A,D).finally(clearTimeout.bind(null,H))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&h(We.prototype,Symbol.toStringTag,"Dexie.Promise"),wr.env=$d(),m(We,{all:function(){var w=K.apply(null,arguments).map(Ps);return new We(function(E,P){w.length===0&&E([]);var A=w.length;w.forEach(function(D,H){return We.resolve(D).then(function(Z){w[H]=Z,--A||E(w)},P)})})},resolve:function(w){return w instanceof We?w:w&&typeof w.then=="function"?new We(function(E,P){w.then(E,P)}):new We(nt,!0,w)},reject:Es,race:function(){var w=K.apply(null,arguments).map(Ps);return new We(function(E,P){w.map(function(A){return We.resolve(A).then(E,P)})})},PSD:{get:function(){return ze},set:function(w){return ze=w}},totalEchoes:{get:function(){return Os}},newPSD:uo,usePSD:Wo,scheduler:{get:function(){return dt},set:function(w){dt=w}},rejectionMapper:{get:function(){return Fr},set:function(w){Fr=w}},follow:function(w,E){return new We(function(P,A){return uo(function(D,H){var Z=ze;Z.unhandleds=[],Z.onunhandled=H,Z.finalize=ge(function(){var Q,re=this;Q=function(){re.unhandleds.length===0?D():H(re.unhandleds[0])},sn.push(function ae(){Q(),sn.splice(sn.indexOf(ae),1)}),++qo,dt(function(){--qo==0&&bu()},[])},Z.finalize),w()},E,P,A)})}}),Qt&&(Qt.allSettled&&h(We,"allSettled",function(){var w=K.apply(null,arguments).map(Ps);return new We(function(E){w.length===0&&E([]);var P=w.length,A=new Array(P);w.forEach(function(D,H){return We.resolve(D).then(function(Z){return A[H]={status:"fulfilled",value:Z}},function(Z){return A[H]={status:"rejected",reason:Z}}).then(function(){return--P||E(A)})})})}),Qt.any&&typeof AggregateError<"u"&&h(We,"any",function(){var w=K.apply(null,arguments).map(Ps);return new We(function(E,P){w.length===0&&P(new AggregateError([]));var A=w.length,D=new Array(A);w.forEach(function(H,Z){return We.resolve(H).then(function(Q){return E(Q)},function(Q){D[Z]=Q,--A||P(new AggregateError(D))})})})}),Qt.withResolvers&&(We.withResolvers=Qt.withResolvers));var kr={awaits:0,echoes:0,id:0},Jh=0,Ss=[],Ns=0,Os=0,Cs=0;function uo(w,E,P,A){var D=ze,H=Object.create(D);return H.parent=D,H.ref=0,H.global=!1,H.id=++Cs,wr.env,H.env=Je?{Promise:We,PromiseProp:{value:We,configurable:!0,writable:!0},all:We.all,race:We.race,allSettled:We.allSettled,any:We.any,resolve:We.resolve,reject:We.reject}:{},E&&l(H,E),++D.ref,H.finalize=function(){--this.parent.ref||this.parent.finalize()},A=Wo(H,w,P,A),H.ref===0&&H.finalize(),A}function Pa(){return kr.id||(kr.id=++Jh),++kr.awaits,kr.echoes+=ht,kr.id}function co(){return!!kr.awaits&&(--kr.awaits==0&&(kr.id=0),kr.echoes=kr.awaits*ht,!0)}function Ps(w){return kr.echoes&&w&&w.constructor===Qt?(Pa(),w.then(function(E){return co(),E},function(E){return co(),hr(E)})):w}function Qh(){var w=Ss[Ss.length-1];Ss.pop(),fo(w,!1)}function fo(w,E){var P,A=ze;(E?!kr.echoes||Ns++&&w===ze:!Ns||--Ns&&w===ze)||queueMicrotask(E?function(D){++Os,kr.echoes&&--kr.echoes!=0||(kr.echoes=kr.awaits=kr.id=0),Ss.push(ze),fo(D,!0)}.bind(null,w):Qh),w!==ze&&(ze=w,A===wr&&(wr.env=$d()),Je&&(P=wr.env.Promise,E=w.env,(A.global||w.global)&&(Object.defineProperty(a,"Promise",E.PromiseProp),P.all=E.all,P.race=E.race,P.resolve=E.resolve,P.reject=E.reject,E.allSettled&&(P.allSettled=E.allSettled),E.any&&(P.any=E.any))))}function $d(){var w=a.Promise;return Je?{Promise:w,PromiseProp:Object.getOwnPropertyDescriptor(a,"Promise"),all:w.all,race:w.race,allSettled:w.allSettled,any:w.any,resolve:w.resolve,reject:w.reject}:{}}function Wo(w,E,P,A,D){var H=ze;try{return fo(w,!0),E(P,A,D)}finally{fo(H,!1)}}function Bd(w,E,P,A){return typeof w!="function"?w:function(){var D=ze;P&&Pa(),fo(E,!0);try{return w.apply(this,arguments)}finally{fo(D,!1),A&&queueMicrotask(co)}}}function vu(w){Promise===Qt&&kr.echoes===0?Ns===0?w():enqueueNativeMicroTask(w):setTimeout(w,0)}(""+Pn).indexOf("[native code]")===-1&&(Pa=co=G);var hr=We.reject,Uo="￿",qn="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",zd="String expected.",Aa=[],As="__dbnames",yu="readonly",xu="readwrite";function Ko(w,E){return w?E?function(){return w.apply(this,arguments)&&E.apply(this,arguments)}:w:E}var Hd={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Ei(w){return typeof w!="string"||/\./.test(w)?function(E){return E}:function(E){return E[w]===void 0&&w in E&&delete(E=L(E))[w],E}}function qd(){throw te.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function At(w,E){try{var P=Wd(w),A=Wd(E);if(P!==A)return P==="Array"?1:A==="Array"?-1:P==="binary"?1:A==="binary"?-1:P==="string"?1:A==="string"?-1:P==="Date"?1:A!=="Date"?NaN:-1;switch(P){case"number":case"Date":case"string":return E<w?1:w<E?-1:0;case"binary":return function(D,H){for(var Z=D.length,Q=H.length,re=Z<Q?Z:Q,ae=0;ae<re;++ae)if(D[ae]!==H[ae])return D[ae]<H[ae]?-1:1;return Z===Q?0:Z<Q?-1:1}(Ud(w),Ud(E));case"Array":return function(D,H){for(var Z=D.length,Q=H.length,re=Z<Q?Z:Q,ae=0;ae<re;++ae){var se=At(D[ae],H[ae]);if(se!==0)return se}return Z===Q?0:Z<Q?-1:1}(w,E)}}catch{}return NaN}function Wd(w){var E=typeof w;return E!="object"?E:ArrayBuffer.isView(w)?"binary":(w=B(w),w==="ArrayBuffer"?"binary":w)}function Ud(w){return w instanceof Uint8Array?w:ArrayBuffer.isView(w)?new Uint8Array(w.buffer,w.byteOffset,w.byteLength):new Uint8Array(w)}function Ts(w,E,P){var A=w.schema.yProps;return A?(E&&0<P.numFailures&&(E=E.filter(function(D,H){return!P.failures[H]})),Promise.all(A.map(function(D){return D=D.updatesTable,E?w.db.table(D).where("k").anyOf(E).delete():w.db.table(D).clear()})).then(function(){return P})):P}var be=(he.prototype._trans=function(w,E,P){var A=this._tx||ze.trans,D=this.name,H=Ze&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(w==="readonly"?"read":"write"," ").concat(this.name));function Z(ae,se,ee){if(!ee.schema[D])throw new te.NotFound("Table "+D+" not part of transaction");return E(ee.idbtrans,ee)}var Q=Oa();try{var re=A&&A.db._novip===this.db._novip?A===ze.trans?A._promise(w,Z,P):uo(function(){return A._promise(w,Z,P)},{trans:A,transless:ze.transless||ze}):function ae(se,ee,fe,ne){if(se.idbdb&&(se._state.openComplete||ze.letThrough||se._vip)){var ie=se._createTransaction(ee,fe,se._dbSchema);try{ie.create(),se._state.PR1398_maxLoop=3}catch(de){return de.name===oe.InvalidState&&se.isOpen()&&0<--se._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),se.close({disableAutoOpen:!1}),se.open().then(function(){return ae(se,ee,fe,ne)})):hr(de)}return ie._promise(ee,function(de,ue){return uo(function(){return ze.trans=ie,ne(de,ue,ie)})}).then(function(de){if(ee==="readwrite")try{ie.idbtrans.commit()}catch{}return ee==="readonly"?de:ie._completion.then(function(){return de})})}if(se._state.openComplete)return hr(new te.DatabaseClosed(se._state.dbOpenError));if(!se._state.isBeingOpened){if(!se._state.autoOpen)return hr(new te.DatabaseClosed);se.open().catch(G)}return se._state.dbReadyPromise.then(function(){return ae(se,ee,fe,ne)})}(this.db,w,[this.name],Z);return H&&(re._consoleTask=H,re=re.catch(function(ae){return console.trace(ae),hr(ae)})),re}finally{Q&&Ca()}},he.prototype.get=function(w,E){var P=this;return w&&w.constructor===Object?this.where(w).first(E):w==null?hr(new te.Type("Invalid argument to Table.get()")):this._trans("readonly",function(A){return P.core.get({trans:A,key:w}).then(function(D){return P.hook.reading.fire(D)})}).then(E)},he.prototype.where=function(w){if(typeof w=="string")return new this.db.WhereClause(this,w);if(s(w))return new this.db.WhereClause(this,"[".concat(w.join("+"),"]"));var E=i(w);if(E.length===1)return this.where(E[0]).equals(w[E[0]]);var P=this.schema.indexes.concat(this.schema.primKey).filter(function(Q){if(Q.compound&&E.every(function(ae){return 0<=Q.keyPath.indexOf(ae)})){for(var re=0;re<E.length;++re)if(E.indexOf(Q.keyPath[re])===-1)return!1;return!0}return!1}).sort(function(Q,re){return Q.keyPath.length-re.keyPath.length})[0];if(P&&this.db._maxKey!==Uo){var H=P.keyPath.slice(0,E.length);return this.where(H).equals(H.map(function(re){return w[re]}))}!P&&Ze&&console.warn("The query ".concat(JSON.stringify(w)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(E.join("+"),"]"));var A=this.schema.idxByName;function D(Q,re){return At(Q,re)===0}var Z=E.reduce(function(ee,re){var ae=ee[0],se=ee[1],ee=A[re],fe=w[re];return[ae||ee,ae||!ee?Ko(se,ee&&ee.multi?function(ne){return ne=C(ne,re),s(ne)&&ne.some(function(ie){return D(fe,ie)})}:function(ne){return D(fe,C(ne,re))}):se]},[null,null]),H=Z[0],Z=Z[1];return H?this.where(H.name).equals(w[H.keyPath]).filter(Z):P?this.filter(Z):this.where(E).equals("")},he.prototype.filter=function(w){return this.toCollection().and(w)},he.prototype.count=function(w){return this.toCollection().count(w)},he.prototype.offset=function(w){return this.toCollection().offset(w)},he.prototype.limit=function(w){return this.toCollection().limit(w)},he.prototype.each=function(w){return this.toCollection().each(w)},he.prototype.toArray=function(w){return this.toCollection().toArray(w)},he.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},he.prototype.orderBy=function(w){return new this.db.Collection(new this.db.WhereClause(this,s(w)?"[".concat(w.join("+"),"]"):w))},he.prototype.reverse=function(){return this.toCollection().reverse()},he.prototype.mapToClass=function(w){var E,P=this.db,A=this.name;function D(){return E!==null&&E.apply(this,arguments)||this}(this.schema.mappedClass=w).prototype instanceof qd&&(function(re,ae){if(typeof ae!="function"&&ae!==null)throw new TypeError("Class extends value "+String(ae)+" is not a constructor or null");function se(){this.constructor=re}r(re,ae),re.prototype=ae===null?Object.create(ae):(se.prototype=ae.prototype,new se)}(D,E=w),Object.defineProperty(D.prototype,"db",{get:function(){return P},enumerable:!1,configurable:!0}),D.prototype.table=function(){return A},w=D);for(var H=new Set,Z=w.prototype;Z;Z=c(Z))Object.getOwnPropertyNames(Z).forEach(function(re){return H.add(re)});function Q(re){if(!re)return re;var ae,se=Object.create(w.prototype);for(ae in re)if(!H.has(ae))try{se[ae]=re[ae]}catch{}return se}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=Q,this.hook("reading",Q),w},he.prototype.defineClass=function(){return this.mapToClass(function(w){l(this,w)})},he.prototype.add=function(w,E){var P=this,A=this.schema.primKey,D=A.auto,H=A.keyPath,Z=w;return H&&D&&(Z=Ei(H)(w)),this._trans("readwrite",function(Q){return P.core.mutate({trans:Q,type:"add",keys:E!=null?[E]:null,values:[Z]})}).then(function(Q){return Q.numFailures?We.reject(Q.failures[0]):Q.lastResult}).then(function(Q){if(H)try{N(w,H,Q)}catch{}return Q})},he.prototype.update=function(w,E){return typeof w!="object"||s(w)?this.where(":id").equals(w).modify(E):(w=C(w,this.schema.primKey.keyPath),w===void 0?hr(new te.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(w).modify(E))},he.prototype.put=function(w,E){var P=this,A=this.schema.primKey,D=A.auto,H=A.keyPath,Z=w;return H&&D&&(Z=Ei(H)(w)),this._trans("readwrite",function(Q){return P.core.mutate({trans:Q,type:"put",values:[Z],keys:E!=null?[E]:null})}).then(function(Q){return Q.numFailures?We.reject(Q.failures[0]):Q.lastResult}).then(function(Q){if(H)try{N(w,H,Q)}catch{}return Q})},he.prototype.delete=function(w){var E=this;return this._trans("readwrite",function(P){return E.core.mutate({trans:P,type:"delete",keys:[w]}).then(function(A){return Ts(E,[w],A)}).then(function(A){return A.numFailures?We.reject(A.failures[0]):void 0})})},he.prototype.clear=function(){var w=this;return this._trans("readwrite",function(E){return w.core.mutate({trans:E,type:"deleteRange",range:Hd}).then(function(P){return Ts(w,null,P)})}).then(function(E){return E.numFailures?We.reject(E.failures[0]):void 0})},he.prototype.bulkGet=function(w){var E=this;return this._trans("readonly",function(P){return E.core.getMany({keys:w,trans:P}).then(function(A){return A.map(function(D){return E.hook.reading.fire(D)})})})},he.prototype.bulkAdd=function(w,E,P){var A=this,D=Array.isArray(E)?E:void 0,H=(P=P||(D?void 0:E))?P.allKeys:void 0;return this._trans("readwrite",function(Z){var ae=A.schema.primKey,Q=ae.auto,ae=ae.keyPath;if(ae&&D)throw new te.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(D&&D.length!==w.length)throw new te.InvalidArgument("Arguments objects and keys must have the same length");var re=w.length,ae=ae&&Q?w.map(Ei(ae)):w;return A.core.mutate({trans:Z,type:"add",keys:D,values:ae,wantResults:H}).then(function(ie){var ee=ie.numFailures,fe=ie.results,ne=ie.lastResult,ie=ie.failures;if(ee===0)return H?fe:ne;throw new ce("".concat(A.name,".bulkAdd(): ").concat(ee," of ").concat(re," operations failed"),ie)})})},he.prototype.bulkPut=function(w,E,P){var A=this,D=Array.isArray(E)?E:void 0,H=(P=P||(D?void 0:E))?P.allKeys:void 0;return this._trans("readwrite",function(Z){var ae=A.schema.primKey,Q=ae.auto,ae=ae.keyPath;if(ae&&D)throw new te.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(D&&D.length!==w.length)throw new te.InvalidArgument("Arguments objects and keys must have the same length");var re=w.length,ae=ae&&Q?w.map(Ei(ae)):w;return A.core.mutate({trans:Z,type:"put",keys:D,values:ae,wantResults:H}).then(function(ie){var ee=ie.numFailures,fe=ie.results,ne=ie.lastResult,ie=ie.failures;if(ee===0)return H?fe:ne;throw new ce("".concat(A.name,".bulkPut(): ").concat(ee," of ").concat(re," operations failed"),ie)})})},he.prototype.bulkUpdate=function(w){var E=this,P=this.core,A=w.map(function(Z){return Z.key}),D=w.map(function(Z){return Z.changes}),H=[];return this._trans("readwrite",function(Z){return P.getMany({trans:Z,keys:A,cache:"clone"}).then(function(Q){var re=[],ae=[];w.forEach(function(ee,fe){var ne=ee.key,ie=ee.changes,de=Q[fe];if(de){for(var ue=0,pe=Object.keys(ie);ue<pe.length;ue++){var xe=pe[ue],ke=ie[xe];if(xe===E.schema.primKey.keyPath){if(At(ke,ne)!==0)throw new te.Constraint("Cannot update primary key in bulkUpdate()")}else N(de,xe,ke)}H.push(fe),re.push(ne),ae.push(de)}});var se=re.length;return P.mutate({trans:Z,type:"put",keys:re,values:ae,updates:{keys:A,changeSpecs:D}}).then(function(ee){var fe=ee.numFailures,ne=ee.failures;if(fe===0)return se;for(var ie=0,de=Object.keys(ne);ie<de.length;ie++){var ue,pe=de[ie],xe=H[Number(pe)];xe!=null&&(ue=ne[pe],delete ne[pe],ne[xe]=ue)}throw new ce("".concat(E.name,".bulkUpdate(): ").concat(fe," of ").concat(se," operations failed"),ne)})})})},he.prototype.bulkDelete=function(w){var E=this,P=w.length;return this._trans("readwrite",function(A){return E.core.mutate({trans:A,type:"delete",keys:w}).then(function(D){return Ts(E,w,D)})}).then(function(Z){var D=Z.numFailures,H=Z.lastResult,Z=Z.failures;if(D===0)return H;throw new ce("".concat(E.name,".bulkDelete(): ").concat(D," of ").concat(P," operations failed"),Z)})},he);function he(){}function Ie(w){function E(Z,Q){if(Q){for(var re=arguments.length,ae=new Array(re-1);--re;)ae[re-1]=arguments[re];return P[Z].subscribe.apply(null,ae),w}if(typeof Z=="string")return P[Z]}var P={};E.addEventType=H;for(var A=1,D=arguments.length;A<D;++A)H(arguments[A]);return E;function H(Z,Q,re){if(typeof Z!="object"){var ae;Q=Q||Ve;var se={subscribers:[],fire:re=re||G,subscribe:function(ee){se.subscribers.indexOf(ee)===-1&&(se.subscribers.push(ee),se.fire=Q(se.fire,ee))},unsubscribe:function(ee){se.subscribers=se.subscribers.filter(function(fe){return fe!==ee}),se.fire=se.subscribers.reduce(Q,re)}};return P[Z]=E[Z]=se}i(ae=Z).forEach(function(ee){var fe=ae[ee];if(s(fe))H(ee,ae[ee][0],ae[ee][1]);else{if(fe!=="asap")throw new te.InvalidArgument("Invalid event config");var ne=H(ee,ye,function(){for(var ie=arguments.length,de=new Array(ie);ie--;)de[ie]=arguments[ie];ne.subscribers.forEach(function(ue){O(function(){ue.apply(null,de)})})})}})}}function Pe(w,E){return b(E).from({prototype:w}),E}function Qe(w,E){return!(w.filter||w.algorithm||w.or)&&(E?w.justLimit:!w.replayFilter)}function tt(w,E){w.filter=Ko(w.filter,E)}function pt(w,E,P){var A=w.replayFilter;w.replayFilter=A?function(){return Ko(A(),E())}:E,w.justLimit=P&&!A}function St(w,E){if(w.isPrimKey)return E.primaryKey;var P=E.getIndexByKeyPath(w.index);if(!P)throw new te.Schema("KeyPath "+w.index+" on object store "+E.name+" is not indexed");return P}function nr(w,E,P){var A=St(w,E.schema);return E.openCursor({trans:P,values:!w.keysOnly,reverse:w.dir==="prev",unique:!!w.unique,query:{index:A,range:w.range}})}function Yt(w,E,P,A){var D=w.replayFilter?Ko(w.filter,w.replayFilter()):w.filter;if(w.or){var H={},Z=function(Q,re,ae){var se,ee;D&&!D(re,ae,function(fe){return re.stop(fe)},function(fe){return re.fail(fe)})||((ee=""+(se=re.primaryKey))=="[object ArrayBuffer]"&&(ee=""+new Uint8Array(se)),f(H,ee)||(H[ee]=!0,E(Q,re,ae)))};return Promise.all([w.or._iterate(Z,P),gt(nr(w,A,P),w.algorithm,Z,!w.keysOnly&&w.valueMapper)])}return gt(nr(w,A,P),Ko(w.algorithm,D),E,!w.keysOnly&&w.valueMapper)}function gt(w,E,P,A){var D=Ft(A?function(H,Z,Q){return P(A(H),Z,Q)}:P);return w.then(function(H){if(H)return H.start(function(){var Z=function(){return H.continue()};E&&!E(H,function(Q){return Z=Q},function(Q){H.stop(Q),Z=G},function(Q){H.fail(Q),Z=G})||D(H.value,H,function(Q){return Z=Q}),Z()})})}var yt=(Tt.prototype.execute=function(w){var E=this["@@propmod"];if(E.add!==void 0){var P=E.add;if(s(P))return o(o([],s(w)?w:[],!0),P).sort();if(typeof P=="number")return(Number(w)||0)+P;if(typeof P=="bigint")try{return BigInt(w)+P}catch{return BigInt(0)+P}throw new TypeError("Invalid term ".concat(P))}if(E.remove!==void 0){var A=E.remove;if(s(A))return s(w)?w.filter(function(D){return!A.includes(D)}).sort():[];if(typeof A=="number")return Number(w)-A;if(typeof A=="bigint")try{return BigInt(w)-A}catch{return BigInt(0)-A}throw new TypeError("Invalid subtrahend ".concat(A))}return P=(P=E.replacePrefix)===null||P===void 0?void 0:P[0],P&&typeof w=="string"&&w.startsWith(P)?E.replacePrefix[1]+w.substring(P.length):w},Tt);function Tt(w){this["@@propmod"]=w}var br=(ot.prototype._read=function(w,E){var P=this._ctx;return P.error?P.table._trans(null,hr.bind(null,P.error)):P.table._trans("readonly",w).then(E)},ot.prototype._write=function(w){var E=this._ctx;return E.error?E.table._trans(null,hr.bind(null,E.error)):E.table._trans("readwrite",w,"locked")},ot.prototype._addAlgorithm=function(w){var E=this._ctx;E.algorithm=Ko(E.algorithm,w)},ot.prototype._iterate=function(w,E){return Yt(this._ctx,w,E,this._ctx.table.core)},ot.prototype.clone=function(w){var E=Object.create(this.constructor.prototype),P=Object.create(this._ctx);return w&&l(P,w),E._ctx=P,E},ot.prototype.raw=function(){return this._ctx.valueMapper=null,this},ot.prototype.each=function(w){var E=this._ctx;return this._read(function(P){return Yt(E,w,P,E.table.core)})},ot.prototype.count=function(w){var E=this;return this._read(function(P){var A=E._ctx,D=A.table.core;if(Qe(A,!0))return D.count({trans:P,query:{index:St(A,D.schema),range:A.range}}).then(function(Z){return Math.min(Z,A.limit)});var H=0;return Yt(A,function(){return++H,!1},P,D).then(function(){return H})}).then(w)},ot.prototype.sortBy=function(w,E){var P=w.split(".").reverse(),A=P[0],D=P.length-1;function H(re,ae){return ae?H(re[P[ae]],ae-1):re[A]}var Z=this._ctx.dir==="next"?1:-1;function Q(re,ae){return At(H(re,D),H(ae,D))*Z}return this.toArray(function(re){return re.sort(Q)}).then(E)},ot.prototype.toArray=function(w){var E=this;return this._read(function(P){var A=E._ctx;if(A.dir==="next"&&Qe(A,!0)&&0<A.limit){var D=A.valueMapper,H=St(A,A.table.core.schema);return A.table.core.query({trans:P,limit:A.limit,values:!0,query:{index:H,range:A.range}}).then(function(Q){return Q=Q.result,D?Q.map(D):Q})}var Z=[];return Yt(A,function(Q){return Z.push(Q)},P,A.table.core).then(function(){return Z})},w)},ot.prototype.offset=function(w){var E=this._ctx;return w<=0||(E.offset+=w,Qe(E)?pt(E,function(){var P=w;return function(A,D){return P===0||(P===1?--P:D(function(){A.advance(P),P=0}),!1)}}):pt(E,function(){var P=w;return function(){return--P<0}})),this},ot.prototype.limit=function(w){return this._ctx.limit=Math.min(this._ctx.limit,w),pt(this._ctx,function(){var E=w;return function(P,A,D){return--E<=0&&A(D),0<=E}},!0),this},ot.prototype.until=function(w,E){return tt(this._ctx,function(P,A,D){return!w(P.value)||(A(D),E)}),this},ot.prototype.first=function(w){return this.limit(1).toArray(function(E){return E[0]}).then(w)},ot.prototype.last=function(w){return this.reverse().first(w)},ot.prototype.filter=function(w){var E;return tt(this._ctx,function(P){return w(P.value)}),(E=this._ctx).isMatch=Ko(E.isMatch,w),this},ot.prototype.and=function(w){return this.filter(w)},ot.prototype.or=function(w){return new this.db.WhereClause(this._ctx.table,w,this)},ot.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},ot.prototype.desc=function(){return this.reverse()},ot.prototype.eachKey=function(w){var E=this._ctx;return E.keysOnly=!E.isMatch,this.each(function(P,A){w(A.key,A)})},ot.prototype.eachUniqueKey=function(w){return this._ctx.unique="unique",this.eachKey(w)},ot.prototype.eachPrimaryKey=function(w){var E=this._ctx;return E.keysOnly=!E.isMatch,this.each(function(P,A){w(A.primaryKey,A)})},ot.prototype.keys=function(w){var E=this._ctx;E.keysOnly=!E.isMatch;var P=[];return this.each(function(A,D){P.push(D.key)}).then(function(){return P}).then(w)},ot.prototype.primaryKeys=function(w){var E=this._ctx;if(E.dir==="next"&&Qe(E,!0)&&0<E.limit)return this._read(function(A){var D=St(E,E.table.core.schema);return E.table.core.query({trans:A,values:!1,limit:E.limit,query:{index:D,range:E.range}})}).then(function(A){return A.result}).then(w);E.keysOnly=!E.isMatch;var P=[];return this.each(function(A,D){P.push(D.primaryKey)}).then(function(){return P}).then(w)},ot.prototype.uniqueKeys=function(w){return this._ctx.unique="unique",this.keys(w)},ot.prototype.firstKey=function(w){return this.limit(1).keys(function(E){return E[0]}).then(w)},ot.prototype.lastKey=function(w){return this.reverse().firstKey(w)},ot.prototype.distinct=function(){var w=this._ctx,w=w.index&&w.table.schema.idxByName[w.index];if(!w||!w.multi)return this;var E={};return tt(this._ctx,function(D){var A=D.primaryKey.toString(),D=f(E,A);return E[A]=!0,!D}),this},ot.prototype.modify=function(w){var E=this,P=this._ctx;return this._write(function(A){var D,H,Z;Z=typeof w=="function"?w:(D=i(w),H=D.length,function(pe){for(var xe=!1,ke=0;ke<H;++ke){var je=D[ke],Ae=w[je],Be=C(pe,je);Ae instanceof yt?(N(pe,je,Ae.execute(Be)),xe=!0):Be!==Ae&&(N(pe,je,Ae),xe=!0)}return xe});var Q=P.table.core,ee=Q.schema.primaryKey,re=ee.outbound,ae=ee.extractKey,se=200,ee=E.db._options.modifyChunkSize;ee&&(se=typeof ee=="object"?ee[Q.name]||ee["*"]||200:ee);function fe(pe,je){var ke=je.failures,je=je.numFailures;ie+=pe-je;for(var Ae=0,Be=i(ke);Ae<Be.length;Ae++){var De=Be[Ae];ne.push(ke[De])}}var ne=[],ie=0,de=[],ue=w===er;return E.clone().primaryKeys().then(function(pe){function xe(je){var Ae=Math.min(se,pe.length-je),Be=pe.slice(je,je+Ae);return(ue?Promise.resolve([]):Q.getMany({trans:A,keys:Be,cache:"immutable"})).then(function(De){var Fe=[],Ue=[],He=re?[]:null,Ke=ue?Be:[];if(!ue)for(var kt=0;kt<Ae;++kt){var Dt=De[kt],bt={value:L(Dt),primKey:pe[je+kt]};Z.call(bt,bt.value,bt)!==!1&&(bt.value==null?Ke.push(pe[je+kt]):re||At(ae(Dt),ae(bt.value))===0?(Ue.push(bt.value),re&&He.push(pe[je+kt])):(Ke.push(pe[je+kt]),Fe.push(bt.value)))}return Promise.resolve(0<Fe.length&&Q.mutate({trans:A,type:"add",values:Fe}).then(function(vr){for(var mt in vr.failures)Ke.splice(parseInt(mt),1);fe(Fe.length,vr)})).then(function(){return(0<Ue.length||ke&&typeof w=="object")&&Q.mutate({trans:A,type:"put",keys:He,values:Ue,criteria:ke,changeSpec:typeof w!="function"&&w,isAdditionalChunk:0<je}).then(function(vr){return fe(Ue.length,vr)})}).then(function(){return(0<Ke.length||ke&&ue)&&Q.mutate({trans:A,type:"delete",keys:Ke,criteria:ke,isAdditionalChunk:0<je}).then(function(vr){return Ts(P.table,Ke,vr)}).then(function(vr){return fe(Ke.length,vr)})}).then(function(){return pe.length>je+Ae&&xe(je+se)})})}var ke=Qe(P)&&P.limit===1/0&&(typeof w!="function"||ue)&&{index:P.index,range:P.range};return xe(0).then(function(){if(0<ne.length)throw new X("Error modifying one or more objects",ne,ie,de);return pe.length})})})},ot.prototype.delete=function(){var w=this._ctx,E=w.range;return!Qe(w)||w.table.schema.yProps||!w.isPrimKey&&E.type!==3?this.modify(er):this._write(function(P){var A=w.table.core.schema.primaryKey,D=E;return w.table.core.count({trans:P,query:{index:A,range:D}}).then(function(H){return w.table.core.mutate({trans:P,type:"deleteRange",range:D}).then(function(re){var Q=re.failures,re=re.numFailures;if(re)throw new X("Could not delete some values",Object.keys(Q).map(function(ae){return Q[ae]}),H-re);return H-re})})})},ot);function ot(){}var er=function(w,E){return E.value=null};function Kd(w,E){return w<E?-1:w===E?0:1}function Cn(w,E){return E<w?-1:w===E?0:1}function bn(w,E,P){return w=w instanceof OE?new w.Collection(w):w,w._ctx.error=new(P||TypeError)(E),w}function Ms(w){return new w.Collection(w,function(){return NE("")}).limit(0)}function Vd(w,E,P,A){var D,H,Z,Q,re,ae,se,ee=P.length;if(!P.every(function(ie){return typeof ie=="string"}))return bn(w,zd);function fe(ie){D=ie==="next"?function(ue){return ue.toUpperCase()}:function(ue){return ue.toLowerCase()},H=ie==="next"?function(ue){return ue.toLowerCase()}:function(ue){return ue.toUpperCase()},Z=ie==="next"?Kd:Cn;var de=P.map(function(ue){return{lower:H(ue),upper:D(ue)}}).sort(function(ue,pe){return Z(ue.lower,pe.lower)});Q=de.map(function(ue){return ue.upper}),re=de.map(function(ue){return ue.lower}),se=(ae=ie)==="next"?"":A}fe("next"),w=new w.Collection(w,function(){return Ta(Q[0],re[ee-1]+A)}),w._ondirectionchange=function(ie){fe(ie)};var ne=0;return w._addAlgorithm(function(ie,de,ue){var pe=ie.key;if(typeof pe!="string")return!1;var xe=H(pe);if(E(xe,re,ne))return!0;for(var ke=null,je=ne;je<ee;++je){var Ae=function(Be,De,Fe,Ue,He,Ke){for(var kt=Math.min(Be.length,Ue.length),Dt=-1,bt=0;bt<kt;++bt){var vr=De[bt];if(vr!==Ue[bt])return He(Be[bt],Fe[bt])<0?Be.substr(0,bt)+Fe[bt]+Fe.substr(bt+1):He(Be[bt],Ue[bt])<0?Be.substr(0,bt)+Ue[bt]+Fe.substr(bt+1):0<=Dt?Be.substr(0,Dt)+De[Dt]+Fe.substr(Dt+1):null;He(Be[bt],vr)<0&&(Dt=bt)}return kt<Ue.length&&Ke==="next"?Be+Fe.substr(Be.length):kt<Be.length&&Ke==="prev"?Be.substr(0,Fe.length):Dt<0?null:Be.substr(0,Dt)+Ue[Dt]+Fe.substr(Dt+1)}(pe,xe,Q[je],re[je],Z,ae);Ae===null&&ke===null?ne=je+1:(ke===null||0<Z(ke,Ae))&&(ke=Ae)}return de(ke!==null?function(){ie.continue(ke+se)}:ue),!1}),w}function Ta(w,E,P,A){return{type:2,lower:w,upper:E,lowerOpen:P,upperOpen:A}}function NE(w){return{type:1,lower:w,upper:w}}var OE=(Object.defineProperty(Ir.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Ir.prototype.between=function(w,E,P,A){P=P!==!1,A=A===!0;try{return 0<this._cmp(w,E)||this._cmp(w,E)===0&&(P||A)&&(!P||!A)?Ms(this):new this.Collection(this,function(){return Ta(w,E,!P,!A)})}catch{return bn(this,qn)}},Ir.prototype.equals=function(w){return w==null?bn(this,qn):new this.Collection(this,function(){return NE(w)})},Ir.prototype.above=function(w){return w==null?bn(this,qn):new this.Collection(this,function(){return Ta(w,void 0,!0)})},Ir.prototype.aboveOrEqual=function(w){return w==null?bn(this,qn):new this.Collection(this,function(){return Ta(w,void 0,!1)})},Ir.prototype.below=function(w){return w==null?bn(this,qn):new this.Collection(this,function(){return Ta(void 0,w,!1,!0)})},Ir.prototype.belowOrEqual=function(w){return w==null?bn(this,qn):new this.Collection(this,function(){return Ta(void 0,w)})},Ir.prototype.startsWith=function(w){return typeof w!="string"?bn(this,zd):this.between(w,w+Uo,!0,!0)},Ir.prototype.startsWithIgnoreCase=function(w){return w===""?this.startsWith(w):Vd(this,function(E,P){return E.indexOf(P[0])===0},[w],Uo)},Ir.prototype.equalsIgnoreCase=function(w){return Vd(this,function(E,P){return E===P[0]},[w],"")},Ir.prototype.anyOfIgnoreCase=function(){var w=K.apply(W,arguments);return w.length===0?Ms(this):Vd(this,function(E,P){return P.indexOf(E)!==-1},w,"")},Ir.prototype.startsWithAnyOfIgnoreCase=function(){var w=K.apply(W,arguments);return w.length===0?Ms(this):Vd(this,function(E,P){return P.some(function(A){return E.indexOf(A)===0})},w,Uo)},Ir.prototype.anyOf=function(){var w=this,E=K.apply(W,arguments),P=this._cmp;try{E.sort(P)}catch{return bn(this,qn)}if(E.length===0)return Ms(this);var A=new this.Collection(this,function(){return Ta(E[0],E[E.length-1])});A._ondirectionchange=function(H){P=H==="next"?w._ascending:w._descending,E.sort(P)};var D=0;return A._addAlgorithm(function(H,Z,Q){for(var re=H.key;0<P(re,E[D]);)if(++D===E.length)return Z(Q),!1;return P(re,E[D])===0||(Z(function(){H.continue(E[D])}),!1)}),A},Ir.prototype.notEqual=function(w){return this.inAnyRange([[-1/0,w],[w,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Ir.prototype.noneOf=function(){var w=K.apply(W,arguments);if(w.length===0)return new this.Collection(this);try{w.sort(this._ascending)}catch{return bn(this,qn)}var E=w.reduce(function(P,A){return P?P.concat([[P[P.length-1][1],A]]):[[-1/0,A]]},null);return E.push([w[w.length-1],this.db._maxKey]),this.inAnyRange(E,{includeLowers:!1,includeUppers:!1})},Ir.prototype.inAnyRange=function(pe,E){var P=this,A=this._cmp,D=this._ascending,H=this._descending,Z=this._min,Q=this._max;if(pe.length===0)return Ms(this);if(!pe.every(function(xe){return xe[0]!==void 0&&xe[1]!==void 0&&D(xe[0],xe[1])<=0}))return bn(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",te.InvalidArgument);var re=!E||E.includeLowers!==!1,ae=E&&E.includeUppers===!0,se,ee=D;function fe(xe,ke){return ee(xe[0],ke[0])}try{(se=pe.reduce(function(xe,ke){for(var je=0,Ae=xe.length;je<Ae;++je){var Be=xe[je];if(A(ke[0],Be[1])<0&&0<A(ke[1],Be[0])){Be[0]=Z(Be[0],ke[0]),Be[1]=Q(Be[1],ke[1]);break}}return je===Ae&&xe.push(ke),xe},[])).sort(fe)}catch{return bn(this,qn)}var ne=0,ie=ae?function(xe){return 0<D(xe,se[ne][1])}:function(xe){return 0<=D(xe,se[ne][1])},de=re?function(xe){return 0<H(xe,se[ne][0])}:function(xe){return 0<=H(xe,se[ne][0])},ue=ie,pe=new this.Collection(this,function(){return Ta(se[0][0],se[se.length-1][1],!re,!ae)});return pe._ondirectionchange=function(xe){ee=xe==="next"?(ue=ie,D):(ue=de,H),se.sort(fe)},pe._addAlgorithm(function(xe,ke,je){for(var Ae,Be=xe.key;ue(Be);)if(++ne===se.length)return ke(je),!1;return!ie(Ae=Be)&&!de(Ae)||(P._cmp(Be,se[ne][1])===0||P._cmp(Be,se[ne][0])===0||ke(function(){ee===D?xe.continue(se[ne][0]):xe.continue(se[ne][1])}),!1)}),pe},Ir.prototype.startsWithAnyOf=function(){var w=K.apply(W,arguments);return w.every(function(E){return typeof E=="string"})?w.length===0?Ms(this):this.inAnyRange(w.map(function(E){return[E,E+Uo]})):bn(this,"startsWithAnyOf() only works with strings")},Ir);function Ir(){}function po(w){return Ft(function(E){return wu(E),w(E.target.error),!1})}function wu(w){w.stopPropagation&&w.stopPropagation(),w.preventDefault&&w.preventDefault()}var ku="storagemutated",eg="x-storagemutated-1",Ma=Ie(null,ku),gI=(mo.prototype._lock=function(){return j(!ze.global),++this._reculock,this._reculock!==1||ze.global||(ze.lockOwnerFor=this),this},mo.prototype._unlock=function(){if(j(!ze.global),--this._reculock==0)for(ze.global||(ze.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var w=this._blockedFuncs.shift();try{Wo(w[1],w[0])}catch{}}return this},mo.prototype._locked=function(){return this._reculock&&ze.lockOwnerFor!==this},mo.prototype.create=function(w){var E=this;if(!this.mode)return this;var P=this.db.idbdb,A=this.db._state.dbOpenError;if(j(!this.idbtrans),!w&&!P)switch(A&&A.name){case"DatabaseClosedError":throw new te.DatabaseClosed(A);case"MissingAPIError":throw new te.MissingAPI(A.message,A);default:throw new te.OpenFailed(A)}if(!this.active)throw new te.TransactionInactive;return j(this._completion._state===null),(w=this.idbtrans=w||(this.db.core||P).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=Ft(function(D){wu(D),E._reject(w.error)}),w.onabort=Ft(function(D){wu(D),E.active&&E._reject(new te.Abort(w.error)),E.active=!1,E.on("abort").fire(D)}),w.oncomplete=Ft(function(){E.active=!1,E._resolve(),"mutatedParts"in w&&Ma.storagemutated.fire(w.mutatedParts)}),this},mo.prototype._promise=function(w,E,P){var A=this;if(w==="readwrite"&&this.mode!=="readwrite")return hr(new te.ReadOnly("Transaction is readonly"));if(!this.active)return hr(new te.TransactionInactive);if(this._locked())return new We(function(H,Z){A._blockedFuncs.push([function(){A._promise(w,E,P).then(H,Z)},ze])});if(P)return uo(function(){var H=new We(function(Z,Q){A._lock();var re=E(Z,Q,A);re&&re.then&&re.then(Z,Q)});return H.finally(function(){return A._unlock()}),H._lib=!0,H});var D=new We(function(H,Z){var Q=E(H,Z,A);Q&&Q.then&&Q.then(H,Z)});return D._lib=!0,D},mo.prototype._root=function(){return this.parent?this.parent._root():this},mo.prototype.waitFor=function(w){var E,P=this._root(),A=We.resolve(w);P._waitingFor?P._waitingFor=P._waitingFor.then(function(){return A}):(P._waitingFor=A,P._waitingQueue=[],E=P.idbtrans.objectStore(P.storeNames[0]),function H(){for(++P._spinCount;P._waitingQueue.length;)P._waitingQueue.shift()();P._waitingFor&&(E.get(-1/0).onsuccess=H)}());var D=P._waitingFor;return new We(function(H,Z){A.then(function(Q){return P._waitingQueue.push(Ft(H.bind(null,Q)))},function(Q){return P._waitingQueue.push(Ft(Z.bind(null,Q)))}).finally(function(){P._waitingFor===D&&(P._waitingFor=null)})})},mo.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new te.Abort))},mo.prototype.table=function(w){var E=this._memoizedTables||(this._memoizedTables={});if(f(E,w))return E[w];var P=this.schema[w];if(!P)throw new te.NotFound("Table "+w+" not part of transaction");return P=new this.db.Table(w,P,this),P.core=this.db.core.table(w),E[w]=P},mo);function mo(){}function tg(w,E,P,A,D,H,Z,Q){return{name:w,keyPath:E,unique:P,multi:A,auto:D,compound:H,src:(P&&!Z?"&":"")+(A?"*":"")+(D?"++":"")+CE(E),type:Q}}function CE(w){return typeof w=="string"?w:w?"["+[].join.call(w,"+")+"]":""}function rg(w,E,P){return{name:w,primKey:E,indexes:P,mappedClass:null,idxByName:(A=function(D){return[D.name,D]},P.reduce(function(D,H,Z){return Z=A(H,Z),Z&&(D[Z[0]]=Z[1]),D},{}))};var A}var ju=function(w){try{return w.only([[]]),ju=function(){return[[]]},[[]]}catch{return ju=function(){return Uo},Uo}};function ng(w){return w==null?function(){}:typeof w=="string"?(E=w).split(".").length===1?function(P){return P[E]}:function(P){return C(P,E)}:function(P){return C(P,w)};var E}function PE(w){return[].slice.call(w)}var bI=0;function Eu(w){return w==null?":id":typeof w=="string"?w:"[".concat(w.join("+"),"]")}function vI(w,E,re){function A(ue){if(ue.type===3)return null;if(ue.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var ne=ue.lower,ie=ue.upper,de=ue.lowerOpen,ue=ue.upperOpen;return ne===void 0?ie===void 0?null:E.upperBound(ie,!!ue):ie===void 0?E.lowerBound(ne,!!de):E.bound(ne,ie,!!de,!!ue)}function D(fe){var ne,ie=fe.name;return{name:ie,schema:fe,mutate:function(de){var ue=de.trans,pe=de.type,xe=de.keys,ke=de.values,je=de.range;return new Promise(function(Ae,Be){Ae=Ft(Ae);var De=ue.objectStore(ie),Fe=De.keyPath==null,Ue=pe==="put"||pe==="add";if(!Ue&&pe!=="delete"&&pe!=="deleteRange")throw new Error("Invalid operation type: "+pe);var He,Ke=(xe||ke||{length:1}).length;if(xe&&ke&&xe.length!==ke.length)throw new Error("Given keys array must have same length as given values array.");if(Ke===0)return Ae({numFailures:0,failures:{},results:[],lastResult:void 0});function kt(Xr){++vr,wu(Xr)}var Dt=[],bt=[],vr=0;if(pe==="deleteRange"){if(je.type===4)return Ae({numFailures:vr,failures:bt,results:[],lastResult:void 0});je.type===3?Dt.push(He=De.clear()):Dt.push(He=De.delete(A(je)))}else{var Fe=Ue?Fe?[ke,xe]:[ke,null]:[xe,null],mt=Fe[0],qr=Fe[1];if(Ue)for(var Wr=0;Wr<Ke;++Wr)Dt.push(He=qr&&qr[Wr]!==void 0?De[pe](mt[Wr],qr[Wr]):De[pe](mt[Wr])),He.onerror=kt;else for(Wr=0;Wr<Ke;++Wr)Dt.push(He=De[pe](mt[Wr])),He.onerror=kt}function af(Xr){Xr=Xr.target.result,Dt.forEach(function(Oi,wg){return Oi.error!=null&&(bt[wg]=Oi.error)}),Ae({numFailures:vr,failures:bt,results:pe==="delete"?xe:Dt.map(function(Oi){return Oi.result}),lastResult:Xr})}He.onerror=function(Xr){kt(Xr),af(Xr)},He.onsuccess=af})},getMany:function(de){var ue=de.trans,pe=de.keys;return new Promise(function(xe,ke){xe=Ft(xe);for(var je,Ae=ue.objectStore(ie),Be=pe.length,De=new Array(Be),Fe=0,Ue=0,He=function(Dt){Dt=Dt.target,De[Dt._pos]=Dt.result,++Ue===Fe&&xe(De)},Ke=po(ke),kt=0;kt<Be;++kt)pe[kt]!=null&&((je=Ae.get(pe[kt]))._pos=kt,je.onsuccess=He,je.onerror=Ke,++Fe);Fe===0&&xe(De)})},get:function(de){var ue=de.trans,pe=de.key;return new Promise(function(xe,ke){xe=Ft(xe);var je=ue.objectStore(ie).get(pe);je.onsuccess=function(Ae){return xe(Ae.target.result)},je.onerror=po(ke)})},query:(ne=ae,function(de){return new Promise(function(ue,pe){ue=Ft(ue);var xe,ke,je,Fe=de.trans,Ae=de.values,Be=de.limit,He=de.query,De=Be===1/0?void 0:Be,Ue=He.index,He=He.range,Fe=Fe.objectStore(ie),Ue=Ue.isPrimaryKey?Fe:Fe.index(Ue.name),He=A(He);if(Be===0)return ue({result:[]});ne?((De=Ae?Ue.getAll(He,De):Ue.getAllKeys(He,De)).onsuccess=function(Ke){return ue({result:Ke.target.result})},De.onerror=po(pe)):(xe=0,ke=!Ae&&"openKeyCursor"in Ue?Ue.openKeyCursor(He):Ue.openCursor(He),je=[],ke.onsuccess=function(Ke){var kt=ke.result;return kt?(je.push(Ae?kt.value:kt.primaryKey),++xe===Be?ue({result:je}):void kt.continue()):ue({result:je})},ke.onerror=po(pe))})}),openCursor:function(de){var ue=de.trans,pe=de.values,xe=de.query,ke=de.reverse,je=de.unique;return new Promise(function(Ae,Be){Ae=Ft(Ae);var Ue=xe.index,De=xe.range,Fe=ue.objectStore(ie),Fe=Ue.isPrimaryKey?Fe:Fe.index(Ue.name),Ue=ke?je?"prevunique":"prev":je?"nextunique":"next",He=!pe&&"openKeyCursor"in Fe?Fe.openKeyCursor(A(De),Ue):Fe.openCursor(A(De),Ue);He.onerror=po(Be),He.onsuccess=Ft(function(Ke){var kt,Dt,bt,vr,mt=He.result;mt?(mt.___id=++bI,mt.done=!1,kt=mt.continue.bind(mt),Dt=(Dt=mt.continuePrimaryKey)&&Dt.bind(mt),bt=mt.advance.bind(mt),vr=function(){throw new Error("Cursor not stopped")},mt.trans=ue,mt.stop=mt.continue=mt.continuePrimaryKey=mt.advance=function(){throw new Error("Cursor not started")},mt.fail=Ft(Be),mt.next=function(){var qr=this,Wr=1;return this.start(function(){return Wr--?qr.continue():qr.stop()}).then(function(){return qr})},mt.start=function(qr){function Wr(){if(He.result)try{qr()}catch(Xr){mt.fail(Xr)}else mt.done=!0,mt.start=function(){throw new Error("Cursor behind last entry")},mt.stop()}var af=new Promise(function(Xr,Oi){Xr=Ft(Xr),He.onerror=po(Oi),mt.fail=Oi,mt.stop=function(wg){mt.stop=mt.continue=mt.continuePrimaryKey=mt.advance=vr,Xr(wg)}});return He.onsuccess=Ft(function(Xr){He.onsuccess=Wr,Wr()}),mt.continue=kt,mt.continuePrimaryKey=Dt,mt.advance=bt,Wr(),af},Ae(mt)):Ae(null)},Be)})},count:function(de){var ue=de.query,pe=de.trans,xe=ue.index,ke=ue.range;return new Promise(function(je,Ae){var Be=pe.objectStore(ie),De=xe.isPrimaryKey?Be:Be.index(xe.name),Be=A(ke),De=Be?De.count(Be):De.count();De.onsuccess=Ft(function(Fe){return je(Fe.target.result)}),De.onerror=po(Ae)})}}}var H,Z,Q,se=(Z=re,Q=PE((H=w).objectStoreNames),{schema:{name:H.name,tables:Q.map(function(fe){return Z.objectStore(fe)}).map(function(fe){var ne=fe.keyPath,ue=fe.autoIncrement,ie=s(ne),de={},ue={name:fe.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:ne==null,compound:ie,keyPath:ne,autoIncrement:ue,unique:!0,extractKey:ng(ne)},indexes:PE(fe.indexNames).map(function(pe){return fe.index(pe)}).map(function(je){var xe=je.name,ke=je.unique,Ae=je.multiEntry,je=je.keyPath,Ae={name:xe,compound:s(je),keyPath:je,unique:ke,multiEntry:Ae,extractKey:ng(je)};return de[Eu(je)]=Ae}),getIndexByKeyPath:function(pe){return de[Eu(pe)]}};return de[":id"]=ue.primaryKey,ne!=null&&(de[Eu(ne)]=ue.primaryKey),ue})},hasGetAll:0<Q.length&&"getAll"in Z.objectStore(Q[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),re=se.schema,ae=se.hasGetAll,se=re.tables.map(D),ee={};return se.forEach(function(fe){return ee[fe.name]=fe}),{stack:"dbcore",transaction:w.transaction.bind(w),table:function(fe){if(!ee[fe])throw new Error("Table '".concat(fe,"' not found"));return ee[fe]},MIN_KEY:-1/0,MAX_KEY:ju(E),schema:re}}function yI(w,E,P,A){var D=P.IDBKeyRange;return P.indexedDB,{dbcore:(A=vI(E,D,A),w.dbcore.reduce(function(H,Z){return Z=Z.create,n(n({},H),Z(H))},A))}}function Gd(w,A){var P=A.db,A=yI(w._middlewares,P,w._deps,A);w.core=A.dbcore,w.tables.forEach(function(D){var H=D.name;w.core.schema.tables.some(function(Z){return Z.name===H})&&(D.core=w.core.table(H),w[H]instanceof w.Table&&(w[H].core=D.core))})}function Yd(w,E,P,A){P.forEach(function(D){var H=A[D];E.forEach(function(Z){var Q=function re(ae,se){return v(ae,se)||(ae=c(ae))&&re(ae,se)}(Z,D);(!Q||"value"in Q&&Q.value===void 0)&&(Z===w.Transaction.prototype||Z instanceof w.Transaction?h(Z,D,{get:function(){return this.table(D)},set:function(re){p(this,D,{value:re,writable:!0,configurable:!0,enumerable:!0})}}):Z[D]=new w.Table(D,H))})})}function og(w,E){E.forEach(function(P){for(var A in P)P[A]instanceof w.Table&&delete P[A]})}function xI(w,E){return w._cfg.version-E._cfg.version}function wI(w,E,P,A){var D=w._dbSchema;P.objectStoreNames.contains("$meta")&&!D.$meta&&(D.$meta=rg("$meta",TE("")[0],[]),w._storeNames.push("$meta"));var H=w._createTransaction("readwrite",w._storeNames,D);H.create(P),H._completion.catch(A);var Z=H._reject.bind(H),Q=ze.transless||ze;uo(function(){return ze.trans=H,ze.transless=Q,E!==0?(Gd(w,P),ae=E,((re=H).storeNames.includes("$meta")?re.table("$meta").get("version").then(function(se){return se??ae}):We.resolve(ae)).then(function(se){return fe=se,ne=H,ie=P,de=[],se=(ee=w)._versions,ue=ee._dbSchema=Zd(0,ee.idbdb,ie),(se=se.filter(function(pe){return pe._cfg.version>=fe})).length!==0?(se.forEach(function(pe){de.push(function(){var xe=ue,ke=pe._cfg.dbschema;Jd(ee,xe,ie),Jd(ee,ke,ie),ue=ee._dbSchema=ke;var je=ag(xe,ke);je.add.forEach(function(Ue){ig(ie,Ue[0],Ue[1].primKey,Ue[1].indexes)}),je.change.forEach(function(Ue){if(Ue.recreate)throw new te.Upgrade("Not yet support for changing primary key");var He=ie.objectStore(Ue.name);Ue.add.forEach(function(Ke){return Xd(He,Ke)}),Ue.change.forEach(function(Ke){He.deleteIndex(Ke.name),Xd(He,Ke)}),Ue.del.forEach(function(Ke){return He.deleteIndex(Ke)})});var Ae=pe._cfg.contentUpgrade;if(Ae&&pe._cfg.version>fe){Gd(ee,ie),ne._memoizedTables={};var Be=T(ke);je.del.forEach(function(Ue){Be[Ue]=xe[Ue]}),og(ee,[ee.Transaction.prototype]),Yd(ee,[ee.Transaction.prototype],i(Be),Be),ne.schema=Be;var De,Fe=q(Ae);return Fe&&Pa(),je=We.follow(function(){var Ue;(De=Ae(ne))&&Fe&&(Ue=co.bind(null,null),De.then(Ue,Ue))}),De&&typeof De.then=="function"?We.resolve(De):je.then(function(){return De})}}),de.push(function(xe){var ke,je,Ae=pe._cfg.dbschema;ke=Ae,je=xe,[].slice.call(je.db.objectStoreNames).forEach(function(Be){return ke[Be]==null&&je.db.deleteObjectStore(Be)}),og(ee,[ee.Transaction.prototype]),Yd(ee,[ee.Transaction.prototype],ee._storeNames,ee._dbSchema),ne.schema=ee._dbSchema}),de.push(function(xe){ee.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(ee.idbdb.version/10)===pe._cfg.version?(ee.idbdb.deleteObjectStore("$meta"),delete ee._dbSchema.$meta,ee._storeNames=ee._storeNames.filter(function(ke){return ke!=="$meta"})):xe.objectStore("$meta").put(pe._cfg.version,"version"))})}),function pe(){return de.length?We.resolve(de.shift()(ne.idbtrans)).then(pe):We.resolve()}().then(function(){AE(ue,ie)})):We.resolve();var ee,fe,ne,ie,de,ue}).catch(Z)):(i(D).forEach(function(se){ig(P,se,D[se].primKey,D[se].indexes)}),Gd(w,P),void We.follow(function(){return w.on.populate.fire(H)}).catch(Z));var re,ae})}function kI(w,E){AE(w._dbSchema,E),E.db.version%10!=0||E.objectStoreNames.contains("$meta")||E.db.createObjectStore("$meta").add(Math.ceil(E.db.version/10-1),"version");var P=Zd(0,w.idbdb,E);Jd(w,w._dbSchema,E);for(var A=0,D=ag(P,w._dbSchema).change;A<D.length;A++){var H=function(Z){if(Z.change.length||Z.recreate)return console.warn("Unable to patch indexes of table ".concat(Z.name," because it has changes on the type of index or primary key.")),{value:void 0};var Q=E.objectStore(Z.name);Z.add.forEach(function(re){Ze&&console.debug("Dexie upgrade patch: Creating missing index ".concat(Z.name,".").concat(re.src)),Xd(Q,re)})}(D[A]);if(typeof H=="object")return H.value}}function ag(w,E){var P,A={del:[],add:[],change:[]};for(P in w)E[P]||A.del.push(P);for(P in E){var D=w[P],H=E[P];if(D){var Z={name:P,def:H,recreate:!1,del:[],add:[],change:[]};if(""+(D.primKey.keyPath||"")!=""+(H.primKey.keyPath||"")||D.primKey.auto!==H.primKey.auto)Z.recreate=!0,A.change.push(Z);else{var Q=D.idxByName,re=H.idxByName,ae=void 0;for(ae in Q)re[ae]||Z.del.push(ae);for(ae in re){var se=Q[ae],ee=re[ae];se?se.src!==ee.src&&Z.change.push(ee):Z.add.push(ee)}(0<Z.del.length||0<Z.add.length||0<Z.change.length)&&A.change.push(Z)}}else A.add.push([P,H])}return A}function ig(w,E,P,A){var D=w.db.createObjectStore(E,P.keyPath?{keyPath:P.keyPath,autoIncrement:P.auto}:{autoIncrement:P.auto});return A.forEach(function(H){return Xd(D,H)}),D}function AE(w,E){i(w).forEach(function(P){E.db.objectStoreNames.contains(P)||(Ze&&console.debug("Dexie: Creating missing table",P),ig(E,P,w[P].primKey,w[P].indexes))})}function Xd(w,E){w.createIndex(E.name,E.keyPath,{unique:E.unique,multiEntry:E.multi})}function Zd(w,E,P){var A={};return k(E.objectStoreNames,0).forEach(function(D){for(var H=P.objectStore(D),Z=tg(CE(ae=H.keyPath),ae||"",!0,!1,!!H.autoIncrement,ae&&typeof ae!="string",!0),Q=[],re=0;re<H.indexNames.length;++re){var se=H.index(H.indexNames[re]),ae=se.keyPath,se=tg(se.name,ae,!!se.unique,!!se.multiEntry,!1,ae&&typeof ae!="string",!1);Q.push(se)}A[D]=rg(D,Z,Q)}),A}function Jd(w,E,P){for(var A=P.db.objectStoreNames,D=0;D<A.length;++D){var H=A[D],Z=P.objectStore(H);w._hasGetAll="getAll"in Z;for(var Q=0;Q<Z.indexNames.length;++Q){var re=Z.indexNames[Q],ae=Z.index(re).keyPath,se=typeof ae=="string"?ae:"["+k(ae).join("+")+"]";!E[H]||(ae=E[H].idxByName[se])&&(ae.name=re,delete E[H].idxByName[se],E[H].idxByName[re]=ae)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&a.WorkerGlobalScope&&a instanceof a.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(w._hasGetAll=!1)}function TE(w){return w.split(",").map(function(E,P){var H=E.split(":"),A=(D=H[1])===null||D===void 0?void 0:D.trim(),D=(E=H[0].trim()).replace(/([&*]|\+\+)/g,""),H=/^\[/.test(D)?D.match(/^\[(.*)\]$/)[1].split("+"):D;return tg(D,H||null,/\&/.test(E),/\*/.test(E),/\+\+/.test(E),s(H),P===0,A)})}var jI=(_s.prototype._createTableSchema=rg,_s.prototype._parseIndexSyntax=TE,_s.prototype._parseStoresSpec=function(w,E){var P=this;i(w).forEach(function(A){if(w[A]!==null){var D=P._parseIndexSyntax(w[A]),H=D.shift();if(!H)throw new te.Schema("Invalid schema for table "+A+": "+w[A]);if(H.unique=!0,H.multi)throw new te.Schema("Primary key cannot be multiEntry*");D.forEach(function(Z){if(Z.auto)throw new te.Schema("Only primary key can be marked as autoIncrement (++)");if(!Z.keyPath)throw new te.Schema("Index must have a name and cannot be an empty string")}),D=P._createTableSchema(A,H,D),E[A]=D}})},_s.prototype.stores=function(P){var E=this.db;this._cfg.storesSource=this._cfg.storesSource?l(this._cfg.storesSource,P):P;var P=E._versions,A={},D={};return P.forEach(function(H){l(A,H._cfg.storesSource),D=H._cfg.dbschema={},H._parseStoresSpec(A,D)}),E._dbSchema=D,og(E,[E._allTables,E,E.Transaction.prototype]),Yd(E,[E._allTables,E,E.Transaction.prototype,this._cfg.tables],i(D),D),E._storeNames=i(D),this},_s.prototype.upgrade=function(w){return this._cfg.contentUpgrade=$e(this._cfg.contentUpgrade||G,w),this},_s);function _s(){}function sg(w,E){var P=w._dbNamesDB;return P||(P=w._dbNamesDB=new Vo(As,{addons:[],indexedDB:w,IDBKeyRange:E})).version(1).stores({dbnames:"name"}),P.table("dbnames")}function lg(w){return w&&typeof w.databases=="function"}function ug(w){return uo(function(){return ze.letThrough=!0,w()})}function cg(w){return!("from"in w)}var Hr=function(w,E){if(!this){var P=new Hr;return w&&"d"in w&&l(P,w),P}l(this,arguments.length?{d:1,from:w,to:1<arguments.length?E:w}:{d:0})};function Su(w,E,P){var A=At(E,P);if(!isNaN(A)){if(0<A)throw RangeError();if(cg(w))return l(w,{from:E,to:P,d:1});var D=w.l,A=w.r;if(At(P,w.from)<0)return D?Su(D,E,P):w.l={from:E,to:P,d:1,l:null,r:null},_E(w);if(0<At(E,w.to))return A?Su(A,E,P):w.r={from:E,to:P,d:1,l:null,r:null},_E(w);At(E,w.from)<0&&(w.from=E,w.l=null,w.d=A?A.d+1:1),0<At(P,w.to)&&(w.to=P,w.r=null,w.d=w.l?w.l.d+1:1),P=!w.r,D&&!w.l&&Nu(w,D),A&&P&&Nu(w,A)}}function Nu(w,E){cg(E)||function P(A,re){var H=re.from,Z=re.to,Q=re.l,re=re.r;Su(A,H,Z),Q&&P(A,Q),re&&P(A,re)}(w,E)}function ME(w,E){var P=Qd(E),A=P.next();if(A.done)return!1;for(var D=A.value,H=Qd(w),Z=H.next(D.from),Q=Z.value;!A.done&&!Z.done;){if(At(Q.from,D.to)<=0&&0<=At(Q.to,D.from))return!0;At(D.from,Q.from)<0?D=(A=P.next(Q.from)).value:Q=(Z=H.next(D.from)).value}return!1}function Qd(w){var E=cg(w)?null:{s:0,n:w};return{next:function(P){for(var A=0<arguments.length;E;)switch(E.s){case 0:if(E.s=1,A)for(;E.n.l&&At(P,E.n.from)<0;)E={up:E,n:E.n.l,s:1};else for(;E.n.l;)E={up:E,n:E.n.l,s:1};case 1:if(E.s=2,!A||At(P,E.n.to)<=0)return{value:E.n,done:!1};case 2:if(E.n.r){E.s=3,E={up:E,n:E.n.r,s:0};continue}case 3:E=E.up}return{done:!0}}}}function _E(w){var E,P,A=(((E=w.r)===null||E===void 0?void 0:E.d)||0)-(((P=w.l)===null||P===void 0?void 0:P.d)||0),D=1<A?"r":A<-1?"l":"";D&&(E=D=="r"?"l":"r",P=n({},w),A=w[D],w.from=A.from,w.to=A.to,w[D]=A[D],P[D]=A[E],(w[E]=P).d=IE(P)),w.d=IE(w)}function IE(P){var E=P.r,P=P.l;return(E?P?Math.max(E.d,P.d):E.d:P?P.d:0)+1}function ef(w,E){return i(E).forEach(function(P){w[P]?Nu(w[P],E[P]):w[P]=function A(D){var H,Z,Q={};for(H in D)f(D,H)&&(Z=D[H],Q[H]=!Z||typeof Z!="object"||_.has(Z.constructor)?Z:A(Z));return Q}(E[P])}),w}function dg(w,E){return w.all||E.all||Object.keys(w).some(function(P){return E[P]&&ME(E[P],w[P])})}m(Hr.prototype,((Pn={add:function(w){return Nu(this,w),this},addKey:function(w){return Su(this,w,w),this},addKeys:function(w){var E=this;return w.forEach(function(P){return Su(E,P,P)}),this},hasKey:function(w){var E=Qd(this).next(w).value;return E&&At(E.from,w)<=0&&0<=At(E.to,w)}})[U]=function(){return Qd(this)},Pn));var Si={},fg={},pg=!1;function tf(w){ef(fg,w),pg||(pg=!0,setTimeout(function(){pg=!1,mg(fg,!(fg={}))},0))}function mg(w,E){E===void 0&&(E=!1);var P=new Set;if(w.all)for(var A=0,D=Object.values(Si);A<D.length;A++)DE(Z=D[A],w,P,E);else for(var H in w){var Z,Q=/^idb\:\/\/(.*)\/(.*)\//.exec(H);Q&&(H=Q[1],Q=Q[2],(Z=Si["idb://".concat(H,"/").concat(Q)])&&DE(Z,w,P,E))}P.forEach(function(re){return re()})}function DE(w,E,P,A){for(var D=[],H=0,Z=Object.entries(w.queries.query);H<Z.length;H++){for(var Q=Z[H],re=Q[0],ae=[],se=0,ee=Q[1];se<ee.length;se++){var fe=ee[se];dg(E,fe.obsSet)?fe.subscribers.forEach(function(ue){return P.add(ue)}):A&&ae.push(fe)}A&&D.push([re,ae])}if(A)for(var ne=0,ie=D;ne<ie.length;ne++){var de=ie[ne],re=de[0],ae=de[1];w.queries.query[re]=ae}}function EI(w){var E=w._state,P=w._deps.indexedDB;if(E.isBeingOpened||w.idbdb)return E.dbReadyPromise.then(function(){return E.dbOpenError?hr(E.dbOpenError):w});E.isBeingOpened=!0,E.dbOpenError=null,E.openComplete=!1;var A=E.openCanceller,D=Math.round(10*w.verno),H=!1;function Z(){if(E.openCanceller!==A)throw new te.DatabaseClosed("db.open() was cancelled")}function Q(){return new We(function(fe,ne){if(Z(),!P)throw new te.MissingAPI;var ie=w.name,de=E.autoSchema||!D?P.open(ie):P.open(ie,D);if(!de)throw new te.MissingAPI;de.onerror=po(ne),de.onblocked=Ft(w._fireOnBlocked),de.onupgradeneeded=Ft(function(ue){var pe;se=de.transaction,E.autoSchema&&!w._options.allowEmptyDB?(de.onerror=wu,se.abort(),de.result.close(),(pe=P.deleteDatabase(ie)).onsuccess=pe.onerror=Ft(function(){ne(new te.NoSuchDatabase("Database ".concat(ie," doesnt exist")))})):(se.onerror=po(ne),ue=ue.oldVersion>Math.pow(2,62)?0:ue.oldVersion,ee=ue<1,w.idbdb=de.result,H&&kI(w,se),wI(w,ue/10,se,ne))},ne),de.onsuccess=Ft(function(){se=null;var ue,pe,xe,ke,je,Ae=w.idbdb=de.result,Be=k(Ae.objectStoreNames);if(0<Be.length)try{var De=Ae.transaction((ke=Be).length===1?ke[0]:ke,"readonly");if(E.autoSchema)pe=Ae,xe=De,(ue=w).verno=pe.version/10,xe=ue._dbSchema=Zd(0,pe,xe),ue._storeNames=k(pe.objectStoreNames,0),Yd(ue,[ue._allTables],i(xe),xe);else if(Jd(w,w._dbSchema,De),((je=ag(Zd(0,(je=w).idbdb,De),je._dbSchema)).add.length||je.change.some(function(Fe){return Fe.add.length||Fe.change.length}))&&!H)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),Ae.close(),D=Ae.version+1,H=!0,fe(Q());Gd(w,De)}catch{}Aa.push(w),Ae.onversionchange=Ft(function(Fe){E.vcFired=!0,w.on("versionchange").fire(Fe)}),Ae.onclose=Ft(function(Fe){w.on("close").fire(Fe)}),ee&&(je=w._deps,De=ie,Ae=je.indexedDB,je=je.IDBKeyRange,lg(Ae)||De===As||sg(Ae,je).put({name:De}).catch(G)),fe()},ne)}).catch(function(fe){switch(fe?.name){case"UnknownError":if(0<E.PR1398_maxLoop)return E.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),Q();break;case"VersionError":if(0<D)return D=0,Q()}return We.reject(fe)})}var re,ae=E.dbReadyResolve,se=null,ee=!1;return We.race([A,(typeof navigator>"u"?We.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(fe){function ne(){return indexedDB.databases().finally(fe)}re=setInterval(ne,100),ne()}).finally(function(){return clearInterval(re)}):Promise.resolve()).then(Q)]).then(function(){return Z(),E.onReadyBeingFired=[],We.resolve(ug(function(){return w.on.ready.fire(w.vip)})).then(function fe(){if(0<E.onReadyBeingFired.length){var ne=E.onReadyBeingFired.reduce($e,G);return E.onReadyBeingFired=[],We.resolve(ug(function(){return ne(w.vip)})).then(fe)}})}).finally(function(){E.openCanceller===A&&(E.onReadyBeingFired=null,E.isBeingOpened=!1)}).catch(function(fe){E.dbOpenError=fe;try{se&&se.abort()}catch{}return A===E.openCanceller&&w._close(),hr(fe)}).finally(function(){E.openComplete=!0,ae()}).then(function(){var fe;return ee&&(fe={},w.tables.forEach(function(ne){ne.schema.indexes.forEach(function(ie){ie.name&&(fe["idb://".concat(w.name,"/").concat(ne.name,"/").concat(ie.name)]=new Hr(-1/0,[[[]]]))}),fe["idb://".concat(w.name,"/").concat(ne.name,"/")]=fe["idb://".concat(w.name,"/").concat(ne.name,"/:dels")]=new Hr(-1/0,[[[]]])}),Ma(ku).fire(fe),mg(fe,!0)),w})}function hg(w){function E(H){return w.next(H)}var P=D(E),A=D(function(H){return w.throw(H)});function D(H){return function(re){var Q=H(re),re=Q.value;return Q.done?re:re&&typeof re.then=="function"?re.then(P,A):s(re)?Promise.all(re).then(P,A):P(re)}}return D(E)()}function rf(w,E,P){for(var A=s(w)?w.slice():[w],D=0;D<P;++D)A.push(E);return A}var SI={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(w){return n(n({},w),{table:function(E){var P=w.table(E),A=P.schema,D={},H=[];function Z(ee,fe,ne){var ie=Eu(ee),de=D[ie]=D[ie]||[],ue=ee==null?0:typeof ee=="string"?1:ee.length,pe=0<fe,pe=n(n({},ne),{name:pe?"".concat(ie,"(virtual-from:").concat(ne.name,")"):ne.name,lowLevelIndex:ne,isVirtual:pe,keyTail:fe,keyLength:ue,extractKey:ng(ee),unique:!pe&&ne.unique});return de.push(pe),pe.isPrimaryKey||H.push(pe),1<ue&&Z(ue===2?ee[0]:ee.slice(0,ue-1),fe+1,ne),de.sort(function(xe,ke){return xe.keyTail-ke.keyTail}),pe}E=Z(A.primaryKey.keyPath,0,A.primaryKey),D[":id"]=[E];for(var Q=0,re=A.indexes;Q<re.length;Q++){var ae=re[Q];Z(ae.keyPath,0,ae)}function se(ee){var fe,ne=ee.query.index;return ne.isVirtual?n(n({},ee),{query:{index:ne.lowLevelIndex,range:(fe=ee.query.range,ne=ne.keyTail,{type:fe.type===1?2:fe.type,lower:rf(fe.lower,fe.lowerOpen?w.MAX_KEY:w.MIN_KEY,ne),lowerOpen:!0,upper:rf(fe.upper,fe.upperOpen?w.MIN_KEY:w.MAX_KEY,ne),upperOpen:!0})}}):ee}return n(n({},P),{schema:n(n({},A),{primaryKey:E,indexes:H,getIndexByKeyPath:function(ee){return(ee=D[Eu(ee)])&&ee[0]}}),count:function(ee){return P.count(se(ee))},query:function(ee){return P.query(se(ee))},openCursor:function(ee){var fe=ee.query.index,ne=fe.keyTail,ie=fe.isVirtual,de=fe.keyLength;return ie?P.openCursor(se(ee)).then(function(pe){return pe&&ue(pe)}):P.openCursor(ee);function ue(pe){return Object.create(pe,{continue:{value:function(xe){xe!=null?pe.continue(rf(xe,ee.reverse?w.MAX_KEY:w.MIN_KEY,ne)):ee.unique?pe.continue(pe.key.slice(0,de).concat(ee.reverse?w.MIN_KEY:w.MAX_KEY,ne)):pe.continue()}},continuePrimaryKey:{value:function(xe,ke){pe.continuePrimaryKey(rf(xe,w.MAX_KEY,ne),ke)}},primaryKey:{get:function(){return pe.primaryKey}},key:{get:function(){var xe=pe.key;return de===1?xe[0]:xe.slice(0,de)}},value:{get:function(){return pe.value}}})}}})}})}};function gg(w,E,P,A){return P=P||{},A=A||"",i(w).forEach(function(D){var H,Z,Q;f(E,D)?(H=w[D],Z=E[D],typeof H=="object"&&typeof Z=="object"&&H&&Z?(Q=B(H))!==B(Z)?P[A+D]=E[D]:Q==="Object"?gg(H,Z,P,A+D+"."):H!==Z&&(P[A+D]=E[D]):H!==Z&&(P[A+D]=E[D])):P[A+D]=void 0}),i(E).forEach(function(D){f(w,D)||(P[A+D]=E[D])}),P}function bg(w,E){return E.type==="delete"?E.keys:E.keys||E.values.map(w.extractKey)}var NI={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(w){return n(n({},w),{table:function(E){var P=w.table(E),A=P.schema.primaryKey;return n(n({},P),{mutate:function(D){var H=ze.trans,Z=H.table(E).hook,Q=Z.deleting,re=Z.creating,ae=Z.updating;switch(D.type){case"add":if(re.fire===G)break;return H._promise("readwrite",function(){return se(D)},!0);case"put":if(re.fire===G&&ae.fire===G)break;return H._promise("readwrite",function(){return se(D)},!0);case"delete":if(Q.fire===G)break;return H._promise("readwrite",function(){return se(D)},!0);case"deleteRange":if(Q.fire===G)break;return H._promise("readwrite",function(){return function ee(fe,ne,ie){return P.query({trans:fe,values:!1,query:{index:A,range:ne},limit:ie}).then(function(de){var ue=de.result;return se({type:"delete",keys:ue,trans:fe}).then(function(pe){return 0<pe.numFailures?Promise.reject(pe.failures[0]):ue.length<ie?{failures:[],numFailures:0,lastResult:void 0}:ee(fe,n(n({},ne),{lower:ue[ue.length-1],lowerOpen:!0}),ie)})})}(D.trans,D.range,1e4)},!0)}return P.mutate(D);function se(ee){var fe,ne,ie,de=ze.trans,ue=ee.keys||bg(A,ee);if(!ue)throw new Error("Keys missing");return(ee=ee.type==="add"||ee.type==="put"?n(n({},ee),{keys:ue}):n({},ee)).type!=="delete"&&(ee.values=o([],ee.values)),ee.keys&&(ee.keys=o([],ee.keys)),fe=P,ie=ue,((ne=ee).type==="add"?Promise.resolve([]):fe.getMany({trans:ne.trans,keys:ie,cache:"immutable"})).then(function(pe){var xe=ue.map(function(ke,je){var Ae,Be,De,Fe=pe[je],Ue={onerror:null,onsuccess:null};return ee.type==="delete"?Q.fire.call(Ue,ke,Fe,de):ee.type==="add"||Fe===void 0?(Ae=re.fire.call(Ue,ke,ee.values[je],de),ke==null&&Ae!=null&&(ee.keys[je]=ke=Ae,A.outbound||N(ee.values[je],A.keyPath,ke))):(Ae=gg(Fe,ee.values[je]),(Be=ae.fire.call(Ue,Ae,ke,Fe,de))&&(De=ee.values[je],Object.keys(Be).forEach(function(He){f(De,He)?De[He]=Be[He]:N(De,He,Be[He])}))),Ue});return P.mutate(ee).then(function(ke){for(var je=ke.failures,Ae=ke.results,Be=ke.numFailures,ke=ke.lastResult,De=0;De<ue.length;++De){var Fe=(Ae||ue)[De],Ue=xe[De];Fe==null?Ue.onerror&&Ue.onerror(je[De]):Ue.onsuccess&&Ue.onsuccess(ee.type==="put"&&pe[De]?ee.values[De]:Fe)}return{failures:je,results:Ae,numFailures:Be,lastResult:ke}}).catch(function(ke){return xe.forEach(function(je){return je.onerror&&je.onerror(ke)}),Promise.reject(ke)})})}}})}})}};function LE(w,E,P){try{if(!E||E.keys.length<w.length)return null;for(var A=[],D=0,H=0;D<E.keys.length&&H<w.length;++D)At(E.keys[D],w[H])===0&&(A.push(P?L(E.values[D]):E.values[D]),++H);return A.length===w.length?A:null}catch{return null}}var OI={stack:"dbcore",level:-1,create:function(w){return{table:function(E){var P=w.table(E);return n(n({},P),{getMany:function(A){if(!A.cache)return P.getMany(A);var D=LE(A.keys,A.trans._cache,A.cache==="clone");return D?We.resolve(D):P.getMany(A).then(function(H){return A.trans._cache={keys:A.keys,values:A.cache==="clone"?L(H):H},H})},mutate:function(A){return A.type!=="add"&&(A.trans._cache=null),P.mutate(A)}})}}}};function RE(w,E){return w.trans.mode==="readonly"&&!!w.subscr&&!w.trans.explicit&&w.trans.db._options.cache!=="disabled"&&!E.schema.primaryKey.outbound}function FE(w,E){switch(w){case"query":return E.values&&!E.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var CI={stack:"dbcore",level:0,name:"Observability",create:function(w){var E=w.schema.name,P=new Hr(w.MIN_KEY,w.MAX_KEY);return n(n({},w),{transaction:function(A,D,H){if(ze.subscr&&D!=="readonly")throw new te.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(ze.querier));return w.transaction(A,D,H)},table:function(A){var D=w.table(A),H=D.schema,Z=H.primaryKey,ee=H.indexes,Q=Z.extractKey,re=Z.outbound,ae=Z.autoIncrement&&ee.filter(function(ne){return ne.compound&&ne.keyPath.includes(Z.keyPath)}),se=n(n({},D),{mutate:function(ne){function ie(He){return He="idb://".concat(E,"/").concat(A,"/").concat(He),ke[He]||(ke[He]=new Hr)}var de,ue,pe,xe=ne.trans,ke=ne.mutatedParts||(ne.mutatedParts={}),je=ie(""),Ae=ie(":dels"),Be=ne.type,Ue=ne.type==="deleteRange"?[ne.range]:ne.type==="delete"?[ne.keys]:ne.values.length<50?[bg(Z,ne).filter(function(He){return He}),ne.values]:[],De=Ue[0],Fe=Ue[1],Ue=ne.trans._cache;return s(De)?(je.addKeys(De),(Ue=Be==="delete"||De.length===Fe.length?LE(De,Ue):null)||Ae.addKeys(De),(Ue||Fe)&&(de=ie,ue=Ue,pe=Fe,H.indexes.forEach(function(He){var Ke=de(He.name||"");function kt(bt){return bt!=null?He.extractKey(bt):null}function Dt(bt){return He.multiEntry&&s(bt)?bt.forEach(function(vr){return Ke.addKey(vr)}):Ke.addKey(bt)}(ue||pe).forEach(function(bt,qr){var mt=ue&&kt(ue[qr]),qr=pe&&kt(pe[qr]);At(mt,qr)!==0&&(mt!=null&&Dt(mt),qr!=null&&Dt(qr))})}))):De?(Fe={from:(Fe=De.lower)!==null&&Fe!==void 0?Fe:w.MIN_KEY,to:(Fe=De.upper)!==null&&Fe!==void 0?Fe:w.MAX_KEY},Ae.add(Fe),je.add(Fe)):(je.add(P),Ae.add(P),H.indexes.forEach(function(He){return ie(He.name).add(P)})),D.mutate(ne).then(function(He){return!De||ne.type!=="add"&&ne.type!=="put"||(je.addKeys(He.results),ae&&ae.forEach(function(Ke){for(var kt=ne.values.map(function(mt){return Ke.extractKey(mt)}),Dt=Ke.keyPath.findIndex(function(mt){return mt===Z.keyPath}),bt=0,vr=He.results.length;bt<vr;++bt)kt[bt][Dt]=He.results[bt];ie(Ke.name).addKeys(kt)})),xe.mutatedParts=ef(xe.mutatedParts||{},ke),He})}}),ee=function(ie){var de=ie.query,ie=de.index,de=de.range;return[ie,new Hr((ie=de.lower)!==null&&ie!==void 0?ie:w.MIN_KEY,(de=de.upper)!==null&&de!==void 0?de:w.MAX_KEY)]},fe={get:function(ne){return[Z,new Hr(ne.key)]},getMany:function(ne){return[Z,new Hr().addKeys(ne.keys)]},count:ee,query:ee,openCursor:ee};return i(fe).forEach(function(ne){se[ne]=function(ie){var de=ze.subscr,ue=!!de,pe=RE(ze,D)&&FE(ne,ie)?ie.obsSet={}:de;if(ue){var xe=function(Fe){return Fe="idb://".concat(E,"/").concat(A,"/").concat(Fe),pe[Fe]||(pe[Fe]=new Hr)},ke=xe(""),je=xe(":dels"),de=fe[ne](ie),ue=de[0],de=de[1];if((ne==="query"&&ue.isPrimaryKey&&!ie.values?je:xe(ue.name||"")).add(de),!ue.isPrimaryKey){if(ne!=="count"){var Ae=ne==="query"&&re&&ie.values&&D.query(n(n({},ie),{values:!1}));return D[ne].apply(this,arguments).then(function(Fe){if(ne==="query"){if(re&&ie.values)return Ae.then(function(kt){return kt=kt.result,ke.addKeys(kt),Fe});var Ue=ie.values?Fe.result.map(Q):Fe.result;(ie.values?ke:je).addKeys(Ue)}else if(ne==="openCursor"){var He=Fe,Ke=ie.values;return He&&Object.create(He,{key:{get:function(){return je.addKey(He.primaryKey),He.key}},primaryKey:{get:function(){var kt=He.primaryKey;return je.addKey(kt),kt}},value:{get:function(){return Ke&&ke.addKey(He.primaryKey),He.value}}})}return Fe})}je.add(P)}}return D[ne].apply(this,arguments)}}),se}})}};function $E(w,E,P){if(P.numFailures===0)return E;if(E.type==="deleteRange")return null;var A=E.keys?E.keys.length:"values"in E&&E.values?E.values.length:1;return P.numFailures===A?null:(E=n({},E),s(E.keys)&&(E.keys=E.keys.filter(function(D,H){return!(H in P.failures)})),"values"in E&&s(E.values)&&(E.values=E.values.filter(function(D,H){return!(H in P.failures)})),E)}function vg(w,E){return P=w,((A=E).lower===void 0||(A.lowerOpen?0<At(P,A.lower):0<=At(P,A.lower)))&&(w=w,(E=E).upper===void 0||(E.upperOpen?At(w,E.upper)<0:At(w,E.upper)<=0));var P,A}function BE(w,E,fe,A,D,H){if(!fe||fe.length===0)return w;var Z=E.query.index,Q=Z.multiEntry,re=E.query.range,ae=A.schema.primaryKey.extractKey,se=Z.extractKey,ee=(Z.lowLevelIndex||Z).extractKey,fe=fe.reduce(function(ne,ie){var de=ne,ue=[];if(ie.type==="add"||ie.type==="put")for(var pe=new Hr,xe=ie.values.length-1;0<=xe;--xe){var ke,je=ie.values[xe],Ae=ae(je);pe.hasKey(Ae)||(ke=se(je),(Q&&s(ke)?ke.some(function(He){return vg(He,re)}):vg(ke,re))&&(pe.addKey(Ae),ue.push(je)))}switch(ie.type){case"add":var Be=new Hr().addKeys(E.values?ne.map(function(Ke){return ae(Ke)}):ne),de=ne.concat(E.values?ue.filter(function(Ke){return Ke=ae(Ke),!Be.hasKey(Ke)&&(Be.addKey(Ke),!0)}):ue.map(function(Ke){return ae(Ke)}).filter(function(Ke){return!Be.hasKey(Ke)&&(Be.addKey(Ke),!0)}));break;case"put":var De=new Hr().addKeys(ie.values.map(function(Ke){return ae(Ke)}));de=ne.filter(function(Ke){return!De.hasKey(E.values?ae(Ke):Ke)}).concat(E.values?ue:ue.map(function(Ke){return ae(Ke)}));break;case"delete":var Fe=new Hr().addKeys(ie.keys);de=ne.filter(function(Ke){return!Fe.hasKey(E.values?ae(Ke):Ke)});break;case"deleteRange":var Ue=ie.range;de=ne.filter(function(Ke){return!vg(ae(Ke),Ue)})}return de},w);return fe===w?w:(fe.sort(function(ne,ie){return At(ee(ne),ee(ie))||At(ae(ne),ae(ie))}),E.limit&&E.limit<1/0&&(fe.length>E.limit?fe.length=E.limit:w.length===E.limit&&fe.length<E.limit&&(D.dirty=!0)),H?Object.freeze(fe):fe)}function zE(w,E){return At(w.lower,E.lower)===0&&At(w.upper,E.upper)===0&&!!w.lowerOpen==!!E.lowerOpen&&!!w.upperOpen==!!E.upperOpen}function PI(w,E){return function(P,A,D,H){if(P===void 0)return A!==void 0?-1:0;if(A===void 0)return 1;if((A=At(P,A))===0){if(D&&H)return 0;if(D)return 1;if(H)return-1}return A}(w.lower,E.lower,w.lowerOpen,E.lowerOpen)<=0&&0<=function(P,A,D,H){if(P===void 0)return A!==void 0?1:0;if(A===void 0)return-1;if((A=At(P,A))===0){if(D&&H)return 0;if(D)return-1;if(H)return 1}return A}(w.upper,E.upper,w.upperOpen,E.upperOpen)}function AI(w,E,P,A){w.subscribers.add(P),A.addEventListener("abort",function(){var D,H;w.subscribers.delete(P),w.subscribers.size===0&&(D=w,H=E,setTimeout(function(){D.subscribers.size===0&&z(H,D)},3e3))})}var TI={stack:"dbcore",level:0,name:"Cache",create:function(w){var E=w.schema.name;return n(n({},w),{transaction:function(P,A,D){var H,Z,Q=w.transaction(P,A,D);return A==="readwrite"&&(Z=(H=new AbortController).signal,D=function(re){return function(){if(H.abort(),A==="readwrite"){for(var ae=new Set,se=0,ee=P;se<ee.length;se++){var fe=ee[se],ne=Si["idb://".concat(E,"/").concat(fe)];if(ne){var ie=w.table(fe),de=ne.optimisticOps.filter(function(Ke){return Ke.trans===Q});if(Q._explicit&&re&&Q.mutatedParts)for(var ue=0,pe=Object.values(ne.queries.query);ue<pe.length;ue++)for(var xe=0,ke=(Be=pe[ue]).slice();xe<ke.length;xe++)dg((De=ke[xe]).obsSet,Q.mutatedParts)&&(z(Be,De),De.subscribers.forEach(function(Ke){return ae.add(Ke)}));else if(0<de.length){ne.optimisticOps=ne.optimisticOps.filter(function(Ke){return Ke.trans!==Q});for(var je=0,Ae=Object.values(ne.queries.query);je<Ae.length;je++)for(var Be,De,Fe,Ue=0,He=(Be=Ae[je]).slice();Ue<He.length;Ue++)(De=He[Ue]).res!=null&&Q.mutatedParts&&(re&&!De.dirty?(Fe=Object.isFrozen(De.res),Fe=BE(De.res,De.req,de,ie,De,Fe),De.dirty?(z(Be,De),De.subscribers.forEach(function(Ke){return ae.add(Ke)})):Fe!==De.res&&(De.res=Fe,De.promise=We.resolve({result:Fe}))):(De.dirty&&z(Be,De),De.subscribers.forEach(function(Ke){return ae.add(Ke)})))}}}ae.forEach(function(Ke){return Ke()})}}},Q.addEventListener("abort",D(!1),{signal:Z}),Q.addEventListener("error",D(!1),{signal:Z}),Q.addEventListener("complete",D(!0),{signal:Z})),Q},table:function(P){var A=w.table(P),D=A.schema.primaryKey;return n(n({},A),{mutate:function(H){var Z=ze.trans;if(D.outbound||Z.db._options.cache==="disabled"||Z.explicit||Z.idbtrans.mode!=="readwrite")return A.mutate(H);var Q=Si["idb://".concat(E,"/").concat(P)];return Q?(Z=A.mutate(H),H.type!=="add"&&H.type!=="put"||!(50<=H.values.length||bg(D,H).some(function(re){return re==null}))?(Q.optimisticOps.push(H),H.mutatedParts&&tf(H.mutatedParts),Z.then(function(re){0<re.numFailures&&(z(Q.optimisticOps,H),(re=$E(0,H,re))&&Q.optimisticOps.push(re),H.mutatedParts&&tf(H.mutatedParts))}),Z.catch(function(){z(Q.optimisticOps,H),H.mutatedParts&&tf(H.mutatedParts)})):Z.then(function(re){var ae=$E(0,n(n({},H),{values:H.values.map(function(se,ee){var fe;return re.failures[ee]||(se=(fe=D.keyPath)!==null&&fe!==void 0&&fe.includes(".")?L(se):n({},se),N(se,D.keyPath,re.results[ee])),se})}),re);Q.optimisticOps.push(ae),queueMicrotask(function(){return H.mutatedParts&&tf(H.mutatedParts)})}),Z):A.mutate(H)},query:function(H){if(!RE(ze,A)||!FE("query",H))return A.query(H);var Z=((ae=ze.trans)===null||ae===void 0?void 0:ae.db._options.cache)==="immutable",ee=ze,Q=ee.requery,re=ee.signal,ae=function(ie,de,ue,pe){var xe=Si["idb://".concat(ie,"/").concat(de)];if(!xe)return[];if(!(de=xe.queries[ue]))return[null,!1,xe,null];var ke=de[(pe.query?pe.query.index.name:null)||""];if(!ke)return[null,!1,xe,null];switch(ue){case"query":var je=ke.find(function(Ae){return Ae.req.limit===pe.limit&&Ae.req.values===pe.values&&zE(Ae.req.query.range,pe.query.range)});return je?[je,!0,xe,ke]:[ke.find(function(Ae){return("limit"in Ae.req?Ae.req.limit:1/0)>=pe.limit&&(!pe.values||Ae.req.values)&&PI(Ae.req.query.range,pe.query.range)}),!1,xe,ke];case"count":return je=ke.find(function(Ae){return zE(Ae.req.query.range,pe.query.range)}),[je,!!je,xe,ke]}}(E,P,"query",H),se=ae[0],ee=ae[1],fe=ae[2],ne=ae[3];return se&&ee?se.obsSet=H.obsSet:(ee=A.query(H).then(function(ie){var de=ie.result;if(se&&(se.res=de),Z){for(var ue=0,pe=de.length;ue<pe;++ue)Object.freeze(de[ue]);Object.freeze(de)}else ie.result=L(de);return ie}).catch(function(ie){return ne&&se&&z(ne,se),Promise.reject(ie)}),se={obsSet:H.obsSet,promise:ee,subscribers:new Set,type:"query",req:H,dirty:!1},ne?ne.push(se):(ne=[se],(fe=fe||(Si["idb://".concat(E,"/").concat(P)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[H.query.index.name||""]=ne)),AI(se,ne,Q,re),se.promise.then(function(ie){return{result:BE(ie.result,H,fe?.optimisticOps,A,se,Z)}})}})}})}};function nf(w,E){return new Proxy(w,{get:function(P,A,D){return A==="db"?E:Reflect.get(P,A,D)}})}var Vo=(xr.prototype.version=function(w){if(isNaN(w)||w<.1)throw new te.Type("Given version is not a positive number");if(w=Math.round(10*w)/10,this.idbdb||this._state.isBeingOpened)throw new te.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,w);var E=this._versions,P=E.filter(function(A){return A._cfg.version===w})[0];return P||(P=new this.Version(w),E.push(P),E.sort(xI),P.stores({}),this._state.autoSchema=!1,P)},xr.prototype._whenReady=function(w){var E=this;return this.idbdb&&(this._state.openComplete||ze.letThrough||this._vip)?w():new We(function(P,A){if(E._state.openComplete)return A(new te.DatabaseClosed(E._state.dbOpenError));if(!E._state.isBeingOpened){if(!E._state.autoOpen)return void A(new te.DatabaseClosed);E.open().catch(G)}E._state.dbReadyPromise.then(P,A)}).then(w)},xr.prototype.use=function(w){var E=w.stack,P=w.create,A=w.level,D=w.name;return D&&this.unuse({stack:E,name:D}),w=this._middlewares[E]||(this._middlewares[E]=[]),w.push({stack:E,create:P,level:A??10,name:D}),w.sort(function(H,Z){return H.level-Z.level}),this},xr.prototype.unuse=function(w){var E=w.stack,P=w.name,A=w.create;return E&&this._middlewares[E]&&(this._middlewares[E]=this._middlewares[E].filter(function(D){return A?D.create!==A:!!P&&D.name!==P})),this},xr.prototype.open=function(){var w=this;return Wo(wr,function(){return EI(w)})},xr.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var w=this._state,E=Aa.indexOf(this);if(0<=E&&Aa.splice(E,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}w.isBeingOpened||(w.dbReadyPromise=new We(function(P){w.dbReadyResolve=P}),w.openCanceller=new We(function(P,A){w.cancelOpen=A}))},xr.prototype.close=function(P){var E=(P===void 0?{disableAutoOpen:!0}:P).disableAutoOpen,P=this._state;E?(P.isBeingOpened&&P.cancelOpen(new te.DatabaseClosed),this._close(),P.autoOpen=!1,P.dbOpenError=new te.DatabaseClosed):(this._close(),P.autoOpen=this._options.autoOpen||P.isBeingOpened,P.openComplete=!1,P.dbOpenError=null)},xr.prototype.delete=function(w){var E=this;w===void 0&&(w={disableAutoOpen:!0});var P=0<arguments.length&&typeof arguments[0]!="object",A=this._state;return new We(function(D,H){function Z(){E.close(w);var Q=E._deps.indexedDB.deleteDatabase(E.name);Q.onsuccess=Ft(function(){var re,ae,se;re=E._deps,ae=E.name,se=re.indexedDB,re=re.IDBKeyRange,lg(se)||ae===As||sg(se,re).delete(ae).catch(G),D()}),Q.onerror=po(H),Q.onblocked=E._fireOnBlocked}if(P)throw new te.InvalidArgument("Invalid closeOptions argument to db.delete()");A.isBeingOpened?A.dbReadyPromise.then(Z):Z()})},xr.prototype.backendDB=function(){return this.idbdb},xr.prototype.isOpen=function(){return this.idbdb!==null},xr.prototype.hasBeenClosed=function(){var w=this._state.dbOpenError;return w&&w.name==="DatabaseClosed"},xr.prototype.hasFailed=function(){return this._state.dbOpenError!==null},xr.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(xr.prototype,"tables",{get:function(){var w=this;return i(this._allTables).map(function(E){return w._allTables[E]})},enumerable:!1,configurable:!0}),xr.prototype.transaction=function(){var w=function(E,P,A){var D=arguments.length;if(D<2)throw new te.InvalidArgument("Too few arguments");for(var H=new Array(D-1);--D;)H[D-1]=arguments[D];return A=H.pop(),[E,I(H),A]}.apply(this,arguments);return this._transaction.apply(this,w)},xr.prototype._transaction=function(w,E,P){var A=this,D=ze.trans;D&&D.db===this&&w.indexOf("!")===-1||(D=null);var H,Z,Q=w.indexOf("?")!==-1;w=w.replace("!","").replace("?","");try{if(Z=E.map(function(ae){if(ae=ae instanceof A.Table?ae.name:ae,typeof ae!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return ae}),w=="r"||w===yu)H=yu;else{if(w!="rw"&&w!=xu)throw new te.InvalidArgument("Invalid transaction mode: "+w);H=xu}if(D){if(D.mode===yu&&H===xu){if(!Q)throw new te.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");D=null}D&&Z.forEach(function(ae){if(D&&D.storeNames.indexOf(ae)===-1){if(!Q)throw new te.SubTransaction("Table "+ae+" not included in parent transaction.");D=null}}),Q&&D&&!D.active&&(D=null)}}catch(ae){return D?D._promise(null,function(se,ee){ee(ae)}):hr(ae)}var re=function ae(se,ee,fe,ne,ie){return We.resolve().then(function(){var de=ze.transless||ze,ue=se._createTransaction(ee,fe,se._dbSchema,ne);if(ue.explicit=!0,de={trans:ue,transless:de},ne)ue.idbtrans=ne.idbtrans;else try{ue.create(),ue.idbtrans._explicit=!0,se._state.PR1398_maxLoop=3}catch(ke){return ke.name===oe.InvalidState&&se.isOpen()&&0<--se._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),se.close({disableAutoOpen:!1}),se.open().then(function(){return ae(se,ee,fe,null,ie)})):hr(ke)}var pe,xe=q(ie);return xe&&Pa(),de=We.follow(function(){var ke;(pe=ie.call(ue,ue))&&(xe?(ke=co.bind(null,null),pe.then(ke,ke)):typeof pe.next=="function"&&typeof pe.throw=="function"&&(pe=hg(pe)))},de),(pe&&typeof pe.then=="function"?We.resolve(pe).then(function(ke){return ue.active?ke:hr(new te.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):de.then(function(){return pe})).then(function(ke){return ne&&ue._resolve(),ue._completion.then(function(){return ke})}).catch(function(ke){return ue._reject(ke),hr(ke)})})}.bind(null,this,H,Z,D,P);return D?D._promise(H,re,"lock"):ze.trans?Wo(ze.transless,function(){return A._whenReady(re)}):this._whenReady(re)},xr.prototype.table=function(w){if(!f(this._allTables,w))throw new te.InvalidTable("Table ".concat(w," does not exist"));return this._allTables[w]},xr);function xr(w,E){var P=this;this._middlewares={},this.verno=0;var A=xr.dependencies;this._options=E=n({addons:xr.addons,autoOpen:!0,indexedDB:A.indexedDB,IDBKeyRange:A.IDBKeyRange,cache:"cloned"},E),this._deps={indexedDB:E.indexedDB,IDBKeyRange:E.IDBKeyRange},A=E.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var D,H,Z,Q,re,ae={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:G,dbReadyPromise:null,cancelOpen:G,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:E.autoOpen};ae.dbReadyPromise=new We(function(ee){ae.dbReadyResolve=ee}),ae.openCanceller=new We(function(ee,fe){ae.cancelOpen=fe}),this._state=ae,this.name=w,this.on=Ie(this,"populate","blocked","versionchange","close",{ready:[$e,G]}),this.once=function(ee,fe){var ne=function(){for(var ie=[],de=0;de<arguments.length;de++)ie[de]=arguments[de];P.on(ee).unsubscribe(ne),fe.apply(P,ie)};return P.on(ee,ne)},this.on.ready.subscribe=S(this.on.ready.subscribe,function(ee){return function(fe,ne){xr.vip(function(){var ie,de=P._state;de.openComplete?(de.dbOpenError||We.resolve().then(fe),ne&&ee(fe)):de.onReadyBeingFired?(de.onReadyBeingFired.push(fe),ne&&ee(fe)):(ee(fe),ie=P,ne||ee(function ue(){ie.on.ready.unsubscribe(fe),ie.on.ready.unsubscribe(ue)}))})}}),this.Collection=(D=this,Pe(br.prototype,function(pe,ue){this.db=D;var ne=Hd,ie=null;if(ue)try{ne=ue()}catch(xe){ie=xe}var de=pe._ctx,ue=de.table,pe=ue.hook.reading.fire;this._ctx={table:ue,index:de.index,isPrimKey:!de.index||ue.schema.primKey.keyPath&&de.index===ue.schema.primKey.name,range:ne,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:ie,or:de.or,valueMapper:pe!==ye?pe:null}})),this.Table=(H=this,Pe(be.prototype,function(ee,fe,ne){this.db=H,this._tx=ne,this.name=ee,this.schema=fe,this.hook=H._allTables[ee]?H._allTables[ee].hook:Ie(null,{creating:[Ce,G],reading:[le,ye],updating:[Ye,G],deleting:[Me,G]})})),this.Transaction=(Z=this,Pe(gI.prototype,function(ee,fe,ne,ie,de){var ue=this;ee!=="readonly"&&fe.forEach(function(pe){pe=(pe=ne[pe])===null||pe===void 0?void 0:pe.yProps,pe&&(fe=fe.concat(pe.map(function(xe){return xe.updatesTable})))}),this.db=Z,this.mode=ee,this.storeNames=fe,this.schema=ne,this.chromeTransactionDurability=ie,this.idbtrans=null,this.on=Ie(this,"complete","error","abort"),this.parent=de||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new We(function(pe,xe){ue._resolve=pe,ue._reject=xe}),this._completion.then(function(){ue.active=!1,ue.on.complete.fire()},function(pe){var xe=ue.active;return ue.active=!1,ue.on.error.fire(pe),ue.parent?ue.parent._reject(pe):xe&&ue.idbtrans&&ue.idbtrans.abort(),hr(pe)})})),this.Version=(Q=this,Pe(jI.prototype,function(ee){this.db=Q,this._cfg={version:ee,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(re=this,Pe(OE.prototype,function(ee,fe,ne){if(this.db=re,this._ctx={table:ee,index:fe===":id"?null:fe,or:ne},this._cmp=this._ascending=At,this._descending=function(ie,de){return At(de,ie)},this._max=function(ie,de){return 0<At(ie,de)?ie:de},this._min=function(ie,de){return At(ie,de)<0?ie:de},this._IDBKeyRange=re._deps.IDBKeyRange,!this._IDBKeyRange)throw new te.MissingAPI})),this.on("versionchange",function(ee){0<ee.newVersion?console.warn("Another connection wants to upgrade database '".concat(P.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(P.name,"'. Closing db now to resume the delete request.")),P.close({disableAutoOpen:!1})}),this.on("blocked",function(ee){!ee.newVersion||ee.newVersion<ee.oldVersion?console.warn("Dexie.delete('".concat(P.name,"') was blocked")):console.warn("Upgrade '".concat(P.name,"' blocked by other connection holding version ").concat(ee.oldVersion/10))}),this._maxKey=ju(E.IDBKeyRange),this._createTransaction=function(ee,fe,ne,ie){return new P.Transaction(ee,fe,ne,P._options.chromeTransactionDurability,ie)},this._fireOnBlocked=function(ee){P.on("blocked").fire(ee),Aa.filter(function(fe){return fe.name===P.name&&fe!==P&&!fe._state.vcFired}).map(function(fe){return fe.on("versionchange").fire(ee)})},this.use(OI),this.use(TI),this.use(CI),this.use(SI),this.use(NI);var se=new Proxy(this,{get:function(ee,fe,ne){if(fe==="_vip")return!0;if(fe==="table")return function(de){return nf(P.table(de),se)};var ie=Reflect.get(ee,fe,ne);return ie instanceof be?nf(ie,se):fe==="tables"?ie.map(function(de){return nf(de,se)}):fe==="_createTransaction"?function(){return nf(ie.apply(this,arguments),se)}:ie}});this.vip=se,A.forEach(function(ee){return ee(P)})}var of,Pn=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",MI=(yg.prototype.subscribe=function(w,E,P){return this._subscribe(w&&typeof w!="function"?w:{next:w,error:E,complete:P})},yg.prototype[Pn]=function(){return this},yg);function yg(w){this._subscribe=w}try{of={indexedDB:a.indexedDB||a.mozIndexedDB||a.webkitIndexedDB||a.msIndexedDB,IDBKeyRange:a.IDBKeyRange||a.webkitIDBKeyRange}}catch{of={indexedDB:null,IDBKeyRange:null}}function HE(w){var E,P=!1,A=new MI(function(D){var H=q(w),Z,Q=!1,re={},ae={},se={get closed(){return Q},unsubscribe:function(){Q||(Q=!0,Z&&Z.abort(),ee&&Ma.storagemutated.unsubscribe(ne))}};D.start&&D.start(se);var ee=!1,fe=function(){return vu(ie)},ne=function(de){ef(re,de),dg(ae,re)&&fe()},ie=function(){var de,ue,pe;!Q&&of.indexedDB&&(re={},de={},Z&&Z.abort(),Z=new AbortController,pe=function(xe){var ke=Oa();try{H&&Pa();var je=uo(w,xe);return je=H?je.finally(co):je}finally{ke&&Ca()}}(ue={subscr:de,signal:Z.signal,requery:fe,querier:w,trans:null}),Promise.resolve(pe).then(function(xe){P=!0,E=xe,Q||ue.signal.aborted||(re={},function(ke){for(var je in ke)if(f(ke,je))return;return 1}(ae=de)||ee||(Ma(ku,ne),ee=!0),vu(function(){return!Q&&D.next&&D.next(xe)}))},function(xe){P=!1,["DatabaseClosedError","AbortError"].includes(xe?.name)||Q||vu(function(){Q||D.error&&D.error(xe)})}))};return setTimeout(fe,0),se});return A.hasValue=function(){return P},A.getValue=function(){return E},A}var Ni=Vo;function xg(w){var E=_a;try{_a=!0,Ma.storagemutated.fire(w),mg(w,!0)}finally{_a=E}}m(Ni,n(n({},ve),{delete:function(w){return new Ni(w,{addons:[]}).delete()},exists:function(w){return new Ni(w,{addons:[]}).open().then(function(E){return E.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(w){try{return E=Ni.dependencies,P=E.indexedDB,E=E.IDBKeyRange,(lg(P)?Promise.resolve(P.databases()).then(function(A){return A.map(function(D){return D.name}).filter(function(D){return D!==As})}):sg(P,E).toCollection().primaryKeys()).then(w)}catch{return hr(new te.MissingAPI)}var E,P},defineClass:function(){return function(w){l(this,w)}},ignoreTransaction:function(w){return ze.trans?Wo(ze.transless,w):w()},vip:ug,async:function(w){return function(){try{var E=hg(w.apply(this,arguments));return E&&typeof E.then=="function"?E:We.resolve(E)}catch(P){return hr(P)}}},spawn:function(w,E,P){try{var A=hg(w.apply(P,E||[]));return A&&typeof A.then=="function"?A:We.resolve(A)}catch(D){return hr(D)}},currentTransaction:{get:function(){return ze.trans||null}},waitFor:function(w,E){return E=We.resolve(typeof w=="function"?Ni.ignoreTransaction(w):w).timeout(E||6e4),ze.trans?ze.trans.waitFor(E):E},Promise:We,debug:{get:function(){return Ze},set:function(w){rt(w)}},derive:b,extend:l,props:m,override:S,Events:Ie,on:Ma,liveQuery:HE,extendObservabilitySet:ef,getByKeyPath:C,setByKeyPath:N,delByKeyPath:function(w,E){typeof E=="string"?N(w,E,void 0):"length"in E&&[].map.call(E,function(P){N(w,P,void 0)})},shallowClone:T,deepClone:L,getObjectDiff:gg,cmp:At,asap:O,minKey:-1/0,addons:[],connections:Aa,errnames:oe,dependencies:of,cache:Si,semVer:"4.2.0",version:"4.2.0".split(".").map(function(w){return parseInt(w)}).reduce(function(w,E,P){return w+E/Math.pow(10,2*P)})})),Ni.maxKey=ju(Ni.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Ma(ku,function(w){_a||(w=new CustomEvent(eg,{detail:w}),_a=!0,dispatchEvent(w),_a=!1)}),addEventListener(eg,function(w){w=w.detail,_a||xg(w)}));var Is,_a=!1,qE=function(){};return typeof BroadcastChannel<"u"&&((qE=function(){(Is=new BroadcastChannel(eg)).onmessage=function(w){return w.data&&xg(w.data)}})(),typeof Is.unref=="function"&&Is.unref(),Ma(ku,function(w){_a||Is.postMessage(w)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(w){if(!Vo.disableBfCache&&w.persisted){Ze&&console.debug("Dexie: handling persisted pagehide"),Is?.close();for(var E=0,P=Aa;E<P.length;E++)P[E].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(w){!Vo.disableBfCache&&w.persisted&&(Ze&&console.debug("Dexie: handling persisted pageshow"),qE(),xg({all:new Hr(-1/0,[[]])}))})),We.rejectionMapper=function(w,E){return!w||w instanceof V||w instanceof TypeError||w instanceof SyntaxError||!w.name||!Ne[w.name]?w:(E=new Ne[w.name](E||w.message,w),"stack"in w&&h(E,"stack",{get:function(){return this.inner.stack}}),E)},rt(Ze),n(Vo,Object.freeze({__proto__:null,Dexie:Vo,liveQuery:HE,Entity:qd,cmp:At,PropModification:yt,replacePrefix:function(w,E){return new yt({replacePrefix:[w,E]})},add:function(w){return new yt({add:w})},remove:function(w){return new yt({remove:w})},default:Vo,RangeSet:Hr,mergeRanges:Nu,rangesOverlap:ME}),{default:Vo}),Vo})}(b0)),b0.exports}var BI=$I();const v0=qt(BI),GE=Symbol.for("Dexie"),sl=globalThis[GE]||(globalThis[GE]=v0);if(v0.semVer!==sl.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${v0.semVer} and ${sl.semVer}`);const{liveQuery:eye,mergeRanges:tye,rangesOverlap:rye,RangeSet:nye,cmp:oye,Entity:aye,PropModification:iye,replacePrefix:sye,add:lye,remove:uye,DexieYProvider:cye}=sl;function zI(e,t,r){var n,o;typeof e=="function"?(n=t||[],o=r):(n=[],o=t);var a=y.useRef({hasResult:!1,result:o,error:null}),i=y.useReducer(function(c){return c+1},0);i[0];var s=i[1],l=y.useMemo(function(){var c=typeof e=="function"?e():e;if(!c||typeof c.subscribe!="function")throw e===c?new TypeError("Given argument to useObservable() was neither a valid observable nor a function."):new TypeError("Observable factory given to useObservable() did not return a valid observable.");if(!a.current.hasResult&&typeof window<"u"&&(typeof c.hasValue!="function"||c.hasValue()))if(typeof c.getValue=="function")a.current.result=c.getValue(),a.current.hasResult=!0;else{var d=c.subscribe(function(f){a.current.result=f,a.current.hasResult=!0});typeof d=="function"?d():d.unsubscribe()}return c},n);if(y.useDebugValue(a.current.result),y.useEffect(function(){var c=l.subscribe(function(d){var f=a.current;(f.error!==null||f.result!==d)&&(f.error=null,f.result=d,f.hasResult=!0,s())},function(d){var f=a.current;f.error!==d&&(f.error=d,s())});return typeof c=="function"?c:c.unsubscribe.bind(c)},n),a.current.error)throw a.current.error;return a.current.result}function ca(e,t,r){return zI(function(){return sl.liveQuery(e)},t||[],r)}typeof FinalizationRegistry<"u"&&new FinalizationRegistry(function(e){var t=sl.DexieYProvider;t&&t.release(e)});function Cr(e,t){const[r,n]=g.useState(()=>{if(typeof window>"u")return t;const o=localStorage.getItem(e);return o!==null?o:t});return g.useEffect(()=>{if(typeof window>"u")return;const o=a=>{if(a.key&&a.key!==e)return;const i=localStorage.getItem(e);n(i!==null?i:t)};return window.addEventListener("storage",o),window.addEventListener("local-storage",o),()=>{window.removeEventListener("storage",o),window.removeEventListener("local-storage",o)}},[e,t]),g.useEffect(()=>{typeof window>"u"||(r==null?localStorage.removeItem(e):localStorage.setItem(e,r),window.dispatchEvent(new CustomEvent("local-storage",{detail:{key:e,value:r}})))},[e,r]),[r,n]}const ld=e=>e>=200&&e<300?"bg-green-200 text-green-800":e>=300&&e<400?"bg-blue-200 text-blue-800":e>=400&&e<500?"bg-orange-600 text-orange-200":e>=500?"bg-red-800 text-red-100":"bg-gray-200 text-gray-800",ud=e=>{if(!e)return"";switch(e.toUpperCase()){case"GET":return"text-[rgb(0,107,230)]";case"POST":return"text-[rgb(23,131,135)]";case"PATCH":return"text-[rgb(204,75,0)]";case"DELETE":return"text-red-700";default:return""}},Ek=e=>{if(!e)return"text-gray-700 dark:text-gray-200 border border-gray-700 dark:border-gray-200";switch(e.toUpperCase()){case"GET":return"text-green-700 dark:text-green-300 border border-green-700 dark:border-green-300";case"POST":return"text-sky-700 dark:text-white border border-sky-700 dark:border-sky-300";case"PUT":return"text-fuchsia-700 dark:text-fuchsia-300 border border-fuchsia-700 dark:border-fuchsia-300";case"PATCH":return"text-purple-700 dark:text-purple-300 border border-purple-700 dark:border-purple-300";case"DELETE":return"text-red-700 dark:text-red-300 border border-red-700 dark:border-red-300";case"OPTIONS":return"text-rose-700 dark:text-rose-300 border border-rose-700 dark:border-rose-300";case"HEAD":return"text-pink-700 dark:text-pink-300 border border-pink-700 dark:border-pink-300";default:return"text-gray-700 dark:text-gray-200 border border-gray-700 dark:border-gray-200"}},zi=e=>{if(!e)return"N/A";const t=new Date(e),r=t.toLocaleDateString("en-CA",{year:"numeric",month:"2-digit",day:"2-digit"}),n=t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});return`${r} at ${n}`},ts=e=>{if(e==null)return"N/A";const t=Number(e);return t<1e3?`${t}ms`:t<6e4?`${(t/1e3).toFixed(2)}s`:`${(t/6e4).toFixed(2)}m`},Ci=e=>{if(e==null)return"N/A";const t=Number(e);if(t===0)return"0 B";const r=["B","KB","MB","GB","TB"],n=Math.floor(Math.log10(t)/Math.log10(1024));return n===0?`${t} ${r[n]}`:`${(t/Math.pow(1024,n)).toFixed(2)} ${r[n]}`},HI=["bg-blue-100 dark:bg-blue-900/30","border-blue-700 dark:border-blue-500"].join(" "),qI="border-l-4",WI=({operation:e,opId:t,onSelect:r,onRemove:n,selected:o,showQueryParams:a=!1})=>{var i,s,l,c,d,f,m,p,h;const b=C=>{r(C)},v=C=>{const N=new Date(C),T=String(N.getHours()).padStart(2,"0"),M=String(N.getMinutes()).padStart(2,"0"),I=String(N.getSeconds()).padStart(2,"0");return`${T}:${M}:${I}`},x=(i=e?.request)==null?void 0:i.path,k=(s=e?.request)==null?void 0:s.query_params;let S=x||((l=e?.request)==null?void 0:l.url);const j=a&&x&&Array.isArray(k)&&k.length>0,O=j?`?${k.map(C=>`${C.name}=${C.value}`).join("&")}`:"";return j&&(S=`${x}${O}`),u.jsx("li",{className:`flex items-center cursor-pointer hover:bg-gray-200 dark:hover:bg-dark-tremor-background-subtle ${qI} ${o?HI:"border-transparent"}`,onClick:()=>{b(e)},children:u.jsxs("div",{className:"flex items-center p-2 w-full",children:[u.jsx("div",{className:"w-16 flex justify-center",children:u.jsx("span",{className:`inline-flex px-3 py-1 text-xs font-semibold rounded-full ${ld((c=e?.response)==null?void 0:c.status)}`,children:((d=e?.response)==null?void 0:d.status)||"N/A"})}),u.jsx("div",{className:`w-20 text-center font-medium ${ud((f=e?.request)==null?void 0:f.method)}`,children:((m=e?.request)==null?void 0:m.method)||"GET"}),u.jsx("div",{className:"flex-grow truncate text-left text-tremor-content-strong dark:text-dark-tremor-content-strong",title:S,children:x?u.jsxs(u.Fragment,{children:[u.jsx("span",{children:x}),j&&u.jsx("span",{className:"text-gray-400 dark:text-gray-400",children:O})]}):S}),u.jsx("div",{className:"w-20 text-gray-900 dark:text-dark-tremor-content text-center text-xs",children:(p=e?.request)!=null&&p.timestamp?v(e.request.timestamp):"N/A"}),u.jsx("div",{className:"w-16 text-gray-500 dark:text-dark-tremor-content text-center text-xs",children:ts((h=e?.timing)==null?void 0:h.duration)}),u.jsx("button",{className:"w-8 h-8 flex items-center justify-center cursor-pointer text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300",onClick:C=>{C.stopPropagation(),n(t)},children:"✕"})]})})},Hi=({options:e=[],selected:t,onChange:r,placeholder:n="Add option...",colorFn:o})=>{const[a,i]=g.useState(""),[s,l]=g.useState(!1),[c,d]=g.useState(0),f=g.useRef(null),m=e.filter(v=>v.toLowerCase().includes(a.toLowerCase())&&!t.includes(v));g.useEffect(()=>{d(0)},[a,t]);const p=v=>{t.includes(v)||r([...t,v]),i("")},h=v=>{r(t.filter(x=>x!==v))},b=v=>{v.key==="ArrowDown"?(v.preventDefault(),d(x=>x+1<m.length?x+1:x)):v.key==="ArrowUp"?(v.preventDefault(),d(x=>x-1>=0?x-1:0)):v.key==="Enter"?(console.log("enter",c),v.preventDefault(),m.length>0&&p(m[c])):v.key==="Backspace"&&!a&&t.length>0&&h(t[t.length-1])};return u.jsxs("div",{className:"w-full max-w-md relative",children:[u.jsxs("div",{className:"flex flex-wrap items-center border border-gray-300 dark:border-dark-tremor-border rounded-md shadow-sm px-2 py-1 bg-white dark:bg-dark-tremor-background-subtle",children:[t.map(v=>u.jsxs("div",{className:`flex items-center rounded-full px-2 py-1 mr-2 my-1 text-xs ${o?o(v):"bg-indigo-100 dark:bg-indigo-900 text-indigo-700 dark:text-indigo-200"}`,children:[u.jsx("span",{children:v}),u.jsx("button",{type:"button",onClick:()=>h(v),className:"ml-1 focus:outline-none cursor-pointer","aria-label":`Remove ${v}`,children:u.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:u.jsx("path",{fillRule:"evenodd",d:`M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414
12
+ 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293
13
+ 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z`,clipRule:"evenodd"})})})]},v)),u.jsx("input",{ref:f,type:"text",className:"flex-grow outline-none p-1 text-gray-900 dark:text-dark-tremor-content placeholder-gray-400 dark:placeholder-dark-tremor-content-subtle bg-transparent dark:bg-dark-tremor-background-subtle border-0",placeholder:t.length>0?"":n,value:a,onChange:v=>i(v.target.value),onKeyDown:b,onFocus:()=>l(!0),onBlur:()=>setTimeout(()=>l(!1),100)})]}),s&&m.length>0&&u.jsx("ul",{className:"absolute left-0 right-0 border border-gray-300 dark:border-dark-tremor-border mt-1 rounded-md shadow-lg bg-white dark:bg-dark-tremor-background-subtle max-h-40 overflow-y-auto z-10",children:m.map((v,x)=>u.jsx("li",{className:`cursor-pointer px-2 py-1 hover:bg-indigo-100 dark:hover:bg-dark-tremor-background ${x===c?"bg-indigo-200 dark:bg-dark-tremor-background-muted":""} text-gray-900 dark:text-dark-tremor-content`,onMouseEnter:()=>d(x),onMouseDown:()=>p(v),children:v},v))})]})},AA=["GET","POST","PUT","PATCH","DELETE","OPTIONS","HEAD"],TA=["200","201","204","301","302","400","401","403","404","500","502","503"],UI=({isOpen:e,onClose:t,sortField:r,sortDirection:n,filters:o,setSortField:a,setSortDirection:i,setFilters:s,tagOptions:l=[]})=>{const c=()=>{a("time"),i("desc")},d=()=>{s({})},f=b=>{const v=b.target.value;s(x=>({...x,timestampRange:v,customStart:void 0,customEnd:void 0}))},m=(b,v)=>{s(x=>({...x,timestampRange:{...typeof x.timestampRange=="object"&&x.timestampRange||{},[b]:v}}))},p=AA,h=TA;return u.jsxs(u.Fragment,{children:[e&&u.jsx("div",{className:"fixed inset-0 bg-black opacity-50",style:{zIndex:9998},onClick:t}),u.jsxs("div",{className:`fixed top-0 left-0 h-full w-100 bg-white dark:bg-dark-tremor-background shadow-xl dark:shadow-dark-tremor-shadow transform transition-transform duration-300
14
+ ${e?"translate-x-0":"-translate-x-full"}
15
+ `,style:{zIndex:9999},children:[u.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-300 dark:border-dark-tremor-border bg-gray-50 dark:bg-dark-tremor-background-subtle",children:[u.jsx("h2",{className:"text-lg font-semibold text-gray-800 dark:text-dark-tremor-content-strong",children:"Filter & Sort"}),u.jsx("button",{onClick:t,className:"text-gray-600 dark:text-dark-tremor-content hover:text-gray-800 dark:hover:text-dark-tremor-content-strong focus:outline-none cursor-pointer","aria-label":"Close",children:"×"})]}),u.jsxs("div",{className:"p-4 overflow-y-auto h-full",children:[u.jsxs("section",{className:"mb-6",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("h3",{className:"mb-3 text-xs font-bold text-gray-600 dark:text-dark-tremor-content uppercase tracking-wide",children:"Sort By"}),u.jsx("button",{onClick:c,className:"text-xs text-blue-600 dark:text-blue-400 hover:underline cursor-pointer",children:"Reset"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs("label",{className:"flex items-center text-xs",children:[u.jsx("input",{type:"radio",name:"sortField",value:"time",checked:r==="time",onChange:b=>a(b.target.value),className:"form-radio text-blue-600 dark:text-blue-500 h-3 w-3"}),u.jsx("span",{className:"ml-2 text-xs text-gray-700 dark:text-dark-tremor-content",children:"Timestamp"})]}),u.jsxs("label",{className:"flex items-center text-xs",children:[u.jsx("input",{type:"radio",name:"sortField",value:"status_code",checked:r==="status_code",onChange:b=>a(b.target.value),className:"form-radio text-blue-600 dark:text-blue-500 h-3 w-3"}),u.jsx("span",{className:"ml-2 text-xs text-gray-700 dark:text-dark-tremor-content",children:"Status"})]}),u.jsxs("label",{className:"flex items-center text-xs",children:[u.jsx("input",{type:"radio",name:"sortField",value:"method",checked:r==="method",onChange:b=>a(b.target.value),className:"form-radio text-blue-600 dark:text-blue-500 h-3 w-3"}),u.jsx("span",{className:"ml-2 text-xs text-gray-700 dark:text-dark-tremor-content",children:"Method"})]})]}),u.jsxs("div",{className:"mt-4",children:[u.jsx("h4",{className:"mb-2 text-xs font-bold text-gray-600 dark:text-dark-tremor-content uppercase tracking-wide",children:"Sort Direction"}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs("label",{className:"flex items-center text-xs",children:[u.jsx("input",{type:"radio",name:"sortDirection",value:"asc",checked:n==="asc",onChange:b=>i(b.target.value),className:"form-radio text-blue-600 dark:text-blue-500 h-3 w-3"}),u.jsx("span",{className:"ml-2 text-xs text-gray-700 dark:text-dark-tremor-content",children:"Ascending"})]}),u.jsxs("label",{className:"flex items-center text-xs",children:[u.jsx("input",{type:"radio",name:"sortDirection",value:"desc",checked:n==="desc",onChange:b=>i(b.target.value),className:"form-radio text-blue-600 dark:text-blue-500 h-3 w-3"}),u.jsx("span",{className:"ml-2 text-xs text-gray-700 dark:text-dark-tremor-content",children:"Descending"})]})]})]})]}),u.jsxs("section",{className:"mb-6",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("h3",{className:"mb-3 text-xs font-bold text-gray-600 dark:text-dark-tremor-content uppercase tracking-wide",children:"Filters"}),u.jsx("button",{onClick:d,className:"text-xs text-blue-600 dark:text-blue-400 hover:underline cursor-pointer",children:"Reset"})]}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-dark-tremor-content mb-1",children:"Quick Time Range"}),u.jsxs("select",{value:typeof o.timestampRange=="string"?o.timestampRange:"",onChange:f,className:"block w-full border border-gray-300 dark:border-dark-tremor-border bg-white dark:bg-dark-tremor-background-subtle dark:text-dark-tremor-content rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm",children:[u.jsx("option",{value:"",children:"Any"}),u.jsx("option",{value:"5M",children:"Last 5 minutes"}),u.jsx("option",{value:"15M",children:"Last 15 minutes"}),u.jsx("option",{value:"30M",children:"Last 30 minutes"}),u.jsx("option",{value:"1H",children:"Last 1 hour"}),u.jsx("option",{value:"3H",children:"Last 3 hours"}),u.jsx("option",{value:"6H",children:"Last 6 hours"}),u.jsx("option",{value:"12H",children:"Last 12 hours"}),u.jsx("option",{value:"24H",children:"Last 24 hours"}),u.jsx("option",{value:"48H",children:"Last 48 hours"}),u.jsx("option",{value:"week",children:"Last Week"}),u.jsx("option",{value:"month",children:"Last Month"})]})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-dark-tremor-content mb-1",children:"Specific Time Range"}),u.jsxs("div",{className:"flex space-x-2",children:[u.jsx("input",{type:"datetime-local",value:typeof o.timestampRange=="object"&&o.timestampRange.start?o.timestampRange.start:"",onChange:b=>m("start",b.target.value),className:"w-1/2 border border-gray-300 dark:border-dark-tremor-border bg-white dark:bg-dark-tremor-background-subtle dark:text-dark-tremor-content rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"}),u.jsx("input",{type:"datetime-local",value:typeof o.timestampRange=="object"&&o.timestampRange.end?o.timestampRange.end:"",onChange:b=>m("end",b.target.value),className:"w-1/2 border border-gray-300 dark:border-dark-tremor-border bg-white dark:bg-dark-tremor-background-subtle dark:text-dark-tremor-content rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"})]})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-dark-tremor-content mb-1",children:"Status"}),u.jsx(Hi,{options:h,selected:o.status||[],onChange:b=>s(v=>({...v,status:b})),placeholder:"Add status code...",colorFn:ld})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-dark-tremor-content mb-1",children:"Method"}),u.jsx(Hi,{options:p,selected:o.method||[],onChange:b=>s(v=>({...v,method:b})),placeholder:"Add method...",colorFn:Ek})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-dark-tremor-content mb-1",children:"Tags"}),u.jsx(Hi,{options:l,selected:o.tags||[],onChange:b=>s(v=>({...v,tags:b})),placeholder:"Add tag..."})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-dark-tremor-content mb-1",children:"Path"}),u.jsx("input",{type:"text",placeholder:"e.g. /api/users",value:o.path||"",onChange:b=>s(v=>({...v,path:b.target.value})),className:"block w-full border border-gray-300 dark:border-dark-tremor-border bg-white dark:bg-dark-tremor-background-subtle dark:text-dark-tremor-content rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-dark-tremor-content mb-1",children:"Duration (ms)"}),u.jsxs("div",{className:"flex space-x-2",children:[u.jsx("input",{type:"number",placeholder:"Min",value:o.durationMin||"",onChange:b=>s(v=>({...v,durationMin:b.target.value})),className:"w-1/2 border border-gray-300 dark:border-dark-tremor-border bg-white dark:bg-dark-tremor-background-subtle dark:text-dark-tremor-content rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"}),u.jsx("input",{type:"number",placeholder:"Max",value:o.durationMax||"",onChange:b=>s(v=>({...v,durationMax:b.target.value})),className:"w-1/2 border border-gray-300 dark:border-dark-tremor-border bg-white dark:bg-dark-tremor-background-subtle dark:text-dark-tremor-content rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"})]})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-dark-tremor-content mb-1",children:"Host"}),u.jsx("input",{type:"text",placeholder:"e.g. localhost",value:o.host||"",onChange:b=>s(v=>({...v,host:b.target.value})),className:"block w-full border border-gray-300 dark:border-dark-tremor-border bg-white dark:bg-dark-tremor-background-subtle dark:text-dark-tremor-content rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"})]})]})]})]})]})]})},MA=({currentPage:e,totalPages:t,meta:r,onPageChange:n,alwaysShow:o=!0})=>{const a=h=>{const b=Number(h);return Number.isFinite(b)?b:null},i=a(r?.page??r?.current_page),s=a(r?.total_pages??r?.totalPages),l=Math.max(0,s??a(t)??0),c=i??a(e)??1,d=l>0?Math.min(Math.max(1,c),l):1;if(l===0||!o&&l<=1)return null;const f=typeof n=="function",m=h=>{f&&(h<1||h>l||h!==d&&n(h))},p=((h,b)=>{const v=[];if(b<=7)for(let x=1;x<=b;x++)v.push(x);else if(h<=4){for(let x=1;x<=5;x++)v.push(x);v.push("ellipsis"),v.push(b)}else if(h>=b-3){v.push(1),v.push("ellipsis");for(let x=b-4;x<=b;x++)v.push(x)}else v.push(1),v.push("ellipsis"),v.push(h-1),v.push(h),v.push(h+1),v.push("ellipsis"),v.push(b);return v})(d,l);return u.jsx("nav",{className:"p-2 border-t border-gray-300",children:u.jsxs("ul",{className:"flex items-center justify-center -space-x-px h-8 text-sm",children:[u.jsx("li",{children:u.jsxs("button",{onClick:()=>m(d-1),disabled:!f||d<=1,className:"flex items-center justify-center px-3 h-8 leading-tight text-gray-500 bg-white border border-e-0 border-gray-300 rounded-s-lg hover:bg-gray-100 hover:text-gray-700 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white cursor-pointer",children:[u.jsx("span",{className:"sr-only",children:"Previous"}),u.jsx("svg",{className:"w-2.5 h-2.5 rtl:rotate-180","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10",children:u.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 1 1 5l4 4"})})]})}),p.map((h,b)=>{if(h==="ellipsis")return u.jsx("li",{children:u.jsx("span",{className:"flex items-center justify-center px-3 h-8 leading-tight text-gray-500 bg-white border border-gray-300 cursor-pointer",children:"..."})},`ellipsis-${b}`);const v=h===d;return u.jsx("li",{children:u.jsx("button",{onClick:()=>m(h),disabled:!f,className:v?"z-10 flex items-center justify-center px-3 h-8 leading-tight text-blue-600 border border-blue-300 bg-blue-50 hover:bg-blue-100 hover:text-blue-700 disabled:cursor-not-allowed dark:border-gray-700 dark:bg-gray-700 dark:text-white cursor-pointer":"flex items-center justify-center px-3 h-8 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 disabled:cursor-not-allowed dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white cursor-pointer",children:h})},h)}),u.jsx("li",{children:u.jsxs("button",{onClick:()=>m(d+1),disabled:!f||d>=l,className:"flex items-center justify-center px-3 h-8 leading-tight text-gray-500 bg-white border border-gray-300 rounded-e-lg hover:bg-gray-100 hover:text-gray-700 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white cursor-pointer",children:[u.jsx("span",{className:"sr-only",children:"Next"}),u.jsx("svg",{className:"w-2.5 h-2.5 rtl:rotate-180","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10",children:u.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 9 4-4-4-4"})})]})})]})})},YE=({color:e="currentColor",size:t=24,className:r,...n})=>y.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...n,className:"remixicon "+(r||"")},y.createElement("path",{d:"M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z"})),KI=({color:e="currentColor",size:t=24,className:r,...n})=>y.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...n,className:"remixicon "+(r||"")},y.createElement("path",{d:"M10 6V8H5V19H16V14H18V20C18 20.5523 17.5523 21 17 21H4C3.44772 21 3 20.5523 3 20V7C3 6.44772 3.44772 6 4 6H10ZM21 3V11H19L18.9999 6.413L11.2071 14.2071L9.79289 12.7929L17.5849 5H13V3H21Z"})),VI=({color:e="currentColor",size:t=24,className:r,...n})=>y.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...n,className:"remixicon "+(r||"")},y.createElement("path",{d:"M10.9042 2.10025L20.8037 3.51446L22.2179 13.414L13.0255 22.6063C12.635 22.9969 12.0019 22.9969 11.6113 22.6063L1.71184 12.7069C1.32131 12.3163 1.32131 11.6832 1.71184 11.2926L10.9042 2.10025ZM11.6113 4.22157L3.83316 11.9997L12.3184 20.485L20.0966 12.7069L19.036 5.28223L11.6113 4.22157ZM13.7327 10.5855C12.9516 9.80448 12.9516 8.53815 13.7327 7.7571C14.5137 6.97606 15.78 6.97606 16.5611 7.7571C17.3421 8.53815 17.3421 9.80448 16.5611 10.5855C15.78 11.3666 14.5137 11.3666 13.7327 10.5855Z"})),GI=({color:e="currentColor",size:t=24,className:r,...n})=>y.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...n,className:"remixicon "+(r||"")},y.createElement("path",{d:"M2 6L2 18H4L4 6H2ZM9.44975 7.05025L4.5 12L9.44727 16.9473L9.44826 13H14.5501L14.55 16.9492L19.5 11.9995L14.5503 7.04976L14.5502 11H9.44876L9.44975 7.05025ZM20 6H22V18H20V6Z"})),YI=({open:e,onClose:t,onConfirmAll:r,onConfirmFiltered:n,hasFilters:o})=>e?u.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[u.jsx("div",{className:"absolute inset-0 bg-black opacity-50",onClick:t}),u.jsxs("div",{className:"relative bg-white rounded-lg shadow-xl max-w-md w-full mx-4 p-6 z-10",children:[u.jsxs("div",{className:"flex items-center",children:[u.jsx("div",{className:"flex-shrink-0 bg-red-100 rounded-full p-2",children:u.jsx("svg",{className:"size-6 text-red-600",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})})}),u.jsxs("div",{className:"ml-4",children:[u.jsx("h3",{className:"text-lg font-medium text-gray-900",children:o?"Clear Requests":"Clear All Requests"}),u.jsx("p",{className:"mt-2 text-sm text-gray-500",children:o?"You have active filters. Would you like to clear only the filtered requests or all requests?":"Are you sure you want to clear all requests? This action cannot be undone."})]})]}),u.jsxs("div",{className:"mt-6 flex justify-end space-x-3",children:[u.jsx("button",{onClick:t,className:"px-4 py-2 bg-gray-200 rounded hover:bg-gray-300 text-sm",children:"Cancel"}),o&&u.jsx("button",{onClick:()=>{n(),t()},className:"px-4 py-2 bg-yellow-500 text-white rounded hover:bg-yellow-600 text-sm",children:"Clear Filtered"}),u.jsx("button",{onClick:()=>{r(),t()},className:"px-4 py-2 bg-red-600 text-white rounded hover:bg-red-700 text-sm",children:"Clear All"})]})]})]}):null,XI=({text:e,align:t="center"})=>t==="left"?u.jsxs("div",{className:"flex items-center my-1",children:[u.jsx("span",{className:"px-3 text-xs text-slate-600",children:e}),u.jsx("div",{className:"flex-grow border-t border-gray-300"})]}):t==="right"?u.jsxs("div",{className:"flex items-center my-1",children:[u.jsx("div",{className:"flex-grow border-t border-gray-300"}),u.jsx("span",{className:"px-3 text-xs text-slate-600",children:e})]}):u.jsxs("div",{className:"flex items-center my-1",children:[u.jsx("div",{className:"flex-grow border-t border-gray-300"}),u.jsx("span",{className:"px-3 text-xs text-slate-600",children:e}),u.jsx("div",{className:"flex-grow border-t border-gray-300"})]}),ZI=({operations:e,onSelect:t,onRemove:r,clearOperations:n,clearFilteredOperations:o,syncOperations:a,selectedOperation:i,currentPage:s,totalPages:l,totalCount:c,onPageChange:d,sortField:f,sortDirection:m,filters:p,setSortField:h,setSortDirection:b,setFilters:v,isSyncing:x,tagOptions:k=[]})=>{const[S,j]=g.useState(!1),[O,C]=g.useState(!1),[N,T]=Cr("showQueryParams","false"),M=N==="true",I=Object.entries(p||{}).reduce((F,[B,U])=>B==="timestampRange"&&typeof U=="object"?U.start||U.end?F+1:F:Array.isArray(U)?U.length>0?F+1:F:U?F+1:F,0),_=I>0?"bg-green-500 text-white":"bg-blue-500 text-white",R=F=>{const B=new Date(F),U=String(B.getDate()).padStart(2,"0"),$=String(B.getMonth()+1).padStart(2,"0");return`${B.getFullYear()}-${$}-${U}`},L=(F=>F.reduce((B,U)=>{var $;const z=($=U?.request)!=null&&$.timestamp?R(U.request.timestamp):"N/A";return B[z]||(B[z]=[]),B[z].push(U),B},{}))(e);return u.jsxs("div",{className:"flex flex-col h-full relative",children:[u.jsxs("div",{className:"p-4 flex justify-between items-center",children:[u.jsxs("span",{className:"font-bold text-xl text-tremor-content-strong dark:text-dark-tremor-content-strong",children:["Requests (",e.length," of ",c,")"]}),u.jsxs("div",{className:"space-x-2 relative",children:[u.jsxs("button",{className:`relative px-3 py-1 rounded text-xs cursor-pointer ${_}`,onClick:()=>j(!0),children:[u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"w-4 h-4 text-white",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z"})}),I>0&&u.jsx("span",{className:"absolute -top-1 -right-1 bg-green-700 text-white text-[10px] font-bold w-4 h-4 flex items-center justify-center rounded-full",children:I})]}),u.jsx("button",{className:`px-3 py-1 bg-teal-500 text-white rounded text-xs ${x?"opacity-75 cursor-not-allowed":"cursor-pointer"}`,onClick:a,disabled:x,children:u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:`w-4 h-4 text-white ${x?"animate-spin":""}`,children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.0228 9.34841H21.0154M21.0154 9.34841V4.3558M21.0154 9.34841L17.8342 6.1655C16.8437 5.17312 15.5866 4.4202 14.1349 4.03121C9.73377 2.85194 5.21 5.46374 4.03073 9.86484M7.97677 14.6517H2.98413M2.98413 14.6517V19.6444M2.98413 14.6517L6.16502 17.8347C7.15555 18.8271 8.41261 19.589 9.86436 19.969C14.2654 21.1483 18.7892 18.5364 19.9685 14.1353"})})}),u.jsx("button",{className:"px-3 py-1 bg-red-500 text-white rounded text-xs cursor-pointer",onClick:()=>C(!0),children:u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"w-4 h-4 text-white",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"})})})]})]}),u.jsxs("div",{className:"flex items-center bg-gray-200 dark:bg-dark-tremor-background-subtle p-2 border-b border-gray-300 dark:border-dark-tremor-border text-sm font-bold text-tremor-content-strong dark:text-dark-tremor-content-strong cursor-pointer",onClick:()=>j(!0),children:[u.jsx("div",{className:"w-16 text-center",children:"Status"}),u.jsx("div",{className:"w-20 text-center",children:"Method"}),u.jsxs("div",{className:"flex-grow text-left flex items-center",children:[u.jsx("span",{children:"Path"}),u.jsx("button",{type:"button",className:`ml-2 p-1 rounded transition-colors cursor-pointer ${M?"text-blue-700 bg-blue-100 hover:bg-blue-200 dark:text-blue-400 dark:bg-blue-900/30 dark:hover:bg-blue-900/50":"text-gray-500 hover:bg-gray-300 dark:text-gray-400 dark:hover:bg-gray-700"}`,title:`Toggle query params (${M?"On":"Off"})`,"aria-label":`Show query params: ${M?"On":"Off"}`,"aria-pressed":M,onClick:F=>{F.stopPropagation(),T(M?"false":"true")},children:u.jsx(GI,{className:"w-4 h-4"})})]}),u.jsx("div",{className:"w-20 text-center",children:"Timestamp"}),u.jsx("div",{className:"w-16 text-right",children:"Duration"}),u.jsx("div",{className:"w-10"})]}),u.jsx("ul",{className:"overflow-y-auto flex-grow",style:{maxHeight:"calc(100vh - 40px - 100px - 49px - 64px)"},children:e.length===0?u.jsx("li",{className:"flex items-center justify-center h-full text-gray-500 dark:text-gray-400 text-2xl",children:"No operations"}):Object.entries(L).map(([F,B])=>u.jsxs(y.Fragment,{children:[u.jsx("li",{children:u.jsx(XI,{text:F,align:"center"})}),B.map((U,$)=>{const z=U.id||$;return u.jsx(WI,{opId:z,operation:U,onSelect:t,onRemove:r,selected:i&&i.id===z,showQueryParams:M},z)})]},F))}),u.jsx(MA,{currentPage:s,totalPages:l,onPageChange:d}),u.jsx(UI,{isOpen:S,onClose:()=>j(!1),sortField:f,sortDirection:m,filters:p,setSortField:h,setSortDirection:b,setFilters:v,tagOptions:k}),u.jsx(YI,{open:O,onClose:()=>C(!1),onConfirmAll:n,onConfirmFiltered:o,hasFilters:I>0})]})},Df=({message:e,subMessage:t,onClose:r,type:n="success"})=>{const[o,a]=g.useState(3e3),[i,s]=g.useState(!1);g.useEffect(()=>{const p=setInterval(()=>{i||a(h=>Math.max(0,h-50))},50);return()=>clearInterval(p)},[i]),g.useEffect(()=>{o===0&&r()},[o,r]);const l=o/3e3*100,c=n==="error"?"border-red-500":"border-green-500",d=n==="error"?"text-red-500":"text-green-500",f=n==="error"?"bg-red-500":"bg-green-500",m=n==="error"?"M12 9v2m0 4h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z":"M9 12.75L11.25 15L15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z";return u.jsx("div",{className:"fixed top-4 right-4 z-50 w-80",onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),children:u.jsx("div",{className:`bg-white border-l-4 ${c} p-2 shadow-lg rounded-lg`,children:u.jsxs("div",{className:"flex items-start",children:[u.jsx("div",{className:"flex-shrink-0",children:u.jsx("svg",{className:`h-6 w-6 ${d}`,fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:m})})}),u.jsxs("div",{className:"ml-1 flex-1",children:[u.jsx("p",{className:"text-sm font-medium text-gray-900",children:e}),t&&u.jsx("p",{className:"mt-1 text-sm text-gray-500 break-words",children:t}),u.jsx("div",{className:`w-full h-1 rounded-t-lg ${f}`,style:{width:`${l}%`}})]}),u.jsx("div",{className:"ml-auto pl-1",children:u.jsxs("button",{onClick:r,className:`text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-${n==="error"?"red":"green"}-500`,children:[u.jsx("span",{className:"sr-only",children:"Close"}),u.jsx("svg",{className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20",children:u.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 0 1 1.414 0L10 8.586l4.293-4.293a1 1 0 1 1 1.414 1.414L11.414 10l4.293 4.293a1 1 0 0 1-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 1 1-1.414-1.414L8.586 10 4.293 5.707a1 1 0 0 1 0-1.414z",clipRule:"evenodd"})})]})})]})})})},_A=typeof document<"u"?y.useLayoutEffect:()=>{};var kg;const JI=(kg=y.useInsertionEffect)!==null&&kg!==void 0?kg:_A;function QI(e){const t=g.useRef(null);return JI(()=>{t.current=e},[e]),g.useCallback((...r)=>{const n=t.current;return n?.(...r)},[])}const mi=e=>{var t;return(t=e?.ownerDocument)!==null&&t!==void 0?t:document},qi=e=>e&&"window"in e&&e.window===e?e:mi(e).defaultView||window;function IA(e,t){return t&&e?e.contains(t):!1}const y0=(e=document)=>e.activeElement;function DA(e){return e.target}function LA(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=LA(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function wt(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=LA(e))&&(n&&(n+=" "),n+=t);return n}function eD(e){var t;if(typeof window>"u"||window.navigator==null)return!1;let r=(t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands;return Array.isArray(r)&&r.some(n=>e.test(n.brand))||e.test(window.navigator.userAgent)}function tD(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function RA(e){let t=null;return()=>(t==null&&(t=e()),t)}const rD=RA(function(){return tD(/^Mac/i)}),nD=RA(function(){return eD(/Android/i)});function FA(){let e=g.useRef(new Map),t=g.useCallback((o,a,i,s)=>{let l=s!=null&&s.once?(...c)=>{e.current.delete(i),i(...c)}:i;e.current.set(i,{type:a,eventTarget:o,fn:l,options:s}),o.addEventListener(a,l,s)},[]),r=g.useCallback((o,a,i,s)=>{var l;let c=((l=e.current.get(i))===null||l===void 0?void 0:l.fn)||i;o.removeEventListener(a,c,s),e.current.delete(i)},[]),n=g.useCallback(()=>{e.current.forEach((o,a)=>{r(o.eventTarget,o.type,a,o.options)})},[r]);return g.useEffect(()=>n,[n]),{addGlobalListener:t,removeGlobalListener:r,removeAllGlobalListeners:n}}function oD(e){return e.pointerType===""&&e.isTrusted?!0:nD()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function $A(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function aD(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function BA(e){let t=g.useRef({isFocused:!1,observer:null});_A(()=>{const n=t.current;return()=>{n.observer&&(n.observer.disconnect(),n.observer=null)}},[]);let r=QI(n=>{e?.(n)});return g.useCallback(n=>{if(n.target instanceof HTMLButtonElement||n.target instanceof HTMLInputElement||n.target instanceof HTMLTextAreaElement||n.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=n.target,a=i=>{if(t.current.isFocused=!1,o.disabled){let s=$A(i);r(s)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",a,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var i;(i=t.current.observer)===null||i===void 0||i.disconnect();let s=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:s})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:s}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[r])}let iD=!1,cd=null,x0=new Set,rc=new Map,as=!1,w0=!1;const sD={Tab:!0,Escape:!0};function Sk(e,t){for(let r of x0)r(e,t)}function lD(e){return!(e.metaKey||!rD()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Yf(e){as=!0,lD(e)&&(cd="keyboard",Sk("keyboard",e))}function Ys(e){cd="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(as=!0,Sk("pointer",e))}function zA(e){oD(e)&&(as=!0,cd="virtual")}function HA(e){e.target===window||e.target===document||iD||!e.isTrusted||(!as&&!w0&&(cd="virtual",Sk("virtual",e)),as=!1,w0=!1)}function qA(){as=!1,w0=!0}function k0(e){if(typeof window>"u"||typeof document>"u"||rc.get(qi(e)))return;const t=qi(e),r=mi(e);let n=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){as=!0,n.apply(this,arguments)},r.addEventListener("keydown",Yf,!0),r.addEventListener("keyup",Yf,!0),r.addEventListener("click",zA,!0),t.addEventListener("focus",HA,!0),t.addEventListener("blur",qA,!1),typeof PointerEvent<"u"&&(r.addEventListener("pointerdown",Ys,!0),r.addEventListener("pointermove",Ys,!0),r.addEventListener("pointerup",Ys,!0)),t.addEventListener("beforeunload",()=>{WA(e)},{once:!0}),rc.set(t,{focus:n})}const WA=(e,t)=>{const r=qi(e),n=mi(e);t&&n.removeEventListener("DOMContentLoaded",t),rc.has(r)&&(r.HTMLElement.prototype.focus=rc.get(r).focus,n.removeEventListener("keydown",Yf,!0),n.removeEventListener("keyup",Yf,!0),n.removeEventListener("click",zA,!0),r.removeEventListener("focus",HA,!0),r.removeEventListener("blur",qA,!1),typeof PointerEvent<"u"&&(n.removeEventListener("pointerdown",Ys,!0),n.removeEventListener("pointermove",Ys,!0),n.removeEventListener("pointerup",Ys,!0)),rc.delete(r))};function uD(e){const t=mi(e);let r;return t.readyState!=="loading"?k0(e):(r=()=>{k0(e)},t.addEventListener("DOMContentLoaded",r)),()=>WA(e,r)}typeof document<"u"&&uD();function UA(){return cd!=="pointer"}const cD=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function dD(e,t,r){let n=mi(r?.target);const o=typeof window<"u"?qi(r?.target).HTMLInputElement:HTMLInputElement,a=typeof window<"u"?qi(r?.target).HTMLTextAreaElement:HTMLTextAreaElement,i=typeof window<"u"?qi(r?.target).HTMLElement:HTMLElement,s=typeof window<"u"?qi(r?.target).KeyboardEvent:KeyboardEvent;return e=e||n.activeElement instanceof o&&!cD.has(n.activeElement.type)||n.activeElement instanceof a||n.activeElement instanceof i&&n.activeElement.isContentEditable,!(e&&t==="keyboard"&&r instanceof s&&!sD[r.key])}function fD(e,t,r){k0(),g.useEffect(()=>{let n=(o,a)=>{dD(!!(r!=null&&r.isTextInput),o,a)&&e(UA())};return x0.add(n),()=>{x0.delete(n)}},t)}function pD(e){let{isDisabled:t,onFocus:r,onBlur:n,onFocusChange:o}=e;const a=g.useCallback(l=>{if(l.target===l.currentTarget)return n&&n(l),o&&o(!1),!0},[n,o]),i=BA(a),s=g.useCallback(l=>{const c=mi(l.target),d=c?y0(c):y0();l.target===l.currentTarget&&d===DA(l.nativeEvent)&&(r&&r(l),o&&o(!0),i(l))},[o,r,i]);return{focusProps:{onFocus:!t&&(r||o||n)?s:void 0,onBlur:!t&&(n||o)?a:void 0}}}function mD(e){let{isDisabled:t,onBlurWithin:r,onFocusWithin:n,onFocusWithinChange:o}=e,a=g.useRef({isFocusWithin:!1}),{addGlobalListener:i,removeAllGlobalListeners:s}=FA(),l=g.useCallback(f=>{f.currentTarget.contains(f.target)&&a.current.isFocusWithin&&!f.currentTarget.contains(f.relatedTarget)&&(a.current.isFocusWithin=!1,s(),r&&r(f),o&&o(!1))},[r,o,a,s]),c=BA(l),d=g.useCallback(f=>{if(!f.currentTarget.contains(f.target))return;const m=mi(f.target),p=y0(m);if(!a.current.isFocusWithin&&p===DA(f.nativeEvent)){n&&n(f),o&&o(!0),a.current.isFocusWithin=!0,c(f);let h=f.currentTarget;i(m,"focus",b=>{if(a.current.isFocusWithin&&!IA(h,b.target)){let v=new m.defaultView.FocusEvent("blur",{relatedTarget:b.target});aD(v,h);let x=$A(v);l(x)}},{capture:!0})}},[n,o,c,i,l]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:d,onBlur:l}}}let j0=!1,sf=0;function hD(){j0=!0,setTimeout(()=>{j0=!1},50)}function XE(e){e.pointerType==="touch"&&hD()}function gD(){if(!(typeof document>"u"))return sf===0&&(typeof PointerEvent<"u"&&document.addEventListener("pointerup",XE)),sf++,()=>{sf--,!(sf>0)&&(typeof PointerEvent<"u"&&document.removeEventListener("pointerup",XE))}}function Lo(e){let{onHoverStart:t,onHoverChange:r,onHoverEnd:n,isDisabled:o}=e,[a,i]=g.useState(!1),s=g.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;g.useEffect(gD,[]);let{addGlobalListener:l,removeAllGlobalListeners:c}=FA(),{hoverProps:d,triggerHoverEnd:f}=g.useMemo(()=>{let m=(b,v)=>{if(s.pointerType=v,o||v==="touch"||s.isHovered||!b.currentTarget.contains(b.target))return;s.isHovered=!0;let x=b.currentTarget;s.target=x,l(mi(b.target),"pointerover",k=>{s.isHovered&&s.target&&!IA(s.target,k.target)&&p(k,k.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:x,pointerType:v}),r&&r(!0),i(!0)},p=(b,v)=>{let x=s.target;s.pointerType="",s.target=null,!(v==="touch"||!s.isHovered||!x)&&(s.isHovered=!1,c(),n&&n({type:"hoverend",target:x,pointerType:v}),r&&r(!1),i(!1))},h={};return typeof PointerEvent<"u"&&(h.onPointerEnter=b=>{j0&&b.pointerType==="mouse"||m(b,b.pointerType)},h.onPointerLeave=b=>{!o&&b.currentTarget.contains(b.target)&&p(b,b.pointerType)}),{hoverProps:h,triggerHoverEnd:p}},[t,r,n,o,s,l,c]);return g.useEffect(()=>{o&&f({currentTarget:s.target},s.pointerType)},[o]),{hoverProps:d,isHovered:a}}function no(e={}){let{autoFocus:t=!1,isTextInput:r,within:n}=e,o=g.useRef({isFocused:!1,isFocusVisible:t||UA()}),[a,i]=g.useState(!1),[s,l]=g.useState(()=>o.current.isFocused&&o.current.isFocusVisible),c=g.useCallback(()=>l(o.current.isFocused&&o.current.isFocusVisible),[]),d=g.useCallback(p=>{o.current.isFocused=p,i(p),c()},[c]);fD(p=>{o.current.isFocusVisible=p,c()},[],{isTextInput:r});let{focusProps:f}=pD({isDisabled:n,onFocusChange:d}),{focusWithinProps:m}=mD({isDisabled:!n,onFocusWithinChange:d});return{isFocused:a,isFocusVisible:s,focusProps:n?m:f}}var bD=Object.defineProperty,vD=(e,t,r)=>t in e?bD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jg=(e,t,r)=>(vD(e,typeof t!="symbol"?t+"":t,r),r);let yD=class{constructor(){jg(this,"current",this.detect()),jg(this,"handoffState","pending"),jg(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Xs=new yD;function Ul(e){var t,r;return Xs.isServer?null:e?"ownerDocument"in e?e.ownerDocument:"current"in e?(r=(t=e.current)==null?void 0:t.ownerDocument)!=null?r:document:null:document}function KA(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function ga(){let e=[],t={addEventListener(r,n,o,a){return r.addEventListener(n,o,a),t.add(()=>r.removeEventListener(n,o,a))},requestAnimationFrame(...r){let n=requestAnimationFrame(...r);return t.add(()=>cancelAnimationFrame(n))},nextFrame(...r){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...r))},setTimeout(...r){let n=setTimeout(...r);return t.add(()=>clearTimeout(n))},microTask(...r){let n={current:!0};return KA(()=>{n.current&&r[0]()}),t.add(()=>{n.current=!1})},style(r,n,o){let a=r.style.getPropertyValue(n);return Object.assign(r.style,{[n]:o}),this.add(()=>{Object.assign(r.style,{[n]:a})})},group(r){let n=ga();return r(n),this.add(()=>n.dispose())},add(r){return e.includes(r)||e.push(r),()=>{let n=e.indexOf(r);if(n>=0)for(let o of e.splice(n,1))o()}},dispose(){for(let r of e.splice(0))r()}};return t}function Kl(){let[e]=g.useState(ga);return g.useEffect(()=>()=>e.dispose(),[e]),e}let zn=(e,t)=>{Xs.isServer?g.useEffect(e,t):g.useLayoutEffect(e,t)};function ri(e){let t=g.useRef(e);return zn(()=>{t.current=e},[e]),t}let xt=function(e){let t=ri(e);return y.useCallback((...r)=>t.current(...r),[t])};function xD(e){let t=e.width/2,r=e.height/2;return{top:e.clientY-r,right:e.clientX+t,bottom:e.clientY+r,left:e.clientX-t}}function wD(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function Nk({disabled:e=!1}={}){let t=g.useRef(null),[r,n]=g.useState(!1),o=Kl(),a=xt(()=>{t.current=null,n(!1),o.dispose()}),i=xt(s=>{if(o.dispose(),t.current===null){t.current=s.currentTarget,n(!0);{let l=Ul(s.currentTarget);o.addEventListener(l,"pointerup",a,!1),o.addEventListener(l,"pointermove",c=>{if(t.current){let d=xD(c);n(wD(d,t.current.getBoundingClientRect()))}},!1),o.addEventListener(l,"pointercancel",a,!1)}}});return{pressed:r,pressProps:e?{}:{onPointerDown:i,onPointerUp:a,onClick:a}}}function oo(e){return g.useMemo(()=>e,Object.values(e))}let kD=g.createContext(void 0);function Ok(){return g.useContext(kD)}function ZE(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function Nn(e,t,...r){if(e in t){let o=t[e];return typeof o=="function"?o(...r):o}let n=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Nn),n}var is=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(is||{}),jD=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(jD||{});function Gr(){let e=SD();return g.useCallback(t=>ED({mergeRefs:e,...t}),[e])}function ED({ourProps:e,theirProps:t,slot:r,defaultTag:n,features:o,visible:a=!0,name:i,mergeRefs:s}){s=s??ND;let l=VA(t,e);if(a)return lf(l,r,n,i,s);let c=o??0;if(c&2){let{static:d=!1,...f}=l;if(d)return lf(f,r,n,i,s)}if(c&1){let{unmount:d=!0,...f}=l;return Nn(d?0:1,{0(){return null},1(){return lf({...f,hidden:!0,style:{display:"none"}},r,n,i,s)}})}return lf(l,r,n,i,s)}function lf(e,t={},r,n,o){let{as:a=r,children:i,refName:s="ref",...l}=Eg(e,["unmount","static"]),c=e.ref!==void 0?{[s]:e.ref}:{},d=typeof i=="function"?i(t):i;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t)),l["aria-labelledby"]&&l["aria-labelledby"]===l.id&&(l["aria-labelledby"]=void 0);let f={};if(t){let m=!1,p=[];for(let[h,b]of Object.entries(t))typeof b=="boolean"&&(m=!0),b===!0&&p.push(h.replace(/([A-Z])/g,v=>`-${v.toLowerCase()}`));if(m){f["data-headlessui-state"]=p.join(" ");for(let h of p)f[`data-${h}`]=""}}if(nc(a)&&(Object.keys(_i(l)).length>0||Object.keys(_i(f)).length>0))if(!g.isValidElement(d)||Array.isArray(d)&&d.length>1||CD(d)){if(Object.keys(_i(l)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(_i(l)).concat(Object.keys(_i(f))).map(m=>` - ${m}`).join(`
16
+ `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(m=>` - ${m}`).join(`
17
+ `)].join(`
18
+ `))}else{let m=d.props,p=m?.className,h=typeof p=="function"?(...x)=>ZE(p(...x),l.className):ZE(p,l.className),b=h?{className:h}:{},v=VA(d.props,_i(Eg(l,["ref"])));for(let x in f)x in v&&delete f[x];return g.cloneElement(d,Object.assign({},v,f,c,{ref:o(OD(d),c.ref)},b))}return g.createElement(a,Object.assign({},Eg(l,["ref"]),!nc(a)&&c,!nc(a)&&f),d)}function SD(){let e=g.useRef([]),t=g.useCallback(r=>{for(let n of e.current)n!=null&&(typeof n=="function"?n(r):n.current=r)},[]);return(...r)=>{if(!r.every(n=>n==null))return e.current=r,t}}function ND(...e){return e.every(t=>t==null)?void 0:t=>{for(let r of e)r!=null&&(typeof r=="function"?r(t):r.current=t)}}function VA(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let n of e)for(let o in n)o.startsWith("on")&&typeof n[o]=="function"?(r[o]!=null||(r[o]=[]),r[o].push(n[o])):t[o]=n[o];if(t.disabled||t["aria-disabled"])for(let n in r)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(n)&&(r[n]=[o=>{var a;return(a=o?.preventDefault)==null?void 0:a.call(o)}]);for(let n in r)Object.assign(t,{[n](o,...a){let i=r[n];for(let s of i){if((o instanceof Event||o?.nativeEvent instanceof Event)&&o.defaultPrevented)return;s(o,...a)}}});return t}function vm(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let n of e)for(let o in n)o.startsWith("on")&&typeof n[o]=="function"?(r[o]!=null||(r[o]=[]),r[o].push(n[o])):t[o]=n[o];for(let n in r)Object.assign(t,{[n](...o){let a=r[n];for(let i of a)i?.(...o)}});return t}function Yr(e){var t;return Object.assign(g.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function _i(e){let t=Object.assign({},e);for(let r in t)t[r]===void 0&&delete t[r];return t}function Eg(e,t=[]){let r=Object.assign({},e);for(let n of t)n in r&&delete r[n];return r}function OD(e){return y.version.split(".")[0]>="19"?e.props.ref:e.ref}function nc(e){return e===g.Fragment||e===Symbol.for("react.fragment")}function CD(e){return nc(e.type)}function PD(e,t,r){let[n,o]=g.useState(r),a=e!==void 0,i=g.useRef(a),s=g.useRef(!1),l=g.useRef(!1);return a&&!i.current&&!s.current?(s.current=!0,i.current=a,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!a&&i.current&&!l.current&&(l.current=!0,i.current=a,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[a?e:n,xt(c=>(a||Ht.flushSync(()=>o(c)),t?.(c)))]}function AD(e){let[t]=g.useState(e);return t}function GA(e={},t=null,r=[]){for(let[n,o]of Object.entries(e))XA(r,YA(t,n),o);return r}function YA(e,t){return e?e+"["+t+"]":t}function XA(e,t,r){if(Array.isArray(r))for(let[n,o]of r.entries())XA(e,YA(t,n.toString()),o);else r instanceof Date?e.push([t,r.toISOString()]):typeof r=="boolean"?e.push([t,r?"1":"0"]):typeof r=="string"?e.push([t,r]):typeof r=="number"?e.push([t,`${r}`]):r==null?e.push([t,""]):GA(r,t,e)}function TD(e){var t,r;let n=(t=e?.form)!=null?t:e.closest("form");if(n){for(let o of n.elements)if(o!==e&&(o.tagName==="INPUT"&&o.type==="submit"||o.tagName==="BUTTON"&&o.type==="submit"||o.nodeName==="INPUT"&&o.type==="image")){o.click();return}(r=n.requestSubmit)==null||r.call(n)}}let MD="span";var ss=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(ss||{});function _D(e,t){var r;let{features:n=1,...o}=e,a={ref:t,"aria-hidden":(n&2)===2?!0:(r=o["aria-hidden"])!=null?r:void 0,hidden:(n&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return Gr()({ourProps:a,theirProps:o,slot:{},defaultTag:MD,name:"Hidden"})}let ll=Yr(_D),ID=g.createContext(null);function DD({children:e}){let t=g.useContext(ID);if(!t)return y.createElement(y.Fragment,null,e);let{target:r}=t;return r?Ht.createPortal(y.createElement(y.Fragment,null,e),r):null}function LD({data:e,form:t,disabled:r,onReset:n,overrides:o}){let[a,i]=g.useState(null),s=Kl();return g.useEffect(()=>{if(n&&a)return s.addEventListener(a,"reset",n)},[a,t,n]),y.createElement(DD,null,y.createElement(RD,{setForm:i,formId:t}),GA(e).map(([l,c])=>y.createElement(ll,{features:ss.Hidden,..._i({key:l,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:r,name:l,value:c,...o})})))}function RD({setForm:e,formId:t}){return g.useEffect(()=>{if(t){let r=document.getElementById(t);r&&e(r)}},[e,t]),t?null:y.createElement(ll,{features:ss.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:r=>{if(!r)return;let n=r.closest("form");n&&e(n)}})}let FD=g.createContext(void 0);function ZA(){return g.useContext(FD)}function $D(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function Za(e){return $D(e)&&"tagName"in e}function Oo(e){return Za(e)&&"accessKey"in e}function Wa(e){return Za(e)&&"tabIndex"in e}function BD(e){return Za(e)&&"style"in e}function zD(e){return Oo(e)&&e.nodeName==="IFRAME"}function JA(e){return Oo(e)&&e.nodeName==="INPUT"}function E0(e){return Oo(e)&&e.nodeName==="LABEL"}function HD(e){return Oo(e)&&e.nodeName==="FIELDSET"}function QA(e){return Oo(e)&&e.nodeName==="LEGEND"}function qD(e){return Za(e)?e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function ym(e){let t=e.parentElement,r=null;for(;t&&!HD(t);)QA(t)&&(r=t),t=t.parentElement;let n=t?.getAttribute("disabled")==="";return n&&WD(r)?!1:n}function WD(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(QA(t))return!1;t=t.previousElementSibling}return!0}let eT=Symbol();function Ck(e,t=!0){return Object.assign(e,{[eT]:t})}function an(...e){let t=g.useRef(e);g.useEffect(()=>{t.current=e},[e]);let r=xt(n=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(n):o.current=n)});return e.every(n=>n==null||n?.[eT])?void 0:r}let xm=g.createContext(null);xm.displayName="DescriptionContext";function tT(){let e=g.useContext(xm);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,tT),t}return e}function UD(){var e,t;return(t=(e=g.useContext(xm))==null?void 0:e.value)!=null?t:void 0}function KD(){let[e,t]=g.useState([]);return[e.length>0?e.join(" "):void 0,g.useMemo(()=>function(r){let n=xt(a=>(t(i=>[...i,a]),()=>t(i=>{let s=i.slice(),l=s.indexOf(a);return l!==-1&&s.splice(l,1),s}))),o=g.useMemo(()=>({register:n,slot:r.slot,name:r.name,props:r.props,value:r.value}),[n,r.slot,r.name,r.props,r.value]);return y.createElement(xm.Provider,{value:o},r.children)},[t])]}let VD="p";function GD(e,t){let r=g.useId(),n=Ok(),{id:o=`headlessui-description-${r}`,...a}=e,i=tT(),s=an(t);zn(()=>i.register(o),[o,i.register]);let l=oo({...i.slot,disabled:n||!1}),c={ref:s,...i.props,id:o};return Gr()({ourProps:c,theirProps:a,slot:l,defaultTag:VD,name:i.name||"Description"})}let YD=Yr(GD),XD=Object.assign(YD,{});var Qr=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Qr||{});let wm=g.createContext(null);wm.displayName="LabelContext";function rT(){let e=g.useContext(wm);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,rT),t}return e}function nT(e){var t,r,n;let o=(r=(t=g.useContext(wm))==null?void 0:t.value)!=null?r:void 0;return((n=void 0)!=null?n:0)>0?[o,...e].filter(Boolean).join(" "):o}function ZD({inherit:e=!1}={}){let t=nT(),[r,n]=g.useState([]),o=e?[t,...r].filter(Boolean):r;return[o.length>0?o.join(" "):void 0,g.useMemo(()=>function(a){let i=xt(l=>(n(c=>[...c,l]),()=>n(c=>{let d=c.slice(),f=d.indexOf(l);return f!==-1&&d.splice(f,1),d}))),s=g.useMemo(()=>({register:i,slot:a.slot,name:a.name,props:a.props,value:a.value}),[i,a.slot,a.name,a.props,a.value]);return y.createElement(wm.Provider,{value:s},a.children)},[n])]}let JD="label";function QD(e,t){var r;let n=g.useId(),o=rT(),a=ZA(),i=Ok(),{id:s=`headlessui-label-${n}`,htmlFor:l=a??((r=o.props)==null?void 0:r.htmlFor),passive:c=!1,...d}=e,f=an(t);zn(()=>o.register(s),[s,o.register]);let m=xt(b=>{let v=b.currentTarget;if(!(b.target!==b.currentTarget&&qD(b.target))&&(E0(v)&&b.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(b),E0(v))){let x=document.getElementById(v.htmlFor);if(x){let k=x.getAttribute("disabled");if(k==="true"||k==="")return;let S=x.getAttribute("aria-disabled");if(S==="true"||S==="")return;(JA(x)&&(x.type==="file"||x.type==="radio"||x.type==="checkbox")||x.role==="radio"||x.role==="checkbox"||x.role==="switch")&&x.click(),x.focus({preventScroll:!0})}}}),p=oo({...o.slot,disabled:i||!1}),h={ref:f,...o.props,id:s,htmlFor:l,onClick:m};return c&&("onClick"in h&&(delete h.htmlFor,delete h.onClick),"onClick"in d&&delete d.onClick),Gr()({ourProps:h,theirProps:d,slot:p,defaultTag:l?JD:"div",name:o.name||"Label"})}let eL=Yr(QD),tL=Object.assign(eL,{}),rL=g.createContext(()=>{});function Pk({value:e,children:t}){return y.createElement(rL.Provider,{value:e},t)}function Ds(e,t,r){let n=r.initialDeps??[],o;function a(){var i,s,l,c;let d;r.key&&(i=r.debug)!=null&&i.call(r)&&(d=Date.now());const f=e();if(!(f.length!==n.length||f.some((p,h)=>n[h]!==p)))return o;n=f;let m;if(r.key&&(s=r.debug)!=null&&s.call(r)&&(m=Date.now()),o=t(...f),r.key&&(l=r.debug)!=null&&l.call(r)){const p=Math.round((Date.now()-d)*100)/100,h=Math.round((Date.now()-m)*100)/100,b=h/16,v=(x,k)=>{for(x=String(x);x.length<k;)x=" "+x;return x};console.info(`%c⏱ ${v(h,5)} /${v(p,5)} ms`,`
19
+ font-size: .6rem;
20
+ font-weight: bold;
21
+ color: hsl(${Math.max(0,Math.min(120-120*b,120))}deg 100% 31%);`,r?.key)}return(c=r?.onChange)==null||c.call(r,o),o}return a.updateDeps=i=>{n=i},a}function JE(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const nL=(e,t)=>Math.abs(e-t)<1.01,oL=(e,t,r)=>{let n;return function(...o){e.clearTimeout(n),n=e.setTimeout(()=>t.apply(this,o),r)}},QE=e=>{const{offsetWidth:t,offsetHeight:r}=e;return{width:t,height:r}},aL=e=>e,iL=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1),n=[];for(let o=t;o<=r;o++)n.push(o);return n},sL=(e,t)=>{const r=e.scrollElement;if(!r)return;const n=e.targetWindow;if(!n)return;const o=i=>{const{width:s,height:l}=i;t({width:Math.round(s),height:Math.round(l)})};if(o(QE(r)),!n.ResizeObserver)return()=>{};const a=new n.ResizeObserver(i=>{const s=()=>{const l=i[0];if(l!=null&&l.borderBoxSize){const c=l.borderBoxSize[0];if(c){o({width:c.inlineSize,height:c.blockSize});return}}o(QE(r))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()});return a.observe(r,{box:"border-box"}),()=>{a.unobserve(r)}},eS={passive:!0},tS=typeof window>"u"?!0:"onscrollend"in window,lL=(e,t)=>{const r=e.scrollElement;if(!r)return;const n=e.targetWindow;if(!n)return;let o=0;const a=e.options.useScrollendEvent&&tS?()=>{}:oL(n,()=>{t(o,!1)},e.options.isScrollingResetDelay),i=d=>()=>{const{horizontal:f,isRtl:m}=e.options;o=f?r.scrollLeft*(m&&-1||1):r.scrollTop,a(),t(o,d)},s=i(!0),l=i(!1);l(),r.addEventListener("scroll",s,eS);const c=e.options.useScrollendEvent&&tS;return c&&r.addEventListener("scrollend",l,eS),()=>{r.removeEventListener("scroll",s),c&&r.removeEventListener("scrollend",l)}},uL=(e,t,r)=>{if(t!=null&&t.borderBoxSize){const n=t.borderBoxSize[0];if(n)return Math.round(n[r.options.horizontal?"inlineSize":"blockSize"])}return e[r.options.horizontal?"offsetWidth":"offsetHeight"]},cL=(e,{adjustments:t=0,behavior:r},n)=>{var o,a;const i=e+t;(a=(o=n.scrollElement)==null?void 0:o.scrollTo)==null||a.call(o,{[n.options.horizontal?"left":"top"]:i,behavior:r})};class dL{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let r=null;const n=()=>r||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:r=new this.targetWindow.ResizeObserver(o=>{o.forEach(a=>{const i=()=>{this._measureElement(a.target,a)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var o;(o=n())==null||o.disconnect(),r=null},observe:o=>{var a;return(a=n())==null?void 0:a.observe(o,{box:"border-box"})},unobserve:o=>{var a;return(a=n())==null?void 0:a.unobserve(o)}}})(),this.range=null,this.setOptions=r=>{Object.entries(r).forEach(([n,o])=>{typeof o>"u"&&delete r[n]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:aL,rangeExtractor:iL,onChange:()=>{},measureElement:uL,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...r}},this.notify=r=>{var n,o;(o=(n=this.options).onChange)==null||o.call(n,this,r)},this.maybeNotify=Ds(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),r=>{this.notify(r)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(r=>r()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var r;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((r=this.scrollElement)==null?void 0:r.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,a)=>{this.scrollAdjustments=0,this.scrollDirection=a?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=a,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(r,n)=>{const o=new Map,a=new Map;for(let i=n-1;i>=0;i--){const s=r[i];if(o.has(s.lane))continue;const l=a.get(s.lane);if(l==null||s.end>l.end?a.set(s.lane,s):s.end<l.end&&o.set(s.lane,!0),o.size===this.options.lanes)break}return a.size===this.options.lanes?Array.from(a.values()).sort((i,s)=>i.end===s.end?i.index-s.index:i.end-s.end)[0]:void 0},this.getMeasurementOptions=Ds(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(r,n,o,a,i)=>(this.pendingMeasuredCacheIndexes=[],{count:r,paddingStart:n,scrollMargin:o,getItemKey:a,enabled:i}),{key:!1}),this.getMeasurements=Ds(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:r,paddingStart:n,scrollMargin:o,getItemKey:a,enabled:i},s)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(d=>{this.itemSizeCache.set(d.key,d.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,l);for(let d=l;d<r;d++){const f=a(d),m=this.options.lanes===1?c[d-1]:this.getFurthestMeasurement(c,d),p=m?m.end+this.options.gap:n+o,h=s.get(f),b=typeof h=="number"?h:this.options.estimateSize(d),v=p+b,x=m?m.lane:d%this.options.lanes;c[d]={index:d,start:p,size:b,end:v,key:f,lane:x}}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Ds(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(r,n,o,a)=>this.range=r.length>0&&n>0?fL({measurements:r,outerSize:n,scrollOffset:o,lanes:a}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Ds(()=>{let r=null,n=null;const o=this.calculateRange();return o&&(r=o.startIndex,n=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,r,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,r,n]},(r,n,o,a,i)=>a===null||i===null?[]:r({startIndex:a,endIndex:i,overscan:n,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=r=>{const n=this.options.indexAttribute,o=r.getAttribute(n);return o?parseInt(o,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this._measureElement=(r,n)=>{const o=this.indexFromElement(r),a=this.measurementsCache[o];if(!a)return;const i=a.key,s=this.elementsCache.get(i);s!==r&&(s&&this.observer.unobserve(s),this.observer.observe(r),this.elementsCache.set(i,r)),r.isConnected&&this.resizeItem(o,this.options.measureElement(r,n,this))},this.resizeItem=(r,n)=>{const o=this.measurementsCache[r];if(!o)return;const a=this.itemSizeCache.get(o.key)??o.size,i=n-a;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,i,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,n)),this.notify(!1))},this.measureElement=r=>{if(!r){this.elementsCache.forEach((n,o)=>{n.isConnected||(this.observer.unobserve(n),this.elementsCache.delete(o))});return}this._measureElement(r,void 0)},this.getVirtualItems=Ds(()=>[this.getVirtualIndexes(),this.getMeasurements()],(r,n)=>{const o=[];for(let a=0,i=r.length;a<i;a++){const s=r[a],l=n[s];o.push(l)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=r=>{const n=this.getMeasurements();if(n.length!==0)return JE(n[oT(0,n.length-1,o=>JE(n[o]).start,r)])},this.getOffsetForAlignment=(r,n,o=0)=>{const a=this.getSize(),i=this.getScrollOffset();n==="auto"&&(n=r>=i+a?"end":"start"),n==="center"?r+=(o-a)/2:n==="end"&&(r-=a);const s=this.getTotalSize()+this.options.scrollMargin-a;return Math.max(Math.min(s,r),0)},this.getOffsetForIndex=(r,n="auto")=>{r=Math.max(0,Math.min(r,this.options.count-1));const o=this.measurementsCache[r];if(!o)return;const a=this.getSize(),i=this.getScrollOffset();if(n==="auto")if(o.end>=i+a-this.options.scrollPaddingEnd)n="end";else if(o.start<=i+this.options.scrollPaddingStart)n="start";else return[i,n];const s=n==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(s,n,o.size),n]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(r,{align:n="start",behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(r,n),{adjustments:void 0,behavior:o})},this.scrollToIndex=(r,{align:n="auto",behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),r=Math.max(0,Math.min(r,this.options.count-1));let a=0;const i=10,s=c=>{if(!this.targetWindow)return;const d=this.getOffsetForIndex(r,c);if(!d){console.warn("Failed to get offset for index:",r);return}const[f,m]=d;this._scrollToOffset(f,{adjustments:void 0,behavior:o}),this.targetWindow.requestAnimationFrame(()=>{const p=this.getScrollOffset(),h=this.getOffsetForIndex(r,m);if(!h){console.warn("Failed to get offset for index:",r);return}nL(h[0],p)||l(m)})},l=c=>{this.targetWindow&&(a++,a<i?this.targetWindow.requestAnimationFrame(()=>s(c)):console.warn(`Failed to scroll to index ${r} after ${i} attempts.`))};s(n)},this.scrollBy=(r,{behavior:n}={})=>{n==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+r,{adjustments:void 0,behavior:n})},this.getTotalSize=()=>{var r;const n=this.getMeasurements();let o;if(n.length===0)o=this.options.paddingStart;else if(this.options.lanes===1)o=((r=n[n.length-1])==null?void 0:r.end)??0;else{const a=Array(this.options.lanes).fill(null);let i=n.length-1;for(;i>=0&&a.some(s=>s===null);){const s=n[i];a[s.lane]===null&&(a[s.lane]=s.end),i--}o=Math.max(...a.filter(s=>s!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(r,{adjustments:n,behavior:o})=>{this.options.scrollToFn(r,{behavior:o,adjustments:n},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const oT=(e,t,r,n)=>{for(;e<=t;){const o=(e+t)/2|0,a=r(o);if(a<n)e=o+1;else if(a>n)t=o-1;else return o}return e>0?e-1:0};function fL({measurements:e,outerSize:t,scrollOffset:r,lanes:n}){const o=e.length-1,a=l=>e[l].start;if(e.length<=n)return{startIndex:0,endIndex:o};let i=oT(0,o,a,r),s=i;if(n===1)for(;s<o&&e[s].end<r+t;)s++;else if(n>1){const l=Array(n).fill(0);for(;s<o&&l.some(d=>d<r+t);){const d=e[s];l[d.lane]=d.end,s++}const c=Array(n).fill(r+t);for(;i>=0&&c.some(d=>d>=r);){const d=e[i];c[d.lane]=d.start,i--}i=Math.max(0,i-i%n),s=Math.min(o,s+(n-1-s%n))}return{startIndex:i,endIndex:s}}const rS=typeof document<"u"?g.useLayoutEffect:g.useEffect;function pL(e){const t=g.useReducer(()=>({}),{})[1],r={...e,onChange:(o,a)=>{var i;a?Ht.flushSync(t):t(),(i=e.onChange)==null||i.call(e,o,a)}},[n]=g.useState(()=>new dL(r));return n.setOptions(r),rS(()=>n._didMount(),[]),rS(()=>n._willUpdate()),n}function mL(e){return pL({observeElementRect:sL,observeElementOffset:lL,scrollToFn:cL,...e})}function nS(e){if(e===null)return{width:0,height:0};let{width:t,height:r}=e.getBoundingClientRect();return{width:t,height:r}}function hL(e,t,r=!1){let[n,o]=g.useState(()=>nS(t));return zn(()=>{if(!t||!e)return;let a=ga();return a.requestAnimationFrame(function i(){a.requestAnimationFrame(i),o(s=>{let l=nS(t);return l.width===s.width&&l.height===s.height?s:l})}),()=>{a.dispose()}},[t,e]),r?{width:`${n.width}px`,height:`${n.height}px`}:n}let aT=class extends Map{constructor(e){super(),this.factory=e}get(e){let t=super.get(e);return t===void 0&&(t=this.factory(e),this.set(e,t)),t}};var gL=Object.defineProperty,bL=(e,t,r)=>t in e?gL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vL=(e,t,r)=>(bL(e,t+"",r),r),iT=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},An=(e,t,r)=>(iT(e,t,"read from private field"),r?r.call(e):t.get(e)),Sg=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},oS=(e,t,r,n)=>(iT(e,t,"write to private field"),t.set(e,r),r),ho,Gu,Yu;let sT=class{constructor(e){Sg(this,ho,{}),Sg(this,Gu,new aT(()=>new Set)),Sg(this,Yu,new Set),vL(this,"disposables",ga()),oS(this,ho,e),Xs.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return An(this,ho)}subscribe(e,t){if(Xs.isServer)return()=>{};let r={selector:e,callback:t,current:e(An(this,ho))};return An(this,Yu).add(r),this.disposables.add(()=>{An(this,Yu).delete(r)})}on(e,t){return Xs.isServer?()=>{}:(An(this,Gu).get(e).add(t),this.disposables.add(()=>{An(this,Gu).get(e).delete(t)}))}send(e){let t=this.reduce(An(this,ho),e);if(t!==An(this,ho)){oS(this,ho,t);for(let r of An(this,Yu)){let n=r.selector(An(this,ho));lT(r.current,n)||(r.current=n,r.callback(n))}for(let r of An(this,Gu).get(e.type))r(An(this,ho),e)}}};ho=new WeakMap,Gu=new WeakMap,Yu=new WeakMap;function lT(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null?!1:Array.isArray(e)&&Array.isArray(t)?e.length!==t.length?!1:Ng(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:Ng(e.entries(),t.entries()):aS(e)&&aS(t)?Ng(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function Ng(e,t){do{let r=e.next(),n=t.next();if(r.done&&n.done)return!0;if(r.done||n.done||!Object.is(r.value,n.value))return!1}while(!0)}function aS(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}var yL=Object.defineProperty,xL=(e,t,r)=>t in e?yL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,iS=(e,t,r)=>(xL(e,typeof t!="symbol"?t+"":t,r),r),wL=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(wL||{});let kL={0(e,t){let r=t.id,n=e.stack,o=e.stack.indexOf(r);if(o!==-1){let a=e.stack.slice();return a.splice(o,1),a.push(r),n=a,{...e,stack:n}}return{...e,stack:[...e.stack,r]}},1(e,t){let r=t.id,n=e.stack.indexOf(r);if(n===-1)return e;let o=e.stack.slice();return o.splice(n,1),{...e,stack:o}}},jL=class uT extends sT{constructor(){super(...arguments),iS(this,"actions",{push:t=>this.send({type:0,id:t}),pop:t=>this.send({type:1,id:t})}),iS(this,"selectors",{isTop:(t,r)=>t.stack[t.stack.length-1]===r,inStack:(t,r)=>t.stack.includes(r)})}static new(){return new uT({stack:[]})}reduce(t,r){return Nn(r.type,kL,t,r)}};const cT=new aT(()=>jL.new());var sS={exports:{}},Og={};/**
22
+ * @license React
23
+ * use-sync-external-store-with-selector.production.js
24
+ *
25
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
26
+ *
27
+ * This source code is licensed under the MIT license found in the
28
+ * LICENSE file in the root directory of this source tree.
29
+ */var lS;function EL(){if(lS)return Og;lS=1;var e=y;function t(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}var r=typeof Object.is=="function"?Object.is:t,n=e.useSyncExternalStore,o=e.useRef,a=e.useEffect,i=e.useMemo,s=e.useDebugValue;return Og.useSyncExternalStoreWithSelector=function(l,c,d,f,m){var p=o(null);if(p.current===null){var h={hasValue:!1,value:null};p.current=h}else h=p.current;p=i(function(){function v(O){if(!x){if(x=!0,k=O,O=f(O),m!==void 0&&h.hasValue){var C=h.value;if(m(C,O))return S=C}return S=O}if(C=S,r(k,O))return C;var N=f(O);return m!==void 0&&m(C,N)?(k=O,C):(k=O,S=N)}var x=!1,k,S,j=d===void 0?null:d;return[function(){return v(c())},j===null?void 0:function(){return v(j())}]},[c,d,f,m]);var b=n(l,p[0],p[1]);return a(function(){h.hasValue=!0,h.value=b},[b]),s(b),b},Og}var uS;function SL(){return uS||(uS=1,sS.exports=EL()),sS.exports}var NL=SL();function ls(e,t,r=lT){return NL.useSyncExternalStoreWithSelector(xt(n=>e.subscribe(OL,n)),xt(()=>e.state),xt(()=>e.state),xt(t),r)}function OL(e){return e}function CL(e,t){let r=g.useId(),n=cT.get(t),[o,a]=ls(n,g.useCallback(i=>[n.selectors.isTop(i,r),n.selectors.inStack(i,r)],[n,r]));return zn(()=>{if(e)return n.actions.push(r),()=>n.actions.pop(r)},[n,e,r]),e?a?o:!0:!1}function PL(e,t,r){let n=ri(o=>{let a=o.getBoundingClientRect();a.x===0&&a.y===0&&a.width===0&&a.height===0&&r()});g.useEffect(()=>{if(!e)return;let o=t===null?null:Oo(t)?t:t.current;if(!o)return;let a=ga();if(typeof ResizeObserver<"u"){let i=new ResizeObserver(()=>n.current(o));i.observe(o),a.add(()=>i.disconnect())}if(typeof IntersectionObserver<"u"){let i=new IntersectionObserver(()=>n.current(o));i.observe(o),a.add(()=>i.disconnect())}return()=>a.dispose()},[t,n,e])}let S0=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),AL=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var ea=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(ea||{}),Xf=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Xf||{}),TL=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(TL||{});function km(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(S0)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}function ML(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(AL)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var Ak=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Ak||{});function dT(e,t=0){var r;return e===((r=Ul(e))==null?void 0:r.body)?!1:Nn(t,{0(){return e.matches(S0)},1(){let n=e;for(;n!==null;){if(n.matches(S0))return!0;n=n.parentElement}return!1}})}var _L=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(_L||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let IL=["textarea","input"].join(",");function DL(e){var t,r;return(r=(t=e?.matches)==null?void 0:t.call(e,IL))!=null?r:!1}function LL(e,t=r=>r){return e.slice().sort((r,n)=>{let o=t(r),a=t(n);if(o===null||a===null)return 0;let i=o.compareDocumentPosition(a);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Wi(e,t,{sorted:r=!0,relativeTo:n=null,skipElements:o=[]}={}){let a=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,i=Array.isArray(e)?r?LL(e):e:t&64?ML(e):km(e);o.length>0&&i.length>1&&(i=i.filter(p=>!o.some(h=>h!=null&&"current"in h?h?.current===p:h===p))),n=n??a.activeElement;let s=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,i.indexOf(n))-1;if(t&4)return Math.max(0,i.indexOf(n))+1;if(t&8)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=t&32?{preventScroll:!0}:{},d=0,f=i.length,m;do{if(d>=f||d+f<=0)return 0;let p=l+d;if(t&16)p=(p+f)%f;else{if(p<0)return 3;if(p>=f)return 1}m=i[p],m?.focus(c),d+=s}while(m!==a.activeElement);return t&6&&DL(m)&&m.select(),2}function fT(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function RL(){return/Android/gi.test(window.navigator.userAgent)}function cS(){return fT()||RL()}function uf(e,t,r,n){let o=ri(r);g.useEffect(()=>{if(!e)return;function a(i){o.current(i)}return document.addEventListener(t,a,n),()=>document.removeEventListener(t,a,n)},[e,t,n])}function pT(e,t,r,n){let o=ri(r);g.useEffect(()=>{if(!e)return;function a(i){o.current(i)}return window.addEventListener(t,a,n),()=>window.removeEventListener(t,a,n)},[e,t,n])}const dS=30;function FL(e,t,r){let n=ri(r),o=g.useCallback(function(s,l){if(s.defaultPrevented)return;let c=l(s);if(c===null||!c.getRootNode().contains(c)||!c.isConnected)return;let d=function f(m){return typeof m=="function"?f(m()):Array.isArray(m)||m instanceof Set?m:[m]}(t);for(let f of d)if(f!==null&&(f.contains(c)||s.composed&&s.composedPath().includes(f)))return;return!dT(c,Ak.Loose)&&c.tabIndex!==-1&&s.preventDefault(),n.current(s,c)},[n,t]),a=g.useRef(null);uf(e,"pointerdown",s=>{var l,c;cS()||(a.current=((c=(l=s.composedPath)==null?void 0:l.call(s))==null?void 0:c[0])||s.target)},!0),uf(e,"pointerup",s=>{if(cS()||!a.current)return;let l=a.current;return a.current=null,o(s,()=>l)},!0);let i=g.useRef({x:0,y:0});uf(e,"touchstart",s=>{i.current.x=s.touches[0].clientX,i.current.y=s.touches[0].clientY},!0),uf(e,"touchend",s=>{let l={x:s.changedTouches[0].clientX,y:s.changedTouches[0].clientY};if(!(Math.abs(l.x-i.current.x)>=dS||Math.abs(l.y-i.current.y)>=dS))return o(s,()=>Wa(s.target)?s.target:null)},!0),pT(e,"blur",s=>o(s,()=>zD(window.document.activeElement)?window.document.activeElement:null),!0)}function ul(...e){return g.useMemo(()=>Ul(...e),[...e])}function $L(e,t,r,n){let o=ri(r);g.useEffect(()=>{e=e??window;function a(i){o.current(i)}return e.addEventListener(t,a,n),()=>e.removeEventListener(t,a,n)},[e,t,n])}function Tk(e,t){return g.useMemo(()=>{var r;if(e.type)return e.type;let n=(r=e.as)!=null?r:"button";if(typeof n=="string"&&n.toLowerCase()==="button"||t?.tagName==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function BL(e){return g.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function zL(e,t){let r=e(),n=new Set;return{getSnapshot(){return r},subscribe(o){return n.add(o),()=>n.delete(o)},dispatch(o,...a){let i=t[o].call(r,...a);i&&(r=i,n.forEach(s=>s()))}}}function HL(){let e;return{before({doc:t}){var r;let n=t.documentElement,o=(r=t.defaultView)!=null?r:window;e=Math.max(0,o.innerWidth-n.clientWidth)},after({doc:t,d:r}){let n=t.documentElement,o=Math.max(0,n.clientWidth-n.offsetWidth),a=Math.max(0,e-o);r.style(n,"paddingRight",`${a}px`)}}}function qL(){return fT()?{before({doc:e,d:t,meta:r}){function n(o){return r.containers.flatMap(a=>a()).some(a=>a.contains(o))}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let s=ga();s.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>s.dispose()))}let a=(o=window.scrollY)!=null?o:window.pageYOffset,i=null;t.addEventListener(e,"click",s=>{if(Wa(s.target))try{let l=s.target.closest("a");if(!l)return;let{hash:c}=new URL(l.href),d=e.querySelector(c);Wa(d)&&!n(d)&&(i=d)}catch{}},!0),t.addEventListener(e,"touchstart",s=>{if(Wa(s.target)&&BD(s.target))if(n(s.target)){let l=s.target;for(;l.parentElement&&n(l.parentElement);)l=l.parentElement;t.style(l,"overscrollBehavior","contain")}else t.style(s.target,"touchAction","none")}),t.addEventListener(e,"touchmove",s=>{if(Wa(s.target)){if(JA(s.target))return;if(n(s.target)){let l=s.target;for(;l.parentElement&&l.dataset.headlessuiPortal!==""&&!(l.scrollHeight>l.clientHeight||l.scrollWidth>l.clientWidth);)l=l.parentElement;l.dataset.headlessuiPortal===""&&s.preventDefault()}else s.preventDefault()}},{passive:!1}),t.add(()=>{var s;let l=(s=window.scrollY)!=null?s:window.pageYOffset;a!==l&&window.scrollTo(0,a),i&&i.isConnected&&(i.scrollIntoView({block:"nearest"}),i=null)})})}}:{}}function WL(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function UL(e){let t={};for(let r of e)Object.assign(t,r(t));return t}let Ui=zL(()=>new Map,{PUSH(e,t){var r;let n=(r=this.get(e))!=null?r:{doc:e,count:0,d:ga(),meta:new Set};return n.count++,n.meta.add(t),this.set(e,n),this},POP(e,t){let r=this.get(e);return r&&(r.count--,r.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:r}){let n={doc:e,d:t,meta:UL(r)},o=[qL(),HL(),WL()];o.forEach(({before:a})=>a?.(n)),o.forEach(({after:a})=>a?.(n))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Ui.subscribe(()=>{let e=Ui.getSnapshot(),t=new Map;for(let[r]of e)t.set(r,r.documentElement.style.overflow);for(let r of e.values()){let n=t.get(r.doc)==="hidden",o=r.count!==0;(o&&!n||!o&&n)&&Ui.dispatch(r.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",r),r.count===0&&Ui.dispatch("TEARDOWN",r)}});function KL(e,t,r=()=>({containers:[]})){let n=BL(Ui),o=t?n.get(t):void 0,a=o?o.count>0:!1;return zn(()=>{if(!(!t||!e))return Ui.dispatch("PUSH",t,r),()=>Ui.dispatch("POP",t,r)},[e,t]),a}function VL(e,t,r=()=>[document.body]){let n=CL(e,"scroll-lock");KL(n,t,o=>{var a;return{containers:[...(a=o.containers)!=null?a:[],r]}})}function GL(e=0){let[t,r]=g.useState(e),n=g.useCallback(l=>r(l),[]),o=g.useCallback(l=>r(c=>c|l),[]),a=g.useCallback(l=>(t&l)===l,[t]),i=g.useCallback(l=>r(c=>c&~l),[]),s=g.useCallback(l=>r(c=>c^l),[]);return{flags:t,setFlag:n,addFlag:o,hasFlag:a,removeFlag:i,toggleFlag:s}}var fS,pS;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((fS=process==null?void 0:PA)==null?void 0:fS.NODE_ENV)==="test"&&typeof((pS=Element?.prototype)==null?void 0:pS.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
30
+ `)),[]});var YL=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(YL||{});function Mk(e){let t={};for(let r in e)e[r]===!0&&(t[`data-${r}`]="");return t}function _k(e,t,r,n){let[o,a]=g.useState(r),{hasFlag:i,addFlag:s,removeFlag:l}=GL(e&&o?3:0),c=g.useRef(!1),d=g.useRef(!1),f=Kl();return zn(()=>{var m;if(e){if(r&&a(!0),!t){r&&s(3);return}return(m=void 0)==null||m.call(n,r),XL(t,{inFlight:c,prepare(){d.current?d.current=!1:d.current=c.current,c.current=!0,!d.current&&(r?(s(3),l(4)):(s(4),l(2)))},run(){d.current?r?(l(3),s(4)):(l(4),s(3)):r?l(1):s(1)},done(){var p;d.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(c.current=!1,l(7),r||a(!1),(p=void 0)==null||p.call(n,r))}})}},[e,r,t,f]),e?[o,{closed:i(1),enter:i(2),leave:i(4),transition:i(2)||i(4)}]:[r,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function XL(e,{prepare:t,run:r,done:n,inFlight:o}){let a=ga();return JL(e,{prepare:t,inFlight:o}),a.nextFrame(()=>{r(),a.requestAnimationFrame(()=>{a.add(ZL(e,n))})}),a.dispose}function ZL(e,t){var r,n;let o=ga();if(!e)return o.dispose;let a=!1;o.add(()=>{a=!0});let i=(n=(r=e.getAnimations)==null?void 0:r.call(e).filter(s=>s instanceof CSSTransition))!=null?n:[];return i.length===0?(t(),o.dispose):(Promise.allSettled(i.map(s=>s.finished)).then(()=>{a||t()}),o.dispose)}function JL(e,{inFlight:t,prepare:r}){if(t!=null&&t.current){r();return}let n=e.style.transition;e.style.transition="none",r(),e.offsetHeight,e.style.transition=n}function jm(){return typeof window<"u"}function Vl(e){return mT(e)?(e.nodeName||"").toLowerCase():"#document"}function En(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ro(e){var t;return(t=(mT(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function mT(e){return jm()?e instanceof Node||e instanceof En(e).Node:!1}function Tr(e){return jm()?e instanceof Element||e instanceof En(e).Element:!1}function Co(e){return jm()?e instanceof HTMLElement||e instanceof En(e).HTMLElement:!1}function mS(e){return!jm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof En(e).ShadowRoot}function dd(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=Jn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(o)}function QL(e){return["table","td","th"].includes(Vl(e))}function Em(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Ik(e){const t=Dk(),r=Tr(e)?Jn(e):e;return["transform","translate","scale","rotate","perspective"].some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function eR(e){let t=ni(e);for(;Co(t)&&!cl(t);){if(Ik(t))return t;if(Em(t))return null;t=ni(t)}return null}function Dk(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function cl(e){return["html","body","#document"].includes(Vl(e))}function Jn(e){return En(e).getComputedStyle(e)}function Sm(e){return Tr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ni(e){if(Vl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||mS(e)&&e.host||Ro(e);return mS(t)?t.host:t}function hT(e){const t=ni(e);return cl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Co(t)&&dd(t)?t:hT(t)}function Ja(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=hT(e),a=o===((n=e.ownerDocument)==null?void 0:n.body),i=En(o);if(a){const s=N0(i);return t.concat(i,i.visualViewport||[],dd(o)?o:[],s&&r?Ja(s):[])}return t.concat(o,Ja(o,[],r))}function N0(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function tR(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:r,version:n}=t;return r+"/"+n}).join(" "):navigator.userAgent}const rR=["top","right","bottom","left"],Po=Math.min,Pr=Math.max,dl=Math.round,cf=Math.floor,ko=e=>({x:e,y:e}),nR={left:"right",right:"left",bottom:"top",top:"bottom"},oR={start:"end",end:"start"};function O0(e,t,r){return Pr(e,Po(t,r))}function Qn(e,t){return typeof e=="function"?e(t):e}function da(e){return e.split("-")[0]}function Gl(e){return e.split("-")[1]}function Lk(e){return e==="x"?"y":"x"}function Rk(e){return e==="y"?"height":"width"}function oi(e){return["top","bottom"].includes(da(e))?"y":"x"}function Fk(e){return Lk(oi(e))}function aR(e,t,r){r===void 0&&(r=!1);const n=Gl(e),o=Fk(e),a=Rk(o);let i=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Zf(i)),[i,Zf(i)]}function iR(e){const t=Zf(e);return[C0(e),t,C0(t)]}function C0(e){return e.replace(/start|end/g,t=>oR[t])}function sR(e,t,r){const n=["left","right"],o=["right","left"],a=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return r?t?o:n:t?n:o;case"left":case"right":return t?a:i;default:return[]}}function lR(e,t,r,n){const o=Gl(e);let a=sR(da(e),r==="start",n);return o&&(a=a.map(i=>i+"-"+o),t&&(a=a.concat(a.map(C0)))),a}function Zf(e){return e.replace(/left|right|bottom|top/g,t=>nR[t])}function uR(e){return{top:0,right:0,bottom:0,left:0,...e}}function gT(e){return typeof e!="number"?uR(e):{top:e,right:e,bottom:e,left:e}}function Jf(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function hS(e,t,r){let{reference:n,floating:o}=e;const a=oi(t),i=Fk(t),s=Rk(i),l=da(t),c=a==="y",d=n.x+n.width/2-o.width/2,f=n.y+n.height/2-o.height/2,m=n[s]/2-o[s]/2;let p;switch(l){case"top":p={x:d,y:n.y-o.height};break;case"bottom":p={x:d,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:f};break;case"left":p={x:n.x-o.width,y:f};break;default:p={x:n.x,y:n.y}}switch(Gl(t)){case"start":p[i]-=m*(r&&c?-1:1);break;case"end":p[i]+=m*(r&&c?-1:1);break}return p}const cR=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:i}=r,s=a.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=hS(c,n,l),m=n,p={},h=0;for(let b=0;b<s.length;b++){const{name:v,fn:x}=s[b],{x:k,y:S,data:j,reset:O}=await x({x:d,y:f,initialPlacement:n,placement:m,strategy:o,middlewareData:p,rects:c,platform:i,elements:{reference:e,floating:t}});d=k??d,f=S??f,p={...p,[v]:{...p[v],...j}},O&&h<=50&&(h++,typeof O=="object"&&(O.placement&&(m=O.placement),O.rects&&(c=O.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):O.rects),{x:d,y:f}=hS(c,m,l)),b=-1)}return{x:d,y:f,placement:m,strategy:o,middlewareData:p}};async function fl(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:m=!1,padding:p=0}=Qn(t,e),h=gT(p),b=s[m?f==="floating"?"reference":"floating":f],v=Jf(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(b)))==null||r?b:b.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:l})),x=f==="floating"?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,k=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),S=await(a.isElement==null?void 0:a.isElement(k))?await(a.getScale==null?void 0:a.getScale(k))||{x:1,y:1}:{x:1,y:1},j=Jf(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:x,offsetParent:k,strategy:l}):x);return{top:(v.top-j.top+h.top)/S.y,bottom:(j.bottom-v.bottom+h.bottom)/S.y,left:(v.left-j.left+h.left)/S.x,right:(j.right-v.right+h.right)/S.x}}const dR=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:d=0}=Qn(e,t)||{};if(c==null)return{};const f=gT(d),m={x:r,y:n},p=Fk(o),h=Rk(p),b=await i.getDimensions(c),v=p==="y",x=v?"top":"left",k=v?"bottom":"right",S=v?"clientHeight":"clientWidth",j=a.reference[h]+a.reference[p]-m[p]-a.floating[h],O=m[p]-a.reference[p],C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let N=C?C[S]:0;(!N||!await(i.isElement==null?void 0:i.isElement(C)))&&(N=s.floating[S]||a.floating[h]);const T=j/2-O/2,M=N/2-b[h]/2-1,I=Po(f[x],M),_=Po(f[k],M),R=I,L=N-b[h]-_,F=N/2-b[h]/2+T,B=O0(R,F,L),U=!l.arrow&&Gl(o)!=null&&F!==B&&a.reference[h]/2-(F<R?I:_)-b[h]/2<0,$=U?F<R?F-R:F-L:0;return{[p]:m[p]+$,data:{[p]:B,centerOffset:F-B-$,...U&&{alignmentOffset:$}},reset:U}}}),fR=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:b=!0,...v}=Qn(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const x=da(o),k=oi(s),S=da(s)===s,j=await(l.isRTL==null?void 0:l.isRTL(c.floating)),O=m||(S||!b?[Zf(s)]:iR(s)),C=h!=="none";!m&&C&&O.push(...lR(s,b,h,j));const N=[s,...O],T=await fl(t,v),M=[];let I=((n=a.flip)==null?void 0:n.overflows)||[];if(d&&M.push(T[x]),f){const F=aR(o,i,j);M.push(T[F[0]],T[F[1]])}if(I=[...I,{placement:o,overflows:M}],!M.every(F=>F<=0)){var _,R;const F=(((_=a.flip)==null?void 0:_.index)||0)+1,B=N[F];if(B)return{data:{index:F,overflows:I},reset:{placement:B}};let U=(R=I.filter($=>$.overflows[0]<=0).sort(($,z)=>$.overflows[1]-z.overflows[1])[0])==null?void 0:R.placement;if(!U)switch(p){case"bestFit":{var L;const $=(L=I.filter(z=>{if(C){const W=oi(z.placement);return W===k||W==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(W=>W>0).reduce((W,K)=>W+K,0)]).sort((z,W)=>z[1]-W[1])[0])==null?void 0:L[0];$&&(U=$);break}case"initialPlacement":U=s;break}if(o!==U)return{reset:{placement:U}}}return{}}}};function gS(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bS(e){return rR.some(t=>e[t]>=0)}const pR=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Qn(e,t);switch(n){case"referenceHidden":{const a=await fl(t,{...o,elementContext:"reference"}),i=gS(a,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:bS(i)}}}case"escaped":{const a=await fl(t,{...o,altBoundary:!0}),i=gS(a,r.floating);return{data:{escapedOffsets:i,escaped:bS(i)}}}default:return{}}}}};async function mR(e,t){const{placement:r,platform:n,elements:o}=e,a=await(n.isRTL==null?void 0:n.isRTL(o.floating)),i=da(r),s=Gl(r),l=oi(r)==="y",c=["left","top"].includes(i)?-1:1,d=a&&l?-1:1,f=Qn(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&typeof h=="number"&&(p=s==="end"?h*-1:h),l?{x:p*d,y:m*c}:{x:m*c,y:p*d}}const hR=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:a,placement:i,middlewareData:s}=t,l=await mR(t,e);return i===((r=s.offset)==null?void 0:r.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}},gR=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:v=>{let{x,y:k}=v;return{x,y:k}}},...l}=Qn(e,t),c={x:r,y:n},d=await fl(t,l),f=oi(da(o)),m=Lk(f);let p=c[m],h=c[f];if(a){const v=m==="y"?"top":"left",x=m==="y"?"bottom":"right",k=p+d[v],S=p-d[x];p=O0(k,p,S)}if(i){const v=f==="y"?"top":"left",x=f==="y"?"bottom":"right",k=h+d[v],S=h-d[x];h=O0(k,h,S)}const b=s.fn({...t,[m]:p,[f]:h});return{...b,data:{x:b.x-r,y:b.y-n,enabled:{[m]:a,[f]:i}}}}}},bR=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Qn(e,t),d={x:r,y:n},f=oi(o),m=Lk(f);let p=d[m],h=d[f];const b=Qn(s,t),v=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const S=m==="y"?"height":"width",j=a.reference[m]-a.floating[S]+v.mainAxis,O=a.reference[m]+a.reference[S]-v.mainAxis;p<j?p=j:p>O&&(p=O)}if(c){var x,k;const S=m==="y"?"width":"height",j=["top","left"].includes(da(o)),O=a.reference[f]-a.floating[S]+(j&&((x=i.offset)==null?void 0:x[f])||0)+(j?0:v.crossAxis),C=a.reference[f]+a.reference[S]+(j?0:((k=i.offset)==null?void 0:k[f])||0)-(j?v.crossAxis:0);h<O?h=O:h>C&&(h=C)}return{[m]:p,[f]:h}}}},vR=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:a,platform:i,elements:s}=t,{apply:l=()=>{},...c}=Qn(e,t),d=await fl(t,c),f=da(o),m=Gl(o),p=oi(o)==="y",{width:h,height:b}=a.floating;let v,x;f==="top"||f==="bottom"?(v=f,x=m===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(x=f,v=m==="end"?"top":"bottom");const k=b-d.top-d.bottom,S=h-d.left-d.right,j=Po(b-d[v],k),O=Po(h-d[x],S),C=!t.middlewareData.shift;let N=j,T=O;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(T=S),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(N=k),C&&!m){const I=Pr(d.left,0),_=Pr(d.right,0),R=Pr(d.top,0),L=Pr(d.bottom,0);p?T=h-2*(I!==0||_!==0?I+_:Pr(d.left,d.right)):N=b-2*(R!==0||L!==0?R+L:Pr(d.top,d.bottom))}await l({...t,availableWidth:T,availableHeight:N});const M=await i.getDimensions(s.floating);return h!==M.width||b!==M.height?{reset:{rects:!0}}:{}}}};function bT(e){const t=Jn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Co(e),a=o?e.offsetWidth:r,i=o?e.offsetHeight:n,s=dl(r)!==a||dl(n)!==i;return s&&(r=a,n=i),{width:r,height:n,$:s}}function $k(e){return Tr(e)?e:e.contextElement}function Zs(e){const t=$k(e);if(!Co(t))return ko(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:a}=bT(t);let i=(a?dl(r.width):r.width)/n,s=(a?dl(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}const yR=ko(0);function vT(e){const t=En(e);return!Dk()||!t.visualViewport?yR:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function xR(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==En(e)?!1:t}function us(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),a=$k(e);let i=ko(1);t&&(n?Tr(n)&&(i=Zs(n)):i=Zs(e));const s=xR(a,r,n)?vT(a):ko(0);let l=(o.left+s.x)/i.x,c=(o.top+s.y)/i.y,d=o.width/i.x,f=o.height/i.y;if(a){const m=En(a),p=n&&Tr(n)?En(n):n;let h=m,b=N0(h);for(;b&&n&&p!==h;){const v=Zs(b),x=b.getBoundingClientRect(),k=Jn(b),S=x.left+(b.clientLeft+parseFloat(k.paddingLeft))*v.x,j=x.top+(b.clientTop+parseFloat(k.paddingTop))*v.y;l*=v.x,c*=v.y,d*=v.x,f*=v.y,l+=S,c+=j,h=En(b),b=N0(h)}}return Jf({width:d,height:f,x:l,y:c})}function Bk(e,t){const r=Sm(e).scrollLeft;return t?t.left+r:us(Ro(e)).left+r}function yT(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-(r?0:Bk(e,n)),a=n.top+t.scrollTop;return{x:o,y:a}}function wR(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const a=o==="fixed",i=Ro(n),s=t?Em(t.floating):!1;if(n===i||s&&a)return r;let l={scrollLeft:0,scrollTop:0},c=ko(1);const d=ko(0),f=Co(n);if((f||!f&&!a)&&((Vl(n)!=="body"||dd(i))&&(l=Sm(n)),Co(n))){const p=us(n);c=Zs(n),d.x=p.x+n.clientLeft,d.y=p.y+n.clientTop}const m=i&&!f&&!a?yT(i,l,!0):ko(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+d.x+m.x,y:r.y*c.y-l.scrollTop*c.y+d.y+m.y}}function kR(e){return Array.from(e.getClientRects())}function jR(e){const t=Ro(e),r=Sm(e),n=e.ownerDocument.body,o=Pr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=Pr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Bk(e);const s=-r.scrollTop;return Jn(n).direction==="rtl"&&(i+=Pr(t.clientWidth,n.clientWidth)-o),{width:o,height:a,x:i,y:s}}function ER(e,t){const r=En(e),n=Ro(e),o=r.visualViewport;let a=n.clientWidth,i=n.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;const c=Dk();(!c||c&&t==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:i,x:s,y:l}}function SR(e,t){const r=us(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=Co(e)?Zs(e):ko(1),i=e.clientWidth*a.x,s=e.clientHeight*a.y,l=o*a.x,c=n*a.y;return{width:i,height:s,x:l,y:c}}function vS(e,t,r){let n;if(t==="viewport")n=ER(e,r);else if(t==="document")n=jR(Ro(e));else if(Tr(t))n=SR(t,r);else{const o=vT(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Jf(n)}function xT(e,t){const r=ni(e);return r===t||!Tr(r)||cl(r)?!1:Jn(r).position==="fixed"||xT(r,t)}function NR(e,t){const r=t.get(e);if(r)return r;let n=Ja(e,[],!1).filter(s=>Tr(s)&&Vl(s)!=="body"),o=null;const a=Jn(e).position==="fixed";let i=a?ni(e):e;for(;Tr(i)&&!cl(i);){const s=Jn(i),l=Ik(i);!l&&s.position==="fixed"&&(o=null),(a?!l&&!o:!l&&s.position==="static"&&o&&["absolute","fixed"].includes(o.position)||dd(i)&&!l&&xT(e,i))?n=n.filter(c=>c!==i):o=s,i=ni(i)}return t.set(e,n),n}function OR(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const a=[...r==="clippingAncestors"?Em(t)?[]:NR(t,this._c):[].concat(r),n],i=a[0],s=a.reduce((l,c)=>{const d=vS(t,c,o);return l.top=Pr(d.top,l.top),l.right=Po(d.right,l.right),l.bottom=Po(d.bottom,l.bottom),l.left=Pr(d.left,l.left),l},vS(t,i,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function CR(e){const{width:t,height:r}=bT(e);return{width:t,height:r}}function PR(e,t,r){const n=Co(t),o=Ro(t),a=r==="fixed",i=us(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=ko(0);if(n||!n&&!a)if((Vl(t)!=="body"||dd(o))&&(s=Sm(t)),n){const m=us(t,!0,a,t);l.x=m.x+t.clientLeft,l.y=m.y+t.clientTop}else o&&(l.x=Bk(o));const c=o&&!n&&!a?yT(o,s):ko(0),d=i.left+s.scrollLeft-l.x-c.x,f=i.top+s.scrollTop-l.y-c.y;return{x:d,y:f,width:i.width,height:i.height}}function Cg(e){return Jn(e).position==="static"}function yS(e,t){if(!Co(e)||Jn(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ro(e)===r&&(r=r.ownerDocument.body),r}function wT(e,t){const r=En(e);if(Em(e))return r;if(!Co(e)){let o=ni(e);for(;o&&!cl(o);){if(Tr(o)&&!Cg(o))return o;o=ni(o)}return r}let n=yS(e,t);for(;n&&QL(n)&&Cg(n);)n=yS(n,t);return n&&cl(n)&&Cg(n)&&!Ik(n)?r:n||eR(e)||r}const AR=async function(e){const t=this.getOffsetParent||wT,r=this.getDimensions,n=await r(e.floating);return{reference:PR(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function TR(e){return Jn(e).direction==="rtl"}const MR={convertOffsetParentRelativeRectToViewportRelativeRect:wR,getDocumentElement:Ro,getClippingRect:OR,getOffsetParent:wT,getElementRects:AR,getClientRects:kR,getDimensions:CR,getScale:Zs,isElement:Tr,isRTL:TR};function kT(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function _R(e,t){let r=null,n;const o=Ro(e);function a(){var s;clearTimeout(n),(s=r)==null||s.disconnect(),r=null}function i(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();const c=e.getBoundingClientRect(),{left:d,top:f,width:m,height:p}=c;if(s||t(),!m||!p)return;const h=cf(f),b=cf(o.clientWidth-(d+m)),v=cf(o.clientHeight-(f+p)),x=cf(d),k={rootMargin:-h+"px "+-b+"px "+-v+"px "+-x+"px",threshold:Pr(0,Po(1,l))||1};let S=!0;function j(O){const C=O[0].intersectionRatio;if(C!==l){if(!S)return i();C?i(!1,C):n=setTimeout(()=>{i(!1,1e-7)},1e3)}C===1&&!kT(c,e.getBoundingClientRect())&&i(),S=!1}try{r=new IntersectionObserver(j,{...k,root:o.ownerDocument})}catch{r=new IntersectionObserver(j,k)}r.observe(e)}return i(!0),a}function Nm(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=$k(e),d=o||a?[...c?Ja(c):[],...Ja(t)]:[];d.forEach(x=>{o&&x.addEventListener("scroll",r,{passive:!0}),a&&x.addEventListener("resize",r)});const f=c&&s?_R(c,r):null;let m=-1,p=null;i&&(p=new ResizeObserver(x=>{let[k]=x;k&&k.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var S;(S=p)==null||S.observe(t)})),r()}),c&&!l&&p.observe(c),p.observe(t));let h,b=l?us(e):null;l&&v();function v(){const x=us(e);b&&!kT(b,x)&&r(),b=x,h=requestAnimationFrame(v)}return r(),()=>{var x;d.forEach(k=>{o&&k.removeEventListener("scroll",r),a&&k.removeEventListener("resize",r)}),f?.(),(x=p)==null||x.disconnect(),p=null,l&&cancelAnimationFrame(h)}}const Js=fl,zk=hR,Hk=gR,qk=fR,jT=vR,IR=pR,xS=dR,DR=bR,Wk=(e,t,r)=>{const n=new Map,o={platform:MR,...r},a={...o.platform,_c:n};return cR(e,t,{...o,platform:a})};var Lf=typeof document<"u"?g.useLayoutEffect:g.useEffect;function Qf(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!Qf(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const a=o[n];if(!(a==="_owner"&&e.$$typeof)&&!Qf(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function ET(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function wS(e,t){const r=ET(e);return Math.round(t*r)/r}function Pg(e){const t=g.useRef(e);return Lf(()=>{t.current=e}),t}function ST(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:a,floating:i}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[d,f]=g.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=g.useState(n);Qf(m,n)||p(n);const[h,b]=g.useState(null),[v,x]=g.useState(null),k=g.useCallback(z=>{z!==C.current&&(C.current=z,b(z))},[]),S=g.useCallback(z=>{z!==N.current&&(N.current=z,x(z))},[]),j=a||h,O=i||v,C=g.useRef(null),N=g.useRef(null),T=g.useRef(d),M=l!=null,I=Pg(l),_=Pg(o),R=Pg(c),L=g.useCallback(()=>{if(!C.current||!N.current)return;const z={placement:t,strategy:r,middleware:m};_.current&&(z.platform=_.current),Wk(C.current,N.current,z).then(W=>{const K={...W,isPositioned:R.current!==!1};F.current&&!Qf(T.current,K)&&(T.current=K,Ht.flushSync(()=>{f(K)}))})},[m,t,r,_,R]);Lf(()=>{c===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(z=>({...z,isPositioned:!1})))},[c]);const F=g.useRef(!1);Lf(()=>(F.current=!0,()=>{F.current=!1}),[]),Lf(()=>{if(j&&(C.current=j),O&&(N.current=O),j&&O){if(I.current)return I.current(j,O,L);L()}},[j,O,L,I,M]);const B=g.useMemo(()=>({reference:C,floating:N,setReference:k,setFloating:S}),[k,S]),U=g.useMemo(()=>({reference:j,floating:O}),[j,O]),$=g.useMemo(()=>{const z={position:r,left:0,top:0};if(!U.floating)return z;const W=wS(U.floating,d.x),K=wS(U.floating,d.y);return s?{...z,transform:"translate("+W+"px, "+K+"px)",...ET(U.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:W,top:K}},[r,s,U.floating,d.x,d.y]);return g.useMemo(()=>({...d,update:L,refs:B,elements:U,floatingStyles:$}),[d,L,B,U,$])}const LR=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?xS({element:n.current,padding:o}).fn(r):{}:n?xS({element:n,padding:o}).fn(r):{}}}},Uk=(e,t)=>({...zk(e),options:[e,t]}),NT=(e,t)=>({...Hk(e),options:[e,t]}),RR=(e,t)=>({...DR(e),options:[e,t]}),OT=(e,t)=>({...qk(e),options:[e,t]}),CT=(e,t)=>({...jT(e),options:[e,t]}),FR=(e,t)=>({...IR(e),options:[e,t]}),$R=(e,t)=>({...LR(e),options:[e,t]}),PT={...il},BR=PT.useInsertionEffect,zR=BR||(e=>e());function AT(e){const t=g.useRef(()=>{});return zR(()=>{t.current=e}),g.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}var P0=typeof document<"u"?g.useLayoutEffect:g.useEffect;let kS=!1,HR=0;const jS=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+HR++;function qR(){const[e,t]=g.useState(()=>kS?jS():void 0);return P0(()=>{e==null&&t(jS())},[]),g.useEffect(()=>{kS=!0},[]),e}const WR=PT.useId,UR=WR||qR;function KR(){const e=new Map;return{emit(t,r){var n;(n=e.get(t))==null||n.forEach(o=>o(r))},on(t,r){e.set(t,[...e.get(t)||[],r])},off(t,r){var n;e.set(t,((n=e.get(t))==null?void 0:n.filter(o=>o!==r))||[])}}}const VR=g.createContext(null),GR=g.createContext(null),YR=()=>{var e;return((e=g.useContext(VR))==null?void 0:e.id)||null},XR=()=>g.useContext(GR),ZR="data-floating-ui-focusable";function JR(e){const{open:t=!1,onOpenChange:r,elements:n}=e,o=UR(),a=g.useRef({}),[i]=g.useState(()=>KR()),s=YR()!=null,[l,c]=g.useState(n.reference),d=AT((p,h,b)=>{a.current.openEvent=p?h:void 0,i.emit("openchange",{open:p,event:h,reason:b,nested:s}),r?.(p,h,b)}),f=g.useMemo(()=>({setPositionReference:c}),[]),m=g.useMemo(()=>({reference:l||n.reference||null,floating:n.floating||null,domReference:n.reference}),[l,n.reference,n.floating]);return g.useMemo(()=>({dataRef:a,open:t,onOpenChange:d,elements:m,events:i,floatingId:o,refs:f}),[t,d,m,i,o,f])}function QR(e){e===void 0&&(e={});const{nodeId:t}=e,r=JR({...e,elements:{reference:null,floating:null,...e.elements}}),n=e.rootContext||r,o=n.elements,[a,i]=g.useState(null),[s,l]=g.useState(null),c=o?.domReference||a,d=g.useRef(null),f=XR();P0(()=>{c&&(d.current=c)},[c]);const m=ST({...e,elements:{...o,...s&&{reference:s}}}),p=g.useCallback(k=>{const S=Tr(k)?{getBoundingClientRect:()=>k.getBoundingClientRect(),contextElement:k}:k;l(S),m.refs.setReference(S)},[m.refs]),h=g.useCallback(k=>{(Tr(k)||k===null)&&(d.current=k,i(k)),(Tr(m.refs.reference.current)||m.refs.reference.current===null||k!==null&&!Tr(k))&&m.refs.setReference(k)},[m.refs]),b=g.useMemo(()=>({...m.refs,setReference:h,setPositionReference:p,domReference:d}),[m.refs,h,p]),v=g.useMemo(()=>({...m.elements,domReference:c}),[m.elements,c]),x=g.useMemo(()=>({...m,...n,refs:b,elements:v,nodeId:t}),[m,b,v,t,n]);return P0(()=>{n.dataRef.current.floatingContext=x;const k=f?.nodesRef.current.find(S=>S.id===t);k&&(k.context=x)}),g.useMemo(()=>({...m,context:x,refs:b,elements:v}),[m,b,v,x])}const ES="active",SS="selected";function Ag(e,t,r){const n=new Map,o=r==="item";let a=e;if(o&&e){const{[ES]:i,[SS]:s,...l}=e;a=l}return{...r==="floating"&&{tabIndex:-1,[ZR]:""},...a,...t.map(i=>{const s=i?i[r]:null;return typeof s=="function"?e?s(e):null:s}).concat(e).reduce((i,s)=>(s&&Object.entries(s).forEach(l=>{let[c,d]=l;if(!(o&&[ES,SS].includes(c)))if(c.indexOf("on")===0){if(n.has(c)||n.set(c,[]),typeof d=="function"){var f;(f=n.get(c))==null||f.push(d),i[c]=function(){for(var m,p=arguments.length,h=new Array(p),b=0;b<p;b++)h[b]=arguments[b];return(m=n.get(c))==null?void 0:m.map(v=>v(...h)).find(v=>v!==void 0)}}}else i[c]=d}),i),{})}}function eF(e){e===void 0&&(e=[]);const t=e.map(s=>s?.reference),r=e.map(s=>s?.floating),n=e.map(s=>s?.item),o=g.useCallback(s=>Ag(s,e,"reference"),t),a=g.useCallback(s=>Ag(s,e,"floating"),r),i=g.useCallback(s=>Ag(s,e,"item"),n);return g.useMemo(()=>({getReferenceProps:o,getFloatingProps:a,getItemProps:i}),[o,a,i])}function NS(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const tF=e=>({name:"inner",options:e,async fn(t){const{listRef:r,overflowRef:n,onFallbackChange:o,offset:a=0,index:i=0,minItemsVisible:s=4,referenceOverflowThreshold:l=0,scrollRef:c,...d}=Qn(e,t),{rects:f,elements:{floating:m}}=t,p=r.current[i],h=c?.current||m,b=m.clientTop||h.clientTop,v=m.clientTop!==0,x=h.clientTop!==0,k=m===h;if(!p)return{};const S={...t,...await Uk(-p.offsetTop-m.clientTop-f.reference.height/2-p.offsetHeight/2-a).fn(t)},j=await Js(NS(S,h.scrollHeight+b+m.clientTop),d),O=await Js(S,{...d,elementContext:"reference"}),C=Pr(0,j.top),N=S.y+C,T=(h.scrollHeight>h.clientHeight?M=>M:dl)(Pr(0,h.scrollHeight+(v&&k||x?b*2:0)-C-Pr(0,j.bottom)));if(h.style.maxHeight=T+"px",h.scrollTop=C,o){const M=h.offsetHeight<p.offsetHeight*Po(s,r.current.length)-1||O.top>=-l||O.bottom>=-l;Ht.flushSync(()=>o(M))}return n&&(n.current=await Js(NS({...S,y:N},h.offsetHeight+b+m.clientTop),d)),{y:N}}});function rF(e,t){const{open:r,elements:n}=e,{enabled:o=!0,overflowRef:a,scrollRef:i,onChange:s}=t,l=AT(s),c=g.useRef(!1),d=g.useRef(null),f=g.useRef(null);g.useEffect(()=>{if(!o)return;function p(b){if(b.ctrlKey||!h||a.current==null)return;const v=b.deltaY,x=a.current.top>=-.5,k=a.current.bottom>=-.5,S=h.scrollHeight-h.clientHeight,j=v<0?-1:1,O=v<0?"max":"min";h.scrollHeight<=h.clientHeight||(!x&&v>0||!k&&v<0?(b.preventDefault(),Ht.flushSync(()=>{l(C=>C+Math[O](v,S*j))})):/firefox/i.test(tR())&&(h.scrollTop+=v))}const h=i?.current||n.floating;if(r&&h)return h.addEventListener("wheel",p),requestAnimationFrame(()=>{d.current=h.scrollTop,a.current!=null&&(f.current={...a.current})}),()=>{d.current=null,f.current=null,h.removeEventListener("wheel",p)}},[o,r,n.floating,a,i,l]);const m=g.useMemo(()=>({onKeyDown(){c.current=!0},onWheel(){c.current=!1},onPointerMove(){c.current=!1},onScroll(){const p=i?.current||n.floating;if(!(!a.current||!p||!c.current)){if(d.current!==null){const h=p.scrollTop-d.current;(a.current.bottom<-.5&&h<-1||a.current.top<-.5&&h>1)&&Ht.flushSync(()=>l(b=>b+h))}requestAnimationFrame(()=>{d.current=p.scrollTop})}}}),[n.floating,l,a,i]);return g.useMemo(()=>o?{floating:m}:{},[o,m])}let fd=g.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});fd.displayName="FloatingContext";let Kk=g.createContext(null);Kk.displayName="PlacementContext";function nF(e){return g.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function oF(){return g.useContext(fd).setReference}function aF(){let{getFloatingProps:e,slot:t}=g.useContext(fd);return g.useCallback((...r)=>Object.assign({},e(...r),{"data-anchor":t.anchor}),[e,t])}function iF(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=g.useContext(Kk),r=g.useMemo(()=>e,[JSON.stringify(e,(o,a)=>{var i;return(i=a?.outerHTML)!=null?i:a})]);zn(()=>{t?.(r??null)},[t,r]);let n=g.useContext(fd);return g.useMemo(()=>[n.setFloating,e?n.styles:{}],[n.setFloating,e,n.styles])}let OS=4;function sF({children:e,enabled:t=!0}){let[r,n]=g.useState(null),[o,a]=g.useState(0),i=g.useRef(null),[s,l]=g.useState(null);lF(s);let c=t&&r!==null&&s!==null,{to:d="bottom",gap:f=0,offset:m=0,padding:p=0,inner:h}=uF(r,s),[b,v="center"]=d.split(" ");zn(()=>{c&&a(0)},[c]);let{refs:x,floatingStyles:k,context:S}=QR({open:c,placement:b==="selection"?v==="center"?"bottom":`bottom-${v}`:v==="center"?`${b}`:`${b}-${v}`,strategy:"absolute",transform:!1,middleware:[Uk({mainAxis:b==="selection"?0:f,crossAxis:m}),NT({padding:p}),b!=="selection"&&OT({padding:p}),b==="selection"&&h?tF({...h,padding:p,overflowRef:i,offset:o,minItemsVisible:OS,referenceOverflowThreshold:p,onFallbackChange(_){var R,L;if(!_)return;let F=S.elements.floating;if(!F)return;let B=parseFloat(getComputedStyle(F).scrollPaddingBottom)||0,U=Math.min(OS,F.childElementCount),$=0,z=0;for(let W of(L=(R=S.elements.floating)==null?void 0:R.childNodes)!=null?L:[])if(Oo(W)){let K=W.offsetTop,q=K+W.clientHeight+B,J=F.scrollTop,V=J+F.clientHeight;if(K>=J&&q<=V)U--;else{z=Math.max(0,Math.min(q,V)-Math.max(K,J)),$=W.clientHeight;break}}U>=1&&a(W=>{let K=$*U-z+B;return W>=K?W:K})}}):null,CT({padding:p,apply({availableWidth:_,availableHeight:R,elements:L}){Object.assign(L.floating.style,{overflow:"auto",maxWidth:`${_}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${R}px)`})}})].filter(Boolean),whileElementsMounted:Nm}),[j=b,O=v]=S.placement.split("-");b==="selection"&&(j="selection");let C=g.useMemo(()=>({anchor:[j,O].filter(Boolean).join(" ")}),[j,O]),N=rF(S,{overflowRef:i,onChange:a}),{getReferenceProps:T,getFloatingProps:M}=eF([N]),I=xt(_=>{l(_),x.setFloating(_)});return g.createElement(Kk.Provider,{value:n},g.createElement(fd.Provider,{value:{setFloating:I,setReference:x.setReference,styles:k,getReferenceProps:T,getFloatingProps:M,slot:C}},e))}function lF(e){zn(()=>{if(!e)return;let t=new MutationObserver(()=>{let r=window.getComputedStyle(e).maxHeight,n=parseFloat(r);if(isNaN(n))return;let o=parseInt(r);isNaN(o)||n!==o&&(e.style.maxHeight=`${Math.ceil(n)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function uF(e,t){var r,n,o;let a=Tg((r=e?.gap)!=null?r:"var(--anchor-gap, 0)",t),i=Tg((n=e?.offset)!=null?n:"var(--anchor-offset, 0)",t),s=Tg((o=e?.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:a,offset:i,padding:s}}function Tg(e,t,r=void 0){let n=Kl(),o=xt((l,c)=>{if(l==null)return[r,null];if(typeof l=="number")return[l,null];if(typeof l=="string"){if(!c)return[r,null];let d=CS(l,c);return[d,f=>{let m=TT(l);{let p=m.map(h=>window.getComputedStyle(c).getPropertyValue(h));n.requestAnimationFrame(function h(){n.nextFrame(h);let b=!1;for(let[x,k]of m.entries()){let S=window.getComputedStyle(c).getPropertyValue(k);if(p[x]!==S){p[x]=S,b=!0;break}}if(!b)return;let v=CS(l,c);d!==v&&(f(v),d=v)})}return n.dispose}]}return[r,null]}),a=g.useMemo(()=>o(e,t)[0],[e,t]),[i=a,s]=g.useState();return zn(()=>{let[l,c]=o(e,t);if(s(l),!!c)return c(s)},[e,t]),i}function TT(e){let t=/var\((.*)\)/.exec(e);if(t){let r=t[1].indexOf(",");if(r===-1)return[t[1]];let n=t[1].slice(0,r).trim(),o=t[1].slice(r+1).trim();return o?[n,...TT(o)]:[n]}return[]}function CS(e,t){let r=document.createElement("div");t.appendChild(r),r.style.setProperty("margin-top","0px","important"),r.style.setProperty("margin-top",e,"important");let n=parseFloat(window.getComputedStyle(r).marginTop)||0;return t.removeChild(r),n}let Om=g.createContext(null);Om.displayName="OpenClosedContext";var eo=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(eo||{});function Vk(){return g.useContext(Om)}function MT({value:e,children:t}){return y.createElement(Om.Provider,{value:e},t)}function _T({children:e}){return y.createElement(Om.Provider,{value:null},e)}function IT(e){let t=xt(e),r=g.useRef(!1);g.useEffect(()=>(r.current=!1,()=>{r.current=!0,KA(()=>{r.current&&t()})}),[t])}let cF=g.createContext(!1);function dF(){return g.useContext(cF)}function fF(e){let t=dF(),r=g.useContext(LT),[n,o]=g.useState(()=>{var a;if(!t&&r!==null)return(a=r.current)!=null?a:null;if(Xs.isServer)return null;let i=e?.getElementById("headlessui-portal-root");if(i)return i;if(e===null)return null;let s=e.createElement("div");return s.setAttribute("id","headlessui-portal-root"),e.body.appendChild(s)});return g.useEffect(()=>{n!==null&&(e!=null&&e.body.contains(n)||e==null||e.body.appendChild(n))},[n,e]),g.useEffect(()=>{t||r!==null&&o(r.current)},[r,o,t]),n}let DT=g.Fragment,pF=Yr(function(e,t){let{ownerDocument:r=null,...n}=e,o=g.useRef(null),a=an(Ck(m=>{o.current=m}),t),i=ul(o),s=r??i,l=fF(s),c=g.useContext(A0),d=Kl(),f=Gr();return IT(()=>{var m;l&&l.childNodes.length<=0&&((m=l.parentElement)==null||m.removeChild(l))}),l?Ht.createPortal(y.createElement("div",{"data-headlessui-portal":"",ref:m=>{d.dispose(),c&&m&&d.add(c.register(m))}},f({ourProps:{ref:a},theirProps:n,slot:{},defaultTag:DT,name:"Portal"})),l):null});function mF(e,t){let r=an(t),{enabled:n=!0,ownerDocument:o,...a}=e,i=Gr();return n?y.createElement(pF,{...a,ownerDocument:o,ref:r}):i({ourProps:{ref:r},theirProps:a,slot:{},defaultTag:DT,name:"Portal"})}let hF=g.Fragment,LT=g.createContext(null);function gF(e,t){let{target:r,...n}=e,o={ref:an(t)},a=Gr();return y.createElement(LT.Provider,{value:r},a({ourProps:o,theirProps:n,defaultTag:hF,name:"Popover.Group"}))}let A0=g.createContext(null);function bF(){let e=g.useContext(A0),t=g.useRef([]),r=xt(a=>(t.current.push(a),e&&e.register(a),()=>n(a))),n=xt(a=>{let i=t.current.indexOf(a);i!==-1&&t.current.splice(i,1),e&&e.unregister(a)}),o=g.useMemo(()=>({register:r,unregister:n,portals:t}),[r,n,t]);return[t,g.useMemo(()=>function({children:a}){return y.createElement(A0.Provider,{value:o},a)},[o])]}let vF=Yr(mF),yF=Yr(gF),xF=Object.assign(vF,{Group:yF});function wF({defaultContainers:e=[],portals:t,mainTreeNode:r}={}){let n=ul(r),o=xt(()=>{var a,i;let s=[];for(let l of e)l!==null&&(Za(l)?s.push(l):"current"in l&&Za(l.current)&&s.push(l.current));if(t!=null&&t.current)for(let l of t.current)s.push(l);for(let l of(a=n?.querySelectorAll("html > *, body > *"))!=null?a:[])l!==document.body&&l!==document.head&&Za(l)&&l.id!=="headlessui-portal-root"&&(r&&(l.contains(r)||l.contains((i=r?.getRootNode())==null?void 0:i.host))||s.some(c=>l.contains(c))||s.push(l));return s});return{resolveContainers:o,contains:xt(a=>o().some(i=>i.contains(a)))}}let RT=g.createContext(null);function FT({children:e,node:t}){let[r,n]=g.useState(null),o=$T(t??r);return y.createElement(RT.Provider,{value:o},e,o===null&&y.createElement(ll,{features:ss.Hidden,ref:a=>{var i,s;if(a){for(let l of(s=(i=Ul(a))==null?void 0:i.querySelectorAll("html > *, body > *"))!=null?s:[])if(l!==document.body&&l!==document.head&&Za(l)&&l!=null&&l.contains(a)){n(l);break}}}}))}function $T(e=null){var t;return(t=g.useContext(RT))!=null?t:e}var ta=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(ta||{});function BT(){let e=g.useRef(0);return pT(!0,"keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}var PS;let kF=(PS=y.startTransition)!=null?PS:function(e){e()};var jF=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(jF||{}),EF=(e=>(e[e.ToggleDisclosure=0]="ToggleDisclosure",e[e.CloseDisclosure=1]="CloseDisclosure",e[e.SetButtonId=2]="SetButtonId",e[e.SetPanelId=3]="SetPanelId",e[e.SetButtonElement=4]="SetButtonElement",e[e.SetPanelElement=5]="SetPanelElement",e))(EF||{});let SF={0:e=>({...e,disclosureState:Nn(e.disclosureState,{0:1,1:0})}),1:e=>e.disclosureState===1?e:{...e,disclosureState:1},2(e,t){return e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId}},3(e,t){return e.panelId===t.panelId?e:{...e,panelId:t.panelId}},4(e,t){return e.buttonElement===t.element?e:{...e,buttonElement:t.element}},5(e,t){return e.panelElement===t.element?e:{...e,panelElement:t.element}}},Gk=g.createContext(null);Gk.displayName="DisclosureContext";function Yk(e){let t=g.useContext(Gk);if(t===null){let r=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Yk),r}return t}let Xk=g.createContext(null);Xk.displayName="DisclosureAPIContext";function zT(e){let t=g.useContext(Xk);if(t===null){let r=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,zT),r}return t}let Zk=g.createContext(null);Zk.displayName="DisclosurePanelContext";function NF(){return g.useContext(Zk)}function OF(e,t){return Nn(t.type,SF,e,t)}let CF=g.Fragment;function PF(e,t){let{defaultOpen:r=!1,...n}=e,o=g.useRef(null),a=an(t,Ck(b=>{o.current=b},e.as===void 0||nc(e.as))),i=g.useReducer(OF,{disclosureState:r?0:1,buttonElement:null,panelElement:null,buttonId:null,panelId:null}),[{disclosureState:s,buttonId:l},c]=i,d=xt(b=>{c({type:1});let v=Ul(o);if(!v||!l)return;let x=b?Wa(b)?b:"current"in b&&Wa(b.current)?b.current:v.getElementById(l):v.getElementById(l);x?.focus()}),f=g.useMemo(()=>({close:d}),[d]),m=oo({open:s===0,close:d}),p={ref:a},h=Gr();return y.createElement(Gk.Provider,{value:i},y.createElement(Xk.Provider,{value:f},y.createElement(Pk,{value:d},y.createElement(MT,{value:Nn(s,{0:eo.Open,1:eo.Closed})},h({ourProps:p,theirProps:n,slot:m,defaultTag:CF,name:"Disclosure"})))))}let AF="button";function TF(e,t){let r=g.useId(),{id:n=`headlessui-disclosure-button-${r}`,disabled:o=!1,autoFocus:a=!1,...i}=e,[s,l]=Yk("Disclosure.Button"),c=NF(),d=c===null?!1:c===s.panelId,f=g.useRef(null),m=an(f,t,xt(M=>{if(!d)return l({type:4,element:M})}));g.useEffect(()=>{if(!d)return l({type:2,buttonId:n}),()=>{l({type:2,buttonId:null})}},[n,l,d]);let p=xt(M=>{var I;if(d){if(s.disclosureState===1)return;switch(M.key){case Qr.Space:case Qr.Enter:M.preventDefault(),M.stopPropagation(),l({type:0}),(I=s.buttonElement)==null||I.focus();break}}else switch(M.key){case Qr.Space:case Qr.Enter:M.preventDefault(),M.stopPropagation(),l({type:0});break}}),h=xt(M=>{switch(M.key){case Qr.Space:M.preventDefault();break}}),b=xt(M=>{var I;ym(M.currentTarget)||o||(d?(l({type:0}),(I=s.buttonElement)==null||I.focus()):l({type:0}))}),{isFocusVisible:v,focusProps:x}=no({autoFocus:a}),{isHovered:k,hoverProps:S}=Lo({isDisabled:o}),{pressed:j,pressProps:O}=Nk({disabled:o}),C=oo({open:s.disclosureState===0,hover:k,active:j,disabled:o,focus:v,autofocus:a}),N=Tk(e,s.buttonElement),T=vm(d?{ref:m,type:N,disabled:o||void 0,autoFocus:a,onKeyDown:p,onClick:b}:{ref:m,id:n,type:N,"aria-expanded":s.disclosureState===0,"aria-controls":s.panelElement?s.panelId:void 0,disabled:o||void 0,autoFocus:a,onKeyDown:p,onKeyUp:h,onClick:b},x,S,O);return Gr()({ourProps:T,theirProps:i,slot:C,defaultTag:AF,name:"Disclosure.Button"})}let MF="div",_F=is.RenderStrategy|is.Static;function IF(e,t){let r=g.useId(),{id:n=`headlessui-disclosure-panel-${r}`,transition:o=!1,...a}=e,[i,s]=Yk("Disclosure.Panel"),{close:l}=zT("Disclosure.Panel"),[c,d]=g.useState(null),f=an(t,xt(k=>{kF(()=>s({type:5,element:k}))}),d);g.useEffect(()=>(s({type:3,panelId:n}),()=>{s({type:3,panelId:null})}),[n,s]);let m=Vk(),[p,h]=_k(o,c,m!==null?(m&eo.Open)===eo.Open:i.disclosureState===0),b=oo({open:i.disclosureState===0,close:l}),v={ref:f,id:n,...Mk(h)},x=Gr();return y.createElement(_T,null,y.createElement(Zk.Provider,{value:i.panelId},x({ourProps:v,theirProps:a,slot:b,defaultTag:MF,features:_F,visible:p,name:"Disclosure.Panel"})))}let DF=Yr(PF),LF=Yr(TF),RF=Yr(IF),Mg=Object.assign(DF,{Button:LF,Panel:RF});var FF=Object.defineProperty,$F=(e,t,r)=>t in e?FF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,AS=(e,t,r)=>($F(e,typeof t!="symbol"?t+"":t,r),r),Sr=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Sr||{}),BF=(e=>(e[e.OpenPopover=0]="OpenPopover",e[e.ClosePopover=1]="ClosePopover",e[e.SetButton=2]="SetButton",e[e.SetButtonId=3]="SetButtonId",e[e.SetPanel=4]="SetPanel",e[e.SetPanelId=5]="SetPanelId",e))(BF||{});let zF={0:e=>e.popoverState===0?e:{...e,popoverState:0,__demoMode:!1},1(e){return e.popoverState===1?e:{...e,popoverState:1,__demoMode:!1}},2(e,t){return e.button===t.button?e:{...e,button:t.button}},3(e,t){return e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId}},4(e,t){return e.panel===t.panel?e:{...e,panel:t.panel}},5(e,t){return e.panelId===t.panelId?e:{...e,panelId:t.panelId}}},HF=class HT extends sT{constructor(t){super(t),AS(this,"actions",{close:()=>this.send({type:1}),refocusableClose:r=>{this.actions.close();let n=r?Oo(r)?r:"current"in r&&Oo(r.current)?r.current:this.state.button:this.state.button;n?.focus()},open:()=>this.send({type:0}),setButtonId:r=>this.send({type:3,buttonId:r}),setButton:r=>this.send({type:2,button:r}),setPanelId:r=>this.send({type:5,panelId:r}),setPanel:r=>this.send({type:4,panel:r})}),AS(this,"selectors",{isPortalled:r=>{if(!r.button||!r.panel)return!1;for(let c of document.querySelectorAll("body > *"))if(Number(c?.contains(r.button))^Number(c?.contains(r.panel)))return!0;let n=km(),o=n.indexOf(r.button),a=(o+n.length-1)%n.length,i=(o+1)%n.length,s=n[a],l=n[i];return!r.panel.contains(s)&&!r.panel.contains(l)}});{let r=this.state.id,n=cT.get(null);this.on(0,()=>n.actions.push(r)),this.on(1,()=>n.actions.pop(r))}}static new({id:t,__demoMode:r=!1}){return new HT({id:t,__demoMode:r,popoverState:r?0:1,buttons:{current:[]},button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:{current:null},afterPanelSentinel:{current:null},afterButtonSentinel:{current:null}})}reduce(t,r){return Nn(r.type,zF,t,r)}};const qT=g.createContext(null);function Cm(e){let t=g.useContext(qT);if(t===null){let r=new Error(`<${e} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Cm),r}return t}function qF({id:e,__demoMode:t=!1}){let r=g.useMemo(()=>HF.new({id:e,__demoMode:t}),[]);return IT(()=>r.dispose()),r}let Jk=g.createContext(null);Jk.displayName="PopoverGroupContext";function WT(){return g.useContext(Jk)}let Pm=g.createContext(null);Pm.displayName="PopoverPanelContext";function WF(){return g.useContext(Pm)}let UF="div";function KF(e,t){var r;let n=g.useId(),{__demoMode:o=!1,...a}=e,i=qF({id:n,__demoMode:o}),s=g.useRef(null),l=an(t,Ck(F=>{s.current=F})),[c,d,f,m,p]=ls(i,g.useCallback(F=>[F.popoverState,F.button,F.panel,F.buttonId,F.panelId],[])),h=ul((r=s.current)!=null?r:d),b=ri(m),v=ri(p),x=g.useMemo(()=>({buttonId:b,panelId:v,close:i.actions.close}),[b,v,i]),k=WT(),S=k?.registerPopover,j=xt(()=>{var F;return(F=k?.isFocusWithinPopoverGroup())!=null?F:h?.activeElement&&(d?.contains(h.activeElement)||f?.contains(h.activeElement))});g.useEffect(()=>S?.(x),[S,x]);let[O,C]=bF(),N=$T(d),T=wF({mainTreeNode:N,portals:O,defaultContainers:[{get current(){return i.state.button}},{get current(){return i.state.panel}}]});$L(h?.defaultView,"focus",F=>{var B,U,$,z,W,K;F.target!==window&&Wa(F.target)&&i.state.popoverState===Sr.Open&&(j()||i.state.button&&i.state.panel&&(T.contains(F.target)||(U=(B=i.state.beforePanelSentinel.current)==null?void 0:B.contains)!=null&&U.call(B,F.target)||(z=($=i.state.afterPanelSentinel.current)==null?void 0:$.contains)!=null&&z.call($,F.target)||(K=(W=i.state.afterButtonSentinel.current)==null?void 0:W.contains)!=null&&K.call(W,F.target)||i.actions.close()))},!0);let M=c===Sr.Open;FL(M,T.resolveContainers,(F,B)=>{i.actions.close(),dT(B,Ak.Loose)||(F.preventDefault(),d?.focus())});let I=oo({open:c===Sr.Open,close:i.actions.refocusableClose}),_=ls(i,g.useCallback(F=>Nn(F.popoverState,{[Sr.Open]:eo.Open,[Sr.Closed]:eo.Closed}),[])),R={ref:l},L=Gr();return y.createElement(FT,{node:N},y.createElement(sF,null,y.createElement(Pm.Provider,{value:null},y.createElement(qT.Provider,{value:i},y.createElement(Pk,{value:i.actions.refocusableClose},y.createElement(MT,{value:_},y.createElement(C,null,L({ourProps:R,theirProps:a,slot:I,defaultTag:UF,name:"Popover"}))))))))}let VF="button";function GF(e,t){let r=g.useId(),{id:n=`headlessui-popover-button-${r}`,disabled:o=!1,autoFocus:a=!1,...i}=e,s=Cm("Popover.Button"),[l,c,d,f,m,p,h]=ls(s,g.useCallback(X=>[X.popoverState,s.selectors.isPortalled(X),X.button,X.buttonId,X.panel,X.panelId,X.afterButtonSentinel],[])),b=g.useRef(null),v=`headlessui-focus-sentinel-${g.useId()}`,x=WT(),k=x?.closeOthers,S=WF()!==null;g.useEffect(()=>{if(!S)return s.actions.setButtonId(n),()=>s.actions.setButtonId(null)},[S,n,s]);let[j]=g.useState(()=>Symbol()),O=an(b,t,oF(),xt(X=>{if(!S){if(X)s.state.buttons.current.push(j);else{let ce=s.state.buttons.current.indexOf(j);ce!==-1&&s.state.buttons.current.splice(ce,1)}s.state.buttons.current.length>1&&console.warn("You are already using a <Popover.Button /> but only 1 <Popover.Button /> is supported."),X&&s.actions.setButton(X)}})),C=an(b,t),N=ul(b),T=xt(X=>{var ce,oe,Oe;if(S){if(s.state.popoverState===Sr.Closed)return;switch(X.key){case Qr.Space:case Qr.Enter:X.preventDefault(),(oe=(ce=X.target).click)==null||oe.call(ce),s.actions.close(),(Oe=s.state.button)==null||Oe.focus();break}}else switch(X.key){case Qr.Space:case Qr.Enter:X.preventDefault(),X.stopPropagation(),s.state.popoverState===Sr.Closed?(k?.(s.state.buttonId),s.actions.open()):s.actions.close();break;case Qr.Escape:if(s.state.popoverState!==Sr.Open)return k?.(s.state.buttonId);if(!b.current||N!=null&&N.activeElement&&!b.current.contains(N.activeElement))return;X.preventDefault(),X.stopPropagation(),s.actions.close();break}}),M=xt(X=>{S||X.key===Qr.Space&&X.preventDefault()}),I=xt(X=>{var ce,oe;ym(X.currentTarget)||o||(S?(s.actions.close(),(ce=s.state.button)==null||ce.focus()):(X.preventDefault(),X.stopPropagation(),s.state.popoverState===Sr.Closed?(k?.(s.state.buttonId),s.actions.open()):s.actions.close(),(oe=s.state.button)==null||oe.focus()))}),_=xt(X=>{X.preventDefault(),X.stopPropagation()}),{isFocusVisible:R,focusProps:L}=no({autoFocus:a}),{isHovered:F,hoverProps:B}=Lo({isDisabled:o}),{pressed:U,pressProps:$}=Nk({disabled:o}),z=l===Sr.Open,W=oo({open:z,active:U||z,disabled:o,hover:F,focus:R,autofocus:a}),K=Tk(e,d),q=vm(S?{ref:C,type:K,onKeyDown:T,onClick:I,disabled:o||void 0,autoFocus:a}:{ref:O,id:f,type:K,"aria-expanded":l===Sr.Open,"aria-controls":m?p:void 0,disabled:o||void 0,autoFocus:a,onKeyDown:T,onKeyUp:M,onClick:I,onMouseDown:_},L,B,$),J=BT(),V=xt(()=>{if(!Oo(s.state.panel))return;let X=s.state.panel;function ce(){Nn(J.current,{[ta.Forwards]:()=>Wi(X,ea.First),[ta.Backwards]:()=>Wi(X,ea.Last)})===Xf.Error&&Wi(km().filter(oe=>oe.dataset.headlessuiFocusGuard!=="true"),Nn(J.current,{[ta.Forwards]:ea.Next,[ta.Backwards]:ea.Previous}),{relativeTo:s.state.button})}ce()}),me=Gr();return y.createElement(y.Fragment,null,me({ourProps:q,theirProps:i,slot:W,defaultTag:VF,name:"Popover.Button"}),z&&!S&&c&&y.createElement(ll,{id:v,ref:h,features:ss.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:V}))}let YF="div",XF=is.RenderStrategy|is.Static;function UT(e,t){let r=g.useId(),{id:n=`headlessui-popover-backdrop-${r}`,transition:o=!1,...a}=e,i=Cm("Popover.Backdrop"),s=ls(i,g.useCallback(x=>x.popoverState,[])),[l,c]=g.useState(null),d=an(t,c),f=Vk(),[m,p]=_k(o,l,f!==null?(f&eo.Open)===eo.Open:s===Sr.Open),h=xt(x=>{if(ym(x.currentTarget))return x.preventDefault();i.actions.close()}),b=oo({open:s===Sr.Open}),v={ref:d,id:n,"aria-hidden":!0,onClick:h,...Mk(p)};return Gr()({ourProps:v,theirProps:a,slot:b,defaultTag:YF,features:XF,visible:m,name:"Popover.Backdrop"})}let ZF="div",JF=is.RenderStrategy|is.Static;function QF(e,t){let r=g.useId(),{id:n=`headlessui-popover-panel-${r}`,focus:o=!1,anchor:a,portal:i=!1,modal:s=!1,transition:l=!1,...c}=e,d=Cm("Popover.Panel"),f=ls(d,d.selectors.isPortalled),[m,p,h,b,v]=ls(d,g.useCallback(V=>[V.popoverState,V.button,V.__demoMode,V.beforePanelSentinel,V.afterPanelSentinel],[])),x=`headlessui-focus-sentinel-before-${r}`,k=`headlessui-focus-sentinel-after-${r}`,S=g.useRef(null),j=nF(a),[O,C]=iF(j),N=aF();j&&(i=!0);let[T,M]=g.useState(null),I=an(S,t,j?O:null,d.actions.setPanel,M),_=ul(p),R=ul(S);zn(()=>(d.actions.setPanelId(n),()=>d.actions.setPanelId(null)),[n,d]);let L=Vk(),[F,B]=_k(l,T,L!==null?(L&eo.Open)===eo.Open:m===Sr.Open);PL(F,p,d.actions.close),VL(h?!1:s&&F,R);let U=xt(V=>{var me;switch(V.key){case Qr.Escape:if(d.state.popoverState!==Sr.Open||!S.current||R!=null&&R.activeElement&&!S.current.contains(R.activeElement))return;V.preventDefault(),V.stopPropagation(),d.actions.close(),(me=d.state.button)==null||me.focus();break}});g.useEffect(()=>{var V;e.static||m===Sr.Closed&&((V=e.unmount)==null||V)&&d.actions.setPanel(null)},[m,e.unmount,e.static,d]),g.useEffect(()=>{if(h||!o||m!==Sr.Open||!S.current)return;let V=R?.activeElement;S.current.contains(V)||Wi(S.current,ea.First)},[h,o,S.current,m]);let $=oo({open:m===Sr.Open,close:d.actions.refocusableClose}),z=vm(j?N():{},{ref:I,id:n,onKeyDown:U,onBlur:o&&m===Sr.Open?V=>{var me,X,ce,oe,Oe;let te=V.relatedTarget;te&&S.current&&((me=S.current)!=null&&me.contains(te)||(d.actions.close(),((ce=(X=b.current)==null?void 0:X.contains)!=null&&ce.call(X,te)||(Oe=(oe=v.current)==null?void 0:oe.contains)!=null&&Oe.call(oe,te))&&te.focus({preventScroll:!0})))}:void 0,tabIndex:-1,style:{...c.style,...C,"--button-width":hL(F,p,!0).width},...Mk(B)}),W=BT(),K=xt(()=>{let V=S.current;if(!V)return;function me(){Nn(W.current,{[ta.Forwards]:()=>{var X;Wi(V,ea.First)===Xf.Error&&((X=d.state.afterPanelSentinel.current)==null||X.focus())},[ta.Backwards]:()=>{var X;(X=d.state.button)==null||X.focus({preventScroll:!0})}})}me()}),q=xt(()=>{let V=S.current;if(!V)return;function me(){Nn(W.current,{[ta.Forwards]:()=>{if(!d.state.button)return;let X=km(),ce=X.indexOf(d.state.button),oe=X.slice(0,ce+1),Oe=[...X.slice(ce+1),...oe];for(let te of Oe.slice())if(te.dataset.headlessuiFocusGuard==="true"||T!=null&&T.contains(te)){let Ne=Oe.indexOf(te);Ne!==-1&&Oe.splice(Ne,1)}Wi(Oe,ea.First,{sorted:!1})},[ta.Backwards]:()=>{var X;Wi(V,ea.Previous)===Xf.Error&&((X=d.state.button)==null||X.focus())}})}me()}),J=Gr();return y.createElement(_T,null,y.createElement(Pm.Provider,{value:n},y.createElement(Pk,{value:d.actions.refocusableClose},y.createElement(xF,{enabled:i?e.static||F:!1,ownerDocument:_},F&&f&&y.createElement(ll,{id:x,ref:b,features:ss.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:K}),J({ourProps:z,theirProps:c,slot:$,defaultTag:ZF,features:JF,visible:F,name:"Popover.Panel"}),F&&f&&y.createElement(ll,{id:k,ref:v,features:ss.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:q})))))}let e$="div";function t$(e,t){let r=g.useRef(null),n=an(r,t),[o,a]=g.useState([]),i=xt(b=>{a(v=>{let x=v.indexOf(b);if(x!==-1){let k=v.slice();return k.splice(x,1),k}return v})}),s=xt(b=>(a(v=>[...v,b]),()=>i(b))),l=xt(()=>{var b;let v=Ul(r);if(!v)return!1;let x=v.activeElement;return(b=r.current)!=null&&b.contains(x)?!0:o.some(k=>{var S,j;return((S=v.getElementById(k.buttonId.current))==null?void 0:S.contains(x))||((j=v.getElementById(k.panelId.current))==null?void 0:j.contains(x))})}),c=xt(b=>{for(let v of o)v.buttonId.current!==b&&v.close()}),d=g.useMemo(()=>({registerPopover:s,unregisterPopover:i,isFocusWithinPopoverGroup:l,closeOthers:c}),[s,i,l,c]),f=oo({}),m=e,p={ref:n},h=Gr();return y.createElement(FT,null,y.createElement(Jk.Provider,{value:d},h({ourProps:p,theirProps:m,slot:f,defaultTag:e$,name:"Popover.Group"})))}let r$=Yr(KF),n$=Yr(GF),o$=Yr(UT),a$=Yr(UT),i$=Yr(QF),s$=Yr(t$),_g=Object.assign(r$,{Button:n$,Backdrop:a$,Overlay:o$,Panel:i$,Group:s$}),Qk=g.createContext(null);Qk.displayName="GroupContext";let l$=g.Fragment;function u$(e){var t;let[r,n]=g.useState(null),[o,a]=ZD(),[i,s]=KD(),l=g.useMemo(()=>({switch:r,setSwitch:n}),[r,n]),c={},d=e,f=Gr();return y.createElement(s,{name:"Switch.Description",value:i},y.createElement(a,{name:"Switch.Label",value:o,props:{htmlFor:(t=l.switch)==null?void 0:t.id,onClick(m){r&&(E0(m.currentTarget)&&m.preventDefault(),r.click(),r.focus({preventScroll:!0}))}}},y.createElement(Qk.Provider,{value:l},f({ourProps:c,theirProps:d,slot:{},defaultTag:l$,name:"Switch.Group"}))))}let c$="button";function d$(e,t){var r;let n=g.useId(),o=ZA(),a=Ok(),{id:i=o||`headlessui-switch-${n}`,disabled:s=a||!1,checked:l,defaultChecked:c,onChange:d,name:f,value:m,form:p,autoFocus:h=!1,...b}=e,v=g.useContext(Qk),[x,k]=g.useState(null),S=g.useRef(null),j=an(S,t,v===null?null:v.setSwitch,k),O=AD(c),[C,N]=PD(l,d,O??!1),T=Kl(),[M,I]=g.useState(!1),_=xt(()=>{I(!0),N?.(!C),T.nextFrame(()=>{I(!1)})}),R=xt(oe=>{if(ym(oe.currentTarget))return oe.preventDefault();oe.preventDefault(),_()}),L=xt(oe=>{oe.key===Qr.Space?(oe.preventDefault(),_()):oe.key===Qr.Enter&&TD(oe.currentTarget)}),F=xt(oe=>oe.preventDefault()),B=nT(),U=UD(),{isFocusVisible:$,focusProps:z}=no({autoFocus:h}),{isHovered:W,hoverProps:K}=Lo({isDisabled:s}),{pressed:q,pressProps:J}=Nk({disabled:s}),V=oo({checked:C,disabled:s,hover:W,focus:$,active:q,autofocus:h,changing:M}),me=vm({id:i,ref:j,role:"switch",type:Tk(e,x),tabIndex:e.tabIndex===-1?0:(r=e.tabIndex)!=null?r:0,"aria-checked":C,"aria-labelledby":B,"aria-describedby":U,disabled:s||void 0,autoFocus:h,onClick:R,onKeyUp:L,onKeyPress:F},z,K,J),X=g.useCallback(()=>{if(O!==void 0)return N?.(O)},[N,O]),ce=Gr();return y.createElement(y.Fragment,null,f!=null&&y.createElement(LD,{disabled:s,data:{[f]:m||"on"},overrides:{type:"checkbox",checked:C},form:p,onReset:X}),ce({ourProps:me,theirProps:b,slot:V,defaultTag:c$,name:"Switch"}))}let f$=Yr(d$),p$=u$,m$=tL,h$=XD,KT=Object.assign(f$,{Group:p$,Label:m$,Description:h$});const cn=({textToCopy:e,onCopy:t=()=>{},copiedTimeout:r=2500,showLabel:n=!0,labelText:o="Copy",copiedText:a="Copied"})=>{const[i,s]=g.useState(!1),l=()=>{navigator.clipboard.writeText(e).then(()=>{s(!0),t(),setTimeout(()=>s(!1),r)}).catch(d=>{console.error("Failed to copy text:",d)})},c=()=>u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",className:"h-4 w-4",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})});return u.jsx("div",{className:"flex items-center rounded px-2 font-sans text-xs text-token-text-secondary",children:u.jsx("span",{"data-state":i?"copied":"closed",children:u.jsxs("button",{onClick:l,className:"flex gap-1 items-center select-none py-1 cursor-pointer","aria-label":"Copy",children:[i?u.jsx(c,{}):u.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"icon-xs",children:u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 5C7 3.34315 8.34315 2 10 2H19C20.6569 2 22 3.34315 22 5V14C22 15.6569 20.6569 17 19 17H17V19C17 20.6569 15.6569 22 14 22H5C3.34315 22 2 20.6569 2 19V10C2 8.34315 3.34315 7 5 7H7V5ZM9 7H14C15.6569 7 17 8.34315 17 10V15H19C19.5523 15 20 14.5523 20 14V5C20 4.44772 19.5523 4 19 4H10C9.44772 4 9 4.44772 9 5V7ZM5 9C4.44772 9 4 9.44772 4 10V19C4 19.5523 4.44772 20 5 20H14C14.5523 20 15 19.5523 15 19V10C15 9.44772 14.5523 9 14 9H5Z",fill:"currentColor"})}),n&&(i?a:o)]})})})},TS=e=>e.replace(/\/+$/,"");class g${constructor(t={}){this.apiEndpoint=TS(t.apiEndpoint||"/api"),this.defaultHeaders={"inspectr-client":"inspectr-app",...t.headers},this.jsonHeaders={...this.defaultHeaders,"Content-Type":"application/json"},this.registration=new b$(this),this.auth=new v$(this),this.operations=new y$(this),this.service=new x$(this),this.stats=new w$(this),this.mock=new k$(this),this.rules=new j$(this),this.connectors=new E$(this)}configure(t={}){t.apiEndpoint&&(this.apiEndpoint=TS(t.apiEndpoint)),t.headers&&(this.defaultHeaders={...this.defaultHeaders,...t.headers},this.jsonHeaders={...this.defaultHeaders,"Content-Type":"application/json"})}}class b${constructor(t){this.client=t}async register(t){const r=await fetch(`${this.client.apiEndpoint}/register`,{method:"POST",headers:this.client.jsonHeaders,body:JSON.stringify(t)});if(!r.ok)throw new Error(`Registration failed (${r.status})`);return await r.json()}async getConfig(){const t=await fetch("/app/config");if(!t.ok)throw new Error(`Config load failed (${t.status})`);return await t.json()}}class v${constructor(t){this.client=t}async getAuthenticationSettings(){const t=await fetch(`${this.client.apiEndpoint}/auth/settings`,{headers:this.client.defaultHeaders});if(!t.ok)throw new Error(`Authentication settings failed (${t.status})`);return await t.json()}async updateAuthenticationSettings(t){const r=await fetch(`${this.client.apiEndpoint}/auth/settings`,{method:"PATCH",headers:this.client.jsonHeaders,body:JSON.stringify(t)});if(!r.ok)throw new Error(`Update authentication settings failed (${r.status})`);return await r.json()}}class y${constructor(t){this.client=t}async deleteAll(){const t=await fetch(`${this.client.apiEndpoint}/operations`,{method:"DELETE",headers:this.client.defaultHeaders});if(!t.ok)throw new Error(`Delete all failed (${t.status})`)}async delete(t){const r=await fetch(`${this.client.apiEndpoint}/operations/${t}`,{method:"DELETE",headers:this.client.defaultHeaders});if(!(r.ok||r.status===404))throw new Error(`Delete ${t} failed (${r.status})`)}async replay(t){const{meta:r,timing:n,response:o,...a}=t,i=await fetch(`${this.client.apiEndpoint}/replay`,{method:"POST",headers:this.client.jsonHeaders,body:JSON.stringify(a)});if(!i.ok)throw new Error(`Replay failed (${i.status})`);return await i.json()}async export({path:t,preset:r,since:n,until:o,format:a="json"}={}){let i;["postman","openapi","phar"].includes(a)?i=`${this.client.apiEndpoint}/operations/export/${a}`:i=`${this.client.apiEndpoint}/operations/export`;const s=new URLSearchParams;t&&s.append("path",t),r&&s.append("preset",r),n&&s.append("since",n),o&&s.append("until",o);const l=await fetch(`${i}?${s}`,{headers:this.client.defaultHeaders});if(!l.ok){const c=l.headers.get("content-type")||"";let d=null,f=`Export failed (${l.status})`;if(c.toLowerCase().includes("application/json")){d=await l.json().catch(()=>null);const p=d?.error||d?.message||d?.detail||d?.title;p&&(f=p)}else{const p=await l.text().catch(()=>"");p&&(d=p,f=p)}const m=new Error(f);throw m.status=l.status,d!==null&&(m.body=d),m}return await l.blob()}async import(t){const r=new FormData;r.append("file",t),{...this.client.defaultHeaders};const n=await fetch(`${this.client.apiEndpoint}/operations/import`,{method:"POST",headers:this.client.defaultHeaders,body:r});if(!n.ok)throw new Error(`Import failed (${n.status})`)}async summarize(t={}){const r=new URLSearchParams,n=l=>{if(l!=null)return l instanceof Date?l.toISOString():String(l)},o=(l,c)=>{if(c==null)return;if(Array.isArray(c)){if(c.length===0)return;r.set(l,c.map(n).join(","));return}const d=n(c);d!==void 0&&r.set(l,d)};o("operation_id",t.operationId),o("since",t.since),o("until",t.until),o("sort_field",t.sortField),o("sort_direction",t.sortDirection),o("status",t.status),o("statuses",t.statuses),o("path",t.path),o("host",t.host),o("method",t.method),o("methods",t.methods),o("min_duration",t.minDuration),o("max_duration",t.maxDuration),o("tag",t.tag),o("tags",t.tags),o("tag_any",t.tagAny),o("tags_any",t.tagsAny);const a=r.toString(),i=`${this.client.apiEndpoint}/operations/summary${a?`?${a}`:""}`,s=await fetch(i,{headers:{...this.client.defaultHeaders,Accept:"application/json"}});if(!s.ok)throw new Error(`Operations summary failed (${s.status})`);return await s.json()}async getSeries(t={}){const{method:r,path:n}=t;if(!r)throw new Error("options.method is required");if(!n)throw new Error("options.path is required");const o=new URLSearchParams,a=d=>{if(d!=null)return d instanceof Date?d.toISOString():String(d)},i=(d,f)=>{if(f==null)return;if(Array.isArray(f)){if(!f.length)return;o.set(d,f.map(a).join(","));return}const m=a(f);m!==void 0&&o.set(d,m)};i("method",r),i("path",n),i("operation_id",t.operationId),i("since",t.since),i("until",t.until),i("host",t.host),i("min_duration",t.minDuration),i("max_duration",t.maxDuration),i("status",t.status),i("statuses",t.statuses),i("tag",t.tag),i("tags",t.tags),i("tag_any",t.tagAny),i("tags_any",t.tagsAny),i("series_limit",t.seriesLimit);const s=o.toString(),l=`${this.client.apiEndpoint}/operations/series${s?`?${s}`:""}`,c=await fetch(l,{headers:{...this.client.defaultHeaders,Accept:"application/json"}});if(!c.ok)throw new Error(`Operations series failed (${c.status})`);return await c.json()}async listTags(){const t=await fetch(`${this.client.apiEndpoint}/operations/tags`,{headers:this.client.defaultHeaders});if(!t.ok)throw new Error(`List tags failed (${t.status})`);return await t.json()}async deleteOperationTags(t,r={}){if(!t)throw new Error("Operation id is required");const n=new URLSearchParams,o=(l,c)=>{Array.isArray(c)?c.forEach(d=>{d!=null&&`${d}`!=""&&n.append(l,String(d))}):c!=null&&`${c}`!=""&&n.append(l,String(c))},a=(l,c)=>{Array.isArray(c)?c.length&&n.set(l,c.join(",")):c!=null&&`${c}`!=""&&n.set(l,String(c))};if(o("tag",r.tag),a("tags",r.tags),!n.has("tag")&&!n.has("tags"))throw new Error("At least one tag must be provided via options.tag or options.tags");const i=`${this.client.apiEndpoint}/operations/${encodeURIComponent(t)}/tags`,s=await fetch(`${i}?${n.toString()}`,{method:"DELETE",headers:this.client.defaultHeaders});if(!s.ok)throw new Error(`Delete operation tags failed (${s.status})`);return await s.json()}async deleteTag(t,r={}){if(!t)throw new Error("tag is required");const n=new URLSearchParams,o=l=>{if(l)return l instanceof Date?l.toISOString():l},a=(l,c)=>{c==null||c===""||Array.isArray(c)&&c.length===0||n.set(l,Array.isArray(c)?c.join(","):String(c))};a("since",o(r.since)),a("until",o(r.until)),a("method",r.method),a("path",r.path),a("host",r.host),Array.isArray(r.tagsAll)&&r.tagsAll.length&&a("tags_all",r.tagsAll),Array.isArray(r.tagsAny)&&r.tagsAny.length&&a("tags_any",r.tagsAny),Array.isArray(r.statuses)&&r.statuses.length&&a("statuses",r.statuses),a("limit",r.limit),a("page_size",r.pageSize);const i=`${this.client.apiEndpoint}/operations/tags/${encodeURIComponent(t)}`,s=await fetch(`${i}${n.toString()?"?"+n.toString():""}`,{method:"DELETE",headers:this.client.defaultHeaders});if(!s.ok)throw new Error(`Delete tag failed (${s.status})`);return await s.json()}async bulkDeleteTag(t={}){const{tag:r}=t;if(!r)throw new Error("options.tag is required");const n=new URLSearchParams,o=l=>{if(l)return l instanceof Date?l.toISOString():l},a=(l,c)=>{c==null||c===""||Array.isArray(c)&&c.length===0||n.set(l,Array.isArray(c)?c.join(","):String(c))};a("tag",r),a("since",o(t.since)),a("until",o(t.until)),a("method",t.method),a("path",t.path),a("host",t.host),Array.isArray(t.tagsAll)&&t.tagsAll.length&&a("tags_all",t.tagsAll),Array.isArray(t.tagsAny)&&t.tagsAny.length&&a("tags_any",t.tagsAny),Array.isArray(t.statuses)&&t.statuses.length&&a("statuses",t.statuses),a("limit",t.limit),a("page_size",t.pageSize),t.dryRun!==void 0&&t.dryRun!==null&&a("dry_run",t.dryRun?"true":"false");const i=`${this.client.apiEndpoint}/operations/tags/bulk-delete`,s=await fetch(`${i}?${n.toString()}`,{method:"POST",headers:this.client.defaultHeaders});if(!s.ok)throw new Error(`Bulk delete tag failed (${s.status})`);return await s.json()}}class x${constructor(t){this.client=t}async getHealth(){const t=await fetch(`${this.client.apiEndpoint}/health`,{headers:{...this.client.defaultHeaders,Accept:"application/json"}});if(!t.ok)throw new Error(`Health check failed (${t.status})`);return await t.json()}async ping(t){const r=await fetch(`${this.client.apiEndpoint}/ping/${t}`,{headers:{...this.client.defaultHeaders,Accept:"application/json"}});if(!r.ok){const n=await r.json();throw new Error(`${n?.error||r.status}`)}return await r.json()}async getMetrics(){const t=await fetch(`${this.client.apiEndpoint}/metrics`,{headers:{...this.client.defaultHeaders,Accept:"application/json"}});if(!t.ok)throw new Error(`Metrics failed (${t.status})`);return await t.json()}async getInfo(){const t=await fetch(`${this.client.apiEndpoint}/info`,{headers:{...this.client.defaultHeaders,Accept:"application/json"}});if(!t.ok)throw new Error(`Info failed (${t.status})`);return await t.json()}async getLicense(){const t=await fetch(`${this.client.apiEndpoint}/license`,{headers:{...this.client.defaultHeaders,Accept:"application/json"}});if(!t.ok)throw new Error(`License failed (${t.status})`);return await t.json()}async putLicense(t){const r=JSON.stringify({license_key:t}),n=await fetch(`${this.client.apiEndpoint}/license`,{method:"PUT",headers:this.client.jsonHeaders,body:r});if(!n.ok){const o=n.status,a=await n.json().catch(()=>({})),i=a?.error||a?.message||`License update failed (${o})`,s=new Error(i);throw s.status=o,s.code=a?.code,s.reason=a?.reason,s.details=a?.error||a?.message,s}return await n.json()}}class w${constructor(t){this.client=t}async getOperations({group:t,start:r,end:n,tag:o}){const a=new URLSearchParams({group:t,start:r,end:n});o&&a.append("tag",o);const i=`${this.client.apiEndpoint}/stats/operations?${a.toString()}`,s=await fetch(i,{headers:this.client.defaultHeaders});if(!s.ok)throw new Error(`Stats operations failed (${s.status})`);return await s.json()}async deleteOperations(){const t=await fetch(`${this.client.apiEndpoint}/stats/operations`,{method:"DELETE",headers:this.client.defaultHeaders});if(t.status!==204)throw new Error(`Delete stats operations failed (${t.status})`)}}class k${constructor(t){this.client=t}async getConfig(){const t=await fetch(`${this.client.apiEndpoint}/mock`,{headers:{...this.client.defaultHeaders,Accept:"application/json"}});if(!t.ok)throw new Error(`Mock info failed (${t.status})`);return await t.json()}async launch(t){const r=`${this.client.apiEndpoint}/mock/launch?openapi=`+encodeURIComponent(t),n=await fetch(r,{method:"GET",headers:this.client.defaultHeaders});if(!n.ok){const o=await n.json().catch(()=>({}));throw new Error(o.error||`Mock launch failed (${n.status})`)}return await n.json()}}class j${constructor(t){this.client=t}async export(t={}){const r=t?.id,n=r?`${this.client.apiEndpoint}/rules/${encodeURIComponent(r)}/export`:`${this.client.apiEndpoint}/rules/export`,o=await fetch(n,{method:"GET",headers:{...this.client.defaultHeaders,Accept:"application/x-yaml"}});if(!o.ok){let d="";try{d=await o.text()}catch{}throw new Error(`Rules export failed (${o.status})${d?`: ${d}`:""}`)}const a=await o.blob(),i=o.headers.get("Content-Type")||"application/x-yaml",s=o.headers.get("Content-Disposition")||"",l=/filename\*=UTF-8''([^;]+)|filename="?([^";]+)"?/i.exec(s),c=decodeURIComponent(l?.[1]||l?.[2]||"rules.yaml");return{blob:a,filename:c,contentType:i}}async import(t,r={}){const n=t&&typeof t=="object"&&(t instanceof Blob||t instanceof File)?t:String(t??""),o=r?.overwrite===!0,a=`${this.client.apiEndpoint}/rules/import`+(o?"?overwrite=true":""),i=await fetch(a,{method:"POST",headers:{...this.client.defaultHeaders,"Content-Type":"application/x-yaml",Accept:"application/json"},body:n});if(!i.ok){let s={};try{s=await i.json()}catch{try{s={message:await i.text()}}catch{}}const l=s?.error||s?.message||`Rules import failed (${i.status})`,c=new Error(l);throw c.status=i.status,c.body=s,c}try{return await i.json()}catch{return{}}}async applyToHistory(t,r={}){if(!t)throw new Error("Rule id is required");const n=new URLSearchParams,o=c=>{if(c)return c instanceof Date?c.toISOString():c},a=(c,d)=>{d==null||d===""||n.set(c,String(d))};a("since",o(r.since)),a("until",o(r.until)),a("method",r.method),a("path",r.path),a("host",r.host),Array.isArray(r.tagsAll)&&r.tagsAll.length&&a("tags_all",r.tagsAll.join(",")),Array.isArray(r.tagsAny)&&r.tagsAny.length&&a("tags_any",r.tagsAny.join(",")),Array.isArray(r.statuses)&&r.statuses.length&&a("statuses",r.statuses.join(",")),typeof r.limit=="number"&&a("limit",r.limit),typeof r.pageSize=="number"&&a("page_size",r.pageSize);const i=r.dryRun!==!1;a("dry_run",i);const s=`${this.client.apiEndpoint}/rules/${encodeURIComponent(t)}/apply`+(n.toString()?`?${n.toString()}`:""),l=await fetch(s,{method:"POST",headers:{...this.client.defaultHeaders,Accept:"application/json"}});if(!l.ok){let c={};try{c=await l.json()}catch{}const d=c?.error||c?.message||`Apply rule failed (${l.status})`,f=new Error(d);throw f.status=l.status,f.body=c,f}return await l.json()}async list({page:t,limit:r}={}){let n=`${this.client.apiEndpoint}/rules`;const o=new URLSearchParams;t&&o.set("page",t),r&&o.set("limit",r),o.toString()&&(n+=`?${o.toString()}`);const a=await fetch(n,{headers:{...this.client.defaultHeaders,Accept:"application/json"}});if(!a.ok)throw new Error(`Rules load failed (${a.status})`);return await a.json()}async create(t){const r=await fetch(`${this.client.apiEndpoint}/rules`,{method:"POST",headers:this.client.jsonHeaders,body:JSON.stringify(t)});if(!r.ok){const n=await r.json().catch(()=>({})),o=n?.error||n?.message||`Rule create failed (${r.status})`,a=new Error(o);throw a.status=r.status,a.body=n,a}return await r.json()}async get(t){const r=await fetch(`${this.client.apiEndpoint}/rules/${t}`,{headers:{...this.client.defaultHeaders,Accept:"application/json"}});if(!r.ok)throw new Error(`Rule load failed (${r.status})`);return await r.json()}async replace(t,r){const n=await fetch(`${this.client.apiEndpoint}/rules/${t}`,{method:"PUT",headers:this.client.jsonHeaders,body:JSON.stringify(r)});if(!n.ok){const o=await n.json().catch(()=>({})),a=o?.error||o?.message||`Rule update failed (${n.status})`,i=new Error(a);throw i.status=n.status,i.body=o,i}return await n.json()}async delete(t){const r=await fetch(`${this.client.apiEndpoint}/rules/${t}`,{method:"DELETE",headers:this.client.defaultHeaders});if(!(r.ok||r.status===204)){const n=await r.json().catch(()=>({})),o=n?.error||n?.message||`Rule delete failed (${r.status})`,a=new Error(o);throw a.status=r.status,a.body=n,a}}async update(t,r){return this.replace(t,r)}async getEvents({page:t,limit:r}={}){let n=`${this.client.apiEndpoint}/rules/events`;const o=new URLSearchParams;t&&o.set("page",t),r&&o.set("limit",r),o.toString()&&(n+=`?${o.toString()}`);const a=await fetch(n,{headers:{...this.client.defaultHeaders,Accept:"application/json"}});if(!a.ok)throw new Error(`Rules events failed (${a.status})`);return await a.json()}async getActions({page:t,limit:r}={}){let n=`${this.client.apiEndpoint}/rules/actions`;const o=new URLSearchParams;t&&o.set("page",t),r&&o.set("limit",r),o.toString()&&(n+=`?${o.toString()}`);const a=await fetch(n,{headers:{...this.client.defaultHeaders,Accept:"application/json"}});if(!a.ok)throw new Error(`Rules actions failed (${a.status})`);return await a.json()}async getOperators({page:t,limit:r}={}){let n=`${this.client.apiEndpoint}/rules/operators`;const o=new URLSearchParams;t&&o.set("page",t),r&&o.set("limit",r),o.toString()&&(n+=`?${o.toString()}`);const a=await fetch(n,{headers:{...this.client.defaultHeaders,Accept:"application/json"}});if(!a.ok)throw new Error(`Rules operators failed (${a.status})`);const i=await a.json();return Array.isArray(i)?i:i&&Array.isArray(i.operators)?i.operators:[]}}class E${constructor(t){this.client=t}async list({page:t,limit:r}={}){let n=`${this.client.apiEndpoint}/connectors`;const o=new URLSearchParams;t&&o.set("page",t),r&&o.set("limit",r),o.toString()&&(n+=`?${o.toString()}`);const a=await fetch(n,{headers:{...this.client.defaultHeaders,Accept:"application/json"}});if(!a.ok)throw new Error(`Connectors list failed (${a.status})`);return await a.json()}async create(t){const r=await fetch(`${this.client.apiEndpoint}/connectors`,{method:"POST",headers:this.client.jsonHeaders,body:JSON.stringify(t)});if(!r.ok){const n=await r.json().catch(()=>({})),o=n?.error||n?.message||`Connector create failed (${r.status})`,a=new Error(o);throw a.status=r.status,a.body=n,a}return await r.json()}async get(t){const r=await fetch(`${this.client.apiEndpoint}/connectors/${encodeURIComponent(t)}`,{headers:{...this.client.defaultHeaders,Accept:"application/json"}});if(!r.ok)throw new Error(`Connector load failed (${r.status})`);return await r.json()}async update(t,r){const n=await fetch(`${this.client.apiEndpoint}/connectors/${encodeURIComponent(t)}`,{method:"PUT",headers:this.client.jsonHeaders,body:JSON.stringify(r)});if(!n.ok){const o=await n.json().catch(()=>({})),a=o?.error||o?.message||`Connector update failed (${n.status})`,i=new Error(a);throw i.status=n.status,i.body=o,i}return await n.json()}async delete(t){const r=await fetch(`${this.client.apiEndpoint}/connectors/${encodeURIComponent(t)}`,{method:"DELETE",headers:this.client.defaultHeaders});if(!(r.ok||r.status===204)){const n=await r.json().catch(()=>({})),o=n?.error||n?.message||`Connector delete failed (${r.status})`,a=new Error(o);throw a.status=r.status,a.body=n,a}}}const S$=[":","="],N$=e=>e==null?"":typeof e=="string"?e:String(e),pl=e=>{const t=N$(e).trim();if(!t)return null;let r=-1,n="";for(const i of S$){const s=t.indexOf(i);if(s>0&&s<t.length-1){r=s,n=i;break}}if(r===-1)return{type:"simple",raw:t,display:t,key:null,value:null,separator:null,token:t.toLowerCase()};const o=t.slice(0,r).trim(),a=t.slice(r+1).trim();return!o||!a?{type:"simple",raw:t,display:t,key:null,value:null,separator:null,token:t.toLowerCase()}:{type:"kv",raw:t,display:`${o}:${a}`,key:o,value:a,separator:n,token:`${o}:${a}`.toLowerCase(),keyToken:o.toLowerCase()}},Am=e=>Array.isArray(e)?e.map(pl).filter(Boolean):[],O$=e=>Array.isArray(e)?e.map(pl).filter(Boolean).map(t=>t.token):[],MS=e=>{var t,r,n;if(!e)return[];if(Array.isArray(e.__normalizedTags))return e.__normalizedTags;const o=Am(((n=(r=(t=e?.raw)==null?void 0:t.data)==null?void 0:r.meta)==null?void 0:n.tags)||[]);return e.__normalizedTags=o,o};class C${constructor(){this.db=new sl("InspectrDB"),this.db.version(1).stores({events:"id, time, operation_id, method, status_code, path, duration, server"})}transformEvent(t){var r,n;const{id:o,data:a,operation_id:i}=t,s=Am(((r=a?.meta)==null?void 0:r.tags)||[]);return{id:o,time:a.request.timestamp,operation_id:i,method:a.request.method,url:a.request.url,server:a.request.server,path:a.request.path,client_ip:a.request.client_ip,duration:a.timing.duration,status_code:(n=a.response)==null?void 0:n.status,raw:t,tagTokens:s.map(l=>l.token),tags:s.map(l=>l.display)}}async upsertEvent(t){const r=this.transformEvent(t);return await this.db.events.put(r)}async bulkUpsertEvents(t){const r=t.map(n=>this.transformEvent(n));return await this.db.transaction("rw",this.db.events,()=>this.db.events.bulkPut(r))}async deleteEvent(t){return await this.db.events.delete(t)}async getEvent(t){return await this.db.events.get(t)}async queryEvents(t={}){const{filters:r={},sort:n={field:"time",order:"desc"},page:o=1,pageSize:a=20}=t;if(!(r.timestampRange||r.status&&r.status.length||r.method&&r.method.length||r.path||r.durationMin||r.durationMax||r.host||r.tags&&r.tags.length)){const f=this.db.events,m=f.count();let p=f.orderBy(n.field);n.order==="desc"&&(p=p.reverse());const h=p.offset((o-1)*a).limit(a).toArray(),[b,v]=await Promise.all([h,m]);return{results:b.map(x=>({id:x.id,...x.raw.data})),totalCount:v}}let i=this.db.events.toCollection();if(r.timestampRange){if(typeof r.timestampRange=="string"){let f=new Date;switch(r.timestampRange){case"5M":f.setMinutes(f.getMinutes()-5);break;case"15M":f.setMinutes(f.getMinutes()-15);break;case"30M":f.setMinutes(f.getMinutes()-30);break;case"1H":f.setHours(f.getHours()-1);break;case"3H":f.setHours(f.getHours()-3);break;case"6H":f.setHours(f.getHours()-6);break;case"12H":f.setHours(f.getHours()-12);break;case"24H":f.setHours(f.getHours()-24);break;case"48H":f.setHours(f.getHours()-48);break;case"week":f.setDate(f.getDate()-7);break;case"month":f.setMonth(f.getMonth()-1);break}i=i.filter(m=>new Date(m.time)>=f)}else if(typeof r.timestampRange=="object"){if(r.timestampRange.start&&r.timestampRange.end){const f=new Date(r.timestampRange.start),m=new Date(r.timestampRange.end);i=i.filter(p=>{const h=new Date(p.time);return h>=f&&h<=m})}else if(r.timestampRange.start){const f=new Date(r.timestampRange.start);i=i.filter(m=>new Date(m.time)>=f)}else if(r.timestampRange.end){const f=new Date(r.timestampRange.end);i=i.filter(m=>new Date(m.time)<=f)}}}if(r.status&&Array.isArray(r.status)&&r.status.length>0&&(i=i.filter(f=>f.status_code===null||f.status_code===void 0?!1:r.status.includes(String(f.status_code)))),r.method&&Array.isArray(r.method)&&r.method.length>0){const f=r.method.map(m=>m.toLowerCase());i=i.filter(m=>f.includes(m.method.toLowerCase()))}if(r.path&&(i=i.filter(f=>f.path.includes(r.path))),r.durationMin&&(i=i.filter(f=>Number(f.duration)>=Number(r.durationMin))),r.durationMax&&(i=i.filter(f=>Number(f.duration)<=Number(r.durationMax))),r.host&&(i=i.filter(f=>f.server.toLowerCase().includes(r.host.toLowerCase()))),r.tags&&Array.isArray(r.tags)&&r.tags.length>0){const f=O$(r.tags);f.length>0&&(i=i.filter(m=>{const p=Array.isArray(m.tagTokens)&&m.tagTokens.length>0?m.tagTokens:MS(m).map(h=>h.token);return!p||p.length===0?!1:f.every(h=>p.includes(h))}))}const s=await i.count();let l;if(typeof i.orderBy=="function")try{l=i.orderBy(n.field),n.order==="desc"&&(l=l.reverse())}catch(f){console.error("[EventDB] orderBy error, fallback sorting:",f),l=(await i.toArray()).sort((m,p)=>{const h=n.field;return m[h]<p[h]?n.order==="asc"?-1:1:m[h]>p[h]?n.order==="asc"?1:-1:0})}else l=(await i.toArray()).sort((f,m)=>{const p=n.field;return f[p]<m[p]?n.order==="asc"?-1:1:f[p]>m[p]?n.order==="asc"?1:-1:0});const c=(o-1)*a;let d;return Array.isArray(l)?d=l.slice(c,c+a):typeof l.offset=="function"?d=await l.offset(c).limit(a).toArray():d=[],{results:d.map(f=>({id:f.id,...f.raw.data})),totalCount:s}}async clearEvents(){return await this.db.events.clear()}async getAllTagOptions(){const t=await this.db.events.toArray(),r=new Map;return t.forEach(n=>{MS(n).forEach(o=>{r.has(o.token)||r.set(o.token,o.display)})}),Array.from(r.values()).sort((n,o)=>n.localeCompare(o))}}const Br=new C$,VT=g.createContext({apiEndpoint:"/api",setApiEndpoint:()=>{},connectionStatus:"reconnecting",setConnectionStatus:()=>{},sseEndpoint:"",ingressEndpoint:"",channelCode:"",setChannelCode:()=>{},channel:"",setChannel:()=>{},token:"",reRegistrationFailedRef:{current:!1},userInitiatedRegistrationRef:{current:!1},handleRegister:()=>{},attemptReRegistration:()=>{},toast:null,setToast:()=>{},debugMode:!1,client:null}),mr=()=>g.useContext(VT),P$=({children:e})=>{const[t,r]=Cr("apiEndpoint","/api"),n=t?t.replace(/\/+$/,""):"/api",o=$e=>{r($e&&$e.replace(/\/+$/,""))},[a,i]=g.useState("disconnected"),[s,l]=Cr("sseEndpoint",""),[c,d]=Cr("ingressEndpoint",""),[f,m]=Cr("channelCode",""),[p,h]=Cr("channel",""),[b,v]=Cr("token",""),[x,k]=Cr("expires",""),[,S]=Cr("expose","false"),[j,O]=g.useState(!1),[C,N]=g.useState(null),T=g.useRef(0),M=g.useRef(!1),I=6,_=5e3,R=typeof window<"u"&&window.location.hostname==="localhost",L=typeof window<"u"&&localStorage.getItem("debug")==="true";g.useEffect(()=>{L&&console.log("[Inspectr] Debug Mode enabled")},[]);const F=()=>{const $e=new URLSearchParams(window.location.search),Ze=$e.get("channelCode"),rt=$e.get("channel"),nt=$e.get("token"),ht=$e.get("sseEndpoint");return Ze||rt||nt||ht?(console.log("🔍 Found credentials in query params"),Ze&&m(Ze),rt&&h(rt),nt&&v(nt),ht&&l(ht),window.history.replaceState({},"",`${window.location.pathname}${$e.toString()?"?"+$e.toString():""}`),!0):!1},B=()=>f&&p&&b?(console.log("✅ Using stored credentials from localStorage"),!0):!1,[U,$]=Cr("proxyEndpoint",""),[z,W]=g.useState(()=>new g$({apiEndpoint:n}));g.useEffect(()=>{z.configure({apiEndpoint:n})},[n]);const K=async()=>{console.log("🔄 Fetching /app/config (Localhost, No credentials found)");try{const $e=await z.registration.getConfig();$e!=null&&$e.token&&$e!=null&&$e.sse_endpoint&&$e!=null&&$e.channel_code&&(console.log("✅ Loaded from /app/config:",$e),m($e.channel_code),h($e.channel),v($e.token),l($e.sse_endpoint),d($e.ingress_endpoint),$($e.proxy_endpoint),S($e.expose?"true":"false"))}catch($e){console.error("❌ Failed to load /app/config:",$e)}},q=async($e=f,Ze=p,rt=b,nt)=>{try{let ht={};$e&&Ze?ht={channel:Ze,channel_code:$e}:rt&&(ht={token:rt}),console.log("📤 Registering with:",ht);const ft=await z.registration.register(ht);if(ft!=null&&ft.token&&ft!=null&&ft.sse_endpoint&&ft!=null&&ft.channel_code)return console.log("✅ Registration successful"),T.current=0,M.current=!1,m(ft.channel_code),h(ft.channel),v(ft.token),k(ft.expires),l(ft.sse_endpoint),d(ft.ingress_endpoint),$(ft.proxy_endpoint),S(ft.expose?"true":"false"),nt&&N({message:"Registration Successful",subMessage:"Your channel and access code have been registered."}),i("connected"),!0;throw console.error("❌ Registration failed:",ft),N({message:"Registration Failed",subMessage:"Please check your channel and access code.",type:"error"}),i("disconnected"),new Error("Registration failed")}catch(ht){throw console.error("❌ Registration error:",ht),N({message:"Registration Error",subMessage:"An error occurred during registration.",type:"error"}),i("disconnected"),ht}},J=()=>{M.current||(i("reconnecting"),T.current<I?(T.current+=1,console.log(`🔄 Attempting re-registration (${T.current}/${I}) in ${_/1e3} seconds...`),setTimeout(async()=>{try{await q()}catch($e){console.log("❌ Re-registration attempt failed:",$e),J()}},_)):(console.log(`❌ Re-registration failed after ${I} attempts. Giving up.`),T.current=0,M.current=!0,i("disconnected")))},V=()=>{T.current=0,M.current=!1};g.useEffect(()=>{(async()=>typeof window>"u"||(F()||!B()&&R&&await K(),O(!0)))()},[]);const me=g.useRef(!1);g.useEffect(()=>{if(j){if(me.current){me.current=!1;return}if(b&&!s&&!M.current){console.log("🔄 Have token but missing sseEndpoint, re-registering"),q("","",b);return}console.log("🔄 Auto-registering with stored credentials:",p,f),p&&f?q(f,p):console.log("⚠️ Missing credentials for auto-registration, skipping.")}},[j,p,f,b,s]);const[X,ce]=Cr("lastEventId",""),oe=g.useRef(null),Oe=g.useRef(!1),te=50,Ne=50,ve=g.useRef(0),G=g.useRef(0),ye=g.useRef([]),le=()=>{if(oe.current){try{oe.current.close()}catch{}oe.current=null}},ge=$e=>{if(le(),!s||!b)return;const Ze=$e??X;let rt=`${s}?token=${encodeURIComponent(b)}`;if(Ze){const ht=rt.includes("?")?"&":"?";rt=`${rt}${ht}last_event_id=${encodeURIComponent(Ze)}`}const nt=new EventSource(rt);oe.current=nt,console.log(`🔄 SSE connecting with ${rt}`),i(Oe.current?"reconnecting":"connecting"),nt.onopen=()=>{Oe.current=!0,i("connected"),L&&console.log("📡️ SSE connection opened.")},nt.onmessage=ht=>{try{const ft=performance.now();if(ft-ve.current>te&&(ve.current=ft,G.current=0),G.current++,!ht.data||ht.data.trim()===""){L&&console.warn("Received empty SSE data, skipping");return}const vt=JSON.parse(ht.data);L&&console.log("[Inspectr] Received event:",vt),vt.operation_id?(vt.id=vt.operation_id,ce(vt.operation_id)):vt.id=vt.id||`req-${Math.random().toString(36).slice(2,11)}`,G.current<Ne?Br.upsertEvent(vt).catch(Qt=>console.error("Error saving event to DB:",Qt)):(ye.current.push(vt),G.current===Ne&&setTimeout(async()=>{try{await Br.bulkUpsertEvents(ye.current)}catch(Qt){console.error("bulk save failed",Qt)}finally{ye.current=[],G.current=0,ve.current=performance.now()}},te))}catch(ft){console.error("Error parsing SSE Inspectr data:",ft)}},nt.onerror=ht=>{if(console.error("❌ SSE connection error:",ht),i("reconnecting"),M.current){console.log("❌ Maximum re-registration attempts reached. Closing EventSource."),i("disconnected");try{nt.close()}catch{}return}console.log("🔄 Starting re-registration retry loop due to SSE error."),J()}},Ce=()=>{le(),i("disconnected"),console.log("📡️ SSE connection closed.")},Me="sync",Ye=()=>{L&&console.log("[Inspectr] Syncing all operations..."),ce(Me),ge(Me)};g.useEffect(()=>{if(!(!s||!b))return V(),ge(),()=>{Ce()}},[s,b]),g.useEffect(()=>{const $e=()=>{try{le()}catch{}};return window.addEventListener("beforeunload",$e),()=>window.removeEventListener("beforeunload",$e)},[]);const Ve={apiEndpoint:n,setApiEndpoint:o,connectionStatus:a,setConnectionStatus:i,sseEndpoint:s,ingressEndpoint:c,proxyEndpoint:U,setProxyEndpoint:$,channelCode:f,setChannelCode:m,channel:p,setChannel:h,token:b,reRegistrationFailedRef:M,userInitiatedRegistrationRef:me,handleRegister:q,attemptReRegistration:J,resetReRegistration:V,toast:C,setToast:N,debugMode:L,client:z,lastEventId:X,setLastEventId:ce,connect:ge,disconnect:Ce,syncOperations:Ye,eventSource:oe.current};return u.jsx(VT.Provider,{value:Ve,children:e})};function Qo(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),r===!1||!n.defaultPrevented)return t?.(n)}}function _S(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function GT(...e){return t=>{let r=!1;const n=e.map(o=>{const a=_S(o,t);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let o=0;o<n.length;o++){const a=n[o];typeof a=="function"?a():_S(e[o],null)}}}}function bs(...e){return g.useCallback(GT(...e),e)}function YT(e,t=[]){let r=[];function n(a,i){const s=g.createContext(i),l=r.length;r=[...r,i];const c=f=>{var m;const{scope:p,children:h,...b}=f,v=((m=p?.[e])==null?void 0:m[l])||s,x=g.useMemo(()=>b,Object.values(b));return u.jsx(v.Provider,{value:x,children:h})};c.displayName=a+"Provider";function d(f,m){var p;const h=((p=m?.[e])==null?void 0:p[l])||s,b=g.useContext(h);if(b)return b;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${a}\``)}return[c,d]}const o=()=>{const a=r.map(i=>g.createContext(i));return function(i){const s=i?.[e]||a;return g.useMemo(()=>({[`__scope${e}`]:{...i,[e]:s}}),[i,s])}};return o.scopeName=e,[n,A$(o,...t)]}function A$(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(o){const a=n.reduce((i,{useScope:s,scopeName:l})=>{const c=s(o)[`__scope${l}`];return{...i,...c}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function T$(e){const t=M$(e),r=g.forwardRef((n,o)=>{const{children:a,...i}=n,s=g.Children.toArray(a),l=s.find(I$);if(l){const c=l.props.children,d=s.map(f=>f===l?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:f);return u.jsx(t,{...i,ref:o,children:g.isValidElement(c)?g.cloneElement(c,void 0,d):null})}return u.jsx(t,{...i,ref:o,children:a})});return r.displayName=`${e}.Slot`,r}function M$(e){const t=g.forwardRef((r,n)=>{const{children:o,...a}=r;if(g.isValidElement(o)){const i=L$(o),s=D$(a,o.props);return o.type!==g.Fragment&&(s.ref=n?GT(n,i):i),g.cloneElement(o,s)}return g.Children.count(o)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var XT=Symbol("radix.slottable");function _$(e){const t=({children:r})=>u.jsx(u.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=XT,t}function I$(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===XT}function D$(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...i)=>{const s=a(...i);return o(...i),s}:o&&(r[n]=o):n==="style"?r[n]={...o,...a}:n==="className"&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}function L$(e){var t,r;let n=(t=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:t.get,o=n&&"isReactWarning"in n&&n.isReactWarning;return o?e.ref:(n=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,o=n&&"isReactWarning"in n&&n.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var R$=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],hi=R$.reduce((e,t)=>{const r=T$(`Primitive.${t}`),n=g.forwardRef((o,a)=>{const{asChild:i,...s}=o,l=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(l,{...s,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function F$(e,t){e&&Ht.flushSync(()=>e.dispatchEvent(t))}function Tm(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function $$(e,t=globalThis?.document){const r=Tm(e);g.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var B$="DismissableLayer",T0="dismissableLayer.update",z$="dismissableLayer.pointerDownOutside",H$="dismissableLayer.focusOutside",IS,ZT=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),JT=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:i,onDismiss:s,...l}=e,c=g.useContext(ZT),[d,f]=g.useState(null),m=d?.ownerDocument??globalThis?.document,[,p]=g.useState({}),h=bs(t,N=>f(N)),b=Array.from(c.layers),[v]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),x=b.indexOf(v),k=d?b.indexOf(d):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,j=k>=x,O=U$(N=>{const T=N.target,M=[...c.branches].some(I=>I.contains(T));!j||M||(o?.(N),i?.(N),N.defaultPrevented||s==null||s())},m),C=K$(N=>{const T=N.target;[...c.branches].some(M=>M.contains(T))||(a?.(N),i?.(N),N.defaultPrevented||s==null||s())},m);return $$(N=>{k===c.layers.size-1&&(n?.(N),!N.defaultPrevented&&s&&(N.preventDefault(),s()))},m),g.useEffect(()=>{if(d)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(IS=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),DS(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=IS)}},[d,m,r,c]),g.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),DS())},[d,c]),g.useEffect(()=>{const N=()=>p({});return document.addEventListener(T0,N),()=>document.removeEventListener(T0,N)},[]),u.jsx(hi.div,{...l,ref:h,style:{pointerEvents:S?j?"auto":"none":void 0,...e.style},onFocusCapture:Qo(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Qo(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Qo(e.onPointerDownCapture,O.onPointerDownCapture)})});JT.displayName=B$;var q$="DismissableLayerBranch",W$=g.forwardRef((e,t)=>{const r=g.useContext(ZT),n=g.useRef(null),o=bs(t,n);return g.useEffect(()=>{const a=n.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),u.jsx(hi.div,{...e,ref:o})});W$.displayName=q$;function U$(e,t=globalThis?.document){const r=Tm(e),n=g.useRef(!1),o=g.useRef(()=>{});return g.useEffect(()=>{const a=s=>{if(s.target&&!n.current){let l=function(){QT(z$,r,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function K$(e,t=globalThis?.document){const r=Tm(e),n=g.useRef(!1);return g.useEffect(()=>{const o=a=>{a.target&&!n.current&&QT(H$,r,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function DS(){const e=new CustomEvent(T0);document.dispatchEvent(e)}function QT(e,t,r,{discrete:n}){const o=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?F$(o,a):o.dispatchEvent(a)}var ai=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},V$=il[" useId ".trim().toString()]||(()=>{}),G$=0;function Y$(e){const[t,r]=g.useState(V$());return ai(()=>{r(n=>n??String(G$++))},[e]),t?`radix-${t}`:""}var X$="Arrow",e6=g.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...a}=e;return u.jsx(hi.svg,{...a,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});e6.displayName=X$;var Z$=e6;function J$(e){const[t,r]=g.useState(void 0);return ai(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let i,s;if("borderBoxSize"in a){const l=a.borderBoxSize,c=Array.isArray(l)?l[0]:l;i=c.inlineSize,s=c.blockSize}else i=e.offsetWidth,s=e.offsetHeight;r({width:i,height:s})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var e2="Popper",[t6,r6]=YT(e2),[Q$,n6]=t6(e2),o6=e=>{const{__scopePopper:t,children:r}=e,[n,o]=g.useState(null);return u.jsx(Q$,{scope:t,anchor:n,onAnchorChange:o,children:r})};o6.displayName=e2;var a6="PopperAnchor",i6=g.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,a=n6(a6,r),i=g.useRef(null),s=bs(t,i),l=g.useRef(null);return g.useEffect(()=>{const c=l.current;l.current=n?.current||i.current,c!==l.current&&a.onAnchorChange(l.current)}),n?null:u.jsx(hi.div,{...o,ref:s})});i6.displayName=a6;var t2="PopperContent",[eB,tB]=t6(t2),s6=g.forwardRef((e,t)=>{var r,n,o,a,i,s;const{__scopePopper:l,side:c="bottom",sideOffset:d=0,align:f="center",alignOffset:m=0,arrowPadding:p=0,avoidCollisions:h=!0,collisionBoundary:b=[],collisionPadding:v=0,sticky:x="partial",hideWhenDetached:k=!1,updatePositionStrategy:S="optimized",onPlaced:j,...O}=e,C=n6(t2,l),[N,T]=g.useState(null),M=bs(t,ye=>T(ye)),[I,_]=g.useState(null),R=J$(I),L=R?.width??0,F=R?.height??0,B=c+(f!=="center"?"-"+f:""),U=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},$=Array.isArray(b)?b:[b],z=$.length>0,W={padding:U,boundary:$.filter(nB),altBoundary:z},{refs:K,floatingStyles:q,placement:J,isPositioned:V,middlewareData:me}=ST({strategy:"fixed",placement:B,whileElementsMounted:(...ye)=>Nm(...ye,{animationFrame:S==="always"}),elements:{reference:C.anchor},middleware:[Uk({mainAxis:d+F,alignmentAxis:m}),h&&NT({mainAxis:!0,crossAxis:!1,limiter:x==="partial"?RR():void 0,...W}),h&&OT({...W}),CT({...W,apply:({elements:ye,rects:le,availableWidth:ge,availableHeight:Ce})=>{const{width:Me,height:Ye}=le.reference,Ve=ye.floating.style;Ve.setProperty("--radix-popper-available-width",`${ge}px`),Ve.setProperty("--radix-popper-available-height",`${Ce}px`),Ve.setProperty("--radix-popper-anchor-width",`${Me}px`),Ve.setProperty("--radix-popper-anchor-height",`${Ye}px`)}}),I&&$R({element:I,padding:p}),oB({arrowWidth:L,arrowHeight:F}),k&&FR({strategy:"referenceHidden",...W})]}),[X,ce]=c6(J),oe=Tm(j);ai(()=>{V&&oe?.()},[V,oe]);const Oe=(r=me.arrow)==null?void 0:r.x,te=(n=me.arrow)==null?void 0:n.y,Ne=((o=me.arrow)==null?void 0:o.centerOffset)!==0,[ve,G]=g.useState();return ai(()=>{N&&G(window.getComputedStyle(N).zIndex)},[N]),u.jsx("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:V?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[(a=me.transformOrigin)==null?void 0:a.x,(i=me.transformOrigin)==null?void 0:i.y].join(" "),...((s=me.hide)==null?void 0:s.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(eB,{scope:l,placedSide:X,onArrowChange:_,arrowX:Oe,arrowY:te,shouldHideArrow:Ne,children:u.jsx(hi.div,{"data-side":X,"data-align":ce,...O,ref:M,style:{...O.style,animation:V?void 0:"none"}})})})});s6.displayName=t2;var l6="PopperArrow",rB={top:"bottom",right:"left",bottom:"top",left:"right"},u6=g.forwardRef(function(e,t){const{__scopePopper:r,...n}=e,o=tB(l6,r),a=rB[o.placedSide];return u.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:u.jsx(Z$,{...n,ref:t,style:{...n.style,display:"block"}})})});u6.displayName=l6;function nB(e){return e!==null}var oB=e=>({name:"transformOrigin",options:e,fn(t){var r,n,o;const{placement:a,rects:i,middlewareData:s}=t,l=((r=s.arrow)==null?void 0:r.centerOffset)!==0,c=l?0:e.arrowWidth,d=l?0:e.arrowHeight,[f,m]=c6(a),p={start:"0%",center:"50%",end:"100%"}[m],h=(((n=s.arrow)==null?void 0:n.x)??0)+c/2,b=(((o=s.arrow)==null?void 0:o.y)??0)+d/2;let v="",x="";return f==="bottom"?(v=l?p:`${h}px`,x=`${-d}px`):f==="top"?(v=l?p:`${h}px`,x=`${i.floating.height+d}px`):f==="right"?(v=`${-d}px`,x=l?p:`${b}px`):f==="left"&&(v=`${i.floating.width+d}px`,x=l?p:`${b}px`),{data:{x:v,y:x}}}});function c6(e){const[t,r="center"]=e.split("-");return[t,r]}var aB=o6,iB=i6,sB=s6,lB=u6,uB="Portal",d6=g.forwardRef((e,t)=>{var r;const{container:n,...o}=e,[a,i]=g.useState(!1);ai(()=>i(!0),[]);const s=n||a&&((r=globalThis?.document)==null?void 0:r.body);return s?DI.createPortal(u.jsx(hi.div,{...o,ref:t}),s):null});d6.displayName=uB;function cB(e,t){return g.useReducer((r,n)=>t[r][n]??r,e)}var r2=e=>{const{present:t,children:r}=e,n=dB(t),o=typeof r=="function"?r({present:n.isPresent}):g.Children.only(r),a=bs(n.ref,fB(o));return typeof r=="function"||n.isPresent?g.cloneElement(o,{ref:a}):null};r2.displayName="Presence";function dB(e){const[t,r]=g.useState(),n=g.useRef(null),o=g.useRef(e),a=g.useRef("none"),i=e?"mounted":"unmounted",[s,l]=cB(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const c=df(n.current);a.current=s==="mounted"?c:"none"},[s]),ai(()=>{const c=n.current,d=o.current;if(d!==e){const f=a.current,m=df(c);e?l("MOUNT"):m==="none"||c?.display==="none"?l("UNMOUNT"):l(d&&f!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),ai(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,f=p=>{const h=df(n.current).includes(CSS.escape(p.animationName));if(p.target===t&&h&&(l("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},m=p=>{p.target===t&&(a.current=df(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:g.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function df(e){return e?.animationName||"none"}function fB(e){var t,r;let n=(t=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:t.get,o=n&&"isReactWarning"in n&&n.isReactWarning;return o?e.ref:(n=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,o=n&&"isReactWarning"in n&&n.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var pB=il[" useInsertionEffect ".trim().toString()]||ai;function mB({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,a,i]=hB({defaultProp:t,onChange:r}),s=e!==void 0,l=s?e:o;{const d=g.useRef(e!==void 0);g.useEffect(()=>{const f=d.current;f!==s&&console.warn(`${n} is changing from ${f?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=s},[s,n])}const c=g.useCallback(d=>{var f;if(s){const m=gB(d)?d(e):d;m!==e&&((f=i.current)==null||f.call(i,m))}else a(d)},[s,e,a,i]);return[l,c]}function hB({defaultProp:e,onChange:t}){const[r,n]=g.useState(e),o=g.useRef(r),a=g.useRef(t);return pB(()=>{a.current=t},[t]),g.useEffect(()=>{var i;o.current!==r&&((i=a.current)==null||i.call(a,r),o.current=r)},[r,o]),[r,n,a]}function gB(e){return typeof e=="function"}var bB=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),vB="VisuallyHidden",f6=g.forwardRef((e,t)=>u.jsx(hi.span,{...e,ref:t,style:{...bB,...e.style}}));f6.displayName=vB;var yB=f6,[Mm,dye]=YT("Tooltip",[r6]),_m=r6(),p6="TooltipProvider",xB=700,M0="tooltip.open",[wB,n2]=Mm(p6),m6=e=>{const{__scopeTooltip:t,delayDuration:r=xB,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:a}=e,i=g.useRef(!0),s=g.useRef(!1),l=g.useRef(0);return g.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),u.jsx(wB,{scope:t,isOpenDelayedRef:i,delayDuration:r,onOpen:g.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:g.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,n)},[n]),isPointerInTransitRef:s,onPointerInTransitChange:g.useCallback(c=>{s.current=c},[]),disableHoverableContent:o,children:a})};m6.displayName=p6;var bc="Tooltip",[kB,pd]=Mm(bc),h6=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:a,disableHoverableContent:i,delayDuration:s}=e,l=n2(bc,e.__scopeTooltip),c=_m(t),[d,f]=g.useState(null),m=Y$(),p=g.useRef(0),h=i??l.disableHoverableContent,b=s??l.delayDuration,v=g.useRef(!1),[x,k]=mB({prop:n,defaultProp:o??!1,onChange:N=>{N?(l.onOpen(),document.dispatchEvent(new CustomEvent(M0))):l.onClose(),a?.(N)},caller:bc}),S=g.useMemo(()=>x?v.current?"delayed-open":"instant-open":"closed",[x]),j=g.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v.current=!1,k(!0)},[k]),O=g.useCallback(()=>{window.clearTimeout(p.current),p.current=0,k(!1)},[k]),C=g.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{v.current=!0,k(!0),p.current=0},b)},[b,k]);return g.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),u.jsx(aB,{...c,children:u.jsx(kB,{scope:t,contentId:m,open:x,stateAttribute:S,trigger:d,onTriggerChange:f,onTriggerEnter:g.useCallback(()=>{l.isOpenDelayedRef.current?C():j()},[l.isOpenDelayedRef,C,j]),onTriggerLeave:g.useCallback(()=>{h?O():(window.clearTimeout(p.current),p.current=0)},[O,h]),onOpen:j,onClose:O,disableHoverableContent:h,children:r})})};h6.displayName=bc;var _0="TooltipTrigger",g6=g.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=pd(_0,r),a=n2(_0,r),i=_m(r),s=g.useRef(null),l=bs(t,s,o.onTriggerChange),c=g.useRef(!1),d=g.useRef(!1),f=g.useCallback(()=>c.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),u.jsx(iB,{asChild:!0,...i,children:u.jsx(hi.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:l,onPointerMove:Qo(e.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:Qo(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:Qo(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Qo(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:Qo(e.onBlur,o.onClose),onClick:Qo(e.onClick,o.onClose)})})});g6.displayName=_0;var o2="TooltipPortal",[jB,EB]=Mm(o2,{forceMount:void 0}),b6=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,a=pd(o2,t);return u.jsx(jB,{scope:t,forceMount:r,children:u.jsx(r2,{present:r||a.open,children:u.jsx(d6,{asChild:!0,container:o,children:n})})})};b6.displayName=o2;var ml="TooltipContent",v6=g.forwardRef((e,t)=>{const r=EB(ml,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...a}=e,i=pd(ml,e.__scopeTooltip);return u.jsx(r2,{present:n||i.open,children:i.disableHoverableContent?u.jsx(y6,{side:o,...a,ref:t}):u.jsx(SB,{side:o,...a,ref:t})})}),SB=g.forwardRef((e,t)=>{const r=pd(ml,e.__scopeTooltip),n=n2(ml,e.__scopeTooltip),o=g.useRef(null),a=bs(t,o),[i,s]=g.useState(null),{trigger:l,onClose:c}=r,d=o.current,{onPointerInTransitChange:f}=n,m=g.useCallback(()=>{s(null),f(!1)},[f]),p=g.useCallback((h,b)=>{const v=h.currentTarget,x={x:h.clientX,y:h.clientY},k=PB(x,v.getBoundingClientRect()),S=AB(x,k),j=TB(b.getBoundingClientRect()),O=_B([...S,...j]);s(O),f(!0)},[f]);return g.useEffect(()=>()=>m(),[m]),g.useEffect(()=>{if(l&&d){const h=v=>p(v,d),b=v=>p(v,l);return l.addEventListener("pointerleave",h),d.addEventListener("pointerleave",b),()=>{l.removeEventListener("pointerleave",h),d.removeEventListener("pointerleave",b)}}},[l,d,p,m]),g.useEffect(()=>{if(i){const h=b=>{const v=b.target,x={x:b.clientX,y:b.clientY},k=l?.contains(v)||d?.contains(v),S=!MB(x,i);k?m():S&&(m(),c())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[l,d,i,c,m]),u.jsx(y6,{...e,ref:a})}),[NB,OB]=Mm(bc,{isInside:!1}),CB=_$("TooltipContent"),y6=g.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:i,...s}=e,l=pd(ml,r),c=_m(r),{onClose:d}=l;return g.useEffect(()=>(document.addEventListener(M0,d),()=>document.removeEventListener(M0,d)),[d]),g.useEffect(()=>{if(l.trigger){const f=m=>{const p=m.target;p!=null&&p.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),u.jsx(JT,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:u.jsxs(sB,{"data-state":l.stateAttribute,...c,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[u.jsx(CB,{children:n}),u.jsx(NB,{scope:r,isInside:!0,children:u.jsx(yB,{id:l.contentId,role:"tooltip",children:o||n})})]})})});v6.displayName=ml;var x6="TooltipArrow",w6=g.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=_m(r);return OB(x6,r).isInside?null:u.jsx(lB,{...o,...n,ref:t})});w6.displayName=x6;function PB(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(r,n,o,a)){case a:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function AB(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function TB(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function MB(e,t){const{x:r,y:n}=e;let o=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){const s=t[a],l=t[i],c=s.x,d=s.y,f=l.x,m=l.y;d>n!=m>n&&r<(f-c)*(n-d)/(m-d)+c&&(o=!o)}return o}function _B(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),IB(t)}function IB(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const a=t[t.length-1],i=t[t.length-2];if((a.x-i.x)*(o.y-i.y)>=(a.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const a=r[r.length-1],i=r[r.length-2];if((a.x-i.x)*(o.y-i.y)>=(a.y-i.y)*(o.x-i.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var DB=m6,LB=h6,RB=g6,FB=b6,$B=v6,BB=w6;function ii(...e){return e.filter(Boolean).join(" ")}const Im=y.forwardRef(({children:e,className:t,content:r,delayDuration:n,defaultOpen:o,open:a,onClick:i,onOpenChange:s,showArrow:l=!0,side:c,sideOffset:d=10,asChild:f,...m},p)=>u.jsx(DB,{delayDuration:150,children:u.jsxs(LB,{open:a,defaultOpen:o,onOpenChange:s,delayDuration:n,"tremor-id":"tremor-raw",children:[u.jsx(RB,{onClick:i,asChild:f,children:e}),u.jsx(FB,{children:u.jsxs($B,{ref:p,side:c,sideOffset:d,align:"center",className:ii("max-w-60 select-none rounded-md px-2.5 py-1.5 text-sm leading-5 shadow-md","text-gray-50 dark:text-gray-900","bg-gray-900 dark:bg-gray-50","will-change-[transform,opacity]","data-[side=bottom]:animate-slide-down-and-fade data-[side=left]:animate-slide-left-and-fade data-[side=right]:animate-slide-right-and-fade data-[side=top]:animate-slide-up-and-fade data-[state=closed]:animate-hide",t),...m,children:[r,l&&u.jsx(BB,{className:"border-none fill-gray-900 dark:fill-gray-50",width:12,height:7,"aria-hidden":"true"})]})})]})}));Im.displayName="Tooltip";function zB({operation:e,onClick:t}){var r,n,o;const a=((n=(r=e?.meta)==null?void 0:r.inspectr)==null?void 0:n.guard)||{},i=((o=e?.request)==null?void 0:o.headers)||[],s=({children:c})=>u.jsxs("span",{onClick:t,className:"py-1 px-1.5 inline-flex items-center gap-x-1 text-xs font-medium bg-blue-100 text-blue-800 rounded-md dark:bg-blue-500/10 dark:text-blue-500 cursor-pointer select-none hover:ring-1 ring-blue-300",children:[u.jsxs("svg",{className:"shrink-0 h-3 w-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[u.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),u.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),c]});if(a["inspectr-auth-token"])return u.jsx(s,{children:"Guard Token"});if(a["inspectr-auth-key"])return u.jsx(s,{children:"Guard Key"});if(i.find(c=>{const d=c?.name;return d?d.toLowerCase().replace(/[^a-z]/g,"").includes("apikey"):!1}))return u.jsx(s,{children:"API Key"});const l=i.find(c=>c.name&&c.name.toLowerCase()==="authorization");if(l&&l.value){const c=l.value.toLowerCase();return c.startsWith("basic")?u.jsx(s,{children:"Basic Auth"}):c.startsWith("bearer")?u.jsx(s,{children:"Bearer"}):u.jsx(s,{children:"Auth"})}return null}function Dm({open:e,rule:t,isDeleting:r,error:n,onCancel:o,onConfirm:a,title:i,description:s,confirmLabel:l}){if(!e)return null;const c=i||"Delete rule?",d=s||u.jsxs(u.Fragment,{children:["This will permanently remove ",u.jsx("span",{className:"font-medium",children:t?.name||"this rule"}),". Actions triggered by this rule will no longer run."]}),f=l||"Delete Rule";return u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4 !mt-0",children:u.jsxs("div",{className:"w-full max-w-md rounded-lg border border-gray-200 bg-white p-6 shadow-xl dark:border-gray-800 dark:bg-gray-900",children:[u.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-50",children:c}),u.jsx("p",{className:"mt-2 text-sm text-gray-600 dark:text-gray-400",children:d}),n&&u.jsx("p",{className:"mt-3 text-sm text-red-600 dark:text-red-400",children:n}),u.jsxs("div",{className:"mt-6 flex justify-end gap-3",children:[u.jsx("button",{type:"button",onClick:o,className:"inline-flex items-center rounded-md border border-gray-300 px-3 py-2 text-sm font-medium text-gray-700 transition hover:bg-gray-100 dark:border-gray-700 dark:text-gray-200 dark:hover:bg-gray-800",disabled:r,children:"Cancel"}),u.jsx("button",{type:"button",onClick:a,disabled:r,className:"inline-flex items-center rounded-md border border-transparent bg-red-600 px-4 py-2 text-sm font-semibold text-white transition hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-300 disabled:cursor-not-allowed disabled:opacity-70 dark:bg-red-500 dark:hover:bg-red-400",children:r?"Deleting…":f})]})]})})}function cs({tag:e,showRemove:t=!1,onRemove:r,removeLabel:n="Remove tag"}){const o=typeof e=="string"?pl(e):e;if(!o)return null;const a=()=>{t&&r?.(o)},i=t?u.jsx("button",{type:"button",onClick:a,className:"inline-flex size-4 -mr-1.5 p-0.5 items-center justify-center rounded-full text-[11px] font-semibold text-red-700 transition hover:bg-red-50 focus:outline-none dark:text-red-300 dark:hover:bg-red-950","aria-label":`${n} ${o.display}`.trim(),title:`${n} ${o.display}`.trim(),children:u.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:u.jsx("path",{"fill-rule":"evenodd",d:`M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414
31
+ 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293
32
+ 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z`,"clip-rule":"evenodd"})})}):null;return o.type==="kv"?u.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-slate-100 pl-2.5 pr-2.5 py-1 text-xs text-slate-700 dark:bg-dark-tremor-background-subtle dark:text-dark-tremor-content",children:[u.jsxs("span",{className:"font-semibold uppercase tracking-wide text-[10px] text-slate-500 dark:text-dark-tremor-content",children:[o.key,":"]}),u.jsx("span",{className:"font-mono text-[11px] text-slate-700 dark:text-dark-tremor-content",children:o.value}),i]}):u.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-slate-100 pl-2.5 pr-2.5 py-1 font-mono text-[11px] font-medium text-slate-700 dark:bg-dark-tremor-background-subtle dark:text-dark-tremor-content",children:[o.display,i]})}const HB=({operation:e,setCurrentTab:t})=>{var r,n,o,a,i,s,l,c,d,f,m;const{client:p,setToast:h}=mr(),[b,v]=g.useState(!1),[x,k]=g.useState(!1),[S,j]=g.useState(!1),[O,C]=g.useState(!1),[N,T]=g.useState(!1),[M,I]=g.useState(()=>{var le;return((le=e?.meta)==null?void 0:le.tags)||[]});g.useEffect(()=>{var le;I(((le=e?.meta)==null?void 0:le.tags)||[])},[e?.id]);const[_,R]=g.useState(null),[L,F]=g.useState(!1),[B,U]=g.useState(""),$=()=>{if(!(e!=null&&e.request))return{headers:0,body:0,total:0};const le=e.request.headers_size||0,ge=e.request.body_size||0;return{headers:le,body:ge,total:le+ge}},z=()=>{if(!(e!=null&&e.response))return{headers:0,body:0,total:0};const le=e.response.headers_size||0,ge=e.response.body_size||0;return{headers:le,body:ge,total:le+ge}},W=$(),K=z(),q=Am(M),J=q.length>0,V=()=>{if(!(e!=null&&e.request))return;const{request:le}=e,{method:ge,url:Ce,headers:Me,body:Ye}=le;let Ve=`curl -X ${ge} '${Ce}'`;return Me&&Me.forEach($e=>{Ve+=` -H '${$e.name}: ${$e.value}'`}),Ye&&(Ve+=` --data '${Ye}'`),Ve},me=()=>{const le=V();navigator.clipboard.writeText(le).then(()=>{v(!0),setTimeout(()=>v(!1),2500)}).catch(ge=>{console.error("[Inspectr] Failed to copy cURL command:",ge),k(!0)})},X=()=>{navigator.clipboard.writeText(e.request.url).then(()=>{j(!0)}).catch(le=>{console.error("[Inspectr] Failed to copy URL:",le)})},ce=()=>{p.operations.replay(e).then(()=>{T(!0),setTimeout(()=>T(!1),2500)}).catch(le=>{console.error("[Inspectr] Failed to replay request:",le),C(!0)})},oe=le=>{R(le),U("")},Oe=()=>{R(null),U("")},te=async()=>{var le;if(!_)return;const ge=e?.id;if(!(p!=null&&p.operations)||!ge){U("Operation or client not available");return}try{F(!0),U(""),await p.operations.deleteOperationTags(ge,{tag:_.raw});const Ce=_.token||((le=pl(_.raw))==null?void 0:le.token);I(Me=>Array.isArray(Me)?Me.filter(Ye=>{const Ve=pl(Ye);return!Ve||Ve.token!==Ce}):[]),h?.({type:"success",message:`Tag "${_.display}" removed from this operation`}),R(null)}catch(Ce){console.error("Delete operation tag failed",Ce),U(Ce?.message||"Failed to delete tag"),h?.({type:"error",message:Ce?.message||"Failed to delete tag"})}finally{F(!1)}},Ne="flex items-center space-x-2 px-2 py-1 border border-slate-600 dark:border-blue-500 text-slate-700 dark:text-white bg-slate-100 dark:bg-blue-600 rounded focus:outline-none cursor-pointer transition-transform duration-150 ease-in-out active:scale-95 hover:bg-slate-200 dark:hover:bg-blue-700 active:ring active:ring-slate-300 dark:active:ring-blue-400",ve=()=>u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})}),G=()=>u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"h-4 w-4",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"})}),ye=()=>{var le,ge;const Ce=((ge=(le=e?.meta)==null?void 0:le.inspectr)==null?void 0:ge.guard)||{},Me=Ce["inspectr-auth-key"],Ye=Ce["inspectr-auth-token"];if(Me||Ye){typeof t=="function"&&t("meta"),setTimeout(()=>{window.dispatchEvent(new CustomEvent("inspectr:openMetaGuard",{detail:{name:Ye?"inspectr-auth-token":"inspectr-auth-key"}}))},150);return}typeof t=="function"?(t("request"),setTimeout(()=>{window.dispatchEvent(new CustomEvent("inspectr:openRequestHeaders"))},50)):window.dispatchEvent(new CustomEvent("inspectr:openRequestHeaders"))};return u.jsxs("div",{className:"mb-4 p-4 bg-white dark:bg-dark-tremor-background border border-gray-300 dark:border-dark-tremor-border rounded shadow dark:shadow-dark-tremor-shadow relative",children:[u.jsxs("div",{className:"flex items-center justify-between mb-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("h2",{className:"font-bold text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Request Details"}),u.jsx(zB,{operation:e,onClick:ye})]}),u.jsxs("div",{className:"flex space-x-2",children:[u.jsxs("button",{onClick:me,className:Ne,children:[b?u.jsx(ve,{}):u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"h-4 w-4",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m6.75 7.5 3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z"})}),u.jsx("span",{className:"text-xs",children:b?"Copied cURL":"Copy as cURL"})]}),u.jsxs("button",{onClick:ce,className:Ne,children:[N?u.jsx(ve,{}):u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"h-4 w-4",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"})}),u.jsx("span",{className:"text-xs",children:N?"Replayed":"Replay"})]})]})]}),u.jsxs("div",{className:"flex flex-col space-y-1",children:[u.jsxs("div",{className:"flex items-center space-x-2 font-mono text-lg",children:[u.jsx("span",{className:`font-bold ${ud((r=e?.request)==null?void 0:r.method)}`,children:(n=e?.request)==null?void 0:n.method}),u.jsx("span",{className:"text-blue-600 dark:text-blue-400",children:(o=e?.request)==null?void 0:o.path}),u.jsx("span",{className:`inline-flex px-3 py-1 text-xs font-semibold rounded-full ${ld((a=e?.response)==null?void 0:a.status)}`,children:(i=e?.response)==null?void 0:i.status}),u.jsx("span",{className:"text-sm dark:text-dark-tremor-content",children:(s=e?.response)==null?void 0:s.status_text})]}),u.jsxs("div",{className:"flex items-center text-gray-600 dark:text-dark-tremor-content",children:[u.jsx("span",{onClick:X,className:"cursor-pointer",children:(l=e?.request)==null?void 0:l.url}),u.jsx(cn,{textToCopy:e.request.url,showLabel:!1})]}),u.jsxs("div",{className:"text-gray-500 dark:text-dark-tremor-content text-xs",children:["Received on"," ",u.jsx("span",{className:"font-semibold",children:zi((c=e?.request)==null?void 0:c.timestamp)})," • Took ",u.jsx("span",{className:"font-semibold",children:ts((d=e?.timing)==null?void 0:d.duration)})," ","to respond •",u.jsxs(_g,{className:"relative inline-block",children:[u.jsxs("span",{className:"flex items-center pl-1",children:["size",u.jsx("span",{className:"font-semibold pl-1",children:Ci(K.total)}),u.jsx(_g.Button,{className:"cursor-pointer pl-1",children:u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"12",height:"12",children:u.jsx("path",{d:"M20 22H4C3.44772 22 3 21.5523 3 21V3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V21C21 21.5523 20.5523 22 20 22ZM19 20V4H5V20H19ZM8 7H16V9H8V7ZM8 11H16V13H8V11ZM8 15H16V17H8V15Z"})})})]}),u.jsx(_g.Panel,{className:"absolute z-10 mt-2 w-72 -translate-x-1/2 transform px-4 sm:px-0",children:u.jsxs("div",{className:"rounded-lg shadow-lg ring-1 ring-black ring-opacity-5 bg-white dark:bg-dark-tremor-background p-3",children:[u.jsx("div",{className:"text-sm font-semibold mb-2",children:"Request Size"}),u.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[u.jsx("div",{children:"Total:"}),u.jsx("div",{className:"font-mono text-right",children:Ci(W.total)}),u.jsx("div",{children:"Headers:"}),u.jsx("div",{className:"font-mono text-right",children:Ci(W.headers)}),u.jsx("div",{children:"Body:"}),u.jsx("div",{className:"font-mono text-right",children:Ci(W.body)})]}),u.jsx("div",{className:"text-sm font-semibold mt-3 mb-2",children:"Response Size"}),u.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[u.jsx("div",{children:"Total:"}),u.jsx("div",{className:"font-mono text-right",children:Ci(K.total)}),u.jsx("div",{children:"Headers:"}),u.jsx("div",{className:"font-mono text-right",children:Ci(K.headers)}),u.jsx("div",{children:"Body:"}),u.jsx("div",{className:"font-mono text-right",children:Ci(K.body)})]})]})})]}),((m=(f=e?.meta)==null?void 0:f.proxy)==null?void 0:m.url)&&u.jsxs(u.Fragment,{children:[u.jsx("span",{children:" • Proxy "}),u.jsx("div",{className:"relative inline-block align-middle",children:u.jsx(Im,{side:"right",content:e.meta.proxy.url,children:u.jsx(G,{className:"relative inline-block"})})})]})]})]}),J&&u.jsxs("div",{className:"mt-4",children:[u.jsx("p",{className:"text-xs font-semibold uppercase tracking-wide text-slate-500 dark:text-dark-tremor-content",children:"Tags"}),u.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:q.map(le=>u.jsx(cs,{tag:le,showRemove:!0,onRemove:()=>oe(le)},le.token||le.display))})]}),u.jsx(Dm,{open:!!_,isDeleting:L,error:B,onCancel:Oe,onConfirm:te,title:"Remove tag from this operation?",description:_?u.jsxs(u.Fragment,{children:["This will remove the tag ",u.jsx("span",{className:"font-semibold",children:_.display})," ","from this operation. This action cannot be undone."]}):"",confirmLabel:"Remove Tag"}),x&&u.jsx(Df,{message:"Failed to copy cURL command!",subMessage:"Please try again.",onClose:()=>k(!1),type:"error"}),S&&u.jsx(Df,{message:"URL copied!",subMessage:"The request URL has been copied to your clipboard.",onClose:()=>j(!1)}),O&&u.jsx(Df,{message:"Replay failed!",subMessage:"Failed to replay the request. Please try again.",onClose:()=>C(!1),type:"error"})]})};function qB(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function LS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function RS(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?LS(Object(r),!0).forEach(function(n){qB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):LS(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function WB(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,a;for(a=0;a<n.length;a++)o=n[a],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function UB(e,t){if(e==null)return{};var r=WB(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function KB(e,t){return VB(e)||GB(e,t)||YB(e,t)||XB()}function VB(e){if(Array.isArray(e))return e}function GB(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,o=!1,a=void 0;try{for(var i=e[Symbol.iterator](),s;!(n=(s=i.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(l){o=!0,a=l}finally{try{!n&&i.return!=null&&i.return()}finally{if(o)throw a}}return r}}function YB(e,t){if(e){if(typeof e=="string")return FS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return FS(e,t)}}function FS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function XB(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
33
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ZB(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $S(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function BS(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$S(Object(r),!0).forEach(function(n){ZB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$S(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function JB(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){return t.reduceRight(function(o,a){return a(o)},n)}}function Xu(e){return function t(){for(var r=this,n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return o.length>=e.length?e.apply(this,o):function(){for(var i=arguments.length,s=new Array(i),l=0;l<i;l++)s[l]=arguments[l];return t.apply(r,[].concat(o,s))}}}function ep(e){return{}.toString.call(e).includes("Object")}function QB(e){return!Object.keys(e).length}function vc(e){return typeof e=="function"}function ez(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function tz(e,t){return ep(t)||Qa("changeType"),Object.keys(t).some(function(r){return!ez(e,r)})&&Qa("changeField"),t}function rz(e){vc(e)||Qa("selectorType")}function nz(e){vc(e)||ep(e)||Qa("handlerType"),ep(e)&&Object.values(e).some(function(t){return!vc(t)})&&Qa("handlersType")}function oz(e){e||Qa("initialIsRequired"),ep(e)||Qa("initialType"),QB(e)&&Qa("initialContent")}function az(e,t){throw new Error(e[t]||e.default)}var iz={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Qa=Xu(az)(iz),ff={changes:tz,selector:rz,handler:nz,initial:oz};function sz(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ff.initial(e),ff.handler(t);var r={current:e},n=Xu(cz)(r,t),o=Xu(uz)(r),a=Xu(ff.changes)(e),i=Xu(lz)(r);function s(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(d){return d};return ff.selector(c),c(r.current)}function l(c){JB(n,o,a,i)(c)}return[s,l]}function lz(e,t){return vc(t)?t(e.current):t}function uz(e,t){return e.current=BS(BS({},e.current),t),t}function cz(e,t,r){return vc(t)?t(e.current):Object.keys(r).forEach(function(n){var o;return(o=t[n])===null||o===void 0?void 0:o.call(t,e.current[n])}),r}var dz={create:sz},fz={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs"}};function pz(e){return function t(){for(var r=this,n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return o.length>=e.length?e.apply(this,o):function(){for(var i=arguments.length,s=new Array(i),l=0;l<i;l++)s[l]=arguments[l];return t.apply(r,[].concat(o,s))}}}function mz(e){return{}.toString.call(e).includes("Object")}function hz(e){return e||zS("configIsRequired"),mz(e)||zS("configType"),e.urls?(gz(),{paths:{vs:e.urls.monacoBase}}):e}function gz(){console.warn(k6.deprecation)}function bz(e,t){throw new Error(e[t]||e.default)}var k6={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
34
+ You are using deprecated way of configuration.
35
+
36
+ Instead of using
37
+ monaco.config({ urls: { monacoBase: '...' } })
38
+ use
39
+ monaco.config({ paths: { vs: '...' } })
40
+
41
+ For more please check the link https://github.com/suren-atoyan/monaco-loader#config
42
+ `},zS=pz(bz)(k6),vz={config:hz},yz=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){return t.reduceRight(function(o,a){return a(o)},n)}};function j6(e,t){return Object.keys(t).forEach(function(r){t[r]instanceof Object&&e[r]&&Object.assign(t[r],j6(e[r],t[r]))}),RS(RS({},e),t)}var xz={type:"cancelation",msg:"operation is manually canceled"};function Ig(e){var t=!1,r=new Promise(function(n,o){e.then(function(a){return t?o(xz):n(a)}),e.catch(o)});return r.cancel=function(){return t=!0},r}var wz=dz.create({config:fz,isInitialized:!1,resolve:null,reject:null,monaco:null}),E6=KB(wz,2),md=E6[0],Lm=E6[1];function kz(e){var t=vz.config(e),r=t.monaco,n=UB(t,["monaco"]);Lm(function(o){return{config:j6(o.config,n),monaco:r}})}function jz(){var e=md(function(t){var r=t.monaco,n=t.isInitialized,o=t.resolve;return{monaco:r,isInitialized:n,resolve:o}});if(!e.isInitialized){if(Lm({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),Ig(Dg);if(window.monaco&&window.monaco.editor)return S6(window.monaco),e.resolve(window.monaco),Ig(Dg);yz(Ez,Nz)(Oz)}return Ig(Dg)}function Ez(e){return document.body.appendChild(e)}function Sz(e){var t=document.createElement("script");return e&&(t.src=e),t}function Nz(e){var t=md(function(n){var o=n.config,a=n.reject;return{config:o,reject:a}}),r=Sz("".concat(t.config.paths.vs,"/loader.js"));return r.onload=function(){return e()},r.onerror=t.reject,r}function Oz(){var e=md(function(r){var n=r.config,o=r.resolve,a=r.reject;return{config:n,resolve:o,reject:a}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(r){S6(r),e.resolve(r)},function(r){e.reject(r)})}function S6(e){md().monaco||Lm({monaco:e})}function Cz(){return md(function(e){var t=e.monaco;return t})}var Dg=new Promise(function(e,t){return Lm({resolve:e,reject:t})}),N6={config:kz,init:jz,__getMonacoInstance:Cz},Pz={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Lg=Pz,Az={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Tz=Az;function Mz({children:e}){return y.createElement("div",{style:Tz.container},e)}var _z=Mz,Iz=_z;function Dz({width:e,height:t,isEditorReady:r,loading:n,_ref:o,className:a,wrapperProps:i}){return y.createElement("section",{style:{...Lg.wrapper,width:e,height:t},...i},!r&&y.createElement(Iz,null,n),y.createElement("div",{ref:o,style:{...Lg.fullWidth,...!r&&Lg.hide},className:a}))}var Lz=Dz,O6=g.memo(Lz);function Rz(e){g.useEffect(e,[])}var C6=Rz;function Fz(e,t,r=!0){let n=g.useRef(!0);g.useEffect(n.current||!r?()=>{n.current=!1}:e,t)}var wn=Fz;function oc(){}function qs(e,t,r,n){return $z(e,n)||Bz(e,t,r,n)}function $z(e,t){return e.editor.getModel(P6(e,t))}function Bz(e,t,r,n){return e.editor.createModel(t,r,n?P6(e,n):void 0)}function P6(e,t){return e.Uri.parse(t)}function zz({original:e,modified:t,language:r,originalLanguage:n,modifiedLanguage:o,originalModelPath:a,modifiedModelPath:i,keepCurrentOriginalModel:s=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:d="Loading...",options:f={},height:m="100%",width:p="100%",className:h,wrapperProps:b={},beforeMount:v=oc,onMount:x=oc}){let[k,S]=g.useState(!1),[j,O]=g.useState(!0),C=g.useRef(null),N=g.useRef(null),T=g.useRef(null),M=g.useRef(x),I=g.useRef(v),_=g.useRef(!1);C6(()=>{let B=N6.init();return B.then(U=>(N.current=U)&&O(!1)).catch(U=>U?.type!=="cancelation"&&console.error("Monaco initialization: error:",U)),()=>C.current?F():B.cancel()}),wn(()=>{if(C.current&&N.current){let B=C.current.getOriginalEditor(),U=qs(N.current,e||"",n||r||"text",a||"");U!==B.getModel()&&B.setModel(U)}},[a],k),wn(()=>{if(C.current&&N.current){let B=C.current.getModifiedEditor(),U=qs(N.current,t||"",o||r||"text",i||"");U!==B.getModel()&&B.setModel(U)}},[i],k),wn(()=>{let B=C.current.getModifiedEditor();B.getOption(N.current.editor.EditorOption.readOnly)?B.setValue(t||""):t!==B.getValue()&&(B.executeEdits("",[{range:B.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),B.pushUndoStop())},[t],k),wn(()=>{var B,U;(U=(B=C.current)==null?void 0:B.getModel())==null||U.original.setValue(e||"")},[e],k),wn(()=>{let{original:B,modified:U}=C.current.getModel();N.current.editor.setModelLanguage(B,n||r||"text"),N.current.editor.setModelLanguage(U,o||r||"text")},[r,n,o],k),wn(()=>{var B;(B=N.current)==null||B.editor.setTheme(c)},[c],k),wn(()=>{var B;(B=C.current)==null||B.updateOptions(f)},[f],k);let R=g.useCallback(()=>{var B;if(!N.current)return;I.current(N.current);let U=qs(N.current,e||"",n||r||"text",a||""),$=qs(N.current,t||"",o||r||"text",i||"");(B=C.current)==null||B.setModel({original:U,modified:$})},[r,t,o,e,n,a,i]),L=g.useCallback(()=>{var B;!_.current&&T.current&&(C.current=N.current.editor.createDiffEditor(T.current,{automaticLayout:!0,...f}),R(),(B=N.current)==null||B.editor.setTheme(c),S(!0),_.current=!0)},[f,c,R]);g.useEffect(()=>{k&&M.current(C.current,N.current)},[k]),g.useEffect(()=>{!j&&!k&&L()},[j,k,L]);function F(){var B,U,$,z;let W=(B=C.current)==null?void 0:B.getModel();s||(U=W?.original)==null||U.dispose(),l||($=W?.modified)==null||$.dispose(),(z=C.current)==null||z.dispose()}return y.createElement(O6,{width:p,height:m,isEditorReady:k,loading:d,_ref:T,className:h,wrapperProps:b})}var Hz=zz;g.memo(Hz);function qz(e){let t=g.useRef();return g.useEffect(()=>{t.current=e},[e]),t.current}var Wz=qz,pf=new Map;function Uz({defaultValue:e,defaultLanguage:t,defaultPath:r,value:n,language:o,path:a,theme:i="light",line:s,loading:l="Loading...",options:c={},overrideServices:d={},saveViewState:f=!0,keepCurrentModel:m=!1,width:p="100%",height:h="100%",className:b,wrapperProps:v={},beforeMount:x=oc,onMount:k=oc,onChange:S,onValidate:j=oc}){let[O,C]=g.useState(!1),[N,T]=g.useState(!0),M=g.useRef(null),I=g.useRef(null),_=g.useRef(null),R=g.useRef(k),L=g.useRef(x),F=g.useRef(),B=g.useRef(n),U=Wz(a),$=g.useRef(!1),z=g.useRef(!1);C6(()=>{let q=N6.init();return q.then(J=>(M.current=J)&&T(!1)).catch(J=>J?.type!=="cancelation"&&console.error("Monaco initialization: error:",J)),()=>I.current?K():q.cancel()}),wn(()=>{var q,J,V,me;let X=qs(M.current,e||n||"",t||o||"",a||r||"");X!==((q=I.current)==null?void 0:q.getModel())&&(f&&pf.set(U,(J=I.current)==null?void 0:J.saveViewState()),(V=I.current)==null||V.setModel(X),f&&((me=I.current)==null||me.restoreViewState(pf.get(a))))},[a],O),wn(()=>{var q;(q=I.current)==null||q.updateOptions(c)},[c],O),wn(()=>{!I.current||n===void 0||(I.current.getOption(M.current.editor.EditorOption.readOnly)?I.current.setValue(n):n!==I.current.getValue()&&(z.current=!0,I.current.executeEdits("",[{range:I.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),I.current.pushUndoStop(),z.current=!1))},[n],O),wn(()=>{var q,J;let V=(q=I.current)==null?void 0:q.getModel();V&&o&&((J=M.current)==null||J.editor.setModelLanguage(V,o))},[o],O),wn(()=>{var q;s!==void 0&&((q=I.current)==null||q.revealLine(s))},[s],O),wn(()=>{var q;(q=M.current)==null||q.editor.setTheme(i)},[i],O);let W=g.useCallback(()=>{var q;if(!(!_.current||!M.current)&&!$.current){L.current(M.current);let J=a||r,V=qs(M.current,n||e||"",t||o||"",J||"");I.current=(q=M.current)==null?void 0:q.editor.create(_.current,{model:V,automaticLayout:!0,...c},d),f&&I.current.restoreViewState(pf.get(J)),M.current.editor.setTheme(i),s!==void 0&&I.current.revealLine(s),C(!0),$.current=!0}},[e,t,r,n,o,a,c,d,f,i,s]);g.useEffect(()=>{O&&R.current(I.current,M.current)},[O]),g.useEffect(()=>{!N&&!O&&W()},[N,O,W]),B.current=n,g.useEffect(()=>{var q,J;O&&S&&((q=F.current)==null||q.dispose(),F.current=(J=I.current)==null?void 0:J.onDidChangeModelContent(V=>{z.current||S(I.current.getValue(),V)}))},[O,S]),g.useEffect(()=>{if(O){let q=M.current.editor.onDidChangeMarkers(J=>{var V;let me=(V=I.current.getModel())==null?void 0:V.uri;if(me&&J.find(X=>X.path===me.path)){let X=M.current.editor.getModelMarkers({resource:me});j?.(X)}});return()=>{q?.dispose()}}return()=>{}},[O,j]);function K(){var q,J;(q=F.current)==null||q.dispose(),m?f&&pf.set(a,I.current.saveViewState()):(J=I.current.getModel())==null||J.dispose(),I.current.dispose()}return y.createElement(O6,{width:p,height:h,isEditorReady:O,loading:l,_ref:_,className:b,wrapperProps:v})}var Kz=Uz,Vz=g.memo(Kz),tp=Vz;const Gz=({open:e,onClose:t,decoded:r})=>{var n,o,a;if(!e)return null;const i=JSON.stringify(r,null,2),s=l=>l?new Date(l*1e3).toLocaleString():"N/A";return u.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[u.jsx("div",{className:"absolute inset-0 bg-black opacity-50",onClick:t}),u.jsxs("div",{className:"relative bg-white rounded-lg shadow-xl max-w-lg w-full mx-4 p-6 z-10",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center",children:[u.jsx("div",{className:"flex-shrink-0 bg-blue-100 rounded-full p-2",children:u.jsxs("svg",{className:"w-6 h-6",viewBox:"0 0 48 48",children:[u.jsx("polygon",{fill:"#546e7a",points:"21.906,31.772 24.507,29.048 27.107,31.772 27.107,43 21.906,43"}),u.jsx("polygon",{fill:"#f50057",points:"17.737,29.058 21.442,28.383 21.945,32.115 15.345,41.199 11.138,38.141"}),u.jsx("polygon",{fill:"#d500f9",points:"15.962,24.409 19.355,26.041 17.569,29.356 6.89,32.825 5.283,27.879"}),u.jsx("polygon",{fill:"#29b6f6",points:"17.256,19.607 19.042,22.922 15.649,24.554 4.97,21.084 6.577,16.137"}),u.jsx("polygon",{fill:"#00e5ff",points:"21.126,16.482 20.623,20.214 16.918,19.539 10.318,10.455 14.526,7.398"}),u.jsx("polygon",{fill:"#546e7a",points:"26.094,16.228 23.493,18.952 20.893,16.228 20.893,5 26.094,5"}),u.jsx("polygon",{fill:"#f50057",points:"30.262,18.943 26.558,19.618 26.055,15.886 32.654,6.802 36.862,9.859"}),u.jsx("polygon",{fill:"#d500f9",points:"32.039,23.59 28.645,21.958 30.431,18.643 41.11,15.174 42.717,20.12"}),u.jsx("polygon",{fill:"#29b6f6",points:"30.744,28.393 28.958,25.078 32.351,23.447 43.03,26.916 41.423,31.863"}),u.jsx("polygon",{fill:"#00e5ff",points:"26.874,31.518 27.378,27.786 31.082,28.461 37.682,37.545 33.474,40.602"})]})}),u.jsxs("div",{className:"ml-4",children:[u.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Decoded JWT"}),u.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Below is the decoded JWT information."})]})]}),u.jsx("button",{onClick:t,className:"text-gray-600 hover:text-gray-800 focus:outline-none cursor-pointer","aria-label":"Close",children:"×"})]}),u.jsxs("div",{className:"relative mt-4",children:[u.jsx("div",{className:"absolute top-2 right-2 z-10",children:u.jsx(cn,{textToCopy:i})}),u.jsx("pre",{className:"bg-gray-100 p-2 rounded text-xs text-gray-700 overflow-x-auto",children:i}),r&&u.jsxs("div",{className:"mt-2 text-sm text-gray-600",children:[((n=r?.payload)==null?void 0:n.iat)&&u.jsxs("p",{children:["Issued At (iat): ",s(r.payload.iat)]}),((o=r?.payload)==null?void 0:o.nbf)&&u.jsxs("p",{children:["Not Before (nbf): ",s(r.payload.nbf)]}),((a=r?.payload)==null?void 0:a.exp)&&u.jsxs("p",{children:["Expires At (exp): ",s(r.payload.exp)]})]})]}),u.jsx("div",{className:"mt-6 flex justify-end",children:u.jsx("button",{onClick:t,className:"px-4 py-2 bg-gray-200 rounded hover:bg-gray-300 text-sm",children:"Close"})})]})]})},rp=e=>{e.editor.defineTheme("tremor-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{"editor.background":"#334155","editor.foreground":"#e1e7ef"}})},np=()=>{if(typeof window<"u"){const e=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,t=document.documentElement.classList.contains("dark");if(e||t)return"tremor-dark"}return"light"},HS=e=>{let t=e.replace(/-/g,"+").replace(/_/g,"/");for(;t.length%4;)t+="=";return t},Yz=e=>{try{const t=e.split(".");if(t.length!==3)return null;const r=JSON.parse(atob(HS(t[0]))),n=JSON.parse(atob(HS(t[1])));return{header:r,payload:n,signature:t[2]}}catch(t){return console.error("Failed to decode JWT:",t),null}},Xz=e=>typeof e!="string"?!1:((e.startsWith("Bearer ")||e.startsWith("bearer "))&&(e=e.slice(7).trim()),/^[A-Za-z0-9\-_]+\.[A-Za-z0-9\-_]+\.[A-Za-z0-9\-_]+$/.test(e)),Zz=({operation:e})=>{var t,r,n,o;const[a,i]=g.useState(!1),[s,l]=g.useState(!1),c=g.useRef(null);g.useEffect(()=>{const C=()=>{l(!0),setTimeout(()=>{var N;(N=c.current)==null||N.scrollIntoView({behavior:"smooth",block:"start"})},0)};return window.addEventListener("inspectr:openRequestHeaders",C),()=>window.removeEventListener("inspectr:openRequestHeaders",C)},[]);const[d,f]=g.useState(!1),[m,p]=g.useState(null),h=C=>C?Array.isArray(C)?C.map(N=>({name:N.name??N.key??"",value:N.value})):typeof C=="object"?"name"in C&&"value"in C?[{name:C.name,value:C.value}]:Object.entries(C).map(([N,T])=>({name:N,value:T})):[]:[],b=C=>{const N=C.startsWith("Bearer ")||C.startsWith("bearer ")?C.slice(7).trim():C,T=Yz(N);T&&(p(T),f(!0))},v=(C,N)=>{if(!C)return null;const T=C.toLowerCase(),M=T.replace(/[^a-z]/g,"");if(T==="authorization"){const I=String(N||"").toLowerCase();return I.startsWith("basic")?"Basic":I.startsWith("bearer")?"Bearer":"Auth"}return M.includes("apikey")?"API Key":M.includes("inspectrauthkey")?"Key":M.includes("inspectrauthtoken")?"Token":null},x=({label:C})=>u.jsxs("span",{className:"ml-2 py-0.5 px-1.5 inline-flex items-center gap-x-1 text-[10px] font-medium bg-blue-100 text-blue-800 rounded-md dark:bg-blue-500/10 dark:text-blue-500",children:[u.jsxs("svg",{className:"shrink-0 h-3 w-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[u.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),u.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),C]}),k=(C,N=!1)=>C.map(T=>{const M=N?v(T.name,T.value):null;return u.jsxs("tr",{children:[u.jsx("td",{className:"border border-slate-200 dark:border-dark-tremor-border px-2 py-1 font-mono text-slate-500 dark:text-dark-tremor-content text-xs",children:u.jsxs("div",{className:"flex items-center",children:[u.jsx("span",{children:T.name}),M&&u.jsx(x,{label:M})]})}),u.jsx("td",{className:"border border-slate-200 dark:border-dark-tremor-border px-2 py-1 font-mono text-xs dark:text-dark-tremor-content",children:u.jsxs("div",{className:"flex flex-wrap items-center",children:[u.jsx("span",{className:"min-w-0 break-all flex-1",children:T.value}),Xz(T.value)&&u.jsx("button",{onClick:()=>b(T.value),className:"ml-2 p-1 text-blue-500 dark:text-blue-400 text-xs border border-slate-600 dark:border-slate-500 rounded cursor-pointer",children:u.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 48 48",children:[u.jsx("polygon",{fill:"#546e7a",points:"21.906,31.772 24.507,29.048 27.107,31.772 27.107,43 21.906,43"}),u.jsx("polygon",{fill:"#f50057",points:"17.737,29.058 21.442,28.383 21.945,32.115 15.345,41.199 11.138,38.141"}),u.jsx("polygon",{fill:"#d500f9",points:"15.962,24.409 19.355,26.041 17.569,29.356 6.89,32.825 5.283,27.879"}),u.jsx("polygon",{fill:"#29b6f6",points:"17.256,19.607 19.042,22.922 15.649,24.554 4.97,21.084 6.577,16.137"}),u.jsx("polygon",{fill:"#00e5ff",points:"21.126,16.482 20.623,20.214 16.918,19.539 10.318,10.455 14.526,7.398"}),u.jsx("polygon",{fill:"#546e7a",points:"26.094,16.228 23.493,18.952 20.893,16.228 20.893,5 26.094,5"}),u.jsx("polygon",{fill:"#f50057",points:"30.262,18.943 26.558,19.618 26.055,15.886 32.654,6.802 36.862,9.859"}),u.jsx("polygon",{fill:"#d500f9",points:"32.039,23.59 28.645,21.958 30.431,18.643 41.11,15.174 42.717,20.12"}),u.jsx("polygon",{fill:"#29b6f6",points:"30.744,28.393 28.958,25.078 32.351,23.447 43.03,26.916 41.423,31.863"}),u.jsx("polygon",{fill:"#00e5ff",points:"26.874,31.518 27.378,27.786 31.082,28.461 37.682,37.545 33.474,40.602"})]})})]})})]},T.name)}),S=e.request.body,j=!S||typeof S=="object"&&Object.keys(S).length===0||typeof S=="string"&&(S.trim()===""||S.trim()==="{}"),O=C=>{try{const N=JSON.parse(C);return JSON.stringify(N,null,2)}catch{return C}};return u.jsxs("div",{className:"flex flex-col h-full",children:[u.jsxs("div",{className:"mb-4",children:[u.jsxs("button",{className:"w-full p-2 text-left font-bold bg-gray-200 dark:bg-dark-tremor-background-subtle dark:text-dark-tremor-content-strong cursor-pointer",onClick:()=>i(!a),children:["Query Parameters (",(((t=e?.request)==null?void 0:t.query_params)??[]).length,")"]}),a&&u.jsx("div",{className:"p-0",children:u.jsxs("table",{className:"table-fixed w-full border-collapse border border-gray-300 dark:border-dark-tremor-border",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"bg-gray-100 dark:bg-blue-900/30",children:[u.jsx("th",{className:"border border-slate-200 dark:border-dark-tremor-border px-2 py-1 w-1/4 text-left font-semibold text-gray-700 dark:text-white",children:"Key"}),u.jsx("th",{className:"border border-slate-200 dark:border-dark-tremor-border px-2 py-1 text-left font-semibold text-gray-700 dark:text-white",children:"Value"})]})}),u.jsx("tbody",{children:k(((r=e?.request)==null?void 0:r.query_params)??[],!1)})]})})]}),u.jsxs("div",{className:"mb-4",ref:c,children:[u.jsxs("button",{className:"w-full p-2 text-left font-bold bg-gray-200 dark:bg-dark-tremor-background-subtle dark:text-dark-tremor-content-strong cursor-pointer",onClick:()=>l(!s),children:["Headers (",h((n=e?.request)==null?void 0:n.headers).length,")"]}),s&&u.jsx("div",{className:"p-0",children:u.jsxs("table",{className:"table-fixed w-full border-collapse border border-gray-300 dark:border-dark-tremor-border",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"bg-gray-100 dark:bg-blue-900/30",children:[u.jsx("th",{className:"border border-slate-200 dark:border-dark-tremor-border px-2 py-1 w-1/4 text-left font-semibold text-gray-700 dark:text-white",children:"Header"}),u.jsx("th",{className:"border border-slate-200 dark:border-dark-tremor-border px-2 py-1 text-left font-semibold text-gray-700 dark:text-white",children:"Value"})]})}),u.jsx("tbody",{children:k(h((o=e?.request)==null?void 0:o.headers),!0)})]})})]}),u.jsxs("div",{className:"flex flex-col flex-1 bg-white dark:bg-dark-tremor-background-subtle rounded-b shadow dark:shadow-dark-tremor-shadow overflow-hidden",children:[u.jsxs("div",{className:"flex justify-between items-center bg-gray-200 dark:bg-dark-tremor-background-subtle",children:[u.jsx("button",{className:"p-2 text-left font-bold flex-grow dark:text-dark-tremor-content-strong",children:"Request Body"}),u.jsx(cn,{textToCopy:O(S)})]}),j?u.jsx("div",{className:"p-4 flex-1 bg-white dark:bg-dark-tremor-background-subtle rounded-b shadow dark:shadow-dark-tremor-shadow dark:text-dark-tremor-content",children:"No payload"}):u.jsx(tp,{height:"100%",className:"flex-1",defaultLanguage:"json",value:O(S),theme:np(),beforeMount:rp,options:{readOnly:!0,minimap:{enabled:!1},automaticLayout:!0,fontFamily:'"Cascadia Code", "Jetbrains Mono", "Fira Code", "Menlo", "Consolas", monospace',tabSize:2,scrollBeyondLastLine:!1}})]}),u.jsx(Gz,{open:d,decoded:m,onClose:()=>{f(!1),p(null)}})]})};var Rf={exports:{}},Rg={exports:{}},qS;function Jz(){return qS||(qS=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.ParsingError=void 0;class r extends Error{constructor(j,O){super(j),this.cause=O}}t.ParsingError=r;let n;function o(){return l(!1)||m()||f()||d()||s(!1)}function a(){return b(/\s*/),l(!0)||f()||c()||s(!1)}function i(){const S=s(!0),j=[];let O,C=a();for(;C;){if(C.node.type==="Element"){if(O)throw new Error("Found multiple root nodes");O=C.node}C.excluded||j.push(C.node),C=a()}if(!O)throw new r("Failed to parse XML","Root Element not found");if(n.xml.length!==0)throw new r("Failed to parse XML","Not Well-Formed XML");return{declaration:S?S.node:null,root:O,children:j}}function s(S){const j=b(S?/^<\?(xml(-stylesheet)?)\s*/:/^<\?([\w-:.]+)\s*/);if(!j)return;const O={name:j[1],type:"ProcessingInstruction",attributes:{}};for(;!(v()||x("?>"));){const C=p();if(C)O.attributes[C.name]=C.value;else return}return b(/\?>/),{excluded:S?!1:n.options.filter(O)===!1,node:O}}function l(S){const j=b(/^<([^?!</>\s]+)\s*/);if(!j)return;const O={type:"Element",name:j[1],attributes:{},children:[]},C=S?!1:n.options.filter(O)===!1;for(;!(v()||x(">")||x("?>")||x("/>"));){const T=p();if(T)O.attributes[T.name]=T.value;else return}if(b(/^\s*\/>/))return O.children=null,{excluded:C,node:O};b(/\??>/);let N=o();for(;N;)N.excluded||O.children.push(N.node),N=o();if(n.options.strictMode){const T=`</${O.name}>`;if(n.xml.startsWith(T))n.xml=n.xml.slice(T.length);else throw new r("Failed to parse XML",`Closing tag not matching "${T}"`)}else b(/^<\/[\w-:.\u00C0-\u00FF]+\s*>/);return{excluded:C,node:O}}function c(){const S=b(/^<!DOCTYPE\s+\S+\s+SYSTEM[^>]*>/)||b(/^<!DOCTYPE\s+\S+\s+PUBLIC[^>]*>/)||b(/^<!DOCTYPE\s+\S+\s*\[[^\]]*]>/)||b(/^<!DOCTYPE\s+\S+\s*>/);if(S){const j={type:"DocumentType",content:S[0]};return{excluded:n.options.filter(j)===!1,node:j}}}function d(){if(n.xml.startsWith("<![CDATA[")){const S=n.xml.indexOf("]]>");if(S>-1){const j=S+3,O={type:"CDATA",content:n.xml.substring(0,j)};return n.xml=n.xml.slice(j),{excluded:n.options.filter(O)===!1,node:O}}}}function f(){const S=b(/^<!--[\s\S]*?-->/);if(S){const j={type:"Comment",content:S[0]};return{excluded:n.options.filter(j)===!1,node:j}}}function m(){const S=b(/^([^<]+)/);if(S){const j={type:"Text",content:S[1]};return{excluded:n.options.filter(j)===!1,node:j}}}function p(){const S=b(/([^=]+)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)\s*/);if(S)return{name:S[1].trim(),value:h(S[2].trim())}}function h(S){return S.replace(/^['"]|['"]$/g,"")}function b(S){const j=n.xml.match(S);if(j)return n.xml=n.xml.slice(j[0].length),j}function v(){return n.xml.length===0}function x(S){return n.xml.indexOf(S)===0}function k(S,j={}){S=S.trim();const O=j.filter||(()=>!0);return n={xml:S,options:Object.assign(Object.assign({},j),{filter:O,strictMode:j.strictMode===!0})},i()}e.exports=k,t.default=k}(Rg,Rg.exports)),Rg.exports}var WS=Rf.exports,US;function Qz(){return US||(US=1,function(e,t){var r=WS&&WS.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(Jz());function o(h){if(!h.options.indentation&&!h.options.lineSeparator)return;h.content+=h.options.lineSeparator;let b;for(b=0;b<h.level;b++)h.content+=h.options.indentation}function a(h){h.content=h.content.replace(/ +$/,"");let b;for(b=0;b<h.level;b++)h.content+=h.options.indentation}function i(h,b){h.content+=b}function s(h,b,v){if(typeof h.content=="string")l(h.content,b,v);else if(h.type==="Element")d(h,b,v);else if(h.type==="ProcessingInstruction")m(h,b);else throw new Error("Unknown node type: "+h.type)}function l(h,b,v){if(!v){const x=h.trim();(b.options.lineSeparator||x.length===0)&&(h=x)}h.length>0&&(!v&&b.content.length>0&&o(b),i(b,h))}function c(h,b){const v="/"+h.join("/"),x=h[h.length-1];return b.includes(x)||b.includes(v)}function d(h,b,v){if(b.path.push(h.name),!v&&b.content.length>0&&o(b),i(b,"<"+h.name),f(b,h.attributes),h.children===null||b.options.forceSelfClosingEmptyTag&&h.children.length===0){const x=b.options.whiteSpaceAtEndOfSelfclosingTag?" />":"/>";i(b,x)}else if(h.children.length===0)i(b,"></"+h.name+">");else{const x=h.children;i(b,">"),b.level++;let k=h.attributes["xml:space"]==="preserve"||v,S=!1;if(!k&&b.options.ignoredPaths&&(S=c(b.path,b.options.ignoredPaths),k=S),!k&&b.options.collapseContent){let j=!1,O=!1,C=!1;x.forEach(function(N,T){N.type==="Text"?(N.content.includes(`
43
+ `)?(O=!0,N.content=N.content.trim()):(T===0||T===x.length-1)&&!v&&N.content.trim().length===0&&(N.content=""),(N.content.trim().length>0||x.length===1)&&(j=!0)):N.type==="CDATA"?j=!0:C=!0}),j&&(!C||!O)&&(k=!0)}x.forEach(function(j){s(j,b,v||k)}),b.level--,!v&&!k&&o(b),S&&a(b),i(b,"</"+h.name+">")}b.path.pop()}function f(h,b){Object.keys(b).forEach(function(v){const x=b[v].replace(/"/g,"&quot;");i(h," "+v+'="'+x+'"')})}function m(h,b){b.content.length>0&&o(b),i(b,"<?"+h.name),f(b,h.attributes),i(b,"?>")}function p(h,b={}){b.indentation="indentation"in b?b.indentation:" ",b.collapseContent=b.collapseContent===!0,b.lineSeparator="lineSeparator"in b?b.lineSeparator:`\r
44
+ `,b.whiteSpaceAtEndOfSelfclosingTag=b.whiteSpaceAtEndOfSelfclosingTag===!0,b.throwOnFailure=b.throwOnFailure!==!1;try{const v=(0,n.default)(h,{filter:b.filter,strictMode:b.strictMode}),x={content:"",level:0,options:b,path:[]};return v.declaration&&m(v.declaration,x),v.children.forEach(function(k){s(k,x,!1)}),b.lineSeparator?x.content.replace(/\r\n/g,`
45
+ `).replace(/\n/g,b.lineSeparator):x.content}catch(v){if(b.throwOnFailure)throw v;return h}}p.minify=(h,b={})=>p(h,Object.assign(Object.assign({},b),{indentation:"",lineSeparator:""})),e.exports=p,t.default=p}(Rf,Rf.exports)),Rf.exports}var eH=Qz();const tH=qt(eH);function rH(e){try{return tH(e,{indentation:" ",collapseContent:!0,lineSeparator:`
46
+ `})}catch{return e}}function nH(e){if(!e)return[];const t=[];let r=null;const n=String(e).split(/\r?\n/);for(const o of n){if(o===""){r&&(t.push({...r,timestamp:r.timestamp??Date.now()}),r=null);continue}if(o.startsWith(":")){const l=o.slice(1).trimStart();t.push({event:"comment",data:l,timestamp:Date.now()});continue}const a=o.indexOf(":");if(a===-1)continue;r||(r={});const i=o.slice(0,a).trim(),s=o.slice(a+1).trimStart();if(i==="data")r.data=r.data?r.data+`
47
+ `+s:s;else if(i==="timestamp"||i==="time"){const l=Number(s);r.timestamp=Number.isNaN(l)?s:l}else r[i]=s}return r&&t.push({...r,timestamp:r.timestamp??Date.now()}),t}const KS=({frames:e,raw:t})=>{const r=y.useMemo(()=>e&&e.length?e:nH(t),[e,t]),[n,o]=y.useState({}),[a,i]=y.useState(null),[s,l]=y.useState("asc"),c=v=>{const x=v.timestamp??v.time;if(x==null)return 0;if(typeof x=="number")return x;const k=Number(x);if(!Number.isNaN(k))return k;const S=new Date(x).getTime();return Number.isNaN(S)?0:S},d=(v,x)=>String(v||"").localeCompare(String(x||"")),f=y.useMemo(()=>{if(!a)return r;const v=s==="asc"?1:-1;return[...r].sort((x,k)=>{let S=0;return a==="id"?S=d(x.id,k.id):a==="type"?S=d(x.event,k.event):a==="data"?S=d(x.data,k.data):a==="time"&&(S=c(x)-c(k)),S*v})},[r,a,s]),m=v=>{a!==v?(i(v),l("asc")):s==="asc"?l("desc"):s==="desc"?(i(null),l("asc")):(i(v),l("asc"))};if(!r||!r.length)return u.jsx("div",{className:"p-4",children:"No event frames"});const p=v=>{try{return JSON.parse(v)}catch{return null}},h=v=>{const x=v.timestamp??v.time;if(!x)return"";const k=new Date(x);if(Number.isNaN(k.getTime()))return typeof x=="string"?x:"";const S=(j,O=2)=>String(j).padStart(O,"0");return`${S(k.getHours())}:${S(k.getMinutes())}:${S(k.getSeconds())}.${S(k.getMilliseconds(),3)}`},b=v=>{if(!v)return"";if(v==="comment")return"bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-gray-200";const x=["bg-blue-200 text-blue-800 dark:bg-blue-700 dark:text-blue-200","bg-green-200 text-green-800 dark:bg-green-700 dark:text-green-200","bg-red-200 text-red-800 dark:bg-red-700 dark:text-red-200","bg-yellow-200 text-yellow-800 dark:bg-yellow-700 dark:text-yellow-200","bg-purple-200 text-purple-800 dark:bg-purple-700 dark:text-purple-200","bg-pink-200 text-pink-800 dark:bg-pink-700 dark:text-pink-200"],k=[...v].reduce((S,j)=>S+j.charCodeAt(0),0);return x[k%x.length]};return u.jsx("div",{className:"overflow-auto h-full",children:u.jsxs("table",{className:"w-full border-collapse border border-slate-200 dark:border-dark-tremor-border",children:[u.jsxs("colgroup",{children:[u.jsx("col",{className:"w-1/6"})," ",u.jsx("col",{className:"w-1/6"})," ",u.jsx("col",{})," ",u.jsx("col",{className:"w-[12ch]"})," "]}),u.jsx("thead",{children:u.jsxs("tr",{className:"bg-gray-100 dark:bg-dark-tremor-background-subtle",children:[u.jsx("th",{className:"sticky top-0 z-10 border px-2 py-1 text-left font-semibold text-gray-700 dark:text-white bg-gray-100 dark:bg-dark-tremor-background-subtle cursor-pointer select-none",onClick:()=>m("id"),"aria-sort":a==="id"?s==="asc"?"ascending":"descending":"none",children:u.jsxs("span",{className:"inline-flex items-center gap-1",children:["ID ",a==="id"?s==="asc"?"▲":"▼":""]})}),u.jsx("th",{className:"sticky top-0 z-10 border px-2 py-1 text-left font-semibold text-gray-700 dark:text-white bg-gray-100 dark:bg-dark-tremor-background-subtle cursor-pointer select-none",onClick:()=>m("type"),"aria-sort":a==="type"?s==="asc"?"ascending":"descending":"none",children:u.jsxs("span",{className:"inline-flex items-center gap-1",children:["Type ",a==="type"?s==="asc"?"▲":"▼":""]})}),u.jsx("th",{className:"sticky top-0 z-10 border px-2 py-1 text-left font-semibold text-gray-700 dark:text-white bg-gray-100 dark:bg-dark-tremor-background-subtle cursor-pointer select-none",onClick:()=>m("data"),"aria-sort":a==="data"?s==="asc"?"ascending":"descending":"none",children:u.jsxs("span",{className:"inline-flex items-center gap-1",children:["Data ",a==="data"?s==="asc"?"▲":"▼":""]})}),u.jsx("th",{className:"sticky top-0 z-10 border px-2 py-1 text-left font-semibold text-gray-700 dark:text-white bg-gray-100 dark:bg-dark-tremor-background-subtle whitespace-nowrap cursor-pointer select-none",onClick:()=>m("time"),"aria-sort":a==="time"?s==="asc"?"ascending":"descending":"none",children:u.jsxs("span",{className:"inline-flex items-center gap-1",children:["Time ",a==="time"?s==="asc"?"▲":"▼":""]})})]})}),u.jsx("tbody",{children:f.map((v,x)=>{const k=v.id??x,S=p(v.data),j=!!n[k];return u.jsxs(y.Fragment,{children:[u.jsxs("tr",{className:"align-top",children:[u.jsx("td",{className:"border px-2 py-1 font-mono text-xs text-slate-500 dark:text-dark-tremor-content",children:v.id||""}),u.jsx("td",{className:"border px-2 py-1",children:v.event?u.jsx("span",{className:`inline-flex items-center rounded px-2.5 py-0.5 font-mono text-xs font-medium ${b(v.event)}`,children:v.event}):""}),u.jsx("td",{className:"border px-2 py-1 font-mono text-xs whitespace-pre-wrap break-all dark:text-dark-tremor-content",children:u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsx("div",{className:"flex-1 break-all whitespace-pre-wrap",children:v.data}),S&&u.jsx("button",{className:"self-start px-2 py-1 text-xs rounded bg-gray-300 dark:bg-gray-700 text-gray-800 dark:text-gray-200",title:j?"Hide formatted JSON":"Show formatted JSON","aria-expanded":j,onClick:()=>o(O=>({...O,[k]:!O[k]})),children:j?"Hide":"Preview"})]})}),u.jsx("td",{className:"border px-2 py-1 font-mono text-xs text-slate-500 dark:text-dark-tremor-content whitespace-nowrap w-[12ch]",children:h(v)})]}),S&&j&&u.jsx("tr",{children:u.jsx("td",{className:"border px-2 py-2 bg-slate-50 dark:bg-dark-tremor-background-subtle",colSpan:4,children:u.jsx(tp,{height:"260px",language:"json",value:JSON.stringify(S,null,2),theme:np(),beforeMount:rp,options:{readOnly:!0,minimap:{enabled:!1},automaticLayout:!0,fontFamily:'"Cascadia Code", "Jetbrains Mono", "Fira Code", "Menlo", "Consolas", monospace',tabSize:2,scrollBeyondLastLine:!1}})})})]},k)})})]})})},oH=({operation:e})=>{var t,r,n;const[o,a]=g.useState(!1),[i,s]=g.useState("source"),l=O=>O?Array.isArray(O)?O.map(C=>({name:C.name??C.key??"",value:C.value})):typeof O=="object"?"name"in O&&"value"in O?[{name:O.name,value:O.value}]:Object.entries(O).map(([C,N])=>({name:C,value:N})):[]:[],c=O=>O.map(C=>u.jsxs("tr",{children:[u.jsx("td",{className:"border border-slate-200 dark:border-dark-tremor-border px-2 py-1 font-mono text-slate-500 dark:text-dark-tremor-content text-xs",children:C.name}),u.jsx("td",{className:"border border-slate-200 dark:border-dark-tremor-border px-2 py-1 font-mono text-xs dark:text-dark-tremor-content",children:u.jsx("div",{className:"flex flex-wrap items-center",children:u.jsx("span",{className:"min-w-0 break-all flex-1",children:C.value})})})]},C.name)),d=e.response.body,f=!d||typeof d=="object"&&Object.keys(d).length===0||typeof d=="string"&&(d.trim()===""||d.trim()==="{}"),m=(O,C)=>{if(typeof O!="string")return O;if(C&&C.includes("json"))try{const N=JSON.parse(O);return JSON.stringify(N,null,2)}catch{return O}return C&&C.includes("xml")?rH(O):O},p=(()=>{var O,C;const N=(C=l((O=e?.response)==null?void 0:O.headers).find(T=>{var M,I;return((M=T.name)==null?void 0:M.toLowerCase())==="content-type"||((I=T.key)==null?void 0:I.toLowerCase())==="content-type"}))==null?void 0:C.value;return typeof N=="string"?N.split(";")[0].trim():void 0})(),h=typeof p=="string"&&p.includes("text/html");typeof p=="string"&&p.includes("xml");const b=typeof p=="string"&&p.startsWith("image/"),v=typeof p=="string"&&p.includes("text/event-stream"),x=((t=e?.response)==null?void 0:t.event_frames)||[],k=Array.isArray(x)&&x.length>0||v,S=(O=>{if(!O)return"json";const C=O.toLowerCase();return C.includes("json")?"json":C.includes("html")?"html":C.includes("xml")?"xml":C.includes("javascript")?"javascript":C.includes("css")?"css":C.includes("yaml")||C.includes("yml")?"yaml":C.includes("sql")?"sql":(C.startsWith("text/"),"plaintext")})(p),j=h||b||k;return u.jsxs("div",{className:"flex flex-col h-full",children:[u.jsxs("div",{className:"mb-4",children:[u.jsxs("button",{className:"w-full p-2 text-left font-bold bg-gray-200 dark:bg-dark-tremor-background-subtle dark:text-dark-tremor-content-strong cursor-pointer",onClick:()=>a(!o),children:["Headers (",l((r=e?.response)==null?void 0:r.headers).length,")"]}),o&&u.jsx("div",{className:"p-0",children:u.jsxs("table",{className:"w-full border-collapse border border-gray-300 dark:border-dark-tremor-border",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"bg-gray-100 dark:bg-blue-900/30",children:[u.jsx("th",{className:"border border-slate-200 dark:border-dark-tremor-border px-2 py-1 w-1/4 text-left font-semibold text-gray-700 dark:text-white",children:"Header"}),u.jsx("th",{className:"border border-slate-200 dark:border-dark-tremor-border px-2 py-1 text-left font-semibold text-gray-700 dark:text-white",children:"Value"})]})}),u.jsx("tbody",{children:c(l((n=e?.response)==null?void 0:n.headers))})]})})]}),u.jsxs("div",{className:"flex flex-col flex-1 bg-white dark:bg-dark-tremor-background-subtle rounded-b shadow dark:shadow-dark-tremor-shadow overflow-hidden",children:[u.jsxs("div",{className:"flex justify-between items-center bg-gray-200 dark:bg-dark-tremor-background-subtle",children:[u.jsx("button",{className:"p-2 text-left font-bold flex-grow dark:text-dark-tremor-content-strong",children:"Response Body"}),j&&u.jsxs("div",{className:"flex space-x-1 mr-2",children:[u.jsx("button",{onClick:()=>s("source"),className:`px-2 py-1 text-xs rounded ${i==="source"?"bg-blue-600 dark:bg-blue-700 text-white":"bg-gray-300 dark:bg-gray-700 text-gray-800 dark:text-gray-200"}`,children:"Source"}),k?u.jsx("button",{onClick:()=>s("events"),className:`px-2 py-1 text-xs rounded ${i==="events"?"bg-blue-600 dark:bg-blue-700 text-white":"bg-gray-300 dark:bg-gray-700 text-gray-800 dark:text-gray-200"}`,children:"Events"}):u.jsx("button",{onClick:()=>s("preview"),className:`px-2 py-1 text-xs rounded ${i==="preview"?"bg-blue-600 dark:bg-blue-700 text-white":"bg-gray-300 dark:bg-gray-700 text-gray-800 dark:text-gray-200"}`,children:"Preview"})]}),u.jsx(cn,{textToCopy:h||b||v?d:m(d,p)})]}),k&&i==="events"?u.jsx(KS,{frames:x,raw:d}):v?i==="events"?u.jsx(KS,{frames:x,raw:d}):f?u.jsx("div",{className:"p-4 flex-1 bg-white dark:bg-dark-tremor-background-subtle rounded-b shadow dark:shadow-dark-tremor-shadow dark:text-dark-tremor-content",children:"No payload"}):u.jsx(tp,{height:"100%",className:"flex-1",language:"plaintext",value:d,theme:np(),beforeMount:rp,options:{readOnly:!0,minimap:{enabled:!1},automaticLayout:!0,fontFamily:'"Cascadia Code", "Jetbrains Mono", "Fira Code", "Menlo", "Consolas", monospace',tabSize:2,scrollBeyondLastLine:!1}}):f?u.jsx("div",{className:"p-4 flex-1 bg-white dark:bg-dark-tremor-background-subtle rounded-b shadow dark:shadow-dark-tremor-shadow dark:text-dark-tremor-content",children:"No payload"}):i==="preview"&&h?u.jsx("iframe",{title:"HTML Preview",srcDoc:d,className:"flex-1 w-full h-full border-none"}):i==="preview"&&b?u.jsx("img",{alt:"Response Preview",src:d.startsWith("data:")?d:`data:${p};base64,${d}`,className:"flex-1 w-full h-full object-contain"}):u.jsx(tp,{height:"100%",className:"flex-1",language:S,value:m(d,p),theme:np(),beforeMount:rp,options:{readOnly:!0,minimap:{enabled:!1},automaticLayout:!0,fontFamily:'"Cascadia Code", "Jetbrains Mono", "Fira Code", "Menlo", "Consolas", monospace',tabSize:2,scrollBeyondLastLine:!1}})]})]})},VS=e=>e?Array.isArray(e)?e:Object.entries(e).map(([t,r])=>({name:t,value:r})):[],aH=({operation:e})=>{var t,r,n,o;const a=VS((r=(t=e?.meta)==null?void 0:t.inspectr)==null?void 0:r.guard),i=VS((o=(n=e?.meta)==null?void 0:n.inspectr)==null?void 0:o.directives),[s,l]=g.useState(null),c=g.useRef(null);g.useEffect(()=>{const f=m=>{var p,h;const b=(p=m?.detail)==null?void 0:p.name;l(b||null),(h=c.current)==null||h.scrollIntoView({behavior:"smooth",block:"start"}),b&&setTimeout(()=>l(null),1600)};return window.addEventListener("inspectr:openMetaGuard",f),()=>window.removeEventListener("inspectr:openMetaGuard",f)},[]);const d=({label:f})=>u.jsxs("span",{className:"ml-2 py-0.5 px-1.5 inline-flex items-center gap-x-1 text-[10px] font-medium bg-blue-100 text-blue-800 rounded-md dark:bg-blue-500/10 dark:text-blue-500",children:[u.jsxs("svg",{className:"shrink-0 h-3 w-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[u.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),u.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),f]});return a.length===0&&i.length===0?u.jsx("div",{className:"text-gray-500 dark:text-dark-tremor-content text-sm",children:"No Inspectr metadata"}):u.jsxs("div",{className:"space-y-4",children:[a.length>0&&u.jsxs("div",{ref:c,children:[u.jsxs("button",{className:"w-full p-2 text-left font-bold bg-gray-200 dark:bg-dark-tremor-background-subtle dark:text-dark-tremor-content-strong",children:["Guard (",(a??[]).length,")"]}),u.jsxs("table",{className:"table-fixed w-full border-collapse border border-gray-300 dark:border-dark-tremor-border",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"bg-gray-100 dark:bg-blue-900/30",children:[u.jsx("th",{className:"border border-slate-200 dark:border-dark-tremor-border px-2 py-1 w-1/4 text-left font-semibold text-gray-700 dark:text-white",children:"API Key"}),u.jsx("th",{className:"border border-slate-200 dark:border-dark-tremor-border px-2 py-1 text-left font-semibold text-gray-700 dark:text-white",children:"Value"})]})}),u.jsx("tbody",{children:a.map(f=>{const m=f.name==="inspectr-auth-token",p=f.name==="inspectr-auth-key",h=s&&s===f.name;return u.jsxs("tr",{className:h?"bg-blue-50 dark:bg-blue-950/30":"",children:[u.jsx("td",{className:"border border-slate-200 dark:border-dark-tremor-border px-2 py-1 font-mono text-slate-500 dark:text-dark-tremor-content text-xs",children:u.jsxs("div",{className:"flex items-center",children:[u.jsx("span",{children:f.name}),m&&u.jsx(d,{label:"Guard Token"}),p&&u.jsx(d,{label:"Guard Key"})]})}),u.jsx("td",{className:"border border-slate-200 dark:border-dark-tremor-border px-2 py-1 font-mono text-xs break-all dark:text-dark-tremor-content",children:f.value})]},f.name)})})]})]}),i.length>0&&u.jsxs("div",{children:[u.jsxs("button",{className:"w-full p-2 text-left font-bold bg-gray-200 dark:bg-dark-tremor-background-subtle dark:text-dark-tremor-content-strong",children:["Directives (",(i??[]).length,")"]}),u.jsxs("table",{className:"table-fixed w-full border-collapse border border-gray-300 dark:border-dark-tremor-border",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"bg-gray-100 dark:bg-blue-900/30",children:[u.jsx("th",{className:"border border-slate-200 dark:border-dark-tremor-border px-2 py-1 w-1/4 text-left font-semibold text-gray-700 dark:text-white",children:"Directive"}),u.jsx("th",{className:"border border-slate-200 dark:border-dark-tremor-border px-2 py-1 text-left font-semibold text-gray-700 dark:text-white",children:"Value"})]})}),u.jsx("tbody",{children:i.map(f=>u.jsxs("tr",{children:[u.jsx("td",{className:"border border-slate-200 dark:border-dark-tremor-border px-2 py-1 font-mono text-slate-500 dark:text-dark-tremor-content text-xs",children:f.name}),u.jsx("td",{className:"border border-slate-200 dark:border-dark-tremor-border px-2 py-1 font-mono text-xs break-all dark:text-dark-tremor-content",children:f.value})]},f.name))})]})]})]})},iH=({endpoint:e,command:t,prompt:r="computer:~$",showCopyButton:n=!1,showCopyLabel:o=!1,copyLabelText:a="Copy",copiedText:i="Copied"})=>{const s=t||`curl -X GET ${e||"http://localhost:8080"}`;return u.jsx("div",{className:"w-full mt-6 max-w-xl mx-auto",children:u.jsxs("div",{className:`coding inverse-toggle px-5 pt-4 shadow-lg text-gray-100 text-sm font-mono subpixel-antialiased
48
+ bg-gray-800 pb-6 pt-4 rounded-lg leading-normal overflow-hidden`,children:[u.jsxs("div",{className:"top mb-2 flex justify-between",children:[u.jsxs("div",{className:"flex",children:[u.jsx("div",{className:"h-3 w-3 bg-red-500 rounded-full"}),u.jsx("div",{className:"ml-2 h-3 w-3 bg-orange-300 rounded-full"}),u.jsx("div",{className:"ml-2 h-3 w-3 bg-green-500 rounded-full"})]}),n&&u.jsx(cn,{textToCopy:s})]}),u.jsxs("div",{className:"mt-4 flex",children:[u.jsx("span",{className:"text-green-400",children:r}),u.jsxs("p",{className:"flex-1 typing items-start pl-2",children:[s,u.jsx("br",{})]})]})]})})},Fg={opacity:1,visibility:"visible",transition:"opacity 0.3s ease-in-out, visibility 0.3s ease-in-out"},$g={opacity:0,visibility:"hidden",transition:"opacity 0.3s ease-in-out, visibility 0.3s ease-in-out"},sH=({operation:e,currentTab:t,setCurrentTab:r})=>{var n,o,a,i;const[s,l]=Cr("ingressEndpoint",""),[c,d]=Cr("proxyEndpoint",""),[f]=Cr("expose","false"),m=f==="true",[p,h]=g.useState(!1),b=S=>S?Array.isArray(S)?S:Object.entries(S).map(([j,O])=>({name:j,value:O})):[],v=b((o=(n=e?.meta)==null?void 0:n.inspectr)==null?void 0:o.guard),x=b((i=(a=e?.meta)==null?void 0:a.inspectr)==null?void 0:i.directives),k=v.length>0||x.length>0;return g.useEffect(()=>{!k&&t==="meta"&&r("request")},[k,t,r]),g.useEffect(()=>{const S=setTimeout(()=>{h(!0)},100);return()=>clearTimeout(S)},[]),e?u.jsxs("div",{className:"flex flex-col h-full",style:p?Fg:$g,children:[u.jsx(HB,{operation:e,setCurrentTab:r}),u.jsxs("div",{className:"flex space-x-2",children:[u.jsx("button",{className:`px-4 py-2 rounded-t ${t==="request"?"bg-blue-600 dark:bg-blue-700 text-white":"bg-gray-200 dark:bg-dark-tremor-background-subtle text-gray-700 dark:text-dark-tremor-content"}`,onClick:()=>r("request"),children:"Request"}),u.jsx("button",{className:`px-4 py-2 rounded-t ${t==="response"?"bg-blue-600 dark:bg-blue-700 text-white":"bg-gray-200 dark:bg-dark-tremor-background-subtle text-gray-700 dark:text-dark-tremor-content"}`,onClick:()=>r("response"),children:"Response"}),k&&u.jsx("button",{className:`px-4 py-2 rounded-t ${t==="meta"?"bg-teal-600 dark:bg-teal-700 text-white":"bg-gray-200 dark:bg-dark-tremor-background-subtle text-gray-700 dark:text-dark-tremor-content"}`,onClick:()=>r("meta"),children:"Info"})]}),u.jsx("div",{className:"p-4 bg-white dark:bg-dark-tremor-background border border-gray-300 dark:border-dark-tremor-border rounded-b shadow dark:shadow-dark-tremor-shadow flex-grow overflow-y-auto",style:{...p?Fg:$g,maxHeight:"calc(100vh - 270px - 64px)"},children:t==="request"?u.jsx(Zz,{operation:e}):t==="response"?u.jsx(oH,{operation:e}):k?u.jsx(aH,{operation:e}):null})]}):u.jsx("div",{className:"h-96 min-h-full mb-20 flex flex-1 flex-col justify-center rounded-tremor-default border border-tremor-border bg-tremor-background-muted px-6 py-10 dark:border-dark-tremor-border dark:bg-dark-tremor-background-muted",style:p?Fg:$g,children:u.jsxs("div",{className:"mx-auto text-center",children:[u.jsx("h4",{className:"text-tremor-metric font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong font-[Inter] font-sans",children:"Request Inspectr"}),u.jsx("p",{className:"mt-3 max-w-xl text-tremor-default leading-6 text-tremor-content dark:text-dark-tremor-content sm:text-base",children:"Select a request from the list to view its details"}),u.jsxs("p",{className:"max-w-xl text-tremor-default leading-6 text-tremor-content dark:text-dark-tremor-content sm:text-base",children:["or get started by making a request to"," ",m?s?`"${s}"`:"the ingress endpoint":c?`"${c}"`:"the proxy endpoint","."]}),u.jsx(iH,{endpoint:m?s:c,showCopyButton:!0}),u.jsxs("div",{className:"mt-8 sm:flex sm:items-center sm:justify-center sm:gap-x-3",children:[u.jsx("a",{href:"https://inspectr.dev/docs",target:"_blank",className:"w-full whitespace-nowrap rounded-tremor-small bg-tremor-brand px-4 py-2 text-tremor-default font-medium text-tremor-brand-inverted shadow-tremor-input hover:bg-tremor-brand-emphasis dark:bg-dark-tremor-brand dark:text-dark-tremor-brand-inverted dark:shadow-dark-tremor-input dark:hover:bg-dark-tremor-brand-emphasis sm:w-fit",children:"View Documentation"}),u.jsxs("a",{href:"https://inspectr.dev",target:"_blank",className:"mt-2 inline-flex w-full items-center justify-center gap-1.5 whitespace-nowrap rounded-tremor-small border border-tremor-border bg-tremor-background px-3 py-2 text-tremor-default font-medium text-tremor-brand shadow-tremor-input hover:text-tremor-brand-emphasis dark:border-dark-tremor-border dark:bg-dark-tremor-background dark:text-dark-tremor-brand dark:shadow-dark-tremor-input hover:dark:text-dark-tremor-brand-emphasis sm:mt-0 sm:w-fit",children:["Visit Website",u.jsx(KI,{className:"size-5 shrink-0","aria-hidden":!0})]})]})]})})},lH="data:image/svg+xml,%3csvg%20class='inline-block'%20width='24'%20height='24'%20viewBox='0%200%201648%201648'%20xmlns='http://www.w3.org/2000/svg'%3e%3cdefs%3e%3clinearGradient%20id='grad-r4R0»'%20x1='0%25'%20y1='0%25'%20x2='100%25'%20y2='0%25'%3e%3cstop%20offset='0%25'%20style='stop-color:%23ff8c00'%3e%3c/stop%3e%3cstop%20offset='100%25'%20style='stop-color:%23ffd700'%3e%3c/stop%3e%3c/linearGradient%3e%3c/defs%3e%3cpath%20d='m610%20216.654c-66.158%204.092-126.119%2035.849-164.917%2087.346-8.408%2011.16-13.344%2019.191-19.983%2032.513-12.431%2024.946-19.521%2050.434-22.11%2079.487-1.665%2018.687-.854%20826.238.841%20837.939%207.867%2054.284%2032.465%20101.134%2070.706%20134.667%2016.297%2014.291%2032.283%2024.657%2053.963%2034.991%2016.889%208.05%2034.568%2013.468%2060.5%2018.541%209.019%201.764%2052.201%201.795%2061.5.044%2026.487-4.989%2043.97-10.341%2061-18.675%2015.131-7.406%2021.53-11.135%2060.5-35.267%2020.813-12.887%2023.095-14.298%2029.5-18.24l13-8%2013-8c6.901-4.247%2012.593-7.767%2029.54-18.271%205.796-3.593%2012.771-7.863%2015.5-9.49%202.728-1.626%208.56-5.19%2012.96-7.921%204.4-2.73%2072.575-44.711%20151.5-93.29s150.925-92.918%20160-98.531c9.075-5.612%2024.15-14.936%2033.5-20.719s23.075-14.234%2030.5-18.78c85.169-52.142%20120.029-73.942%20130.014-81.304%2040.974-30.211%2068.344-69.764%2081.788-118.194%2013.864-49.94%208.549-104.847-14.809-153-16.836-34.708-41.252-62.432-74.993-85.154-4.125-2.778-17.625-11.26-30-18.849s-27-16.594-32.5-20.009c-5.5-3.416-109.45-67.427-231-142.246-306.386-188.593-335.221-206.352-350-215.553-30.562-19.028-59.301-29.911-90-34.083-11.697-1.59-30.408-2.514-39.5-1.952m-10.5%2077.269c-39.541%206.402-76.013%2029.73-97.661%2062.467-13.001%2019.66-19.718%2038.39-22.802%2063.584-1.472%2012.028-1.434%20802.191.04%20818.026%201.861%2019.998%206.142%2035.48%2014.415%2052.133%2017.942%2036.114%2053.025%2064.18%2091.508%2073.203%203.575.839%208.975%202.118%2012%202.844%208.221%201.973%2040.343%201.613%2049.971-.56%2032.301-7.289%2065.233-26.686%2094.817-55.849%2015.26-15.042%2022.884-24.803%2033.571-42.979%2013.939-23.706%2020.949-43.36%2027.745-77.792%201.004-5.086%201.428-50%201.949-206.5.465-139.686%201.001-201.809%201.777-206%20.611-3.3%201.608-9.15%202.217-13%201.672-10.583%204.039-21.117%207.191-32%208.179-28.247%2020.714-55.13%2037.188-79.751%2024.262-36.262%2053.189-63.572%2093.074-87.872%204.95-3.016%2012.825-7.435%2017.5-9.82s8.95-4.668%209.5-5.074c3.565-2.63%2034.688-13.266%2052.465-17.93%206.2-1.627%2011.49-3.174%2011.754-3.439%201.003-1.002-1.016-2.602-10.967-8.689-5.639-3.449-16.552-10.172-24.252-14.94-13.435-8.319-31.76-19.604-58.5-36.029-6.875-4.222-16.1-9.911-20.5-12.641-7.667-4.758-73.088-45.103-122.5-75.546-75.227-46.348-108.509-66.591-116.5-70.86-9.422-5.033-25.23-10.76-37.043-13.419-7.967-1.794-40.076-2.843-47.957-1.567m473.5%20305.564c-5.775.685-11.625%201.491-13%201.792-1.375.3-5.2%201.088-8.5%201.749-7.914%201.587-27.103%207.461-36.5%2011.174-38.797%2015.33-75.171%2044.925-98.829%2080.41-11.24%2016.86-21.329%2038.407-26.167%2055.888-2.443%208.825-3.85%2014.608-4.866%2020-.621%203.3-1.653%208.475-2.292%2011.5-.846%204.008-1.345%2059.624-1.837%20205-.618%20182.331-.824%20200.361-2.399%20209.5-1.629%209.459-4.196%2022.506-6.744%2034.279-.628%202.903-.881%205.54-.561%205.859.596.596%20455.986-279.084%20472.195-290.001%2017.547-11.819%2036.335-33.412%2046.291-53.203%203.956-7.863%209.527-23.924%2011.597-33.434%204.848-22.272%203.572-48.26-3.506-71.387-6.907-22.572-18.055-40.93-35.316-58.158-12.705-12.681-16.829-15.485-79.066-53.756-7.15-4.397-15.7-9.654-19-11.684-3.3-2.029-8.925-5.504-12.5-7.722-53.826-33.397-67.199-40.611-88.616-47.8-29.343-9.85-61.599-13.421-90.384-10.006m-1066.25%201048.256c3.988.189%2010.513.189%2014.5%200%203.988-.19.725-.346-7.25-.346s-11.238.156-7.25.346'%20fill='url(%23grad-r4R0»)'%20fill-rule='evenodd'%3e%3c/path%3e%3c/svg%3e";function uH({status:e,onReconnect:t}){const r={connected:"bg-green-500 text-white",reconnecting:"bg-yellow-500 text-black",disconnected:"bg-red-500 text-white"}[e],n={connected:"bg-green-800 animate-pulse",reconnecting:"bg-yellow-800 animate-pulse",disconnected:"bg-red-800"}[e],o=e.charAt(0).toUpperCase()+e.slice(1);return u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsxs("span",{className:`px-2 py-1 rounded-full text-xs font-semibold flex items-center ${r}`,children:[u.jsx("span",{className:`w-2 h-2 rounded-full mr-1 ${n}`}),o]}),e==="disconnected"&&u.jsx("button",{onClick:t,className:"ml-2 text-sm font-medium text-blue-600 hover:underline",children:"Reconnect"})]})}const cH=()=>{const{apiEndpoint:e,setApiEndpoint:t,connectionStatus:r,channelCode:n,setChannelCode:o,channel:a,setChannel:i,client:s,userInitiatedRegistrationRef:l,handleRegister:c,attemptReRegistration:d,resetReRegistration:f}=mr(),[m,p]=g.useState(!1),[h,b]=g.useState(e),[v,x]=g.useState(n),[k,S]=g.useState(a);g.useEffect(()=>{m||(b(e),x(n),S(a))},[e,n,a,m]);const j=()=>{const C=h.replace(/\/+$/,"");t(C),s.configure({apiEndpoint:C}),l.current=!1,c(n,a,"",!0)},O=()=>{l.current=!0,o(v),i(k),c(v,k,"",!0)};return u.jsxs("div",{className:"fixed bottom-0 left-0 w-full",children:[u.jsxs("div",{className:"flex items-center justify-between bg-gray-200 dark:bg-dark-tremor-background-subtle px-4 py-2 w-full cursor-pointer select-none",onClick:()=>p(C=>!C),children:[u.jsx(uH,{status:r,onReconnect:C=>{C.stopPropagation(),f(),d()}}),u.jsxs("a",{href:"https://github.com/inspectr-hq/inspectr",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2",onClick:C=>C.stopPropagation(),children:[u.jsx("img",{src:lH,alt:"Inspectr Logo",className:"h-6"}),u.jsx("span",{className:"text-gray-700 dark:text-dark-tremor-content font-semibold text-sm",children:"Inspectr"})]})]}),u.jsx("div",{className:`bg-gray-100 dark:bg-dark-tremor-background border-t border-gray-300 dark:border-dark-tremor-border transition-all duration-300 overflow-hidden ${m?"max-h-96 opacity-100 py-4":"max-h-0 opacity-0 py-0"}`,children:u.jsxs("div",{className:"px-6",children:[u.jsx("h2",{className:"text-lg font-semibold text-gray-800 dark:text-dark-tremor-content-strong mb-4",children:"Configuration"}),u.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-dark-tremor-content mb-1",children:"Inspectr API Endpoint"}),u.jsx("input",{type:"text",placeholder:"Enter API Endpoint...",value:h,onChange:C=>b(C.target.value),className:"w-full border bg-white dark:bg-dark-tremor-background-subtle dark:text-dark-tremor-content border-gray-300 dark:border-dark-tremor-border rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"}),u.jsx("button",{onClick:j,className:"mt-2 bg-blue-600 hover:bg-blue-700 dark:bg-blue-700 dark:hover:bg-blue-800 text-white px-3 py-1.5 rounded-md text-sm",children:"Save"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-dark-tremor-content mb-1",children:"Channel"}),u.jsx("input",{type:"text",placeholder:"Enter Channel...",value:k,onChange:C=>S(C.target.value),className:"w-full bg-white dark:bg-dark-tremor-background-subtle dark:text-dark-tremor-content border border-gray-300 dark:border-dark-tremor-border rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"}),u.jsx("button",{onClick:O,className:"mt-2 bg-green-600 hover:bg-green-700 dark:bg-green-700 dark:hover:bg-green-800 text-white px-3 py-1.5 rounded-md text-sm",children:"Register"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-dark-tremor-content mb-1",children:"Access Code"}),u.jsx("input",{type:"text",placeholder:"Enter Access Code...",value:v,onChange:C=>x(C.target.value),className:"w-full border bg-white dark:bg-dark-tremor-background-subtle dark:text-dark-tremor-content border-gray-300 dark:border-dark-tremor-border rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"})]})]})]})})]})};function a2(){const e=window.location.hash.slice(1),[t,r]=e.split("?"),[n,o,a]=t.split("/"),i=Object.fromEntries(new URLSearchParams(r||""));return{slug:n,operationId:o,subTab:a,params:i}}function dH(e,t=e[0].slug){const r=()=>{const{slug:s,operationId:l,subTab:c,params:d}=a2();return e.some(f=>f.slug===s)?{slug:s,operationId:l,subTab:c,params:d}:{slug:t,operationId:null,subTab:null,params:{}}},[n,o]=g.useState(()=>typeof window>"u"?{slug:t,operationId:null,subTab:null,params:{}}:r());g.useEffect(()=>{const s=()=>o(r());return window.addEventListener("hashchange",s),()=>window.removeEventListener("hashchange",s)},[]);const a=s=>{window.history.pushState(null,"",`#${s.slug}`),o({slug:s.slug,operationId:null,subTab:null,params:{}})},i=e.find(s=>s.slug===n.slug)||e[0];return{route:n,currentNav:i,handleTabClick:a}}function fH(e,t="request"){const[r,n]=g.useState(null),[o,a]=g.useState(t);return g.useEffect(()=>{const i=()=>{const{slug:s,operationId:l,subTab:c}=a2();if(s==="inspectr"){if(l&&e.length){const d=e.find(f=>String(f.id)===l);d&&n(d)}c&&a(c)}};return i(),window.addEventListener("hashchange",i),()=>window.removeEventListener("hashchange",i)},[e]),{selectedOperation:r,currentTab:o,handleSelect:i=>{n(i),window.history.pushState(null,"",`#inspectr/${i.id}/${o}`)},handleTabChange:i=>{a(i);const s=r?`#inspectr/${r.id}`:"#inspectr";window.history.replaceState(null,"",`${s}/${i}`)},clearSelection:()=>{n(null),window.history.pushState(null,"","#inspectr")}}}function GS(e,t){if(e===null)return t;try{return JSON.parse(e)}catch{return e}}function YS(e){if(e==null)return null;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function pH(e,t,r={}){const{resetOnReload:n=!1}=r,o=g.useRef(),a=()=>{if(typeof window>"u")return t;const l=sessionStorage.getItem(e);return GS(l,t)},[i,s]=g.useState(a);return g.useEffect(()=>{o.current=i},[i]),g.useEffect(()=>{if(!n||typeof window>"u")return;const l=()=>{sessionStorage.removeItem(e)};return window.addEventListener("beforeunload",l),()=>window.removeEventListener("beforeunload",l)},[e,n]),g.useEffect(()=>{if(typeof window>"u")return;const l=c=>{if(c.key&&c.key!==e)return;const d=sessionStorage.getItem(e),f=GS(d,t),m=YS(o.current);d!==m&&s(f)};return window.addEventListener("storage",l),window.addEventListener("session-storage",l),()=>{window.removeEventListener("storage",l),window.removeEventListener("session-storage",l)}},[e,t]),g.useEffect(()=>{if(typeof window>"u")return;const l=YS(i),c=sessionStorage.getItem(e);if(l===null){if(c===null)return;sessionStorage.removeItem(e)}else{if(c===l)return;sessionStorage.setItem(e,l)}window.dispatchEvent(new CustomEvent("session-storage",{detail:{key:e,value:i}}))},[e,i]),[i,s]}const mH="requestFilters",hH=Object.freeze({}),gH=Object.freeze({resetOnReload:!0}),A6=()=>{const{toast:e,setToast:t,client:r}=mr(),{syncOperations:n,setLastEventId:o}=mr(),a=100,i=33,[s,l]=g.useState(1),[c,d]=g.useState(!1),[f,m]=Cr("leftPanelWidth",i),p=parseFloat(f||i),h=g.useRef(!1),[b,v]=g.useState("time"),[x,k]=g.useState("desc"),[S,j]=pH(mH,hH,gH),{results:O=[],totalCount:C=0}=ca(()=>Br.queryEvents({filters:S,sort:{field:b,order:x},page:s,pageSize:a}),[S,b,x,s],{results:[],totalCount:0})||{},N=ca(()=>Br.getAllTagOptions(),[],[])||[],T=C?Math.ceil(C/a):1,{selectedOperation:M,currentTab:I,handleSelect:_,handleTabChange:R,clearSelection:L}=fH(O),F=()=>{d(!0),n(),setTimeout(()=>d(!1),2500)};g.useEffect(()=>{O&&(M&&O.some(q=>q.id===M.id)||(O.length>0?_(O[0]):L()))},[O,M]);const B=async()=>{L();try{await Br.clearEvents(),await z(),o("")}catch(q){console.error("Error clearing all operations:",q)}},U=async()=>{try{const q=await Br.queryEvents({filters:S,sort:{field:"time",order:"desc"},page:1,pageSize:Number.MAX_SAFE_INTEGER});await Promise.all(q.map(async J=>{await Br.deleteEvent(J.id),await W(J.operation_id)})),M&&q.some(J=>J.id===M.id)&&L()}catch(q){console.error("Error clearing filtered operations:",q)}},$=async q=>{const J=M&&(M.id||"")===q,V=await Br.getEvent(q);try{if(await Br.deleteEvent(q),await W(V.operation_id),J){L();const me=await Br.queryEvents({sort:{field:b,order:x},filters:S,page:s,pageSize:a});me&&me.length>0&&_(me[0])}}catch(me){console.error("Error during operation removal:",me)}},z=async()=>{try{await r.operations.deleteAll()}catch(q){console.error("Error deleting all operations:",q),t({message:"Error deleting all operations",subMessage:q.message,type:"error"})}},W=async q=>{try{await r.operations.delete(q)}catch(J){console.error(`Error deleting operation ${q}:`,J),t({message:"Error deleting operation",subMessage:J.message,type:"error"})}};g.useEffect(()=>{const q=V=>{if(!h.current)return;const me=V.clientX/window.innerWidth*100;me>10&&me<90&&m(String(me))},J=()=>{h.current=!1};return window.addEventListener("mousemove",q),window.addEventListener("mouseup",J),()=>{window.removeEventListener("mousemove",q),window.removeEventListener("mouseup",J)}},[m]);const K=()=>{h.current=!0};return u.jsxs("div",{className:"flex flex-col h-screen bg-white dark:bg-dark-tremor-background",style:{maxHeight:"calc(100vh - 64px)"},children:[u.jsxs("div",{className:"flex flex-grow",children:[u.jsx("div",{className:"overflow-y-auto",style:{width:`${p}%`},children:u.jsx(ZI,{operations:O||[],onSelect:_,onRemove:$,clearOperations:B,clearFilteredOperations:U,selectedOperation:M,currentPage:s,totalPages:T,totalCount:C||0,onPageChange:l,sortField:b,sortDirection:x,filters:S,setSortField:v,setSortDirection:k,setFilters:j,syncOperations:F,isSyncing:c,tagOptions:N})}),u.jsx("div",{className:"relative w-px bg-gray-300 dark:bg-dark-tremor-border cursor-col-resize",onMouseDown:K,children:u.jsx("button",{type:"button",className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-10 flex items-center justify-center px-0 py-2 rounded-md border border-gray-300 bg-white/80 backdrop-blur-sm shadow-sm cursor-col-resize dark:border-dark-tremor-border dark:bg-dark-tremor-background/80",title:"Drag to resize. Double-click to reset.","aria-label":"Resize panels",onMouseDown:q=>{q.preventDefault(),K()},onDoubleClick:q=>{q.preventDefault(),m(i)},children:u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"w-4 h-4 text-gray-600 dark:text-gray-400","aria-hidden":!0,children:u.jsx("path",{d:"M8.5 7C9.32843 7 10 6.32843 10 5.5C10 4.67157 9.32843 4 8.5 4C7.67157 4 7 4.67157 7 5.5C7 6.32843 7.67157 7 8.5 7ZM8.5 13.5C9.32843 13.5 10 12.8284 10 12C10 11.1716 9.32843 10.5 8.5 10.5C7.67157 10.5 7 11.1716 7 12C7 12.8284 7.67157 13.5 8.5 13.5ZM10 18.5C10 19.3284 9.32843 20 8.5 20C7.67157 20 7 19.3284 7 18.5C7 17.6716 7.67157 17 8.5 17C9.32843 17 10 17.6716 10 18.5ZM15.5 7C16.3284 7 17 6.32843 17 5.5C17 4.67157 16.3284 4 15.5 4C14.6716 4 14 4.67157 14 5.5C14 6.32843 14.6716 7 15.5 7ZM17 12C17 12.8284 16.3284 13.5 15.5 13.5C14.6716 13.5 14 12.8284 14 12C14 11.1716 14.6716 10.5 15.5 10.5C16.3284 10.5 17 11.1716 17 12ZM15.5 20C16.3284 20 17 19.3284 17 18.5C17 17.6716 16.3284 17 15.5 17C14.6716 17 14 17.6716 14 18.5C14 19.3284 14.6716 20 15.5 20Z"})})})}),u.jsx("div",{className:"p-4 h-full overflow-y-auto bg-white dark:bg-dark-tremor-background text-tremor-content-strong dark:text-dark-tremor-content-strong",style:{width:`${100-p}%`},children:u.jsx("div",{className:"flex flex-col h-full",children:u.jsx(sH,{operation:M,currentTab:I,setCurrentTab:R})})})]}),u.jsx(cH,{})]})},XS="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%201648%201648'%20xmlns='http://www.w3.org/2000/svg'%3e%3cdefs%3e%3clinearGradient%20id='grad-ops'%20x1='0%25'%20y1='0%25'%20x2='100%25'%20y2='0%25'%3e%3cstop%20offset='0%25'%20stop-color='%2353afba'%3e%3c/stop%3e%3cstop%20offset='100%25'%20stop-color='%2376fffb'%3e%3c/stop%3e%3c/linearGradient%3e%3c/defs%3e%3cpath%20d='m610%20216.654c-66.158%204.092-126.119%2035.849-164.917%2087.346-8.408%2011.16-13.344%2019.191-19.983%2032.513-12.431%2024.946-19.521%2050.434-22.11%2079.487-1.665%2018.687-.854%20826.238.841%20837.939%207.867%2054.284%2032.465%20101.134%2070.706%20134.667%2016.297%2014.291%2032.283%2024.657%2053.963%2034.991%2016.889%208.05%2034.568%2013.468%2060.5%2018.541%209.019%201.764%2052.201%201.795%2061.5.044%2026.487-4.989%2043.97-10.341%2061-18.675%2015.131-7.406%2021.53-11.135%2060.5-35.267%2020.813-12.887%2023.095-14.298%2029.5-18.24l13-8%2013-8c6.901-4.247%2012.593-7.767%2029.54-18.271%205.796-3.593%2012.771-7.863%2015.5-9.49%202.728-1.626%208.56-5.19%2012.96-7.921%204.4-2.73%2072.575-44.711%20151.5-93.29s150.925-92.918%20160-98.531c9.075-5.612%2024.15-14.936%2033.5-20.719s23.075-14.234%2030.5-18.78c85.169-52.142%20120.029-73.942%20130.014-81.304%2040.974-30.211%2068.344-69.764%2081.788-118.194%2013.864-49.94%208.549-104.847-14.809-153-16.836-34.708-41.252-62.432-74.993-85.154-4.125-2.778-17.625-11.26-30-18.849s-27-16.594-32.5-20.009c-5.5-3.416-109.45-67.427-231-142.246-306.386-188.593-335.221-206.352-350-215.553-30.562-19.028-59.301-29.911-90-34.083-11.697-1.59-30.408-2.514-39.5-1.952m-10.5%2077.269c-39.541%206.402-76.013%2029.73-97.661%2062.467-13.001%2019.66-19.718%2038.39-22.802%2063.584-1.472%2012.028-1.434%20802.191.04%20818.026%201.861%2019.998%206.142%2035.48%2014.415%2052.133%2017.942%2036.114%2053.025%2064.18%2091.508%2073.203%203.575.839%208.975%202.118%2012%202.844%208.221%201.973%2040.343%201.613%2049.971-.56%2032.301-7.289%2065.233-26.686%2094.817-55.849%2015.26-15.042%2022.884-24.803%2033.571-42.979%2013.939-23.706%2020.949-43.36%2027.745-77.792%201.004-5.086%201.428-50%201.949-206.5.465-139.686%201.001-201.809%201.777-206%20.611-3.3%201.608-9.15%202.217-13%201.672-10.583%204.039-21.117%207.191-32%208.179-28.247%2020.714-55.13%2037.188-79.751%2024.262-36.262%2053.189-63.572%2093.074-87.872%204.95-3.016%2012.825-7.435%2017.5-9.82s8.95-4.668%209.5-5.074c3.565-2.63%2034.688-13.266%2052.465-17.93%206.2-1.627%2011.49-3.174%2011.754-3.439%201.003-1.002-1.016-2.602-10.967-8.689-5.639-3.449-16.552-10.172-24.252-14.94-13.435-8.319-31.76-19.604-58.5-36.029-6.875-4.222-16.1-9.911-20.5-12.641-7.667-4.758-73.088-45.103-122.5-75.546-75.227-46.348-108.509-66.591-116.5-70.86-9.422-5.033-25.23-10.76-37.043-13.419-7.967-1.794-40.076-2.843-47.957-1.567m473.5%20305.564c-5.775.685-11.625%201.491-13%201.792-1.375.3-5.2%201.088-8.5%201.749-7.914%201.587-27.103%207.461-36.5%2011.174-38.797%2015.33-75.171%2044.925-98.829%2080.41-11.24%2016.86-21.329%2038.407-26.167%2055.888-2.443%208.825-3.85%2014.608-4.866%2020-.621%203.3-1.653%208.475-2.292%2011.5-.846%204.008-1.345%2059.624-1.837%20205-.618%20182.331-.824%20200.361-2.399%20209.5-1.629%209.459-4.196%2022.506-6.744%2034.279-.628%202.903-.881%205.54-.561%205.859.596.596%20455.986-279.084%20472.195-290.001%2017.547-11.819%2036.335-33.412%2046.291-53.203%203.956-7.863%209.527-23.924%2011.597-33.434%204.848-22.272%203.572-48.26-3.506-71.387-6.907-22.572-18.055-40.93-35.316-58.158-12.705-12.681-16.829-15.485-79.066-53.756-7.15-4.397-15.7-9.654-19-11.684-3.3-2.029-8.925-5.504-12.5-7.722-53.826-33.397-67.199-40.611-88.616-47.8-29.343-9.85-61.599-13.421-90.384-10.006m-1066.25%201048.256c3.988.189%2010.513.189%2014.5%200%203.988-.19.725-.346-7.25-.346s-11.238.156-7.25.346'%20fill='url(%23grad-ops)'%20fill-rule='evenodd'%3e%3c/path%3e%3c/svg%3e",bH="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%201648%201648'%20xmlns='http://www.w3.org/2000/svg'%3e%3cdefs%3e%3clinearGradient%20id='grad-connections'%20x1='0%25'%20y1='0%25'%20x2='100%25'%20y2='0%25'%3e%3cstop%20offset='0%25'%20stop-color='%23ff8c00'%3e%3c/stop%3e%3cstop%20offset='100%25'%20stop-color='%23ffd700'%3e%3c/stop%3e%3c/linearGradient%3e%3c/defs%3e%3cpath%20d='m610%20216.654c-66.158%204.092-126.119%2035.849-164.917%2087.346-8.408%2011.16-13.344%2019.191-19.983%2032.513-12.431%2024.946-19.521%2050.434-22.11%2079.487-1.665%2018.687-.854%20826.238.841%20837.939%207.867%2054.284%2032.465%20101.134%2070.706%20134.667%2016.297%2014.291%2032.283%2024.657%2053.963%2034.991%2016.889%208.05%2034.568%2013.468%2060.5%2018.541%209.019%201.764%2052.201%201.795%2061.5.044%2026.487-4.989%2043.97-10.341%2061-18.675%2015.131-7.406%2021.53-11.135%2060.5-35.267%2020.813-12.887%2023.095-14.298%2029.5-18.24l13-8%2013-8c6.901-4.247%2012.593-7.767%2029.54-18.271%205.796-3.593%2012.771-7.863%2015.5-9.49%202.728-1.626%208.56-5.19%2012.96-7.921%204.4-2.73%2072.575-44.711%20151.5-93.29s150.925-92.918%20160-98.531c9.075-5.612%2024.15-14.936%2033.5-20.719s23.075-14.234%2030.5-18.78c85.169-52.142%20120.029-73.942%20130.014-81.304%2040.974-30.211%2068.344-69.764%2081.788-118.194%2013.864-49.94%208.549-104.847-14.809-153-16.836-34.708-41.252-62.432-74.993-85.154-4.125-2.778-17.625-11.26-30-18.849s-27-16.594-32.5-20.009c-5.5-3.416-109.45-67.427-231-142.246-306.386-188.593-335.221-206.352-350-215.553-30.562-19.028-59.301-29.911-90-34.083-11.697-1.59-30.408-2.514-39.5-1.952m-10.5%2077.269c-39.541%206.402-76.013%2029.73-97.661%2062.467-13.001%2019.66-19.718%2038.39-22.802%2063.584-1.472%2012.028-1.434%20802.191.04%20818.026%201.861%2019.998%206.142%2035.48%2014.415%2052.133%2017.942%2036.114%2053.025%2064.18%2091.508%2073.203%203.575.839%208.975%202.118%2012%202.844%208.221%201.973%2040.343%201.613%2049.971-.56%2032.301-7.289%2065.233-26.686%2094.817-55.849%2015.26-15.042%2022.884-24.803%2033.571-42.979%2013.939-23.706%2020.949-43.36%2027.745-77.792%201.004-5.086%201.428-50%201.949-206.5.465-139.686%201.001-201.809%201.777-206%20.611-3.3%201.608-9.15%202.217-13%201.672-10.583%204.039-21.117%207.191-32%208.179-28.247%2020.714-55.13%2037.188-79.751%2024.262-36.262%2053.189-63.572%2093.074-87.872%204.95-3.016%2012.825-7.435%2017.5-9.82s8.95-4.668%209.5-5.074c3.565-2.63%2034.688-13.266%2052.465-17.93%206.2-1.627%2011.49-3.174%2011.754-3.439%201.003-1.002-1.016-2.602-10.967-8.689-5.639-3.449-16.552-10.172-24.252-14.94-13.435-8.319-31.76-19.604-58.5-36.029-6.875-4.222-16.1-9.911-20.5-12.641-7.667-4.758-73.088-45.103-122.5-75.546-75.227-46.348-108.509-66.591-116.5-70.86-9.422-5.033-25.23-10.76-37.043-13.419-7.967-1.794-40.076-2.843-47.957-1.567m473.5%20305.564c-5.775.685-11.625%201.491-13%201.792-1.375.3-5.2%201.088-8.5%201.749-7.914%201.587-27.103%207.461-36.5%2011.174-38.797%2015.33-75.171%2044.925-98.829%2080.41-11.24%2016.86-21.329%2038.407-26.167%2055.888-2.443%208.825-3.85%2014.608-4.866%2020-.621%203.3-1.653%208.475-2.292%2011.5-.846%204.008-1.345%2059.624-1.837%20205-.618%20182.331-.824%20200.361-2.399%20209.5-1.629%209.459-4.196%2022.506-6.744%2034.279-.628%202.903-.881%205.54-.561%205.859.596.596%20455.986-279.084%20472.195-290.001%2017.547-11.819%2036.335-33.412%2046.291-53.203%203.956-7.863%209.527-23.924%2011.597-33.434%204.848-22.272%203.572-48.26-3.506-71.387-6.907-22.572-18.055-40.93-35.316-58.158-12.705-12.681-16.829-15.485-79.066-53.756-7.15-4.397-15.7-9.654-19-11.684-3.3-2.029-8.925-5.504-12.5-7.722-53.826-33.397-67.199-40.611-88.616-47.8-29.343-9.85-61.599-13.421-90.384-10.006m-1066.25%201048.256c3.988.189%2010.513.189%2014.5%200%203.988-.19.725-.346-7.25-.346s-11.238.156-7.25.346'%20fill='url(%23grad-connections)'%20fill-rule='evenodd'%3e%3c/path%3e%3c/svg%3e",vH="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20width='24'%20height='24'%20fill='none'%3e%3cpath%20d='M3.49994%2011.7501L11.6717%203.57855C12.7762%202.47398%2014.5672%202.47398%2015.6717%203.57855C16.7762%204.68312%2016.7762%206.47398%2015.6717%207.57855M15.6717%207.57855L9.49994%2013.7501M15.6717%207.57855C16.7762%206.47398%2018.5672%206.47398%2019.6717%207.57855C20.7762%208.68312%2020.7762%2010.474%2019.6717%2011.5785L12.7072%2018.543C12.3167%2018.9335%2012.3167%2019.5667%2012.7072%2019.9572L13.9999%2021.2499'%20stroke='%236b7280'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3c/path%3e%3cpath%20d='M17.4999%209.74921L11.3282%2015.921C10.2237%2017.0255%208.43272%2017.0255%207.32823%2015.921C6.22373%2014.8164%206.22373%2013.0255%207.32823%2011.921L13.4999%205.74939'%20stroke='%236b7280'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3c/path%3e%3c/svg%3e",ZS="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%236b7280'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%20aria-hidden='true'%3e%3cpath%20d='m15%2012-8.373%208.373a1%201%200%201%201-3-3L12%209'%3e%3c/path%3e%3cpath%20d='m18%2015%204-4'%3e%3c/path%3e%3cpath%20d='m21.5%2011.5-1.914-1.914A2%202%200%200%201%2019%208.172V7l-2.26-2.26a6%206%200%200%200-4.202-1.756L9%202.96l.92.82A6.18%206.18%200%200%201%2012%208.4V10l2%202h1.172a2%202%200%200%201%201.414.586L18.5%2014.5'%3e%3c/path%3e%3c/svg%3e",yH="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%236b7280'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%20aria-hidden='true'%3e%3cpath%20d='M20%207h-3a2%202%200%200%201-2-2V2'%3e%3c/path%3e%3cpath%20d='M9%2018a2%202%200%200%201-2-2V4a2%202%200%200%201%202-2h7l4%204v10a2%202%200%200%201-2%202Z'%3e%3c/path%3e%3cpath%20d='M3%207.6v12.8A1.6%201.6%200%200%200%204.6%2022h9.8'%3e%3c/path%3e%3c/svg%3e",xH="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%236b7280'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%20aria-hidden='true'%3e%3cpath%20d='M21%2015a2%202%200%200%201-2%202H7l-4%204V5a2%202%200%200%201%202-2h14a2%202%200%200%201%202%202z'%3e%3c/path%3e%3c/svg%3e";function Te(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}var Bg,JS;function gn(){if(JS)return Bg;JS=1;var e=Array.isArray;return Bg=e,Bg}var zg,QS;function T6(){if(QS)return zg;QS=1;var e=typeof Vu=="object"&&Vu&&Vu.Object===Object&&Vu;return zg=e,zg}var Hg,eN;function Fo(){if(eN)return Hg;eN=1;var e=T6(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return Hg=r,Hg}var qg,tN;function hd(){if(tN)return qg;tN=1;var e=Fo(),t=e.Symbol;return qg=t,qg}var Wg,rN;function wH(){if(rN)return Wg;rN=1;var e=hd(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,o=e?e.toStringTag:void 0;function a(i){var s=r.call(i,o),l=i[o];try{i[o]=void 0;var c=!0}catch{}var d=n.call(i);return c&&(s?i[o]=l:delete i[o]),d}return Wg=a,Wg}var Ug,nN;function kH(){if(nN)return Ug;nN=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return Ug=r,Ug}var Kg,oN;function ba(){if(oN)return Kg;oN=1;var e=hd(),t=wH(),r=kH(),n="[object Null]",o="[object Undefined]",a=e?e.toStringTag:void 0;function i(s){return s==null?s===void 0?o:n:a&&a in Object(s)?t(s):r(s)}return Kg=i,Kg}var Vg,aN;function va(){if(aN)return Vg;aN=1;function e(t){return t!=null&&typeof t=="object"}return Vg=e,Vg}var Gg,iN;function Yl(){if(iN)return Gg;iN=1;var e=ba(),t=va(),r="[object Symbol]";function n(o){return typeof o=="symbol"||t(o)&&e(o)==r}return Gg=n,Gg}var Yg,sN;function i2(){if(sN)return Yg;sN=1;var e=gn(),t=Yl(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function o(a,i){if(e(a))return!1;var s=typeof a;return s=="number"||s=="symbol"||s=="boolean"||a==null||t(a)?!0:n.test(a)||!r.test(a)||i!=null&&a in Object(i)}return Yg=o,Yg}var Xg,lN;function gi(){if(lN)return Xg;lN=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return Xg=e,Xg}var Zg,uN;function s2(){if(uN)return Zg;uN=1;var e=ba(),t=gi(),r="[object AsyncFunction]",n="[object Function]",o="[object GeneratorFunction]",a="[object Proxy]";function i(s){if(!t(s))return!1;var l=e(s);return l==n||l==o||l==r||l==a}return Zg=i,Zg}var Jg,cN;function jH(){if(cN)return Jg;cN=1;var e=Fo(),t=e["__core-js_shared__"];return Jg=t,Jg}var Qg,dN;function EH(){if(dN)return Qg;dN=1;var e=jH(),t=function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function r(n){return!!t&&t in n}return Qg=r,Qg}var eb,fN;function M6(){if(fN)return eb;fN=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return eb=r,eb}var tb,pN;function SH(){if(pN)return tb;pN=1;var e=s2(),t=EH(),r=gi(),n=M6(),o=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,i=Function.prototype,s=Object.prototype,l=i.toString,c=s.hasOwnProperty,d=RegExp("^"+l.call(c).replace(o,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(m){if(!r(m)||t(m))return!1;var p=e(m)?d:a;return p.test(n(m))}return tb=f,tb}var rb,mN;function NH(){if(mN)return rb;mN=1;function e(t,r){return t?.[r]}return rb=e,rb}var nb,hN;function vs(){if(hN)return nb;hN=1;var e=SH(),t=NH();function r(n,o){var a=t(n,o);return e(a)?a:void 0}return nb=r,nb}var ob,gN;function Rm(){if(gN)return ob;gN=1;var e=vs(),t=e(Object,"create");return ob=t,ob}var ab,bN;function OH(){if(bN)return ab;bN=1;var e=Rm();function t(){this.__data__=e?e(null):{},this.size=0}return ab=t,ab}var ib,vN;function CH(){if(vN)return ib;vN=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return ib=e,ib}var sb,yN;function PH(){if(yN)return sb;yN=1;var e=Rm(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function o(a){var i=this.__data__;if(e){var s=i[a];return s===t?void 0:s}return n.call(i,a)?i[a]:void 0}return sb=o,sb}var lb,xN;function AH(){if(xN)return lb;xN=1;var e=Rm(),t=Object.prototype,r=t.hasOwnProperty;function n(o){var a=this.__data__;return e?a[o]!==void 0:r.call(a,o)}return lb=n,lb}var ub,wN;function TH(){if(wN)return ub;wN=1;var e=Rm(),t="__lodash_hash_undefined__";function r(n,o){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=e&&o===void 0?t:o,this}return ub=r,ub}var cb,kN;function MH(){if(kN)return cb;kN=1;var e=OH(),t=CH(),r=PH(),n=AH(),o=TH();function a(i){var s=-1,l=i==null?0:i.length;for(this.clear();++s<l;){var c=i[s];this.set(c[0],c[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=o,cb=a,cb}var db,jN;function _H(){if(jN)return db;jN=1;function e(){this.__data__=[],this.size=0}return db=e,db}var fb,EN;function l2(){if(EN)return fb;EN=1;function e(t,r){return t===r||t!==t&&r!==r}return fb=e,fb}var pb,SN;function Fm(){if(SN)return pb;SN=1;var e=l2();function t(r,n){for(var o=r.length;o--;)if(e(r[o][0],n))return o;return-1}return pb=t,pb}var mb,NN;function IH(){if(NN)return mb;NN=1;var e=Fm(),t=Array.prototype,r=t.splice;function n(o){var a=this.__data__,i=e(a,o);if(i<0)return!1;var s=a.length-1;return i==s?a.pop():r.call(a,i,1),--this.size,!0}return mb=n,mb}var hb,ON;function DH(){if(ON)return hb;ON=1;var e=Fm();function t(r){var n=this.__data__,o=e(n,r);return o<0?void 0:n[o][1]}return hb=t,hb}var gb,CN;function LH(){if(CN)return gb;CN=1;var e=Fm();function t(r){return e(this.__data__,r)>-1}return gb=t,gb}var bb,PN;function RH(){if(PN)return bb;PN=1;var e=Fm();function t(r,n){var o=this.__data__,a=e(o,r);return a<0?(++this.size,o.push([r,n])):o[a][1]=n,this}return bb=t,bb}var vb,AN;function $m(){if(AN)return vb;AN=1;var e=_H(),t=IH(),r=DH(),n=LH(),o=RH();function a(i){var s=-1,l=i==null?0:i.length;for(this.clear();++s<l;){var c=i[s];this.set(c[0],c[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=o,vb=a,vb}var yb,TN;function u2(){if(TN)return yb;TN=1;var e=vs(),t=Fo(),r=e(t,"Map");return yb=r,yb}var xb,MN;function FH(){if(MN)return xb;MN=1;var e=MH(),t=$m(),r=u2();function n(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return xb=n,xb}var wb,_N;function $H(){if(_N)return wb;_N=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return wb=e,wb}var kb,IN;function Bm(){if(IN)return kb;IN=1;var e=$H();function t(r,n){var o=r.__data__;return e(n)?o[typeof n=="string"?"string":"hash"]:o.map}return kb=t,kb}var jb,DN;function BH(){if(DN)return jb;DN=1;var e=Bm();function t(r){var n=e(this,r).delete(r);return this.size-=n?1:0,n}return jb=t,jb}var Eb,LN;function zH(){if(LN)return Eb;LN=1;var e=Bm();function t(r){return e(this,r).get(r)}return Eb=t,Eb}var Sb,RN;function HH(){if(RN)return Sb;RN=1;var e=Bm();function t(r){return e(this,r).has(r)}return Sb=t,Sb}var Nb,FN;function qH(){if(FN)return Nb;FN=1;var e=Bm();function t(r,n){var o=e(this,r),a=o.size;return o.set(r,n),this.size+=o.size==a?0:1,this}return Nb=t,Nb}var Ob,$N;function c2(){if($N)return Ob;$N=1;var e=FH(),t=BH(),r=zH(),n=HH(),o=qH();function a(i){var s=-1,l=i==null?0:i.length;for(this.clear();++s<l;){var c=i[s];this.set(c[0],c[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=o,Ob=a,Ob}var Cb,BN;function _6(){if(BN)return Cb;BN=1;var e=c2(),t="Expected a function";function r(n,o){if(typeof n!="function"||o!=null&&typeof o!="function")throw new TypeError(t);var a=function(){var i=arguments,s=o?o.apply(this,i):i[0],l=a.cache;if(l.has(s))return l.get(s);var c=n.apply(this,i);return a.cache=l.set(s,c)||l,c};return a.cache=new(r.Cache||e),a}return r.Cache=e,Cb=r,Cb}var Pb,zN;function WH(){if(zN)return Pb;zN=1;var e=_6(),t=500;function r(n){var o=e(n,function(i){return a.size===t&&a.clear(),i}),a=o.cache;return o}return Pb=r,Pb}var Ab,HN;function UH(){if(HN)return Ab;HN=1;var e=WH(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=e(function(o){var a=[];return o.charCodeAt(0)===46&&a.push(""),o.replace(t,function(i,s,l,c){a.push(l?c.replace(r,"$1"):s||i)}),a});return Ab=n,Ab}var Tb,qN;function d2(){if(qN)return Tb;qN=1;function e(t,r){for(var n=-1,o=t==null?0:t.length,a=Array(o);++n<o;)a[n]=r(t[n],n,t);return a}return Tb=e,Tb}var Mb,WN;function KH(){if(WN)return Mb;WN=1;var e=hd(),t=d2(),r=gn(),n=Yl(),o=e?e.prototype:void 0,a=o?o.toString:void 0;function i(s){if(typeof s=="string")return s;if(r(s))return t(s,i)+"";if(n(s))return a?a.call(s):"";var l=s+"";return l=="0"&&1/s==-1/0?"-0":l}return Mb=i,Mb}var _b,UN;function I6(){if(UN)return _b;UN=1;var e=KH();function t(r){return r==null?"":e(r)}return _b=t,_b}var Ib,KN;function D6(){if(KN)return Ib;KN=1;var e=gn(),t=i2(),r=UH(),n=I6();function o(a,i){return e(a)?a:t(a,i)?[a]:r(n(a))}return Ib=o,Ib}var Db,VN;function zm(){if(VN)return Db;VN=1;var e=Yl();function t(r){if(typeof r=="string"||e(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return Db=t,Db}var Lb,GN;function f2(){if(GN)return Lb;GN=1;var e=D6(),t=zm();function r(n,o){o=e(o,n);for(var a=0,i=o.length;n!=null&&a<i;)n=n[t(o[a++])];return a&&a==i?n:void 0}return Lb=r,Lb}var Rb,YN;function L6(){if(YN)return Rb;YN=1;var e=f2();function t(r,n,o){var a=r==null?void 0:e(r,n);return a===void 0?o:a}return Rb=t,Rb}var VH=L6();const Sn=qt(VH);var Fb,XN;function GH(){if(XN)return Fb;XN=1;function e(t){return t==null}return Fb=e,Fb}var YH=GH();const st=qt(YH);var $b,ZN;function XH(){if(ZN)return $b;ZN=1;var e=ba(),t=gn(),r=va(),n="[object String]";function o(a){return typeof a=="string"||!t(a)&&r(a)&&e(a)==n}return $b=o,$b}var ZH=XH();const gd=qt(ZH);var JH=s2();const it=qt(JH);var QH=gi();const Xl=qt(QH);var JN={exports:{}},$t={};/**
49
+ * @license React
50
+ * react-is.production.min.js
51
+ *
52
+ * Copyright (c) Facebook, Inc. and its affiliates.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE file in the root directory of this source tree.
56
+ */var QN;function eq(){if(QN)return $t;QN=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),i=Symbol.for("react.context"),s=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),h;h=Symbol.for("react.module.reference");function b(v){if(typeof v=="object"&&v!==null){var x=v.$$typeof;switch(x){case e:switch(v=v.type,v){case r:case o:case n:case c:case d:return v;default:switch(v=v&&v.$$typeof,v){case s:case i:case l:case m:case f:case a:return v;default:return x}}case t:return x}}}return $t.ContextConsumer=i,$t.ContextProvider=a,$t.Element=e,$t.ForwardRef=l,$t.Fragment=r,$t.Lazy=m,$t.Memo=f,$t.Portal=t,$t.Profiler=o,$t.StrictMode=n,$t.Suspense=c,$t.SuspenseList=d,$t.isAsyncMode=function(){return!1},$t.isConcurrentMode=function(){return!1},$t.isContextConsumer=function(v){return b(v)===i},$t.isContextProvider=function(v){return b(v)===a},$t.isElement=function(v){return typeof v=="object"&&v!==null&&v.$$typeof===e},$t.isForwardRef=function(v){return b(v)===l},$t.isFragment=function(v){return b(v)===r},$t.isLazy=function(v){return b(v)===m},$t.isMemo=function(v){return b(v)===f},$t.isPortal=function(v){return b(v)===t},$t.isProfiler=function(v){return b(v)===o},$t.isStrictMode=function(v){return b(v)===n},$t.isSuspense=function(v){return b(v)===c},$t.isSuspenseList=function(v){return b(v)===d},$t.isValidElementType=function(v){return typeof v=="string"||typeof v=="function"||v===r||v===o||v===n||v===c||v===d||v===p||typeof v=="object"&&v!==null&&(v.$$typeof===m||v.$$typeof===f||v.$$typeof===a||v.$$typeof===i||v.$$typeof===l||v.$$typeof===h||v.getModuleId!==void 0)},$t.typeOf=b,$t}var eO;function tq(){return eO||(eO=1,JN.exports=eq()),JN.exports}var rq=tq(),Bb,tO;function R6(){if(tO)return Bb;tO=1;var e=ba(),t=va(),r="[object Number]";function n(o){return typeof o=="number"||t(o)&&e(o)==r}return Bb=n,Bb}var zb,rO;function nq(){if(rO)return zb;rO=1;var e=R6();function t(r){return e(r)&&r!=+r}return zb=t,zb}var oq=nq();const Zl=qt(oq);var aq=R6();const iq=qt(aq);var en=function(e){return e===0?0:e>0?1:-1},Ki=function(e){return gd(e)&&e.indexOf("%")===e.length-1},Re=function(e){return iq(e)&&!Zl(e)},Mr=function(e){return Re(e)||gd(e)},sq=0,bi=function(e){var t=++sq;return"".concat(e||"").concat(t)},tn=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Re(e)&&!gd(e))return r;var o;if(Ki(e)){var a=e.indexOf("%");o=t*parseFloat(e.slice(0,a))/100}else o=+e;return Zl(o)&&(o=r),n&&o>t&&(o=t),o},Ha=function(e){if(!e)return null;var t=Object.keys(e);return t&&t.length?e[t[0]]:null},lq=function(e){if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;n<t;n++)if(!r[e[n]])r[e[n]]=!0;else return!0;return!1},gr=function(e,t){return Re(e)&&Re(t)?function(r){return e+r*(t-e)}:function(){return t}};function op(e,t,r){return!e||!e.length?null:e.find(function(n){return n&&(typeof t=="function"?t(n):Sn(n,t))===r})}var uq=function(e){if(!e||!e.length)return null;for(var t=e.length,r=0,n=0,o=0,a=0,i=1/0,s=-1/0,l=0,c=0,d=0;d<t;d++)l=e[d].cx||0,c=e[d].cy||0,r+=l,n+=c,o+=l*c,a+=l*l,i=Math.min(i,l),s=Math.max(s,l);var f=t*a!==r*r?(t*o-r*n)/(t*a-r*r):0;return{xmin:i,xmax:s,a:f,b:(n-f*r)/t}};function Qs(e,t){for(var r in e)if({}.hasOwnProperty.call(e,r)&&(!{}.hasOwnProperty.call(t,r)||e[r]!==t[r]))return!1;for(var n in t)if({}.hasOwnProperty.call(t,n)&&!{}.hasOwnProperty.call(e,n))return!1;return!0}function I0(e){"@babel/helpers - typeof";return I0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I0(e)}var cq=["viewBox","children"],dq=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],nO=["points","pathLength"],oO={svg:cq,polygon:nO,polyline:nO},p2=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],ap=function(e,t){if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(g.isValidElement(e)&&(r=e.props),!Xl(r))return null;var n={};return Object.keys(r).forEach(function(o){p2.includes(o)&&(n[o]=t||function(a){return r[o](r,a)})}),n},fq=function(e,t,r){return function(n){return e(t,r,n),null}},si=function(e,t,r){if(!Xl(e)||I0(e)!=="object")return null;var n=null;return Object.keys(e).forEach(function(o){var a=e[o];p2.includes(o)&&typeof a=="function"&&(n||(n={}),n[o]=fq(a,t,r))}),n},pq=["children"],mq=["children"];function aO(e,t){if(e==null)return{};var r=hq(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function hq(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function D0(e){"@babel/helpers - typeof";return D0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},D0(e)}var iO={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},ia=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},sO=null,Hb=null,m2=function e(t){if(t===sO&&Array.isArray(Hb))return Hb;var r=[];return g.Children.forEach(t,function(n){st(n)||(rq.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),Hb=r,sO=t,r};function on(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(o){return ia(o)}):n=[ia(t)],m2(e).forEach(function(o){var a=Sn(o,"type.displayName")||Sn(o,"type.name");n.indexOf(a)!==-1&&r.push(o)}),r}function xn(e,t){var r=on(e,t);return r&&r[0]}var lO=function(e){if(!e||!e.props)return!1;var t=e.props,r=t.width,n=t.height;return!(!Re(r)||r<=0||!Re(n)||n<=0)},gq=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],bq=function(e){return e&&e.type&&gd(e.type)&&gq.indexOf(e.type)>=0},F6=function(e){return e&&D0(e)==="object"&&"clipDot"in e},vq=function(e,t,r,n){var o,a=(o=oO?.[n])!==null&&o!==void 0?o:[];return t.startsWith("data-")||!it(e)&&(n&&a.includes(t)||dq.includes(t))||r&&p2.includes(t)},Xe=function(e,t,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(g.isValidElement(e)&&(n=e.props),!Xl(n))return null;var o={};return Object.keys(n).forEach(function(a){var i;vq((i=n)===null||i===void 0?void 0:i[a],a,t,r)&&(o[a]=n[a])}),o},L0=function e(t,r){if(t===r)return!0;var n=g.Children.count(t);if(n!==g.Children.count(r))return!1;if(n===0)return!0;if(n===1)return uO(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var o=0;o<n;o++){var a=t[o],i=r[o];if(Array.isArray(a)||Array.isArray(i)){if(!e(a,i))return!1}else if(!uO(a,i))return!1}return!0},uO=function(e,t){if(st(e)&&st(t))return!0;if(!st(e)&&!st(t)){var r=e.props||{},n=r.children,o=aO(r,pq),a=t.props||{},i=a.children,s=aO(a,mq);return n&&i?Qs(o,s)&&L0(n,i):!n&&!i?Qs(o,s):!1}return!1},cO=function(e,t){var r=[],n={};return m2(e).forEach(function(o,a){if(bq(o))r.push(o);else if(o){var i=ia(o.type),s=t[i]||{},l=s.handler,c=s.once;if(l&&(!c||!n[i])){var d=l(o,i,a);r.push(d),n[i]=!0}}}),r},yq=function(e){var t=e&&e.type;return t&&iO[t]?iO[t]:null},xq=function(e,t){return m2(t).indexOf(e)},wq=["children","width","height","viewBox","className","style","title","desc"];function R0(){return R0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},R0.apply(this,arguments)}function kq(e,t){if(e==null)return{};var r=jq(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function jq(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function F0(e){var t=e.children,r=e.width,n=e.height,o=e.viewBox,a=e.className,i=e.style,s=e.title,l=e.desc,c=kq(e,wq),d=o||{width:r,height:n,x:0,y:0},f=wt("recharts-surface",a);return y.createElement("svg",R0({},Xe(c,!0,"svg"),{className:f,width:r,height:n,style:i,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),y.createElement("title",null,s),y.createElement("desc",null,l),t)}var Eq=["children","className"];function $0(){return $0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$0.apply(this,arguments)}function Sq(e,t){if(e==null)return{};var r=Nq(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Nq(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var jt=y.forwardRef(function(e,t){var r=e.children,n=e.className,o=Sq(e,Eq),a=wt("recharts-layer",n);return y.createElement("g",$0({className:a},Xe(o,!0),{ref:t}),r)}),Xn=function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o]},qb,dO;function Oq(){if(dO)return qb;dO=1;function e(t,r,n){var o=-1,a=t.length;r<0&&(r=-r>a?0:a+r),n=n>a?a:n,n<0&&(n+=a),a=r>n?0:n-r>>>0,r>>>=0;for(var i=Array(a);++o<a;)i[o]=t[o+r];return i}return qb=e,qb}var Wb,fO;function Cq(){if(fO)return Wb;fO=1;var e=Oq();function t(r,n,o){var a=r.length;return o=o===void 0?a:o,!n&&o>=a?r:e(r,n,o)}return Wb=t,Wb}var Ub,pO;function $6(){if(pO)return Ub;pO=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",o=t+r+n,a="\\ufe0e\\ufe0f",i="\\u200d",s=RegExp("["+i+e+o+a+"]");function l(c){return s.test(c)}return Ub=l,Ub}var Kb,mO;function Pq(){if(mO)return Kb;mO=1;function e(t){return t.split("")}return Kb=e,Kb}var Vb,hO;function Aq(){if(hO)return Vb;hO=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",o=t+r+n,a="\\ufe0e\\ufe0f",i="["+e+"]",s="["+o+"]",l="\\ud83c[\\udffb-\\udfff]",c="(?:"+s+"|"+l+")",d="[^"+e+"]",f="(?:\\ud83c[\\udde6-\\uddff]){2}",m="[\\ud800-\\udbff][\\udc00-\\udfff]",p="\\u200d",h=c+"?",b="["+a+"]?",v="(?:"+p+"(?:"+[d,f,m].join("|")+")"+b+h+")*",x=b+h+v,k="(?:"+[d+s+"?",s,f,m,i].join("|")+")",S=RegExp(l+"(?="+l+")|"+k+x,"g");function j(O){return O.match(S)||[]}return Vb=j,Vb}var Gb,gO;function Tq(){if(gO)return Gb;gO=1;var e=Pq(),t=$6(),r=Aq();function n(o){return t(o)?r(o):e(o)}return Gb=n,Gb}var Yb,bO;function Mq(){if(bO)return Yb;bO=1;var e=Cq(),t=$6(),r=Tq(),n=I6();function o(a){return function(i){i=n(i);var s=t(i)?r(i):void 0,l=s?s[0]:i.charAt(0),c=s?e(s,1).join(""):i.slice(1);return l[a]()+c}}return Yb=o,Yb}var Xb,vO;function _q(){if(vO)return Xb;vO=1;var e=Mq(),t=e("toUpperCase");return Xb=t,Xb}var Iq=_q();const Hm=qt(Iq);function ur(e){return function(){return e}}const B6=Math.cos,ip=Math.sin,ao=Math.sqrt,sp=Math.PI,qm=2*sp,B0=Math.PI,z0=2*B0,Ii=1e-6,Dq=z0-Ii;function z6(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function Lq(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return z6;const r=10**t;return function(n){this._+=n[0];for(let o=1,a=n.length;o<a;++o)this._+=Math.round(arguments[o]*r)/r+n[o]}}class Rq{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?z6:Lq(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,o){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+o}`}bezierCurveTo(t,r,n,o,a,i){this._append`C${+t},${+r},${+n},${+o},${this._x1=+a},${this._y1=+i}`}arcTo(t,r,n,o,a){if(t=+t,r=+r,n=+n,o=+o,a=+a,a<0)throw new Error(`negative radius: ${a}`);let i=this._x1,s=this._y1,l=n-t,c=o-r,d=i-t,f=s-r,m=d*d+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(m>Ii)if(!(Math.abs(f*l-c*d)>Ii)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let p=n-i,h=o-s,b=l*l+c*c,v=p*p+h*h,x=Math.sqrt(b),k=Math.sqrt(m),S=a*Math.tan((B0-Math.acos((b+m-v)/(2*x*k)))/2),j=S/k,O=S/x;Math.abs(j-1)>Ii&&this._append`L${t+j*d},${r+j*f}`,this._append`A${a},${a},0,0,${+(f*p>d*h)},${this._x1=t+O*l},${this._y1=r+O*c}`}}arc(t,r,n,o,a,i){if(t=+t,r=+r,n=+n,i=!!i,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(o),l=n*Math.sin(o),c=t+s,d=r+l,f=1^i,m=i?o-a:a-o;this._x1===null?this._append`M${c},${d}`:(Math.abs(this._x1-c)>Ii||Math.abs(this._y1-d)>Ii)&&this._append`L${c},${d}`,n&&(m<0&&(m=m%z0+z0),m>Dq?this._append`A${n},${n},0,1,${f},${t-s},${r-l}A${n},${n},0,1,${f},${this._x1=c},${this._y1=d}`:m>Ii&&this._append`A${n},${n},0,${+(m>=B0)},${f},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,o){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+o}h${-n}Z`}toString(){return this._}}function h2(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new Rq(t)}function g2(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function H6(e){this._context=e}H6.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Wm(e){return new H6(e)}function q6(e){return e[0]}function W6(e){return e[1]}function U6(e,t){var r=ur(!0),n=null,o=Wm,a=null,i=h2(s);e=typeof e=="function"?e:e===void 0?q6:ur(e),t=typeof t=="function"?t:t===void 0?W6:ur(t);function s(l){var c,d=(l=g2(l)).length,f,m=!1,p;for(n==null&&(a=o(p=i())),c=0;c<=d;++c)!(c<d&&r(f=l[c],c,l))===m&&((m=!m)?a.lineStart():a.lineEnd()),m&&a.point(+e(f,c,l),+t(f,c,l));if(p)return a=null,p+""||null}return s.x=function(l){return arguments.length?(e=typeof l=="function"?l:ur(+l),s):e},s.y=function(l){return arguments.length?(t=typeof l=="function"?l:ur(+l),s):t},s.defined=function(l){return arguments.length?(r=typeof l=="function"?l:ur(!!l),s):r},s.curve=function(l){return arguments.length?(o=l,n!=null&&(a=o(n)),s):o},s.context=function(l){return arguments.length?(l==null?n=a=null:a=o(n=l),s):n},s}function mf(e,t,r){var n=null,o=ur(!0),a=null,i=Wm,s=null,l=h2(c);e=typeof e=="function"?e:e===void 0?q6:ur(+e),t=typeof t=="function"?t:ur(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?W6:ur(+r);function c(f){var m,p,h,b=(f=g2(f)).length,v,x=!1,k,S=new Array(b),j=new Array(b);for(a==null&&(s=i(k=l())),m=0;m<=b;++m){if(!(m<b&&o(v=f[m],m,f))===x)if(x=!x)p=m,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),h=m-1;h>=p;--h)s.point(S[h],j[h]);s.lineEnd(),s.areaEnd()}x&&(S[m]=+e(v,m,f),j[m]=+t(v,m,f),s.point(n?+n(v,m,f):S[m],r?+r(v,m,f):j[m]))}if(k)return s=null,k+""||null}function d(){return U6().defined(o).curve(i).context(a)}return c.x=function(f){return arguments.length?(e=typeof f=="function"?f:ur(+f),n=null,c):e},c.x0=function(f){return arguments.length?(e=typeof f=="function"?f:ur(+f),c):e},c.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:ur(+f),c):n},c.y=function(f){return arguments.length?(t=typeof f=="function"?f:ur(+f),r=null,c):t},c.y0=function(f){return arguments.length?(t=typeof f=="function"?f:ur(+f),c):t},c.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:ur(+f),c):r},c.lineX0=c.lineY0=function(){return d().x(e).y(t)},c.lineY1=function(){return d().x(e).y(r)},c.lineX1=function(){return d().x(n).y(t)},c.defined=function(f){return arguments.length?(o=typeof f=="function"?f:ur(!!f),c):o},c.curve=function(f){return arguments.length?(i=f,a!=null&&(s=i(a)),c):i},c.context=function(f){return arguments.length?(f==null?a=s=null:s=i(a=f),c):a},c}class K6{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function Fq(e){return new K6(e,!0)}function $q(e){return new K6(e,!1)}const b2={draw(e,t){const r=ao(t/sp);e.moveTo(r,0),e.arc(0,0,r,0,qm)}},Bq={draw(e,t){const r=ao(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},V6=ao(1/3),zq=V6*2,Hq={draw(e,t){const r=ao(t/zq),n=r*V6;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},qq={draw(e,t){const r=ao(t),n=-r/2;e.rect(n,n,r,r)}},Wq=.8908130915292852,G6=ip(sp/10)/ip(7*sp/10),Uq=ip(qm/10)*G6,Kq=-B6(qm/10)*G6,Vq={draw(e,t){const r=ao(t*Wq),n=Uq*r,o=Kq*r;e.moveTo(0,-r),e.lineTo(n,o);for(let a=1;a<5;++a){const i=qm*a/5,s=B6(i),l=ip(i);e.lineTo(l*r,-s*r),e.lineTo(s*n-l*o,l*n+s*o)}e.closePath()}},Zb=ao(3),Gq={draw(e,t){const r=-ao(t/(Zb*3));e.moveTo(0,r*2),e.lineTo(-Zb*r,-r),e.lineTo(Zb*r,-r),e.closePath()}},Tn=-.5,Mn=ao(3)/2,H0=1/ao(12),Yq=(H0/2+1)*3,Xq={draw(e,t){const r=ao(t/Yq),n=r/2,o=r*H0,a=n,i=r*H0+r,s=-a,l=i;e.moveTo(n,o),e.lineTo(a,i),e.lineTo(s,l),e.lineTo(Tn*n-Mn*o,Mn*n+Tn*o),e.lineTo(Tn*a-Mn*i,Mn*a+Tn*i),e.lineTo(Tn*s-Mn*l,Mn*s+Tn*l),e.lineTo(Tn*n+Mn*o,Tn*o-Mn*n),e.lineTo(Tn*a+Mn*i,Tn*i-Mn*a),e.lineTo(Tn*s+Mn*l,Tn*l-Mn*s),e.closePath()}};function Zq(e,t){let r=null,n=h2(o);e=typeof e=="function"?e:ur(e||b2),t=typeof t=="function"?t:ur(t===void 0?64:+t);function o(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return o.type=function(a){return arguments.length?(e=typeof a=="function"?a:ur(a),o):e},o.size=function(a){return arguments.length?(t=typeof a=="function"?a:ur(+a),o):t},o.context=function(a){return arguments.length?(r=a??null,o):r},o}function lp(){}function up(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function Y6(e){this._context=e}Y6.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:up(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:up(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Jq(e){return new Y6(e)}function X6(e){this._context=e}X6.prototype={areaStart:lp,areaEnd:lp,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:up(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Qq(e){return new X6(e)}function Z6(e){this._context=e}Z6.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:up(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function eW(e){return new Z6(e)}function J6(e){this._context=e}J6.prototype={areaStart:lp,areaEnd:lp,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function tW(e){return new J6(e)}function yO(e){return e<0?-1:1}function xO(e,t,r){var n=e._x1-e._x0,o=t-e._x1,a=(e._y1-e._y0)/(n||o<0&&-0),i=(r-e._y1)/(o||n<0&&-0),s=(a*o+i*n)/(n+o);return(yO(a)+yO(i))*Math.min(Math.abs(a),Math.abs(i),.5*Math.abs(s))||0}function wO(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Jb(e,t,r){var n=e._x0,o=e._y0,a=e._x1,i=e._y1,s=(a-n)/3;e._context.bezierCurveTo(n+s,o+s*t,a-s,i-s*r,a,i)}function cp(e){this._context=e}cp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Jb(this,this._t0,wO(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Jb(this,wO(this,r=xO(this,e,t)),r);break;default:Jb(this,this._t0,r=xO(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function Q6(e){this._context=new e7(e)}(Q6.prototype=Object.create(cp.prototype)).point=function(e,t){cp.prototype.point.call(this,t,e)};function e7(e){this._context=e}e7.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,o,a){this._context.bezierCurveTo(t,e,n,r,a,o)}};function rW(e){return new cp(e)}function nW(e){return new Q6(e)}function t7(e){this._context=e}t7.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=kO(e),o=kO(t),a=0,i=1;i<r;++a,++i)this._context.bezierCurveTo(n[0][a],o[0][a],n[1][a],o[1][a],e[i],t[i]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function kO(e){var t,r=e.length-1,n,o=new Array(r),a=new Array(r),i=new Array(r);for(o[0]=0,a[0]=2,i[0]=e[0]+2*e[1],t=1;t<r-1;++t)o[t]=1,a[t]=4,i[t]=4*e[t]+2*e[t+1];for(o[r-1]=2,a[r-1]=7,i[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=o[t]/a[t-1],a[t]-=n,i[t]-=n*i[t-1];for(o[r-1]=i[r-1]/a[r-1],t=r-2;t>=0;--t)o[t]=(i[t]-o[t+1])/a[t];for(a[r-1]=(e[r]+o[r-1])/2,t=0;t<r-1;++t)a[t]=2*e[t+1]-o[t+1];return[o,a]}function oW(e){return new t7(e)}function Um(e,t){this._context=e,this._t=t}Um.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function aW(e){return new Um(e,.5)}function iW(e){return new Um(e,0)}function sW(e){return new Um(e,1)}function hl(e,t){if((i=e.length)>1)for(var r=1,n,o,a=e[t[0]],i,s=a.length;r<i;++r)for(o=a,a=e[t[r]],n=0;n<s;++n)a[n][1]+=a[n][0]=isNaN(o[n][1])?o[n][0]:o[n][1]}function q0(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function lW(e,t){return e[t]}function uW(e){const t=[];return t.key=e,t}function cW(){var e=ur([]),t=q0,r=hl,n=lW;function o(a){var i=Array.from(e.apply(this,arguments),uW),s,l=i.length,c=-1,d;for(const f of a)for(s=0,++c;s<l;++s)(i[s][c]=[0,+n(f,i[s].key,c,a)]).data=f;for(s=0,d=g2(t(i));s<l;++s)i[d[s]].index=s;return r(i,d),i}return o.keys=function(a){return arguments.length?(e=typeof a=="function"?a:ur(Array.from(a)),o):e},o.value=function(a){return arguments.length?(n=typeof a=="function"?a:ur(+a),o):n},o.order=function(a){return arguments.length?(t=a==null?q0:typeof a=="function"?a:ur(Array.from(a)),o):t},o.offset=function(a){return arguments.length?(r=a??hl,o):r},o}function dW(e,t){if((n=e.length)>0){for(var r,n,o=0,a=e[0].length,i;o<a;++o){for(i=r=0;r<n;++r)i+=e[r][o][1]||0;if(i)for(r=0;r<n;++r)e[r][o][1]/=i}hl(e,t)}}function fW(e,t){if((o=e.length)>0){for(var r=0,n=e[t[0]],o,a=n.length;r<a;++r){for(var i=0,s=0;i<o;++i)s+=e[i][r][1]||0;n[r][1]+=n[r][0]=-s/2}hl(e,t)}}function pW(e,t){if(!(!((i=e.length)>0)||!((a=(o=e[t[0]]).length)>0))){for(var r=0,n=1,o,a,i;n<a;++n){for(var s=0,l=0,c=0;s<i;++s){for(var d=e[t[s]],f=d[n][1]||0,m=d[n-1][1]||0,p=(f-m)/2,h=0;h<s;++h){var b=e[t[h]],v=b[n][1]||0,x=b[n-1][1]||0;p+=v-x}l+=f,c+=p*f}o[n-1][1]+=o[n-1][0]=r,l&&(r-=c/l)}o[n-1][1]+=o[n-1][0]=r,hl(e,t)}}function yc(e){"@babel/helpers - typeof";return yc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yc(e)}var mW=["type","size","sizeType"];function W0(){return W0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},W0.apply(this,arguments)}function jO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function EO(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?jO(Object(r),!0).forEach(function(n){hW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hW(e,t,r){return t=gW(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gW(e){var t=bW(e,"string");return yc(t)=="symbol"?t:t+""}function bW(e,t){if(yc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(yc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vW(e,t){if(e==null)return{};var r=yW(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function yW(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var r7={symbolCircle:b2,symbolCross:Bq,symbolDiamond:Hq,symbolSquare:qq,symbolStar:Vq,symbolTriangle:Gq,symbolWye:Xq},xW=Math.PI/180,wW=function(e){var t="symbol".concat(Hm(e));return r7[t]||b2},kW=function(e,t,r){if(t==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var n=18*xW;return 1.25*e*e*(Math.tan(n)-Math.tan(n*2)*Math.pow(Math.tan(n),2))}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},jW=function(e,t){r7["symbol".concat(Hm(e))]=t},Km=function(e){var t=e.type,r=t===void 0?"circle":t,n=e.size,o=n===void 0?64:n,a=e.sizeType,i=a===void 0?"area":a,s=vW(e,mW),l=EO(EO({},s),{},{type:r,size:o,sizeType:i}),c=function(){var h=wW(r),b=Zq().type(h).size(kW(o,i,r));return b()},d=l.className,f=l.cx,m=l.cy,p=Xe(l,!0);return f===+f&&m===+m&&o===+o?y.createElement("path",W0({},p,{className:wt("recharts-symbols",d),transform:"translate(".concat(f,", ").concat(m,")"),d:c()})):null};Km.registerSymbol=jW;function gl(e){"@babel/helpers - typeof";return gl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gl(e)}function U0(){return U0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},U0.apply(this,arguments)}function SO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function EW(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?SO(Object(r),!0).forEach(function(n){xc(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):SO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function SW(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function NW(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,o7(n.key),n)}}function OW(e,t,r){return t&&NW(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function CW(e,t,r){return t=dp(t),PW(e,n7()?Reflect.construct(t,r||[],dp(e).constructor):t.apply(e,r))}function PW(e,t){if(t&&(gl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return AW(e)}function AW(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function n7(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(n7=function(){return!!e})()}function dp(e){return dp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},dp(e)}function TW(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&K0(e,t)}function K0(e,t){return K0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},K0(e,t)}function xc(e,t,r){return t=o7(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o7(e){var t=MW(e,"string");return gl(t)=="symbol"?t:t+""}function MW(e,t){if(gl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(gl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Wn=32,v2=function(e){function t(){return SW(this,t),CW(this,t,arguments)}return TW(t,e),OW(t,[{key:"renderIcon",value:function(r){var n=this.props.inactiveColor,o=Wn/2,a=Wn/6,i=Wn/3,s=r.inactive?n:r.color;if(r.type==="plainline")return y.createElement("line",{strokeWidth:4,fill:"none",stroke:s,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:o,x2:Wn,y2:o,className:"recharts-legend-icon"});if(r.type==="line")return y.createElement("path",{strokeWidth:4,fill:"none",stroke:s,d:"M0,".concat(o,"h").concat(i,`
57
+ A`).concat(a,",").concat(a,",0,1,1,").concat(2*i,",").concat(o,`
58
+ H`).concat(Wn,"M").concat(2*i,",").concat(o,`
59
+ A`).concat(a,",").concat(a,",0,1,1,").concat(i,",").concat(o),className:"recharts-legend-icon"});if(r.type==="rect")return y.createElement("path",{stroke:"none",fill:s,d:"M0,".concat(Wn/8,"h").concat(Wn,"v").concat(Wn*3/4,"h").concat(-32,"z"),className:"recharts-legend-icon"});if(y.isValidElement(r.legendIcon)){var l=EW({},r);return delete l.legendIcon,y.cloneElement(r.legendIcon,l)}return y.createElement(Km,{fill:s,cx:o,cy:o,size:Wn,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,n=this.props,o=n.payload,a=n.iconSize,i=n.layout,s=n.formatter,l=n.inactiveColor,c={x:0,y:0,width:Wn,height:Wn},d={display:i==="horizontal"?"inline-block":"block",marginRight:10},f={display:"inline-block",verticalAlign:"middle",marginRight:4};return o.map(function(m,p){var h=m.formatter||s,b=wt(xc(xc({"recharts-legend-item":!0},"legend-item-".concat(p),!0),"inactive",m.inactive));if(m.type==="none")return null;var v=it(m.value)?null:m.value;Xn(!it(m.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var x=m.inactive?l:m.color;return y.createElement("li",U0({className:b,style:d,key:"legend-item-".concat(p)},si(r.props,m,p)),y.createElement(F0,{width:a,height:a,viewBox:c,style:f},r.renderIcon(m)),y.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},h?h(v,m,p):v))})}},{key:"render",value:function(){var r=this.props,n=r.payload,o=r.layout,a=r.align;if(!n||!n.length)return null;var i={padding:0,margin:0,textAlign:o==="horizontal"?a:"left"};return y.createElement("ul",{className:"recharts-default-legend",style:i},this.renderItems())}}])}(g.PureComponent);xc(v2,"displayName","Legend");xc(v2,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Qb,NO;function _W(){if(NO)return Qb;NO=1;var e=$m();function t(){this.__data__=new e,this.size=0}return Qb=t,Qb}var ev,OO;function IW(){if(OO)return ev;OO=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return ev=e,ev}var tv,CO;function DW(){if(CO)return tv;CO=1;function e(t){return this.__data__.get(t)}return tv=e,tv}var rv,PO;function LW(){if(PO)return rv;PO=1;function e(t){return this.__data__.has(t)}return rv=e,rv}var nv,AO;function RW(){if(AO)return nv;AO=1;var e=$m(),t=u2(),r=c2(),n=200;function o(a,i){var s=this.__data__;if(s instanceof e){var l=s.__data__;if(!t||l.length<n-1)return l.push([a,i]),this.size=++s.size,this;s=this.__data__=new r(l)}return s.set(a,i),this.size=s.size,this}return nv=o,nv}var ov,TO;function a7(){if(TO)return ov;TO=1;var e=$m(),t=_W(),r=IW(),n=DW(),o=LW(),a=RW();function i(s){var l=this.__data__=new e(s);this.size=l.size}return i.prototype.clear=t,i.prototype.delete=r,i.prototype.get=n,i.prototype.has=o,i.prototype.set=a,ov=i,ov}var av,MO;function FW(){if(MO)return av;MO=1;var e="__lodash_hash_undefined__";function t(r){return this.__data__.set(r,e),this}return av=t,av}var iv,_O;function $W(){if(_O)return iv;_O=1;function e(t){return this.__data__.has(t)}return iv=e,iv}var sv,IO;function i7(){if(IO)return sv;IO=1;var e=c2(),t=FW(),r=$W();function n(o){var a=-1,i=o==null?0:o.length;for(this.__data__=new e;++a<i;)this.add(o[a])}return n.prototype.add=n.prototype.push=t,n.prototype.has=r,sv=n,sv}var lv,DO;function s7(){if(DO)return lv;DO=1;function e(t,r){for(var n=-1,o=t==null?0:t.length;++n<o;)if(r(t[n],n,t))return!0;return!1}return lv=e,lv}var uv,LO;function l7(){if(LO)return uv;LO=1;function e(t,r){return t.has(r)}return uv=e,uv}var cv,RO;function u7(){if(RO)return cv;RO=1;var e=i7(),t=s7(),r=l7(),n=1,o=2;function a(i,s,l,c,d,f){var m=l&n,p=i.length,h=s.length;if(p!=h&&!(m&&h>p))return!1;var b=f.get(i),v=f.get(s);if(b&&v)return b==s&&v==i;var x=-1,k=!0,S=l&o?new e:void 0;for(f.set(i,s),f.set(s,i);++x<p;){var j=i[x],O=s[x];if(c)var C=m?c(O,j,x,s,i,f):c(j,O,x,i,s,f);if(C!==void 0){if(C)continue;k=!1;break}if(S){if(!t(s,function(N,T){if(!r(S,T)&&(j===N||d(j,N,l,c,f)))return S.push(T)})){k=!1;break}}else if(!(j===O||d(j,O,l,c,f))){k=!1;break}}return f.delete(i),f.delete(s),k}return cv=a,cv}var dv,FO;function BW(){if(FO)return dv;FO=1;var e=Fo(),t=e.Uint8Array;return dv=t,dv}var fv,$O;function zW(){if($O)return fv;$O=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(o,a){n[++r]=[a,o]}),n}return fv=e,fv}var pv,BO;function y2(){if(BO)return pv;BO=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(o){n[++r]=o}),n}return pv=e,pv}var mv,zO;function HW(){if(zO)return mv;zO=1;var e=hd(),t=BW(),r=l2(),n=u7(),o=zW(),a=y2(),i=1,s=2,l="[object Boolean]",c="[object Date]",d="[object Error]",f="[object Map]",m="[object Number]",p="[object RegExp]",h="[object Set]",b="[object String]",v="[object Symbol]",x="[object ArrayBuffer]",k="[object DataView]",S=e?e.prototype:void 0,j=S?S.valueOf:void 0;function O(C,N,T,M,I,_,R){switch(T){case k:if(C.byteLength!=N.byteLength||C.byteOffset!=N.byteOffset)return!1;C=C.buffer,N=N.buffer;case x:return!(C.byteLength!=N.byteLength||!_(new t(C),new t(N)));case l:case c:case m:return r(+C,+N);case d:return C.name==N.name&&C.message==N.message;case p:case b:return C==N+"";case f:var L=o;case h:var F=M&i;if(L||(L=a),C.size!=N.size&&!F)return!1;var B=R.get(C);if(B)return B==N;M|=s,R.set(C,N);var U=n(L(C),L(N),M,I,_,R);return R.delete(C),U;case v:if(j)return j.call(C)==j.call(N)}return!1}return mv=O,mv}var hv,HO;function c7(){if(HO)return hv;HO=1;function e(t,r){for(var n=-1,o=r.length,a=t.length;++n<o;)t[a+n]=r[n];return t}return hv=e,hv}var gv,qO;function qW(){if(qO)return gv;qO=1;var e=c7(),t=gn();function r(n,o,a){var i=o(n);return t(n)?i:e(i,a(n))}return gv=r,gv}var bv,WO;function WW(){if(WO)return bv;WO=1;function e(t,r){for(var n=-1,o=t==null?0:t.length,a=0,i=[];++n<o;){var s=t[n];r(s,n,t)&&(i[a++]=s)}return i}return bv=e,bv}var vv,UO;function UW(){if(UO)return vv;UO=1;function e(){return[]}return vv=e,vv}var yv,KO;function KW(){if(KO)return yv;KO=1;var e=WW(),t=UW(),r=Object.prototype,n=r.propertyIsEnumerable,o=Object.getOwnPropertySymbols,a=o?function(i){return i==null?[]:(i=Object(i),e(o(i),function(s){return n.call(i,s)}))}:t;return yv=a,yv}var xv,VO;function VW(){if(VO)return xv;VO=1;function e(t,r){for(var n=-1,o=Array(t);++n<t;)o[n]=r(n);return o}return xv=e,xv}var wv,GO;function GW(){if(GO)return wv;GO=1;var e=ba(),t=va(),r="[object Arguments]";function n(o){return t(o)&&e(o)==r}return wv=n,wv}var kv,YO;function x2(){if(YO)return kv;YO=1;var e=GW(),t=va(),r=Object.prototype,n=r.hasOwnProperty,o=r.propertyIsEnumerable,a=e(function(){return arguments}())?e:function(i){return t(i)&&n.call(i,"callee")&&!o.call(i,"callee")};return kv=a,kv}var Ff={exports:{}},jv,XO;function YW(){if(XO)return jv;XO=1;function e(){return!1}return jv=e,jv}Ff.exports;var ZO;function d7(){return ZO||(ZO=1,function(e,t){var r=Fo(),n=YW(),o=t&&!t.nodeType&&t,a=o&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===o,s=i?r.Buffer:void 0,l=s?s.isBuffer:void 0,c=l||n;e.exports=c}(Ff,Ff.exports)),Ff.exports}var Ev,JO;function w2(){if(JO)return Ev;JO=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function r(n,o){var a=typeof n;return o=o??e,!!o&&(a=="number"||a!="symbol"&&t.test(n))&&n>-1&&n%1==0&&n<o}return Ev=r,Ev}var Sv,QO;function k2(){if(QO)return Sv;QO=1;var e=9007199254740991;function t(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=e}return Sv=t,Sv}var Nv,eC;function XW(){if(eC)return Nv;eC=1;var e=ba(),t=k2(),r=va(),n="[object Arguments]",o="[object Array]",a="[object Boolean]",i="[object Date]",s="[object Error]",l="[object Function]",c="[object Map]",d="[object Number]",f="[object Object]",m="[object RegExp]",p="[object Set]",h="[object String]",b="[object WeakMap]",v="[object ArrayBuffer]",x="[object DataView]",k="[object Float32Array]",S="[object Float64Array]",j="[object Int8Array]",O="[object Int16Array]",C="[object Int32Array]",N="[object Uint8Array]",T="[object Uint8ClampedArray]",M="[object Uint16Array]",I="[object Uint32Array]",_={};_[k]=_[S]=_[j]=_[O]=_[C]=_[N]=_[T]=_[M]=_[I]=!0,_[n]=_[o]=_[v]=_[a]=_[x]=_[i]=_[s]=_[l]=_[c]=_[d]=_[f]=_[m]=_[p]=_[h]=_[b]=!1;function R(L){return r(L)&&t(L.length)&&!!_[e(L)]}return Nv=R,Nv}var Ov,tC;function f7(){if(tC)return Ov;tC=1;function e(t){return function(r){return t(r)}}return Ov=e,Ov}var $f={exports:{}};$f.exports;var rC;function ZW(){return rC||(rC=1,function(e,t){var r=T6(),n=t&&!t.nodeType&&t,o=n&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===n,i=a&&r.process,s=function(){try{var l=o&&o.require&&o.require("util").types;return l||i&&i.binding&&i.binding("util")}catch{}}();e.exports=s}($f,$f.exports)),$f.exports}var Cv,nC;function p7(){if(nC)return Cv;nC=1;var e=XW(),t=f7(),r=ZW(),n=r&&r.isTypedArray,o=n?t(n):e;return Cv=o,Cv}var Pv,oC;function JW(){if(oC)return Pv;oC=1;var e=VW(),t=x2(),r=gn(),n=d7(),o=w2(),a=p7(),i=Object.prototype,s=i.hasOwnProperty;function l(c,d){var f=r(c),m=!f&&t(c),p=!f&&!m&&n(c),h=!f&&!m&&!p&&a(c),b=f||m||p||h,v=b?e(c.length,String):[],x=v.length;for(var k in c)(d||s.call(c,k))&&!(b&&(k=="length"||p&&(k=="offset"||k=="parent")||h&&(k=="buffer"||k=="byteLength"||k=="byteOffset")||o(k,x)))&&v.push(k);return v}return Pv=l,Pv}var Av,aC;function QW(){if(aC)return Av;aC=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,o=typeof n=="function"&&n.prototype||e;return r===o}return Av=t,Av}var Tv,iC;function m7(){if(iC)return Tv;iC=1;function e(t,r){return function(n){return t(r(n))}}return Tv=e,Tv}var Mv,sC;function eU(){if(sC)return Mv;sC=1;var e=m7(),t=e(Object.keys,Object);return Mv=t,Mv}var _v,lC;function tU(){if(lC)return _v;lC=1;var e=QW(),t=eU(),r=Object.prototype,n=r.hasOwnProperty;function o(a){if(!e(a))return t(a);var i=[];for(var s in Object(a))n.call(a,s)&&s!="constructor"&&i.push(s);return i}return _v=o,_v}var Iv,uC;function bd(){if(uC)return Iv;uC=1;var e=s2(),t=k2();function r(n){return n!=null&&t(n.length)&&!e(n)}return Iv=r,Iv}var Dv,cC;function Vm(){if(cC)return Dv;cC=1;var e=JW(),t=tU(),r=bd();function n(o){return r(o)?e(o):t(o)}return Dv=n,Dv}var Lv,dC;function rU(){if(dC)return Lv;dC=1;var e=qW(),t=KW(),r=Vm();function n(o){return e(o,r,t)}return Lv=n,Lv}var Rv,fC;function nU(){if(fC)return Rv;fC=1;var e=rU(),t=1,r=Object.prototype,n=r.hasOwnProperty;function o(a,i,s,l,c,d){var f=s&t,m=e(a),p=m.length,h=e(i),b=h.length;if(p!=b&&!f)return!1;for(var v=p;v--;){var x=m[v];if(!(f?x in i:n.call(i,x)))return!1}var k=d.get(a),S=d.get(i);if(k&&S)return k==i&&S==a;var j=!0;d.set(a,i),d.set(i,a);for(var O=f;++v<p;){x=m[v];var C=a[x],N=i[x];if(l)var T=f?l(N,C,x,i,a,d):l(C,N,x,a,i,d);if(!(T===void 0?C===N||c(C,N,s,l,d):T)){j=!1;break}O||(O=x=="constructor")}if(j&&!O){var M=a.constructor,I=i.constructor;M!=I&&"constructor"in a&&"constructor"in i&&!(typeof M=="function"&&M instanceof M&&typeof I=="function"&&I instanceof I)&&(j=!1)}return d.delete(a),d.delete(i),j}return Rv=o,Rv}var Fv,pC;function oU(){if(pC)return Fv;pC=1;var e=vs(),t=Fo(),r=e(t,"DataView");return Fv=r,Fv}var $v,mC;function aU(){if(mC)return $v;mC=1;var e=vs(),t=Fo(),r=e(t,"Promise");return $v=r,$v}var Bv,hC;function h7(){if(hC)return Bv;hC=1;var e=vs(),t=Fo(),r=e(t,"Set");return Bv=r,Bv}var zv,gC;function iU(){if(gC)return zv;gC=1;var e=vs(),t=Fo(),r=e(t,"WeakMap");return zv=r,zv}var Hv,bC;function sU(){if(bC)return Hv;bC=1;var e=oU(),t=u2(),r=aU(),n=h7(),o=iU(),a=ba(),i=M6(),s="[object Map]",l="[object Object]",c="[object Promise]",d="[object Set]",f="[object WeakMap]",m="[object DataView]",p=i(e),h=i(t),b=i(r),v=i(n),x=i(o),k=a;return(e&&k(new e(new ArrayBuffer(1)))!=m||t&&k(new t)!=s||r&&k(r.resolve())!=c||n&&k(new n)!=d||o&&k(new o)!=f)&&(k=function(S){var j=a(S),O=j==l?S.constructor:void 0,C=O?i(O):"";if(C)switch(C){case p:return m;case h:return s;case b:return c;case v:return d;case x:return f}return j}),Hv=k,Hv}var qv,vC;function lU(){if(vC)return qv;vC=1;var e=a7(),t=u7(),r=HW(),n=nU(),o=sU(),a=gn(),i=d7(),s=p7(),l=1,c="[object Arguments]",d="[object Array]",f="[object Object]",m=Object.prototype,p=m.hasOwnProperty;function h(b,v,x,k,S,j){var O=a(b),C=a(v),N=O?d:o(b),T=C?d:o(v);N=N==c?f:N,T=T==c?f:T;var M=N==f,I=T==f,_=N==T;if(_&&i(b)){if(!i(v))return!1;O=!0,M=!1}if(_&&!M)return j||(j=new e),O||s(b)?t(b,v,x,k,S,j):r(b,v,N,x,k,S,j);if(!(x&l)){var R=M&&p.call(b,"__wrapped__"),L=I&&p.call(v,"__wrapped__");if(R||L){var F=R?b.value():b,B=L?v.value():v;return j||(j=new e),S(F,B,x,k,j)}}return _?(j||(j=new e),n(b,v,x,k,S,j)):!1}return qv=h,qv}var Wv,yC;function j2(){if(yC)return Wv;yC=1;var e=lU(),t=va();function r(n,o,a,i,s){return n===o?!0:n==null||o==null||!t(n)&&!t(o)?n!==n&&o!==o:e(n,o,a,i,r,s)}return Wv=r,Wv}var Uv,xC;function uU(){if(xC)return Uv;xC=1;var e=a7(),t=j2(),r=1,n=2;function o(a,i,s,l){var c=s.length,d=c,f=!l;if(a==null)return!d;for(a=Object(a);c--;){var m=s[c];if(f&&m[2]?m[1]!==a[m[0]]:!(m[0]in a))return!1}for(;++c<d;){m=s[c];var p=m[0],h=a[p],b=m[1];if(f&&m[2]){if(h===void 0&&!(p in a))return!1}else{var v=new e;if(l)var x=l(h,b,p,a,i,v);if(!(x===void 0?t(b,h,r|n,l,v):x))return!1}}return!0}return Uv=o,Uv}var Kv,wC;function g7(){if(wC)return Kv;wC=1;var e=gi();function t(r){return r===r&&!e(r)}return Kv=t,Kv}var Vv,kC;function cU(){if(kC)return Vv;kC=1;var e=g7(),t=Vm();function r(n){for(var o=t(n),a=o.length;a--;){var i=o[a],s=n[i];o[a]=[i,s,e(s)]}return o}return Vv=r,Vv}var Gv,jC;function b7(){if(jC)return Gv;jC=1;function e(t,r){return function(n){return n==null?!1:n[t]===r&&(r!==void 0||t in Object(n))}}return Gv=e,Gv}var Yv,EC;function dU(){if(EC)return Yv;EC=1;var e=uU(),t=cU(),r=b7();function n(o){var a=t(o);return a.length==1&&a[0][2]?r(a[0][0],a[0][1]):function(i){return i===o||e(i,o,a)}}return Yv=n,Yv}var Xv,SC;function fU(){if(SC)return Xv;SC=1;function e(t,r){return t!=null&&r in Object(t)}return Xv=e,Xv}var Zv,NC;function pU(){if(NC)return Zv;NC=1;var e=D6(),t=x2(),r=gn(),n=w2(),o=k2(),a=zm();function i(s,l,c){l=e(l,s);for(var d=-1,f=l.length,m=!1;++d<f;){var p=a(l[d]);if(!(m=s!=null&&c(s,p)))break;s=s[p]}return m||++d!=f?m:(f=s==null?0:s.length,!!f&&o(f)&&n(p,f)&&(r(s)||t(s)))}return Zv=i,Zv}var Jv,OC;function mU(){if(OC)return Jv;OC=1;var e=fU(),t=pU();function r(n,o){return n!=null&&t(n,o,e)}return Jv=r,Jv}var Qv,CC;function hU(){if(CC)return Qv;CC=1;var e=j2(),t=L6(),r=mU(),n=i2(),o=g7(),a=b7(),i=zm(),s=1,l=2;function c(d,f){return n(d)&&o(f)?a(i(d),f):function(m){var p=t(m,d);return p===void 0&&p===f?r(m,d):e(f,p,s|l)}}return Qv=c,Qv}var ey,PC;function Jl(){if(PC)return ey;PC=1;function e(t){return t}return ey=e,ey}var ty,AC;function gU(){if(AC)return ty;AC=1;function e(t){return function(r){return r?.[t]}}return ty=e,ty}var ry,TC;function bU(){if(TC)return ry;TC=1;var e=f2();function t(r){return function(n){return e(n,r)}}return ry=t,ry}var ny,MC;function vU(){if(MC)return ny;MC=1;var e=gU(),t=bU(),r=i2(),n=zm();function o(a){return r(a)?e(n(a)):t(a)}return ny=o,ny}var oy,_C;function $o(){if(_C)return oy;_C=1;var e=dU(),t=hU(),r=Jl(),n=gn(),o=vU();function a(i){return typeof i=="function"?i:i==null?r:typeof i=="object"?n(i)?t(i[0],i[1]):e(i):o(i)}return oy=a,oy}var ay,IC;function v7(){if(IC)return ay;IC=1;function e(t,r,n,o){for(var a=t.length,i=n+(o?1:-1);o?i--:++i<a;)if(r(t[i],i,t))return i;return-1}return ay=e,ay}var iy,DC;function yU(){if(DC)return iy;DC=1;function e(t){return t!==t}return iy=e,iy}var sy,LC;function xU(){if(LC)return sy;LC=1;function e(t,r,n){for(var o=n-1,a=t.length;++o<a;)if(t[o]===r)return o;return-1}return sy=e,sy}var ly,RC;function wU(){if(RC)return ly;RC=1;var e=v7(),t=yU(),r=xU();function n(o,a,i){return a===a?r(o,a,i):e(o,t,i)}return ly=n,ly}var uy,FC;function kU(){if(FC)return uy;FC=1;var e=wU();function t(r,n){var o=r==null?0:r.length;return!!o&&e(r,n,0)>-1}return uy=t,uy}var cy,$C;function jU(){if($C)return cy;$C=1;function e(t,r,n){for(var o=-1,a=t==null?0:t.length;++o<a;)if(n(r,t[o]))return!0;return!1}return cy=e,cy}var dy,BC;function EU(){if(BC)return dy;BC=1;function e(){}return dy=e,dy}var fy,zC;function SU(){if(zC)return fy;zC=1;var e=h7(),t=EU(),r=y2(),n=1/0,o=e&&1/r(new e([,-0]))[1]==n?function(a){return new e(a)}:t;return fy=o,fy}var py,HC;function NU(){if(HC)return py;HC=1;var e=i7(),t=kU(),r=jU(),n=l7(),o=SU(),a=y2(),i=200;function s(l,c,d){var f=-1,m=t,p=l.length,h=!0,b=[],v=b;if(d)h=!1,m=r;else if(p>=i){var x=c?null:o(l);if(x)return a(x);h=!1,m=n,v=new e}else v=c?[]:b;e:for(;++f<p;){var k=l[f],S=c?c(k):k;if(k=d||k!==0?k:0,h&&S===S){for(var j=v.length;j--;)if(v[j]===S)continue e;c&&v.push(S),b.push(k)}else m(v,S,d)||(v!==b&&v.push(S),b.push(k))}return b}return py=s,py}var my,qC;function OU(){if(qC)return my;qC=1;var e=$o(),t=NU();function r(n,o){return n&&n.length?t(n,e(o,2)):[]}return my=r,my}var CU=OU();const WC=qt(CU);function y7(e,t,r){return t===!0?WC(e,r):it(t)?WC(e,t):e}function bl(e){"@babel/helpers - typeof";return bl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bl(e)}var PU=["ref"];function UC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Go(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?UC(Object(r),!0).forEach(function(n){Gm(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):UC(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function AU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KC(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,w7(n.key),n)}}function TU(e,t,r){return t&&KC(e.prototype,t),r&&KC(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function MU(e,t,r){return t=fp(t),_U(e,x7()?Reflect.construct(t,r||[],fp(e).constructor):t.apply(e,r))}function _U(e,t){if(t&&(bl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return IU(e)}function IU(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function x7(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(x7=function(){return!!e})()}function fp(e){return fp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fp(e)}function DU(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&V0(e,t)}function V0(e,t){return V0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},V0(e,t)}function Gm(e,t,r){return t=w7(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function w7(e){var t=LU(e,"string");return bl(t)=="symbol"?t:t+""}function LU(e,t){if(bl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(bl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function RU(e,t){if(e==null)return{};var r=FU(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function FU(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function $U(e){return e.value}function BU(e,t){if(y.isValidElement(e))return y.cloneElement(e,t);if(typeof e=="function")return y.createElement(e,t);t.ref;var r=RU(t,PU);return y.createElement(v2,r)}var VC=1,jo=function(e){function t(){var r;AU(this,t);for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return r=MU(this,t,[].concat(o)),Gm(r,"lastBoundingBox",{width:-1,height:-1}),r}return DU(t,e),TU(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();return r.height=this.wrapperNode.offsetHeight,r.width=this.wrapperNode.offsetWidth,r}return null}},{key:"updateBBox",value:function(){var r=this.props.onBBoxUpdate,n=this.getBBox();n?(Math.abs(n.width-this.lastBoundingBox.width)>VC||Math.abs(n.height-this.lastBoundingBox.height)>VC)&&(this.lastBoundingBox.width=n.width,this.lastBoundingBox.height=n.height,r&&r(n)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Go({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var n=this.props,o=n.layout,a=n.align,i=n.verticalAlign,s=n.margin,l=n.chartWidth,c=n.chartHeight,d,f;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(a==="center"&&o==="vertical"){var m=this.getBBoxSnapshot();d={left:((l||0)-m.width)/2}}else d=a==="right"?{right:s&&s.right||0}:{left:s&&s.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(i==="middle"){var p=this.getBBoxSnapshot();f={top:((c||0)-p.height)/2}}else f=i==="bottom"?{bottom:s&&s.bottom||0}:{top:s&&s.top||0};return Go(Go({},d),f)}},{key:"render",value:function(){var r=this,n=this.props,o=n.content,a=n.width,i=n.height,s=n.wrapperStyle,l=n.payloadUniqBy,c=n.payload,d=Go(Go({position:"absolute",width:a||"auto",height:i||"auto"},this.getDefaultPosition(s)),s);return y.createElement("div",{className:"recharts-legend-wrapper",style:d,ref:function(f){r.wrapperNode=f}},BU(o,Go(Go({},this.props),{},{payload:y7(c,l,$U)})))}}],[{key:"getWithHeight",value:function(r,n){var o=Go(Go({},this.defaultProps),r.props),a=o.layout;return a==="vertical"&&Re(r.props.height)?{height:r.props.height}:a==="horizontal"?{width:r.props.width||n}:null}}])}(g.PureComponent);Gm(jo,"displayName","Legend");Gm(jo,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var hy,GC;function zU(){if(GC)return hy;GC=1;var e=hd(),t=x2(),r=gn(),n=e?e.isConcatSpreadable:void 0;function o(a){return r(a)||t(a)||!!(n&&a&&a[n])}return hy=o,hy}var gy,YC;function k7(){if(YC)return gy;YC=1;var e=c7(),t=zU();function r(n,o,a,i,s){var l=-1,c=n.length;for(a||(a=t),s||(s=[]);++l<c;){var d=n[l];o>0&&a(d)?o>1?r(d,o-1,a,i,s):e(s,d):i||(s[s.length]=d)}return s}return gy=r,gy}var by,XC;function HU(){if(XC)return by;XC=1;function e(t){return function(r,n,o){for(var a=-1,i=Object(r),s=o(r),l=s.length;l--;){var c=s[t?l:++a];if(n(i[c],c,i)===!1)break}return r}}return by=e,by}var vy,ZC;function qU(){if(ZC)return vy;ZC=1;var e=HU(),t=e();return vy=t,vy}var yy,JC;function j7(){if(JC)return yy;JC=1;var e=qU(),t=Vm();function r(n,o){return n&&e(n,o,t)}return yy=r,yy}var xy,QC;function WU(){if(QC)return xy;QC=1;var e=bd();function t(r,n){return function(o,a){if(o==null)return o;if(!e(o))return r(o,a);for(var i=o.length,s=n?i:-1,l=Object(o);(n?s--:++s<i)&&a(l[s],s,l)!==!1;);return o}}return xy=t,xy}var wy,e5;function E2(){if(e5)return wy;e5=1;var e=j7(),t=WU(),r=t(e);return wy=r,wy}var ky,t5;function E7(){if(t5)return ky;t5=1;var e=E2(),t=bd();function r(n,o){var a=-1,i=t(n)?Array(n.length):[];return e(n,function(s,l,c){i[++a]=o(s,l,c)}),i}return ky=r,ky}var jy,r5;function UU(){if(r5)return jy;r5=1;function e(t,r){var n=t.length;for(t.sort(r);n--;)t[n]=t[n].value;return t}return jy=e,jy}var Ey,n5;function KU(){if(n5)return Ey;n5=1;var e=Yl();function t(r,n){if(r!==n){var o=r!==void 0,a=r===null,i=r===r,s=e(r),l=n!==void 0,c=n===null,d=n===n,f=e(n);if(!c&&!f&&!s&&r>n||s&&l&&d&&!c&&!f||a&&l&&d||!o&&d||!i)return 1;if(!a&&!s&&!f&&r<n||f&&o&&i&&!a&&!s||c&&o&&i||!l&&i||!d)return-1}return 0}return Ey=t,Ey}var Sy,o5;function VU(){if(o5)return Sy;o5=1;var e=KU();function t(r,n,o){for(var a=-1,i=r.criteria,s=n.criteria,l=i.length,c=o.length;++a<l;){var d=e(i[a],s[a]);if(d){if(a>=c)return d;var f=o[a];return d*(f=="desc"?-1:1)}}return r.index-n.index}return Sy=t,Sy}var Ny,a5;function GU(){if(a5)return Ny;a5=1;var e=d2(),t=f2(),r=$o(),n=E7(),o=UU(),a=f7(),i=VU(),s=Jl(),l=gn();function c(d,f,m){f.length?f=e(f,function(b){return l(b)?function(v){return t(v,b.length===1?b[0]:b)}:b}):f=[s];var p=-1;f=e(f,a(r));var h=n(d,function(b,v,x){var k=e(f,function(S){return S(b)});return{criteria:k,index:++p,value:b}});return o(h,function(b,v){return i(b,v,m)})}return Ny=c,Ny}var Oy,i5;function YU(){if(i5)return Oy;i5=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return Oy=e,Oy}var Cy,s5;function XU(){if(s5)return Cy;s5=1;var e=YU(),t=Math.max;function r(n,o,a){return o=t(o===void 0?n.length-1:o,0),function(){for(var i=arguments,s=-1,l=t(i.length-o,0),c=Array(l);++s<l;)c[s]=i[o+s];s=-1;for(var d=Array(o+1);++s<o;)d[s]=i[s];return d[o]=a(c),e(n,this,d)}}return Cy=r,Cy}var Py,l5;function ZU(){if(l5)return Py;l5=1;function e(t){return function(){return t}}return Py=e,Py}var Ay,u5;function S7(){if(u5)return Ay;u5=1;var e=vs(),t=function(){try{var r=e(Object,"defineProperty");return r({},"",{}),r}catch{}}();return Ay=t,Ay}var Ty,c5;function JU(){if(c5)return Ty;c5=1;var e=ZU(),t=S7(),r=Jl(),n=t?function(o,a){return t(o,"toString",{configurable:!0,enumerable:!1,value:e(a),writable:!0})}:r;return Ty=n,Ty}var My,d5;function QU(){if(d5)return My;d5=1;var e=800,t=16,r=Date.now;function n(o){var a=0,i=0;return function(){var s=r(),l=t-(s-i);if(i=s,l>0){if(++a>=e)return arguments[0]}else a=0;return o.apply(void 0,arguments)}}return My=n,My}var _y,f5;function eK(){if(f5)return _y;f5=1;var e=JU(),t=QU(),r=t(e);return _y=r,_y}var Iy,p5;function tK(){if(p5)return Iy;p5=1;var e=Jl(),t=XU(),r=eK();function n(o,a){return r(t(o,a,e),o+"")}return Iy=n,Iy}var Dy,m5;function Ym(){if(m5)return Dy;m5=1;var e=l2(),t=bd(),r=w2(),n=gi();function o(a,i,s){if(!n(s))return!1;var l=typeof i;return(l=="number"?t(s)&&r(i,s.length):l=="string"&&i in s)?e(s[i],a):!1}return Dy=o,Dy}var Ly,h5;function rK(){if(h5)return Ly;h5=1;var e=k7(),t=GU(),r=tK(),n=Ym(),o=r(function(a,i){if(a==null)return[];var s=i.length;return s>1&&n(a,i[0],i[1])?i=[]:s>2&&n(i[0],i[1],i[2])&&(i=[i[0]]),t(a,e(i,1),[])});return Ly=o,Ly}var nK=rK();const S2=qt(nK);function wc(e){"@babel/helpers - typeof";return wc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wc(e)}function G0(){return G0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},G0.apply(this,arguments)}function oK(e,t){return lK(e)||sK(e,t)||iK(e,t)||aK()}function aK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
60
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iK(e,t){if(e){if(typeof e=="string")return g5(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return g5(e,t)}}function g5(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function sK(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,a,i,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(d){c=!0,o=d}finally{try{if(!l&&r.return!=null&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}function lK(e){if(Array.isArray(e))return e}function b5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ry(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?b5(Object(r),!0).forEach(function(n){uK(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function uK(e,t,r){return t=cK(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cK(e){var t=dK(e,"string");return wc(t)=="symbol"?t:t+""}function dK(e,t){if(wc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(wc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fK(e){return Array.isArray(e)&&Mr(e[0])&&Mr(e[1])?e.join(" ~ "):e}var pK=function(e){var t=e.separator,r=t===void 0?" : ":t,n=e.contentStyle,o=n===void 0?{}:n,a=e.itemStyle,i=a===void 0?{}:a,s=e.labelStyle,l=s===void 0?{}:s,c=e.payload,d=e.formatter,f=e.itemSorter,m=e.wrapperClassName,p=e.labelClassName,h=e.label,b=e.labelFormatter,v=e.accessibilityLayer,x=v===void 0?!1:v,k=function(){if(c&&c.length){var I={padding:0,margin:0},_=(f?S2(c,f):c).map(function(R,L){if(R.type==="none")return null;var F=Ry({display:"block",paddingTop:4,paddingBottom:4,color:R.color||"#000"},i),B=R.formatter||d||fK,U=R.value,$=R.name,z=U,W=$;if(B&&z!=null&&W!=null){var K=B(U,$,R,L,c);if(Array.isArray(K)){var q=oK(K,2);z=q[0],W=q[1]}else z=K}return y.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(L),style:F},Mr(W)?y.createElement("span",{className:"recharts-tooltip-item-name"},W):null,Mr(W)?y.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,y.createElement("span",{className:"recharts-tooltip-item-value"},z),y.createElement("span",{className:"recharts-tooltip-item-unit"},R.unit||""))});return y.createElement("ul",{className:"recharts-tooltip-item-list",style:I},_)}return null},S=Ry({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},o),j=Ry({margin:0},l),O=!st(h),C=O?h:"",N=wt("recharts-default-tooltip",m),T=wt("recharts-tooltip-label",p);O&&b&&c!==void 0&&c!==null&&(C=b(h,c));var M=x?{role:"status","aria-live":"assertive"}:{};return y.createElement("div",G0({className:N,style:S},M),y.createElement("p",{className:T,style:j},y.isValidElement(C)?C:"".concat(C)),k())};function kc(e){"@babel/helpers - typeof";return kc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kc(e)}function hf(e,t,r){return t=mK(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mK(e){var t=hK(e,"string");return kc(t)=="symbol"?t:t+""}function hK(e,t){if(kc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(kc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Cu="recharts-tooltip-wrapper",gK={visibility:"hidden"};function bK(e){var t=e.coordinate,r=e.translateX,n=e.translateY;return wt(Cu,hf(hf(hf(hf({},"".concat(Cu,"-right"),Re(r)&&t&&Re(t.x)&&r>=t.x),"".concat(Cu,"-left"),Re(r)&&t&&Re(t.x)&&r<t.x),"".concat(Cu,"-bottom"),Re(n)&&t&&Re(t.y)&&n>=t.y),"".concat(Cu,"-top"),Re(n)&&t&&Re(t.y)&&n<t.y))}function v5(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.key,o=e.offsetTopLeft,a=e.position,i=e.reverseDirection,s=e.tooltipDimension,l=e.viewBox,c=e.viewBoxDimension;if(a&&Re(a[n]))return a[n];var d=r[n]-s-o,f=r[n]+o;if(t[n])return i[n]?d:f;if(i[n]){var m=d,p=l[n];return m<p?Math.max(f,l[n]):Math.max(d,l[n])}var h=f+s,b=l[n]+c;return h>b?Math.max(d,l[n]):Math.max(f,l[n])}function vK(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function yK(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,o=e.position,a=e.reverseDirection,i=e.tooltipBox,s=e.useTranslate3d,l=e.viewBox,c,d,f;return i.height>0&&i.width>0&&r?(d=v5({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:o,reverseDirection:a,tooltipDimension:i.width,viewBox:l,viewBoxDimension:l.width}),f=v5({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:o,reverseDirection:a,tooltipDimension:i.height,viewBox:l,viewBoxDimension:l.height}),c=vK({translateX:d,translateY:f,useTranslate3d:s})):c=gK,{cssProperties:c,cssClasses:bK({translateX:d,translateY:f,coordinate:r})}}function vl(e){"@babel/helpers - typeof";return vl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vl(e)}function y5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function x5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?y5(Object(r),!0).forEach(function(n){X0(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xK(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wK(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,O7(n.key),n)}}function kK(e,t,r){return t&&wK(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function jK(e,t,r){return t=pp(t),EK(e,N7()?Reflect.construct(t,r||[],pp(e).constructor):t.apply(e,r))}function EK(e,t){if(t&&(vl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return SK(e)}function SK(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function N7(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(N7=function(){return!!e})()}function pp(e){return pp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},pp(e)}function NK(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Y0(e,t)}function Y0(e,t){return Y0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Y0(e,t)}function X0(e,t,r){return t=O7(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function O7(e){var t=OK(e,"string");return vl(t)=="symbol"?t:t+""}function OK(e,t){if(vl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(vl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var w5=1,CK=function(e){function t(){var r;xK(this,t);for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return r=jK(this,t,[].concat(o)),X0(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),X0(r,"handleKeyDown",function(i){if(i.key==="Escape"){var s,l,c,d;r.setState({dismissed:!0,dismissedAtCoordinate:{x:(s=(l=r.props.coordinate)===null||l===void 0?void 0:l.x)!==null&&s!==void 0?s:0,y:(c=(d=r.props.coordinate)===null||d===void 0?void 0:d.y)!==null&&c!==void 0?c:0}})}}),r}return NK(t,e),kK(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>w5||Math.abs(r.height-this.state.lastBoundingBox.height)>w5)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,n;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((n=this.props.coordinate)===null||n===void 0?void 0:n.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,n=this.props,o=n.active,a=n.allowEscapeViewBox,i=n.animationDuration,s=n.animationEasing,l=n.children,c=n.coordinate,d=n.hasPayload,f=n.isAnimationActive,m=n.offset,p=n.position,h=n.reverseDirection,b=n.useTranslate3d,v=n.viewBox,x=n.wrapperStyle,k=yK({allowEscapeViewBox:a,coordinate:c,offsetTopLeft:m,position:p,reverseDirection:h,tooltipBox:this.state.lastBoundingBox,useTranslate3d:b,viewBox:v}),S=k.cssClasses,j=k.cssProperties,O=x5(x5({transition:f&&o?"transform ".concat(i,"ms ").concat(s):void 0},j),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&d?"visible":"hidden",position:"absolute",top:0,left:0},x);return y.createElement("div",{tabIndex:-1,className:S,style:O,ref:function(C){r.wrapperNode=C}},l)}}])}(g.PureComponent),PK=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},ya={isSsr:PK()};function yl(e){"@babel/helpers - typeof";return yl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yl(e)}function k5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function j5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?k5(Object(r),!0).forEach(function(n){N2(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function AK(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function TK(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,P7(n.key),n)}}function MK(e,t,r){return t&&TK(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _K(e,t,r){return t=mp(t),IK(e,C7()?Reflect.construct(t,r||[],mp(e).constructor):t.apply(e,r))}function IK(e,t){if(t&&(yl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return DK(e)}function DK(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function C7(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(C7=function(){return!!e})()}function mp(e){return mp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},mp(e)}function LK(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Z0(e,t)}function Z0(e,t){return Z0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Z0(e,t)}function N2(e,t,r){return t=P7(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function P7(e){var t=RK(e,"string");return yl(t)=="symbol"?t:t+""}function RK(e,t){if(yl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(yl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function FK(e){return e.dataKey}function $K(e,t){return y.isValidElement(e)?y.cloneElement(e,t):typeof e=="function"?y.createElement(e,t):y.createElement(pK,t)}var ln=function(e){function t(){return AK(this,t),_K(this,t,arguments)}return LK(t,e),MK(t,[{key:"render",value:function(){var r=this,n=this.props,o=n.active,a=n.allowEscapeViewBox,i=n.animationDuration,s=n.animationEasing,l=n.content,c=n.coordinate,d=n.filterNull,f=n.isAnimationActive,m=n.offset,p=n.payload,h=n.payloadUniqBy,b=n.position,v=n.reverseDirection,x=n.useTranslate3d,k=n.viewBox,S=n.wrapperStyle,j=p??[];d&&j.length&&(j=y7(p.filter(function(C){return C.value!=null&&(C.hide!==!0||r.props.includeHidden)}),h,FK));var O=j.length>0;return y.createElement(CK,{allowEscapeViewBox:a,animationDuration:i,animationEasing:s,isAnimationActive:f,active:o,coordinate:c,hasPayload:O,offset:m,position:b,reverseDirection:v,useTranslate3d:x,viewBox:k,wrapperStyle:S},$K(l,j5(j5({},this.props),{},{payload:j})))}}])}(g.PureComponent);N2(ln,"displayName","Tooltip");N2(ln,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!ya.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var Fy,E5;function BK(){if(E5)return Fy;E5=1;var e=Fo(),t=function(){return e.Date.now()};return Fy=t,Fy}var $y,S5;function zK(){if(S5)return $y;S5=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return $y=t,$y}var By,N5;function HK(){if(N5)return By;N5=1;var e=zK(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return By=r,By}var zy,O5;function A7(){if(O5)return zy;O5=1;var e=HK(),t=gi(),r=Yl(),n=NaN,o=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,i=/^0o[0-7]+$/i,s=parseInt;function l(c){if(typeof c=="number")return c;if(r(c))return n;if(t(c)){var d=typeof c.valueOf=="function"?c.valueOf():c;c=t(d)?d+"":d}if(typeof c!="string")return c===0?c:+c;c=e(c);var f=a.test(c);return f||i.test(c)?s(c.slice(2),f?2:8):o.test(c)?n:+c}return zy=l,zy}var Hy,C5;function qK(){if(C5)return Hy;C5=1;var e=gi(),t=BK(),r=A7(),n="Expected a function",o=Math.max,a=Math.min;function i(s,l,c){var d,f,m,p,h,b,v=0,x=!1,k=!1,S=!0;if(typeof s!="function")throw new TypeError(n);l=r(l)||0,e(c)&&(x=!!c.leading,k="maxWait"in c,m=k?o(r(c.maxWait)||0,l):m,S="trailing"in c?!!c.trailing:S);function j(L){var F=d,B=f;return d=f=void 0,v=L,p=s.apply(B,F),p}function O(L){return v=L,h=setTimeout(T,l),x?j(L):p}function C(L){var F=L-b,B=L-v,U=l-F;return k?a(U,m-B):U}function N(L){var F=L-b,B=L-v;return b===void 0||F>=l||F<0||k&&B>=m}function T(){var L=t();if(N(L))return M(L);h=setTimeout(T,C(L))}function M(L){return h=void 0,S&&d?j(L):(d=f=void 0,p)}function I(){h!==void 0&&clearTimeout(h),v=0,d=b=f=h=void 0}function _(){return h===void 0?p:M(t())}function R(){var L=t(),F=N(L);if(d=arguments,f=this,b=L,F){if(h===void 0)return O(b);if(k)return clearTimeout(h),h=setTimeout(T,l),j(b)}return h===void 0&&(h=setTimeout(T,l)),p}return R.cancel=I,R.flush=_,R}return Hy=i,Hy}var qy,P5;function WK(){if(P5)return qy;P5=1;var e=qK(),t=gi(),r="Expected a function";function n(o,a,i){var s=!0,l=!0;if(typeof o!="function")throw new TypeError(r);return t(i)&&(s="leading"in i?!!i.leading:s,l="trailing"in i?!!i.trailing:l),e(o,a,{leading:s,maxWait:a,trailing:l})}return qy=n,qy}var UK=WK();const T7=qt(UK);function jc(e){"@babel/helpers - typeof";return jc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jc(e)}function A5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function gf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?A5(Object(r),!0).forEach(function(n){KK(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function KK(e,t,r){return t=VK(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function VK(e){var t=GK(e,"string");return jc(t)=="symbol"?t:t+""}function GK(e,t){if(jc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(jc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function YK(e,t){return QK(e)||JK(e,t)||ZK(e,t)||XK()}function XK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
61
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ZK(e,t){if(e){if(typeof e=="string")return T5(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return T5(e,t)}}function T5(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function JK(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,a,i,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(d){c=!0,o=d}finally{try{if(!l&&r.return!=null&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}function QK(e){if(Array.isArray(e))return e}var vi=g.forwardRef(function(e,t){var r=e.aspect,n=e.initialDimension,o=n===void 0?{width:-1,height:-1}:n,a=e.width,i=a===void 0?"100%":a,s=e.height,l=s===void 0?"100%":s,c=e.minWidth,d=c===void 0?0:c,f=e.minHeight,m=e.maxHeight,p=e.children,h=e.debounce,b=h===void 0?0:h,v=e.id,x=e.className,k=e.onResize,S=e.style,j=S===void 0?{}:S,O=g.useRef(null),C=g.useRef();C.current=k,g.useImperativeHandle(t,function(){return Object.defineProperty(O.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),O.current},configurable:!0})});var N=g.useState({containerWidth:o.width,containerHeight:o.height}),T=YK(N,2),M=T[0],I=T[1],_=g.useCallback(function(L,F){I(function(B){var U=Math.round(L),$=Math.round(F);return B.containerWidth===U&&B.containerHeight===$?B:{containerWidth:U,containerHeight:$}})},[]);g.useEffect(function(){var L=function(z){var W,K=z[0].contentRect,q=K.width,J=K.height;_(q,J),(W=C.current)===null||W===void 0||W.call(C,q,J)};b>0&&(L=T7(L,b,{trailing:!0,leading:!1}));var F=new ResizeObserver(L),B=O.current.getBoundingClientRect(),U=B.width,$=B.height;return _(U,$),F.observe(O.current),function(){F.disconnect()}},[_,b]);var R=g.useMemo(function(){var L=M.containerWidth,F=M.containerHeight;if(L<0||F<0)return null;Xn(Ki(i)||Ki(l),`The width(%s) and height(%s) are both fixed numbers,
62
+ maybe you don't need to use a ResponsiveContainer.`,i,l),Xn(!r||r>0,"The aspect(%s) must be greater than zero.",r);var B=Ki(i)?L:i,U=Ki(l)?F:l;r&&r>0&&(B?U=B/r:U&&(B=U*r),m&&U>m&&(U=m)),Xn(B>0||U>0,`The width(%s) and height(%s) of chart should be greater than 0,
63
+ please check the style of container, or the props width(%s) and height(%s),
64
+ or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
65
+ height and width.`,B,U,i,l,d,f,r);var $=!Array.isArray(p)&&ia(p.type).endsWith("Chart");return y.Children.map(p,function(z){return y.isValidElement(z)?g.cloneElement(z,gf({width:B,height:U},$?{style:gf({height:"100%",width:"100%",maxHeight:U,maxWidth:B},z.props.style)}:{})):z})},[r,p,l,m,f,d,M,i]);return y.createElement("div",{id:v?"".concat(v):void 0,className:wt("recharts-responsive-container",x),style:gf(gf({},j),{},{width:i,height:l,minWidth:d,minHeight:f,maxHeight:m}),ref:O},R)}),Xm=function(e){return null};Xm.displayName="Cell";function Ec(e){"@babel/helpers - typeof";return Ec=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ec(e)}function M5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function J0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?M5(Object(r),!0).forEach(function(n){eV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):M5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function eV(e,t,r){return t=tV(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tV(e){var t=rV(e,"string");return Ec(t)=="symbol"?t:t+""}function rV(e,t){if(Ec(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ec(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ls={widthCache:{},cacheCount:0},nV=2e3,oV={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},_5="recharts_measurement_span";function aV(e){var t=J0({},e);return Object.keys(t).forEach(function(r){t[r]||delete t[r]}),t}var ac=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||ya.isSsr)return{width:0,height:0};var r=aV(t),n=JSON.stringify({text:e,copyStyle:r});if(Ls.widthCache[n])return Ls.widthCache[n];try{var o=document.getElementById(_5);o||(o=document.createElement("span"),o.setAttribute("id",_5),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var a=J0(J0({},oV),r);Object.assign(o.style,a),o.textContent="".concat(e);var i=o.getBoundingClientRect(),s={width:i.width,height:i.height};return Ls.widthCache[n]=s,++Ls.cacheCount>nV&&(Ls.cacheCount=0,Ls.widthCache={}),s}catch{return{width:0,height:0}}},iV=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function Sc(e){"@babel/helpers - typeof";return Sc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sc(e)}function hp(e,t){return cV(e)||uV(e,t)||lV(e,t)||sV()}function sV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
66
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lV(e,t){if(e){if(typeof e=="string")return I5(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return I5(e,t)}}function I5(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function uV(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,a,i,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(d){c=!0,o=d}finally{try{if(!l&&r.return!=null&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}function cV(e){if(Array.isArray(e))return e}function dV(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function D5(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,pV(n.key),n)}}function fV(e,t,r){return t&&D5(e.prototype,t),r&&D5(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function pV(e){var t=mV(e,"string");return Sc(t)=="symbol"?t:t+""}function mV(e,t){if(Sc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Sc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var L5=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,R5=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,hV=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,gV=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,M7={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},bV=Object.keys(M7),Ws="NaN";function vV(e,t){return e*M7[t]}var bf=function(){function e(t,r){dV(this,e),this.num=t,this.unit=r,this.num=t,this.unit=r,Number.isNaN(t)&&(this.unit=""),r!==""&&!hV.test(r)&&(this.num=NaN,this.unit=""),bV.includes(r)&&(this.num=vV(t,r),this.unit="px")}return fV(e,[{key:"add",value:function(t){return this.unit!==t.unit?new e(NaN,""):new e(this.num+t.num,this.unit)}},{key:"subtract",value:function(t){return this.unit!==t.unit?new e(NaN,""):new e(this.num-t.num,this.unit)}},{key:"multiply",value:function(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new e(NaN,""):new e(this.num*t.num,this.unit||t.unit)}},{key:"divide",value:function(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new e(NaN,""):new e(this.num/t.num,this.unit||t.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(t){var r,n=(r=gV.exec(t))!==null&&r!==void 0?r:[],o=hp(n,3),a=o[1],i=o[2];return new e(parseFloat(a),i??"")}}])}();function _7(e){if(e.includes(Ws))return Ws;for(var t=e;t.includes("*")||t.includes("/");){var r,n=(r=L5.exec(t))!==null&&r!==void 0?r:[],o=hp(n,4),a=o[1],i=o[2],s=o[3],l=bf.parse(a??""),c=bf.parse(s??""),d=i==="*"?l.multiply(c):l.divide(c);if(d.isNaN())return Ws;t=t.replace(L5,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,m=(f=R5.exec(t))!==null&&f!==void 0?f:[],p=hp(m,4),h=p[1],b=p[2],v=p[3],x=bf.parse(h??""),k=bf.parse(v??""),S=b==="+"?x.add(k):x.subtract(k);if(S.isNaN())return Ws;t=t.replace(R5,S.toString())}return t}var F5=/\(([^()]*)\)/;function yV(e){for(var t=e;t.includes("(");){var r=F5.exec(t),n=hp(r,2),o=n[1];t=t.replace(F5,_7(o))}return t}function xV(e){var t=e.replace(/\s+/g,"");return t=yV(t),t=_7(t),t}function wV(e){try{return xV(e)}catch{return Ws}}function Wy(e){var t=wV(e.slice(5,-1));return t===Ws?"":t}var kV=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],jV=["dx","dy","angle","className","breakAll"];function Q0(){return Q0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Q0.apply(this,arguments)}function $5(e,t){if(e==null)return{};var r=EV(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function EV(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function B5(e,t){return CV(e)||OV(e,t)||NV(e,t)||SV()}function SV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
67
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NV(e,t){if(e){if(typeof e=="string")return z5(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return z5(e,t)}}function z5(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function OV(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,a,i,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(d){c=!0,o=d}finally{try{if(!l&&r.return!=null&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}function CV(e){if(Array.isArray(e))return e}var I7=/[ \f\n\r\t\v\u2028\u2029]+/,D7=function(e){var t=e.children,r=e.breakAll,n=e.style;try{var o=[];st(t)||(r?o=t.toString().split(""):o=t.toString().split(I7));var a=o.map(function(s){return{word:s,width:ac(s,n).width}}),i=r?0:ac(" ",n).width;return{wordsWithComputedWidth:a,spaceWidth:i}}catch{return null}},PV=function(e,t,r,n,o){var a=e.maxLines,i=e.children,s=e.style,l=e.breakAll,c=Re(a),d=i,f=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return L.reduce(function(F,B){var U=B.word,$=B.width,z=F[F.length-1];if(z&&(n==null||o||z.width+$+r<Number(n)))z.words.push(U),z.width+=$+r;else{var W={words:[U],width:$};F.push(W)}return F},[])},m=f(t),p=function(L){return L.reduce(function(F,B){return F.width>B.width?F:B})};if(!c)return m;for(var h="…",b=function(L){var F=d.slice(0,L),B=D7({breakAll:l,style:s,children:F+h}).wordsWithComputedWidth,U=f(B),$=U.length>a||p(U).width>Number(n);return[$,U]},v=0,x=d.length-1,k=0,S;v<=x&&k<=d.length-1;){var j=Math.floor((v+x)/2),O=j-1,C=b(O),N=B5(C,2),T=N[0],M=N[1],I=b(j),_=B5(I,1),R=_[0];if(!T&&!R&&(v=j+1),T&&R&&(x=j-1),!T&&R){S=M;break}k++}return S||m},H5=function(e){var t=st(e)?[]:e.toString().split(I7);return[{words:t}]},AV=function(e){var t=e.width,r=e.scaleToFit,n=e.children,o=e.style,a=e.breakAll,i=e.maxLines;if((t||r)&&!ya.isSsr){var s,l,c=D7({breakAll:a,children:n,style:o});if(c){var d=c.wordsWithComputedWidth,f=c.spaceWidth;s=d,l=f}else return H5(n);return PV({breakAll:a,children:n,maxLines:i,style:o},s,l,t,r)}return H5(n)},q5="#808080",ds=function(e){var t=e.x,r=t===void 0?0:t,n=e.y,o=n===void 0?0:n,a=e.lineHeight,i=a===void 0?"1em":a,s=e.capHeight,l=s===void 0?"0.71em":s,c=e.scaleToFit,d=c===void 0?!1:c,f=e.textAnchor,m=f===void 0?"start":f,p=e.verticalAnchor,h=p===void 0?"end":p,b=e.fill,v=b===void 0?q5:b,x=$5(e,kV),k=g.useMemo(function(){return AV({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:d,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,d,x.style,x.width]),S=x.dx,j=x.dy,O=x.angle,C=x.className,N=x.breakAll,T=$5(x,jV);if(!Mr(r)||!Mr(o))return null;var M=r+(Re(S)?S:0),I=o+(Re(j)?j:0),_;switch(h){case"start":_=Wy("calc(".concat(l,")"));break;case"middle":_=Wy("calc(".concat((k.length-1)/2," * -").concat(i," + (").concat(l," / 2))"));break;default:_=Wy("calc(".concat(k.length-1," * -").concat(i,")"));break}var R=[];if(d){var L=k[0].width,F=x.width;R.push("scale(".concat((Re(F)?F/L:1)/L,")"))}return O&&R.push("rotate(".concat(O,", ").concat(M,", ").concat(I,")")),R.length&&(T.transform=R.join(" ")),y.createElement("text",Q0({},Xe(T,!0),{x:M,y:I,className:wt("recharts-text",C),textAnchor:m,fill:v.includes("url")?q5:v}),k.map(function(B,U){var $=B.words.join(N?"":" ");return y.createElement("tspan",{x:M,dy:U===0?_:i,key:"".concat($,"-").concat(U)},$)}))};function ei(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function TV(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function O2(e){let t,r,n;e.length!==2?(t=ei,r=(s,l)=>ei(e(s),l),n=(s,l)=>e(s)-l):(t=e===ei||e===TV?e:MV,r=e,n=e);function o(s,l,c=0,d=s.length){if(c<d){if(t(l,l)!==0)return d;do{const f=c+d>>>1;r(s[f],l)<0?c=f+1:d=f}while(c<d)}return c}function a(s,l,c=0,d=s.length){if(c<d){if(t(l,l)!==0)return d;do{const f=c+d>>>1;r(s[f],l)<=0?c=f+1:d=f}while(c<d)}return c}function i(s,l,c=0,d=s.length){const f=o(s,l,c,d-1);return f>c&&n(s[f-1],l)>-n(s[f],l)?f-1:f}return{left:o,center:i,right:a}}function MV(){return 0}function L7(e){return e===null?NaN:+e}function*_V(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const IV=O2(ei),vd=IV.right;O2(L7).center;class W5 extends Map{constructor(t,r=RV){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,o]of t)this.set(n,o)}get(t){return super.get(U5(this,t))}has(t){return super.has(U5(this,t))}set(t,r){return super.set(DV(this,t),r)}delete(t){return super.delete(LV(this,t))}}function U5({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function DV({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function LV({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function RV(e){return e!==null&&typeof e=="object"?e.valueOf():e}function FV(e=ei){if(e===ei)return R7;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function R7(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const $V=Math.sqrt(50),BV=Math.sqrt(10),zV=Math.sqrt(2);function gp(e,t,r){const n=(t-e)/Math.max(0,r),o=Math.floor(Math.log10(n)),a=n/Math.pow(10,o),i=a>=$V?10:a>=BV?5:a>=zV?2:1;let s,l,c;return o<0?(c=Math.pow(10,-o)/i,s=Math.round(e*c),l=Math.round(t*c),s/c<e&&++s,l/c>t&&--l,c=-c):(c=Math.pow(10,o)*i,s=Math.round(e/c),l=Math.round(t/c),s*c<e&&++s,l*c>t&&--l),l<s&&.5<=r&&r<2?gp(e,t,r*2):[s,l,c]}function ew(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[o,a,i]=n?gp(t,e,r):gp(e,t,r);if(!(a>=o))return[];const s=a-o+1,l=new Array(s);if(n)if(i<0)for(let c=0;c<s;++c)l[c]=(a-c)/-i;else for(let c=0;c<s;++c)l[c]=(a-c)*i;else if(i<0)for(let c=0;c<s;++c)l[c]=(o+c)/-i;else for(let c=0;c<s;++c)l[c]=(o+c)*i;return l}function tw(e,t,r){return t=+t,e=+e,r=+r,gp(e,t,r)[2]}function rw(e,t,r){t=+t,e=+e,r=+r;const n=t<e,o=n?tw(t,e,r):tw(e,t,r);return(n?-1:1)*(o<0?1/-o:o)}function K5(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function V5(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function F7(e,t,r=0,n=1/0,o){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(o=o===void 0?R7:FV(o);n>r;){if(n-r>600){const l=n-r+1,c=t-r+1,d=Math.log(l),f=.5*Math.exp(2*d/3),m=.5*Math.sqrt(d*f*(l-f)/l)*(c-l/2<0?-1:1),p=Math.max(r,Math.floor(t-c*f/l+m)),h=Math.min(n,Math.floor(t+(l-c)*f/l+m));F7(e,t,p,h,o)}const a=e[t];let i=r,s=n;for(Pu(e,r,t),o(e[n],a)>0&&Pu(e,r,n);i<s;){for(Pu(e,i,s),++i,--s;o(e[i],a)<0;)++i;for(;o(e[s],a)>0;)--s}o(e[r],a)===0?Pu(e,r,s):(++s,Pu(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function Pu(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function HV(e,t,r){if(e=Float64Array.from(_V(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return V5(e);if(t>=1)return K5(e);var n,o=(n-1)*t,a=Math.floor(o),i=K5(F7(e,a).subarray(0,a+1)),s=V5(e.subarray(a+1));return i+(s-i)*(o-a)}}function qV(e,t,r=L7){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,o=(n-1)*t,a=Math.floor(o),i=+r(e[a],a,e),s=+r(e[a+1],a+1,e);return i+(s-i)*(o-a)}}function WV(e,t,r){e=+e,t=+t,r=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+r;for(var n=-1,o=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(o);++n<o;)a[n]=e+n*r;return a}function Hn(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function xa(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const nw=Symbol("implicit");function C2(){var e=new W5,t=[],r=[],n=nw;function o(a){let i=e.get(a);if(i===void 0){if(n!==nw)return n;e.set(a,i=t.push(a)-1)}return r[i%r.length]}return o.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new W5;for(const i of a)e.has(i)||e.set(i,t.push(i)-1);return o},o.range=function(a){return arguments.length?(r=Array.from(a),o):r.slice()},o.unknown=function(a){return arguments.length?(n=a,o):n},o.copy=function(){return C2(t,r).unknown(n)},Hn.apply(o,arguments),o}function Nc(){var e=C2().unknown(void 0),t=e.domain,r=e.range,n=0,o=1,a,i,s=!1,l=0,c=0,d=.5;delete e.unknown;function f(){var m=t().length,p=o<n,h=p?o:n,b=p?n:o;a=(b-h)/Math.max(1,m-l+c*2),s&&(a=Math.floor(a)),h+=(b-h-a*(m-l))*d,i=a*(1-l),s&&(h=Math.round(h),i=Math.round(i));var v=WV(m).map(function(x){return h+a*x});return r(p?v.reverse():v)}return e.domain=function(m){return arguments.length?(t(m),f()):t()},e.range=function(m){return arguments.length?([n,o]=m,n=+n,o=+o,f()):[n,o]},e.rangeRound=function(m){return[n,o]=m,n=+n,o=+o,s=!0,f()},e.bandwidth=function(){return i},e.step=function(){return a},e.round=function(m){return arguments.length?(s=!!m,f()):s},e.padding=function(m){return arguments.length?(l=Math.min(1,c=+m),f()):l},e.paddingInner=function(m){return arguments.length?(l=Math.min(1,m),f()):l},e.paddingOuter=function(m){return arguments.length?(c=+m,f()):c},e.align=function(m){return arguments.length?(d=Math.max(0,Math.min(1,m)),f()):d},e.copy=function(){return Nc(t(),[n,o]).round(s).paddingInner(l).paddingOuter(c).align(d)},Hn.apply(f(),arguments)}function $7(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return $7(t())},e}function ic(){return $7(Nc.apply(null,arguments).paddingInner(1))}function P2(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function B7(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function yd(){}var Oc=.7,bp=1/Oc,el="\\s*([+-]?\\d+)\\s*",Cc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Eo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",UV=/^#([0-9a-f]{3,8})$/,KV=new RegExp(`^rgb\\(${el},${el},${el}\\)$`),VV=new RegExp(`^rgb\\(${Eo},${Eo},${Eo}\\)$`),GV=new RegExp(`^rgba\\(${el},${el},${el},${Cc}\\)$`),YV=new RegExp(`^rgba\\(${Eo},${Eo},${Eo},${Cc}\\)$`),XV=new RegExp(`^hsl\\(${Cc},${Eo},${Eo}\\)$`),ZV=new RegExp(`^hsla\\(${Cc},${Eo},${Eo},${Cc}\\)$`),G5={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};P2(yd,Pc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Y5,formatHex:Y5,formatHex8:JV,formatHsl:QV,formatRgb:X5,toString:X5});function Y5(){return this.rgb().formatHex()}function JV(){return this.rgb().formatHex8()}function QV(){return z7(this).formatHsl()}function X5(){return this.rgb().formatRgb()}function Pc(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=UV.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Z5(t):r===3?new dn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?vf(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?vf(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=KV.exec(e))?new dn(t[1],t[2],t[3],1):(t=VV.exec(e))?new dn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=GV.exec(e))?vf(t[1],t[2],t[3],t[4]):(t=YV.exec(e))?vf(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=XV.exec(e))?e3(t[1],t[2]/100,t[3]/100,1):(t=ZV.exec(e))?e3(t[1],t[2]/100,t[3]/100,t[4]):G5.hasOwnProperty(e)?Z5(G5[e]):e==="transparent"?new dn(NaN,NaN,NaN,0):null}function Z5(e){return new dn(e>>16&255,e>>8&255,e&255,1)}function vf(e,t,r,n){return n<=0&&(e=t=r=NaN),new dn(e,t,r,n)}function eG(e){return e instanceof yd||(e=Pc(e)),e?(e=e.rgb(),new dn(e.r,e.g,e.b,e.opacity)):new dn}function ow(e,t,r,n){return arguments.length===1?eG(e):new dn(e,t,r,n??1)}function dn(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}P2(dn,ow,B7(yd,{brighter(e){return e=e==null?bp:Math.pow(bp,e),new dn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Oc:Math.pow(Oc,e),new dn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new dn(rs(this.r),rs(this.g),rs(this.b),vp(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:J5,formatHex:J5,formatHex8:tG,formatRgb:Q5,toString:Q5}));function J5(){return`#${Vi(this.r)}${Vi(this.g)}${Vi(this.b)}`}function tG(){return`#${Vi(this.r)}${Vi(this.g)}${Vi(this.b)}${Vi((isNaN(this.opacity)?1:this.opacity)*255)}`}function Q5(){const e=vp(this.opacity);return`${e===1?"rgb(":"rgba("}${rs(this.r)}, ${rs(this.g)}, ${rs(this.b)}${e===1?")":`, ${e})`}`}function vp(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function rs(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Vi(e){return e=rs(e),(e<16?"0":"")+e.toString(16)}function e3(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Yn(e,t,r,n)}function z7(e){if(e instanceof Yn)return new Yn(e.h,e.s,e.l,e.opacity);if(e instanceof yd||(e=Pc(e)),!e)return new Yn;if(e instanceof Yn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,o=Math.min(t,r,n),a=Math.max(t,r,n),i=NaN,s=a-o,l=(a+o)/2;return s?(t===a?i=(r-n)/s+(r<n)*6:r===a?i=(n-t)/s+2:i=(t-r)/s+4,s/=l<.5?a+o:2-a-o,i*=60):s=l>0&&l<1?0:i,new Yn(i,s,l,e.opacity)}function rG(e,t,r,n){return arguments.length===1?z7(e):new Yn(e,t,r,n??1)}function Yn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}P2(Yn,rG,B7(yd,{brighter(e){return e=e==null?bp:Math.pow(bp,e),new Yn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Oc:Math.pow(Oc,e),new Yn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,o=2*r-n;return new dn(Uy(e>=240?e-240:e+120,o,n),Uy(e,o,n),Uy(e<120?e+240:e-120,o,n),this.opacity)},clamp(){return new Yn(t3(this.h),yf(this.s),yf(this.l),vp(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=vp(this.opacity);return`${e===1?"hsl(":"hsla("}${t3(this.h)}, ${yf(this.s)*100}%, ${yf(this.l)*100}%${e===1?")":`, ${e})`}`}}));function t3(e){return e=(e||0)%360,e<0?e+360:e}function yf(e){return Math.max(0,Math.min(1,e||0))}function Uy(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const A2=e=>()=>e;function nG(e,t){return function(r){return e+r*t}}function oG(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function aG(e){return(e=+e)==1?H7:function(t,r){return r-t?oG(t,r,e):A2(isNaN(t)?r:t)}}function H7(e,t){var r=t-e;return r?nG(e,r):A2(isNaN(e)?t:e)}const r3=function e(t){var r=aG(t);function n(o,a){var i=r((o=ow(o)).r,(a=ow(a)).r),s=r(o.g,a.g),l=r(o.b,a.b),c=H7(o.opacity,a.opacity);return function(d){return o.r=i(d),o.g=s(d),o.b=l(d),o.opacity=c(d),o+""}}return n.gamma=e,n}(1);function iG(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),o;return function(a){for(o=0;o<r;++o)n[o]=e[o]*(1-a)+t[o]*a;return n}}function sG(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function lG(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,o=new Array(n),a=new Array(r),i;for(i=0;i<n;++i)o[i]=Ql(e[i],t[i]);for(;i<r;++i)a[i]=t[i];return function(s){for(i=0;i<n;++i)a[i]=o[i](s);return a}}function uG(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function yp(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function cG(e,t){var r={},n={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?r[o]=Ql(e[o],t[o]):n[o]=t[o];return function(a){for(o in r)n[o]=r[o](a);return n}}var aw=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ky=new RegExp(aw.source,"g");function dG(e){return function(){return e}}function fG(e){return function(t){return e(t)+""}}function pG(e,t){var r=aw.lastIndex=Ky.lastIndex=0,n,o,a,i=-1,s=[],l=[];for(e=e+"",t=t+"";(n=aw.exec(e))&&(o=Ky.exec(t));)(a=o.index)>r&&(a=t.slice(r,a),s[i]?s[i]+=a:s[++i]=a),(n=n[0])===(o=o[0])?s[i]?s[i]+=o:s[++i]=o:(s[++i]=null,l.push({i,x:yp(n,o)})),r=Ky.lastIndex;return r<t.length&&(a=t.slice(r),s[i]?s[i]+=a:s[++i]=a),s.length<2?l[0]?fG(l[0].x):dG(t):(t=l.length,function(c){for(var d=0,f;d<t;++d)s[(f=l[d]).i]=f.x(c);return s.join("")})}function Ql(e,t){var r=typeof t,n;return t==null||r==="boolean"?A2(t):(r==="number"?yp:r==="string"?(n=Pc(t))?(t=n,r3):pG:t instanceof Pc?r3:t instanceof Date?uG:sG(t)?iG:Array.isArray(t)?lG:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?cG:yp)(e,t)}function T2(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function mG(e,t){t===void 0&&(t=e,e=Ql);for(var r=0,n=t.length-1,o=t[0],a=new Array(n<0?0:n);r<n;)a[r]=e(o,o=t[++r]);return function(i){var s=Math.max(0,Math.min(n-1,Math.floor(i*=n)));return a[s](i-s)}}function hG(e){return function(){return e}}function xp(e){return+e}var n3=[0,1];function rn(e){return e}function iw(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:hG(isNaN(t)?NaN:.5)}function gG(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function bG(e,t,r){var n=e[0],o=e[1],a=t[0],i=t[1];return o<n?(n=iw(o,n),a=r(i,a)):(n=iw(n,o),a=r(a,i)),function(s){return a(n(s))}}function vG(e,t,r){var n=Math.min(e.length,t.length)-1,o=new Array(n),a=new Array(n),i=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++i<n;)o[i]=iw(e[i],e[i+1]),a[i]=r(t[i],t[i+1]);return function(s){var l=vd(e,s,1,n)-1;return a[l](o[l](s))}}function xd(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Zm(){var e=n3,t=n3,r=Ql,n,o,a,i=rn,s,l,c;function d(){var m=Math.min(e.length,t.length);return i!==rn&&(i=gG(e[0],e[m-1])),s=m>2?vG:bG,l=c=null,f}function f(m){return m==null||isNaN(m=+m)?a:(l||(l=s(e.map(n),t,r)))(n(i(m)))}return f.invert=function(m){return i(o((c||(c=s(t,e.map(n),yp)))(m)))},f.domain=function(m){return arguments.length?(e=Array.from(m,xp),d()):e.slice()},f.range=function(m){return arguments.length?(t=Array.from(m),d()):t.slice()},f.rangeRound=function(m){return t=Array.from(m),r=T2,d()},f.clamp=function(m){return arguments.length?(i=m?!0:rn,d()):i!==rn},f.interpolate=function(m){return arguments.length?(r=m,d()):r},f.unknown=function(m){return arguments.length?(a=m,f):a},function(m,p){return n=m,o=p,d()}}function M2(){return Zm()(rn,rn)}function yG(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function wp(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function xl(e){return e=wp(Math.abs(e)),e?e[1]:NaN}function xG(e,t){return function(r,n){for(var o=r.length,a=[],i=0,s=e[0],l=0;o>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),a.push(r.substring(o-=s,o+s)),!((l+=s+1)>n));)s=e[i=(i+1)%e.length];return a.reverse().join(t)}}function wG(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var kG=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ac(e){if(!(t=kG.exec(e)))throw new Error("invalid format: "+e);var t;return new _2({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Ac.prototype=_2.prototype;function _2(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}_2.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function jG(e){e:for(var t=e.length,r=1,n=-1,o;r<t;++r)switch(e[r]){case".":n=o=r;break;case"0":n===0&&(n=r),o=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(o+1):e}var q7;function EG(e,t){var r=wp(e,t);if(!r)return e+"";var n=r[0],o=r[1],a=o-(q7=Math.max(-8,Math.min(8,Math.floor(o/3)))*3)+1,i=n.length;return a===i?n:a>i?n+new Array(a-i+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+wp(e,Math.max(0,t+a-1))[0]}function o3(e,t){var r=wp(e,t);if(!r)return e+"";var n=r[0],o=r[1];return o<0?"0."+new Array(-o).join("0")+n:n.length>o+1?n.slice(0,o+1)+"."+n.slice(o+1):n+new Array(o-n.length+2).join("0")}const a3={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:yG,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>o3(e*100,t),r:o3,s:EG,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function i3(e){return e}var s3=Array.prototype.map,l3=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function SG(e){var t=e.grouping===void 0||e.thousands===void 0?i3:xG(s3.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",o=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?i3:wG(s3.call(e.numerals,String)),i=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(f){f=Ac(f);var m=f.fill,p=f.align,h=f.sign,b=f.symbol,v=f.zero,x=f.width,k=f.comma,S=f.precision,j=f.trim,O=f.type;O==="n"?(k=!0,O="g"):a3[O]||(S===void 0&&(S=12),j=!0,O="g"),(v||m==="0"&&p==="=")&&(v=!0,m="0",p="=");var C=b==="$"?r:b==="#"&&/[boxX]/.test(O)?"0"+O.toLowerCase():"",N=b==="$"?n:/[%p]/.test(O)?i:"",T=a3[O],M=/[defgprs%]/.test(O);S=S===void 0?6:/[gprs]/.test(O)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function I(_){var R=C,L=N,F,B,U;if(O==="c")L=T(_)+L,_="";else{_=+_;var $=_<0||1/_<0;if(_=isNaN(_)?l:T(Math.abs(_),S),j&&(_=jG(_)),$&&+_==0&&h!=="+"&&($=!1),R=($?h==="("?h:s:h==="-"||h==="("?"":h)+R,L=(O==="s"?l3[8+q7/3]:"")+L+($&&h==="("?")":""),M){for(F=-1,B=_.length;++F<B;)if(U=_.charCodeAt(F),48>U||U>57){L=(U===46?o+_.slice(F+1):_.slice(F))+L,_=_.slice(0,F);break}}}k&&!v&&(_=t(_,1/0));var z=R.length+_.length+L.length,W=z<x?new Array(x-z+1).join(m):"";switch(k&&v&&(_=t(W+_,W.length?x-L.length:1/0),W=""),p){case"<":_=R+_+L+W;break;case"=":_=R+W+_+L;break;case"^":_=W.slice(0,z=W.length>>1)+R+_+L+W.slice(z);break;default:_=W+R+_+L;break}return a(_)}return I.toString=function(){return f+""},I}function d(f,m){var p=c((f=Ac(f),f.type="f",f)),h=Math.max(-8,Math.min(8,Math.floor(xl(m)/3)))*3,b=Math.pow(10,-h),v=l3[8+h/3];return function(x){return p(b*x)+v}}return{format:c,formatPrefix:d}}var xf,I2,W7;NG({thousands:",",grouping:[3],currency:["$",""]});function NG(e){return xf=SG(e),I2=xf.format,W7=xf.formatPrefix,xf}function OG(e){return Math.max(0,-xl(Math.abs(e)))}function CG(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(xl(t)/3)))*3-xl(Math.abs(e)))}function PG(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,xl(t)-xl(e))+1}function U7(e,t,r,n){var o=rw(e,t,r),a;switch(n=Ac(n??",f"),n.type){case"s":{var i=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=CG(o,i))&&(n.precision=a),W7(n,i)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=PG(o,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=OG(o))&&(n.precision=a-(n.type==="%")*2);break}}return I2(n)}function yi(e){var t=e.domain;return e.ticks=function(r){var n=t();return ew(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var o=t();return U7(o[0],o[o.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),o=0,a=n.length-1,i=n[o],s=n[a],l,c,d=10;for(s<i&&(c=i,i=s,s=c,c=o,o=a,a=c);d-- >0;){if(c=tw(i,s,r),c===l)return n[o]=i,n[a]=s,t(n);if(c>0)i=Math.floor(i/c)*c,s=Math.ceil(s/c)*c;else if(c<0)i=Math.ceil(i*c)/c,s=Math.floor(s*c)/c;else break;l=c}return e},e}function kp(){var e=M2();return e.copy=function(){return xd(e,kp())},Hn.apply(e,arguments),yi(e)}function K7(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,xp),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return K7(e).unknown(t)},e=arguments.length?Array.from(e,xp):[0,1],yi(r)}function V7(e,t){e=e.slice();var r=0,n=e.length-1,o=e[r],a=e[n],i;return a<o&&(i=r,r=n,n=i,i=o,o=a,a=i),e[r]=t.floor(o),e[n]=t.ceil(a),e}function u3(e){return Math.log(e)}function c3(e){return Math.exp(e)}function AG(e){return-Math.log(-e)}function TG(e){return-Math.exp(-e)}function MG(e){return isFinite(e)?+("1e"+e):e<0?0:e}function _G(e){return e===10?MG:e===Math.E?Math.exp:t=>Math.pow(e,t)}function IG(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function d3(e){return(t,r)=>-e(-t,r)}function D2(e){const t=e(u3,c3),r=t.domain;let n=10,o,a;function i(){return o=IG(n),a=_G(n),r()[0]<0?(o=d3(o),a=d3(a),e(AG,TG)):e(u3,c3),t}return t.base=function(s){return arguments.length?(n=+s,i()):n},t.domain=function(s){return arguments.length?(r(s),i()):r()},t.ticks=s=>{const l=r();let c=l[0],d=l[l.length-1];const f=d<c;f&&([c,d]=[d,c]);let m=o(c),p=o(d),h,b;const v=s==null?10:+s;let x=[];if(!(n%1)&&p-m<v){if(m=Math.floor(m),p=Math.ceil(p),c>0){for(;m<=p;++m)for(h=1;h<n;++h)if(b=m<0?h/a(-m):h*a(m),!(b<c)){if(b>d)break;x.push(b)}}else for(;m<=p;++m)for(h=n-1;h>=1;--h)if(b=m>0?h/a(-m):h*a(m),!(b<c)){if(b>d)break;x.push(b)}x.length*2<v&&(x=ew(c,d,v))}else x=ew(m,p,Math.min(p-m,v)).map(a);return f?x.reverse():x},t.tickFormat=(s,l)=>{if(s==null&&(s=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=Ac(l)).precision==null&&(l.trim=!0),l=I2(l)),s===1/0)return l;const c=Math.max(1,n*s/t.ticks().length);return d=>{let f=d/a(Math.round(o(d)));return f*n<n-.5&&(f*=n),f<=c?l(d):""}},t.nice=()=>r(V7(r(),{floor:s=>a(Math.floor(o(s))),ceil:s=>a(Math.ceil(o(s)))})),t}function G7(){const e=D2(Zm()).domain([1,10]);return e.copy=()=>xd(e,G7()).base(e.base()),Hn.apply(e,arguments),e}function f3(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function p3(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function L2(e){var t=1,r=e(f3(t),p3(t));return r.constant=function(n){return arguments.length?e(f3(t=+n),p3(t)):t},yi(r)}function Y7(){var e=L2(Zm());return e.copy=function(){return xd(e,Y7()).constant(e.constant())},Hn.apply(e,arguments)}function m3(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function DG(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function LG(e){return e<0?-e*e:e*e}function R2(e){var t=e(rn,rn),r=1;function n(){return r===1?e(rn,rn):r===.5?e(DG,LG):e(m3(r),m3(1/r))}return t.exponent=function(o){return arguments.length?(r=+o,n()):r},yi(t)}function F2(){var e=R2(Zm());return e.copy=function(){return xd(e,F2()).exponent(e.exponent())},Hn.apply(e,arguments),e}function RG(){return F2.apply(null,arguments).exponent(.5)}function h3(e){return Math.sign(e)*e*e}function FG(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function X7(){var e=M2(),t=[0,1],r=!1,n;function o(a){var i=FG(e(a));return isNaN(i)?n:r?Math.round(i):i}return o.invert=function(a){return e.invert(h3(a))},o.domain=function(a){return arguments.length?(e.domain(a),o):e.domain()},o.range=function(a){return arguments.length?(e.range((t=Array.from(a,xp)).map(h3)),o):t.slice()},o.rangeRound=function(a){return o.range(a).round(!0)},o.round=function(a){return arguments.length?(r=!!a,o):r},o.clamp=function(a){return arguments.length?(e.clamp(a),o):e.clamp()},o.unknown=function(a){return arguments.length?(n=a,o):n},o.copy=function(){return X7(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Hn.apply(o,arguments),yi(o)}function Z7(){var e=[],t=[],r=[],n;function o(){var i=0,s=Math.max(1,t.length);for(r=new Array(s-1);++i<s;)r[i-1]=qV(e,i/s);return a}function a(i){return i==null||isNaN(i=+i)?n:t[vd(r,i)]}return a.invertExtent=function(i){var s=t.indexOf(i);return s<0?[NaN,NaN]:[s>0?r[s-1]:e[0],s<r.length?r[s]:e[e.length-1]]},a.domain=function(i){if(!arguments.length)return e.slice();e=[];for(let s of i)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(ei),o()},a.range=function(i){return arguments.length?(t=Array.from(i),o()):t.slice()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.quantiles=function(){return r.slice()},a.copy=function(){return Z7().domain(e).range(t).unknown(n)},Hn.apply(a,arguments)}function J7(){var e=0,t=1,r=1,n=[.5],o=[0,1],a;function i(l){return l!=null&&l<=l?o[vd(n,l,0,r)]:a}function s(){var l=-1;for(n=new Array(r);++l<r;)n[l]=((l+1)*t-(l-r)*e)/(r+1);return i}return i.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,s()):[e,t]},i.range=function(l){return arguments.length?(r=(o=Array.from(l)).length-1,s()):o.slice()},i.invertExtent=function(l){var c=o.indexOf(l);return c<0?[NaN,NaN]:c<1?[e,n[0]]:c>=r?[n[r-1],t]:[n[c-1],n[c]]},i.unknown=function(l){return arguments.length&&(a=l),i},i.thresholds=function(){return n.slice()},i.copy=function(){return J7().domain([e,t]).range(o).unknown(a)},Hn.apply(yi(i),arguments)}function Q7(){var e=[.5],t=[0,1],r,n=1;function o(a){return a!=null&&a<=a?t[vd(e,a,0,n)]:r}return o.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),o):e.slice()},o.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),o):t.slice()},o.invertExtent=function(a){var i=t.indexOf(a);return[e[i-1],e[i]]},o.unknown=function(a){return arguments.length?(r=a,o):r},o.copy=function(){return Q7().domain(e).range(t).unknown(r)},Hn.apply(o,arguments)}const Vy=new Date,Gy=new Date;function _r(e,t,r,n){function o(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return o.floor=a=>(e(a=new Date(+a)),a),o.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),o.round=a=>{const i=o(a),s=o.ceil(a);return a-i<s-a?i:s},o.offset=(a,i)=>(t(a=new Date(+a),i==null?1:Math.floor(i)),a),o.range=(a,i,s)=>{const l=[];if(a=o.ceil(a),s=s==null?1:Math.floor(s),!(a<i)||!(s>0))return l;let c;do l.push(c=new Date(+a)),t(a,s),e(a);while(c<a&&a<i);return l},o.filter=a=>_r(i=>{if(i>=i)for(;e(i),!a(i);)i.setTime(i-1)},(i,s)=>{if(i>=i)if(s<0)for(;++s<=0;)for(;t(i,-1),!a(i););else for(;--s>=0;)for(;t(i,1),!a(i););}),r&&(o.count=(a,i)=>(Vy.setTime(+a),Gy.setTime(+i),e(Vy),e(Gy),Math.floor(r(Vy,Gy))),o.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?o.filter(n?i=>n(i)%a===0:i=>o.count(0,i)%a===0):o)),o}const jp=_r(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);jp.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?_r(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):jp);jp.range;const ra=1e3,Dn=ra*60,na=Dn*60,fa=na*24,$2=fa*7,g3=fa*30,Yy=fa*365,Gi=_r(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ra)},(e,t)=>(t-e)/ra,e=>e.getUTCSeconds());Gi.range;const B2=_r(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ra)},(e,t)=>{e.setTime(+e+t*Dn)},(e,t)=>(t-e)/Dn,e=>e.getMinutes());B2.range;const z2=_r(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Dn)},(e,t)=>(t-e)/Dn,e=>e.getUTCMinutes());z2.range;const H2=_r(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ra-e.getMinutes()*Dn)},(e,t)=>{e.setTime(+e+t*na)},(e,t)=>(t-e)/na,e=>e.getHours());H2.range;const q2=_r(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*na)},(e,t)=>(t-e)/na,e=>e.getUTCHours());q2.range;const wd=_r(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Dn)/fa,e=>e.getDate()-1);wd.range;const Jm=_r(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/fa,e=>e.getUTCDate()-1);Jm.range;const eM=_r(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/fa,e=>Math.floor(e/fa));eM.range;function ys(e){return _r(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Dn)/$2)}const Qm=ys(0),Ep=ys(1),$G=ys(2),BG=ys(3),wl=ys(4),zG=ys(5),HG=ys(6);Qm.range;Ep.range;$G.range;BG.range;wl.range;zG.range;HG.range;function xs(e){return _r(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/$2)}const eh=xs(0),Sp=xs(1),qG=xs(2),WG=xs(3),kl=xs(4),UG=xs(5),KG=xs(6);eh.range;Sp.range;qG.range;WG.range;kl.range;UG.range;KG.range;const W2=_r(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());W2.range;const U2=_r(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());U2.range;const pa=_r(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());pa.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:_r(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});pa.range;const ma=_r(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ma.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:_r(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});ma.range;function tM(e,t,r,n,o,a){const i=[[Gi,1,ra],[Gi,5,5*ra],[Gi,15,15*ra],[Gi,30,30*ra],[a,1,Dn],[a,5,5*Dn],[a,15,15*Dn],[a,30,30*Dn],[o,1,na],[o,3,3*na],[o,6,6*na],[o,12,12*na],[n,1,fa],[n,2,2*fa],[r,1,$2],[t,1,g3],[t,3,3*g3],[e,1,Yy]];function s(c,d,f){const m=d<c;m&&([c,d]=[d,c]);const p=f&&typeof f.range=="function"?f:l(c,d,f),h=p?p.range(c,+d+1):[];return m?h.reverse():h}function l(c,d,f){const m=Math.abs(d-c)/f,p=O2(([,,v])=>v).right(i,m);if(p===i.length)return e.every(rw(c/Yy,d/Yy,f));if(p===0)return jp.every(Math.max(rw(c,d,f),1));const[h,b]=i[m/i[p-1][2]<i[p][2]/m?p-1:p];return h.every(b)}return[s,l]}const[VG,GG]=tM(ma,U2,eh,eM,q2,z2),[YG,XG]=tM(pa,W2,Qm,wd,H2,B2);function Xy(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Zy(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Au(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function ZG(e){var t=e.dateTime,r=e.date,n=e.time,o=e.periods,a=e.days,i=e.shortDays,s=e.months,l=e.shortMonths,c=Tu(o),d=Mu(o),f=Tu(a),m=Mu(a),p=Tu(i),h=Mu(i),b=Tu(s),v=Mu(s),x=Tu(l),k=Mu(l),S={a:$,A:z,b:W,B:K,c:null,d:k3,e:k3,f:xY,g:AY,G:MY,H:bY,I:vY,j:yY,L:rM,m:wY,M:kY,p:q,q:J,Q:S3,s:N3,S:jY,u:EY,U:SY,V:NY,w:OY,W:CY,x:null,X:null,y:PY,Y:TY,Z:_Y,"%":E3},j={a:V,A:me,b:X,B:ce,c:null,d:j3,e:j3,f:RY,g:VY,G:YY,H:IY,I:DY,j:LY,L:oM,m:FY,M:$Y,p:oe,q:Oe,Q:S3,s:N3,S:BY,u:zY,U:HY,V:qY,w:WY,W:UY,x:null,X:null,y:KY,Y:GY,Z:XY,"%":E3},O={a:I,A:_,b:R,B:L,c:F,d:x3,e:x3,f:pY,g:y3,G:v3,H:w3,I:w3,j:uY,L:fY,m:lY,M:cY,p:M,q:sY,Q:hY,s:gY,S:dY,u:rY,U:nY,V:oY,w:tY,W:aY,x:B,X:U,y:y3,Y:v3,Z:iY,"%":mY};S.x=C(r,S),S.X=C(n,S),S.c=C(t,S),j.x=C(r,j),j.X=C(n,j),j.c=C(t,j);function C(te,Ne){return function(ve){var G=[],ye=-1,le=0,ge=te.length,Ce,Me,Ye;for(ve instanceof Date||(ve=new Date(+ve));++ye<ge;)te.charCodeAt(ye)===37&&(G.push(te.slice(le,ye)),(Me=b3[Ce=te.charAt(++ye)])!=null?Ce=te.charAt(++ye):Me=Ce==="e"?" ":"0",(Ye=Ne[Ce])&&(Ce=Ye(ve,Me)),G.push(Ce),le=ye+1);return G.push(te.slice(le,ye)),G.join("")}}function N(te,Ne){return function(ve){var G=Au(1900,void 0,1),ye=T(G,te,ve+="",0),le,ge;if(ye!=ve.length)return null;if("Q"in G)return new Date(G.Q);if("s"in G)return new Date(G.s*1e3+("L"in G?G.L:0));if(Ne&&!("Z"in G)&&(G.Z=0),"p"in G&&(G.H=G.H%12+G.p*12),G.m===void 0&&(G.m="q"in G?G.q:0),"V"in G){if(G.V<1||G.V>53)return null;"w"in G||(G.w=1),"Z"in G?(le=Zy(Au(G.y,0,1)),ge=le.getUTCDay(),le=ge>4||ge===0?Sp.ceil(le):Sp(le),le=Jm.offset(le,(G.V-1)*7),G.y=le.getUTCFullYear(),G.m=le.getUTCMonth(),G.d=le.getUTCDate()+(G.w+6)%7):(le=Xy(Au(G.y,0,1)),ge=le.getDay(),le=ge>4||ge===0?Ep.ceil(le):Ep(le),le=wd.offset(le,(G.V-1)*7),G.y=le.getFullYear(),G.m=le.getMonth(),G.d=le.getDate()+(G.w+6)%7)}else("W"in G||"U"in G)&&("w"in G||(G.w="u"in G?G.u%7:"W"in G?1:0),ge="Z"in G?Zy(Au(G.y,0,1)).getUTCDay():Xy(Au(G.y,0,1)).getDay(),G.m=0,G.d="W"in G?(G.w+6)%7+G.W*7-(ge+5)%7:G.w+G.U*7-(ge+6)%7);return"Z"in G?(G.H+=G.Z/100|0,G.M+=G.Z%100,Zy(G)):Xy(G)}}function T(te,Ne,ve,G){for(var ye=0,le=Ne.length,ge=ve.length,Ce,Me;ye<le;){if(G>=ge)return-1;if(Ce=Ne.charCodeAt(ye++),Ce===37){if(Ce=Ne.charAt(ye++),Me=O[Ce in b3?Ne.charAt(ye++):Ce],!Me||(G=Me(te,ve,G))<0)return-1}else if(Ce!=ve.charCodeAt(G++))return-1}return G}function M(te,Ne,ve){var G=c.exec(Ne.slice(ve));return G?(te.p=d.get(G[0].toLowerCase()),ve+G[0].length):-1}function I(te,Ne,ve){var G=p.exec(Ne.slice(ve));return G?(te.w=h.get(G[0].toLowerCase()),ve+G[0].length):-1}function _(te,Ne,ve){var G=f.exec(Ne.slice(ve));return G?(te.w=m.get(G[0].toLowerCase()),ve+G[0].length):-1}function R(te,Ne,ve){var G=x.exec(Ne.slice(ve));return G?(te.m=k.get(G[0].toLowerCase()),ve+G[0].length):-1}function L(te,Ne,ve){var G=b.exec(Ne.slice(ve));return G?(te.m=v.get(G[0].toLowerCase()),ve+G[0].length):-1}function F(te,Ne,ve){return T(te,t,Ne,ve)}function B(te,Ne,ve){return T(te,r,Ne,ve)}function U(te,Ne,ve){return T(te,n,Ne,ve)}function $(te){return i[te.getDay()]}function z(te){return a[te.getDay()]}function W(te){return l[te.getMonth()]}function K(te){return s[te.getMonth()]}function q(te){return o[+(te.getHours()>=12)]}function J(te){return 1+~~(te.getMonth()/3)}function V(te){return i[te.getUTCDay()]}function me(te){return a[te.getUTCDay()]}function X(te){return l[te.getUTCMonth()]}function ce(te){return s[te.getUTCMonth()]}function oe(te){return o[+(te.getUTCHours()>=12)]}function Oe(te){return 1+~~(te.getUTCMonth()/3)}return{format:function(te){var Ne=C(te+="",S);return Ne.toString=function(){return te},Ne},parse:function(te){var Ne=N(te+="",!1);return Ne.toString=function(){return te},Ne},utcFormat:function(te){var Ne=C(te+="",j);return Ne.toString=function(){return te},Ne},utcParse:function(te){var Ne=N(te+="",!0);return Ne.toString=function(){return te},Ne}}}var b3={"-":"",_:" ",0:"0"},Lr=/^\s*\d+/,JG=/^%/,QG=/[\\^$*+?|[\]().{}]/g;function Rt(e,t,r){var n=e<0?"-":"",o=(n?-e:e)+"",a=o.length;return n+(a<r?new Array(r-a+1).join(t)+o:o)}function eY(e){return e.replace(QG,"\\$&")}function Tu(e){return new RegExp("^(?:"+e.map(eY).join("|")+")","i")}function Mu(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function tY(e,t,r){var n=Lr.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function rY(e,t,r){var n=Lr.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function nY(e,t,r){var n=Lr.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function oY(e,t,r){var n=Lr.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function aY(e,t,r){var n=Lr.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function v3(e,t,r){var n=Lr.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function y3(e,t,r){var n=Lr.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function iY(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function sY(e,t,r){var n=Lr.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function lY(e,t,r){var n=Lr.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function x3(e,t,r){var n=Lr.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function uY(e,t,r){var n=Lr.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function w3(e,t,r){var n=Lr.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function cY(e,t,r){var n=Lr.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function dY(e,t,r){var n=Lr.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function fY(e,t,r){var n=Lr.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function pY(e,t,r){var n=Lr.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function mY(e,t,r){var n=JG.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function hY(e,t,r){var n=Lr.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function gY(e,t,r){var n=Lr.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function k3(e,t){return Rt(e.getDate(),t,2)}function bY(e,t){return Rt(e.getHours(),t,2)}function vY(e,t){return Rt(e.getHours()%12||12,t,2)}function yY(e,t){return Rt(1+wd.count(pa(e),e),t,3)}function rM(e,t){return Rt(e.getMilliseconds(),t,3)}function xY(e,t){return rM(e,t)+"000"}function wY(e,t){return Rt(e.getMonth()+1,t,2)}function kY(e,t){return Rt(e.getMinutes(),t,2)}function jY(e,t){return Rt(e.getSeconds(),t,2)}function EY(e){var t=e.getDay();return t===0?7:t}function SY(e,t){return Rt(Qm.count(pa(e)-1,e),t,2)}function nM(e){var t=e.getDay();return t>=4||t===0?wl(e):wl.ceil(e)}function NY(e,t){return e=nM(e),Rt(wl.count(pa(e),e)+(pa(e).getDay()===4),t,2)}function OY(e){return e.getDay()}function CY(e,t){return Rt(Ep.count(pa(e)-1,e),t,2)}function PY(e,t){return Rt(e.getFullYear()%100,t,2)}function AY(e,t){return e=nM(e),Rt(e.getFullYear()%100,t,2)}function TY(e,t){return Rt(e.getFullYear()%1e4,t,4)}function MY(e,t){var r=e.getDay();return e=r>=4||r===0?wl(e):wl.ceil(e),Rt(e.getFullYear()%1e4,t,4)}function _Y(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Rt(t/60|0,"0",2)+Rt(t%60,"0",2)}function j3(e,t){return Rt(e.getUTCDate(),t,2)}function IY(e,t){return Rt(e.getUTCHours(),t,2)}function DY(e,t){return Rt(e.getUTCHours()%12||12,t,2)}function LY(e,t){return Rt(1+Jm.count(ma(e),e),t,3)}function oM(e,t){return Rt(e.getUTCMilliseconds(),t,3)}function RY(e,t){return oM(e,t)+"000"}function FY(e,t){return Rt(e.getUTCMonth()+1,t,2)}function $Y(e,t){return Rt(e.getUTCMinutes(),t,2)}function BY(e,t){return Rt(e.getUTCSeconds(),t,2)}function zY(e){var t=e.getUTCDay();return t===0?7:t}function HY(e,t){return Rt(eh.count(ma(e)-1,e),t,2)}function aM(e){var t=e.getUTCDay();return t>=4||t===0?kl(e):kl.ceil(e)}function qY(e,t){return e=aM(e),Rt(kl.count(ma(e),e)+(ma(e).getUTCDay()===4),t,2)}function WY(e){return e.getUTCDay()}function UY(e,t){return Rt(Sp.count(ma(e)-1,e),t,2)}function KY(e,t){return Rt(e.getUTCFullYear()%100,t,2)}function VY(e,t){return e=aM(e),Rt(e.getUTCFullYear()%100,t,2)}function GY(e,t){return Rt(e.getUTCFullYear()%1e4,t,4)}function YY(e,t){var r=e.getUTCDay();return e=r>=4||r===0?kl(e):kl.ceil(e),Rt(e.getUTCFullYear()%1e4,t,4)}function XY(){return"+0000"}function E3(){return"%"}function S3(e){return+e}function N3(e){return Math.floor(+e/1e3)}var Rs,iM,sM;ZY({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function ZY(e){return Rs=ZG(e),iM=Rs.format,Rs.parse,sM=Rs.utcFormat,Rs.utcParse,Rs}function JY(e){return new Date(e)}function QY(e){return e instanceof Date?+e:+new Date(+e)}function K2(e,t,r,n,o,a,i,s,l,c){var d=M2(),f=d.invert,m=d.domain,p=c(".%L"),h=c(":%S"),b=c("%I:%M"),v=c("%I %p"),x=c("%a %d"),k=c("%b %d"),S=c("%B"),j=c("%Y");function O(C){return(l(C)<C?p:s(C)<C?h:i(C)<C?b:a(C)<C?v:n(C)<C?o(C)<C?x:k:r(C)<C?S:j)(C)}return d.invert=function(C){return new Date(f(C))},d.domain=function(C){return arguments.length?m(Array.from(C,QY)):m().map(JY)},d.ticks=function(C){var N=m();return e(N[0],N[N.length-1],C??10)},d.tickFormat=function(C,N){return N==null?O:c(N)},d.nice=function(C){var N=m();return(!C||typeof C.range!="function")&&(C=t(N[0],N[N.length-1],C??10)),C?m(V7(N,C)):d},d.copy=function(){return xd(d,K2(e,t,r,n,o,a,i,s,l,c))},d}function eX(){return Hn.apply(K2(YG,XG,pa,W2,Qm,wd,H2,B2,Gi,iM).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function tX(){return Hn.apply(K2(VG,GG,ma,U2,eh,Jm,q2,z2,Gi,sM).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function th(){var e=0,t=1,r,n,o,a,i=rn,s=!1,l;function c(f){return f==null||isNaN(f=+f)?l:i(o===0?.5:(f=(a(f)-r)*o,s?Math.max(0,Math.min(1,f)):f))}c.domain=function(f){return arguments.length?([e,t]=f,r=a(e=+e),n=a(t=+t),o=r===n?0:1/(n-r),c):[e,t]},c.clamp=function(f){return arguments.length?(s=!!f,c):s},c.interpolator=function(f){return arguments.length?(i=f,c):i};function d(f){return function(m){var p,h;return arguments.length?([p,h]=m,i=f(p,h),c):[i(0),i(1)]}}return c.range=d(Ql),c.rangeRound=d(T2),c.unknown=function(f){return arguments.length?(l=f,c):l},function(f){return a=f,r=f(e),n=f(t),o=r===n?0:1/(n-r),c}}function xi(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function lM(){var e=yi(th()(rn));return e.copy=function(){return xi(e,lM())},xa.apply(e,arguments)}function uM(){var e=D2(th()).domain([1,10]);return e.copy=function(){return xi(e,uM()).base(e.base())},xa.apply(e,arguments)}function cM(){var e=L2(th());return e.copy=function(){return xi(e,cM()).constant(e.constant())},xa.apply(e,arguments)}function V2(){var e=R2(th());return e.copy=function(){return xi(e,V2()).exponent(e.exponent())},xa.apply(e,arguments)}function rX(){return V2.apply(null,arguments).exponent(.5)}function dM(){var e=[],t=rn;function r(n){if(n!=null&&!isNaN(n=+n))return t((vd(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let o of n)o!=null&&!isNaN(o=+o)&&e.push(o);return e.sort(ei),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,o)=>t(o/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(o,a)=>HV(e,a/n))},r.copy=function(){return dM(t).domain(e)},xa.apply(r,arguments)}function rh(){var e=0,t=.5,r=1,n=1,o,a,i,s,l,c=rn,d,f=!1,m;function p(b){return isNaN(b=+b)?m:(b=.5+((b=+d(b))-a)*(n*b<n*a?s:l),c(f?Math.max(0,Math.min(1,b)):b))}p.domain=function(b){return arguments.length?([e,t,r]=b,o=d(e=+e),a=d(t=+t),i=d(r=+r),s=o===a?0:.5/(a-o),l=a===i?0:.5/(i-a),n=a<o?-1:1,p):[e,t,r]},p.clamp=function(b){return arguments.length?(f=!!b,p):f},p.interpolator=function(b){return arguments.length?(c=b,p):c};function h(b){return function(v){var x,k,S;return arguments.length?([x,k,S]=v,c=mG(b,[x,k,S]),p):[c(0),c(.5),c(1)]}}return p.range=h(Ql),p.rangeRound=h(T2),p.unknown=function(b){return arguments.length?(m=b,p):m},function(b){return d=b,o=b(e),a=b(t),i=b(r),s=o===a?0:.5/(a-o),l=a===i?0:.5/(i-a),n=a<o?-1:1,p}}function fM(){var e=yi(rh()(rn));return e.copy=function(){return xi(e,fM())},xa.apply(e,arguments)}function pM(){var e=D2(rh()).domain([.1,1,10]);return e.copy=function(){return xi(e,pM()).base(e.base())},xa.apply(e,arguments)}function mM(){var e=L2(rh());return e.copy=function(){return xi(e,mM()).constant(e.constant())},xa.apply(e,arguments)}function G2(){var e=R2(rh());return e.copy=function(){return xi(e,G2()).exponent(e.exponent())},xa.apply(e,arguments)}function nX(){return G2.apply(null,arguments).exponent(.5)}const O3=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Nc,scaleDiverging:fM,scaleDivergingLog:pM,scaleDivergingPow:G2,scaleDivergingSqrt:nX,scaleDivergingSymlog:mM,scaleIdentity:K7,scaleImplicit:nw,scaleLinear:kp,scaleLog:G7,scaleOrdinal:C2,scalePoint:ic,scalePow:F2,scaleQuantile:Z7,scaleQuantize:J7,scaleRadial:X7,scaleSequential:lM,scaleSequentialLog:uM,scaleSequentialPow:V2,scaleSequentialQuantile:dM,scaleSequentialSqrt:rX,scaleSequentialSymlog:cM,scaleSqrt:RG,scaleSymlog:Y7,scaleThreshold:Q7,scaleTime:eX,scaleUtc:tX,tickFormat:U7},Symbol.toStringTag,{value:"Module"}));var Jy,C3;function nh(){if(C3)return Jy;C3=1;var e=Yl();function t(r,n,o){for(var a=-1,i=r.length;++a<i;){var s=r[a],l=n(s);if(l!=null&&(c===void 0?l===l&&!e(l):o(l,c)))var c=l,d=s}return d}return Jy=t,Jy}var Qy,P3;function hM(){if(P3)return Qy;P3=1;function e(t,r){return t>r}return Qy=e,Qy}var ex,A3;function oX(){if(A3)return ex;A3=1;var e=nh(),t=hM(),r=Jl();function n(o){return o&&o.length?e(o,r,t):void 0}return ex=n,ex}var aX=oX();const Ua=qt(aX);var tx,T3;function gM(){if(T3)return tx;T3=1;function e(t,r){return t<r}return tx=e,tx}var rx,M3;function iX(){if(M3)return rx;M3=1;var e=nh(),t=gM(),r=Jl();function n(o){return o&&o.length?e(o,r,t):void 0}return rx=n,rx}var sX=iX();const oh=qt(sX);var nx,_3;function lX(){if(_3)return nx;_3=1;var e=d2(),t=$o(),r=E7(),n=gn();function o(a,i){var s=n(a)?e:r;return s(a,t(i,3))}return nx=o,nx}var ox,I3;function uX(){if(I3)return ox;I3=1;var e=k7(),t=lX();function r(n,o){return e(t(n,o),1)}return ox=r,ox}var cX=uX();const dX=qt(cX);var ax,D3;function fX(){if(D3)return ax;D3=1;var e=j2();function t(r,n){return e(r,n)}return ax=t,ax}var pX=fX();const li=qt(pX);var eu=1e9,mX={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},X2,pr=!0,Ln="[DecimalError] ",ns=Ln+"Invalid argument: ",Y2=Ln+"Exponent out of range: ",tu=Math.floor,Di=Math.pow,hX=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,kn,Dr=1e7,cr=7,bM=9007199254740991,Np=tu(bM/cr),Ge={};Ge.absoluteValue=Ge.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Ge.comparedTo=Ge.cmp=function(e){var t,r,n,o,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(n=a.d.length,o=e.d.length,t=0,r=n<o?n:o;t<r;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return n===o?0:n>o^a.s<0?1:-1};Ge.decimalPlaces=Ge.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*cr;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};Ge.dividedBy=Ge.div=function(e){return sa(this,new this.constructor(e))};Ge.dividedToIntegerBy=Ge.idiv=function(e){var t=this,r=t.constructor;return rr(sa(t,new r(e),0,1),r.precision)};Ge.equals=Ge.eq=function(e){return!this.cmp(e)};Ge.exponent=function(){return Nr(this)};Ge.greaterThan=Ge.gt=function(e){return this.cmp(e)>0};Ge.greaterThanOrEqualTo=Ge.gte=function(e){return this.cmp(e)>=0};Ge.isInteger=Ge.isint=function(){return this.e>this.d.length-2};Ge.isNegative=Ge.isneg=function(){return this.s<0};Ge.isPositive=Ge.ispos=function(){return this.s>0};Ge.isZero=function(){return this.s===0};Ge.lessThan=Ge.lt=function(e){return this.cmp(e)<0};Ge.lessThanOrEqualTo=Ge.lte=function(e){return this.cmp(e)<1};Ge.logarithm=Ge.log=function(e){var t,r=this,n=r.constructor,o=n.precision,a=o+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(kn))throw Error(Ln+"NaN");if(r.s<1)throw Error(Ln+(r.s?"NaN":"-Infinity"));return r.eq(kn)?new n(0):(pr=!1,t=sa(Tc(r,a),Tc(e,a),a),pr=!0,rr(t,o))};Ge.minus=Ge.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?xM(t,e):vM(t,(e.s=-e.s,e))};Ge.modulo=Ge.mod=function(e){var t,r=this,n=r.constructor,o=n.precision;if(e=new n(e),!e.s)throw Error(Ln+"NaN");return r.s?(pr=!1,t=sa(r,e,0,1).times(e),pr=!0,r.minus(t)):rr(new n(r),o)};Ge.naturalExponential=Ge.exp=function(){return yM(this)};Ge.naturalLogarithm=Ge.ln=function(){return Tc(this)};Ge.negated=Ge.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Ge.plus=Ge.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?vM(t,e):xM(t,(e.s=-e.s,e))};Ge.precision=Ge.sd=function(e){var t,r,n,o=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ns+e);if(t=Nr(o)+1,n=o.d.length-1,r=n*cr+1,n=o.d[n],n){for(;n%10==0;n/=10)r--;for(n=o.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};Ge.squareRoot=Ge.sqrt=function(){var e,t,r,n,o,a,i,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(Ln+"NaN")}for(e=Nr(s),pr=!1,o=Math.sqrt(+s),o==0||o==1/0?(t=bo(s.d),(t.length+e)%2==0&&(t+="0"),o=Math.sqrt(t),e=tu((e+1)/2)-(e<0||e%2),o==1/0?t="5e"+e:(t=o.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new l(t)):n=new l(o.toString()),r=l.precision,o=i=r+3;;)if(a=n,n=a.plus(sa(s,a,i+2)).times(.5),bo(a.d).slice(0,i)===(t=bo(n.d)).slice(0,i)){if(t=t.slice(i-3,i+1),o==i&&t=="4999"){if(rr(a,r+1,0),a.times(a).eq(s)){n=a;break}}else if(t!="9999")break;i+=4}return pr=!0,rr(n,r)};Ge.times=Ge.mul=function(e){var t,r,n,o,a,i,s,l,c,d=this,f=d.constructor,m=d.d,p=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,r=d.e+e.e,l=m.length,c=p.length,l<c&&(a=m,m=p,p=a,i=l,l=c,c=i),a=[],i=l+c,n=i;n--;)a.push(0);for(n=c;--n>=0;){for(t=0,o=l+n;o>n;)s=a[o]+p[n]*m[o-n-1]+t,a[o--]=s%Dr|0,t=s/Dr|0;a[o]=(a[o]+t)%Dr|0}for(;!a[--i];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,pr?rr(e,f.precision):e};Ge.toDecimalPlaces=Ge.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Ao(e,0,eu),t===void 0?t=n.rounding:Ao(t,0,8),rr(r,e+Nr(r)+1,t))};Ge.toExponential=function(e,t){var r,n=this,o=n.constructor;return e===void 0?r=fs(n,!0):(Ao(e,0,eu),t===void 0?t=o.rounding:Ao(t,0,8),n=rr(new o(n),e+1,t),r=fs(n,!0,e+1)),r};Ge.toFixed=function(e,t){var r,n,o=this,a=o.constructor;return e===void 0?fs(o):(Ao(e,0,eu),t===void 0?t=a.rounding:Ao(t,0,8),n=rr(new a(o),e+Nr(o)+1,t),r=fs(n.abs(),!1,e+Nr(n)+1),o.isneg()&&!o.isZero()?"-"+r:r)};Ge.toInteger=Ge.toint=function(){var e=this,t=e.constructor;return rr(new t(e),Nr(e)+1,t.rounding)};Ge.toNumber=function(){return+this};Ge.toPower=Ge.pow=function(e){var t,r,n,o,a,i,s=this,l=s.constructor,c=12,d=+(e=new l(e));if(!e.s)return new l(kn);if(s=new l(s),!s.s){if(e.s<1)throw Error(Ln+"Infinity");return s}if(s.eq(kn))return s;if(n=l.precision,e.eq(kn))return rr(s,n);if(t=e.e,r=e.d.length-1,i=t>=r,a=s.s,i){if((r=d<0?-d:d)<=bM){for(o=new l(kn),t=Math.ceil(n/cr+4),pr=!1;r%2&&(o=o.times(s),R3(o.d,t)),r=tu(r/2),r!==0;)s=s.times(s),R3(s.d,t);return pr=!0,e.s<0?new l(kn).div(o):rr(o,n)}}else if(a<0)throw Error(Ln+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,s.s=1,pr=!1,o=e.times(Tc(s,n+c)),pr=!0,o=yM(o),o.s=a,o};Ge.toPrecision=function(e,t){var r,n,o=this,a=o.constructor;return e===void 0?(r=Nr(o),n=fs(o,r<=a.toExpNeg||r>=a.toExpPos)):(Ao(e,1,eu),t===void 0?t=a.rounding:Ao(t,0,8),o=rr(new a(o),e,t),r=Nr(o),n=fs(o,e<=r||r<=a.toExpNeg,e)),n};Ge.toSignificantDigits=Ge.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Ao(e,1,eu),t===void 0?t=n.rounding:Ao(t,0,8)),rr(new n(r),e,t)};Ge.toString=Ge.valueOf=Ge.val=Ge.toJSON=Ge[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Nr(e),r=e.constructor;return fs(e,t<=r.toExpNeg||t>=r.toExpPos)};function vM(e,t){var r,n,o,a,i,s,l,c,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),pr?rr(t,f):t;if(l=e.d,c=t.d,i=e.e,o=t.e,l=l.slice(),a=i-o,a){for(a<0?(n=l,a=-a,s=c.length):(n=c,o=i,s=l.length),i=Math.ceil(f/cr),s=i>s?i+1:s+1,a>s&&(a=s,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(s=l.length,a=c.length,s-a<0&&(a=s,n=c,c=l,l=n),r=0;a;)r=(l[--a]=l[a]+c[a]+r)/Dr|0,l[a]%=Dr;for(r&&(l.unshift(r),++o),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=o,pr?rr(t,f):t}function Ao(e,t,r){if(e!==~~e||e<t||e>r)throw Error(ns+e)}function bo(e){var t,r,n,o=e.length-1,a="",i=e[0];if(o>0){for(a+=i,t=1;t<o;t++)n=e[t]+"",r=cr-n.length,r&&(a+=Ba(r)),a+=n;i=e[t],n=i+"",r=cr-n.length,r&&(a+=Ba(r))}else if(i===0)return"0";for(;i%10===0;)i/=10;return a+i}var sa=function(){function e(n,o){var a,i=0,s=n.length;for(n=n.slice();s--;)a=n[s]*o+i,n[s]=a%Dr|0,i=a/Dr|0;return i&&n.unshift(i),n}function t(n,o,a,i){var s,l;if(a!=i)l=a>i?1:-1;else for(s=l=0;s<a;s++)if(n[s]!=o[s]){l=n[s]>o[s]?1:-1;break}return l}function r(n,o,a){for(var i=0;a--;)n[a]-=i,i=n[a]<o[a]?1:0,n[a]=i*Dr+n[a]-o[a];for(;!n[0]&&n.length>1;)n.shift()}return function(n,o,a,i){var s,l,c,d,f,m,p,h,b,v,x,k,S,j,O,C,N,T,M=n.constructor,I=n.s==o.s?1:-1,_=n.d,R=o.d;if(!n.s)return new M(n);if(!o.s)throw Error(Ln+"Division by zero");for(l=n.e-o.e,N=R.length,O=_.length,p=new M(I),h=p.d=[],c=0;R[c]==(_[c]||0);)++c;if(R[c]>(_[c]||0)&&--l,a==null?k=a=M.precision:i?k=a+(Nr(n)-Nr(o))+1:k=a,k<0)return new M(0);if(k=k/cr+2|0,c=0,N==1)for(d=0,R=R[0],k++;(c<O||d)&&k--;c++)S=d*Dr+(_[c]||0),h[c]=S/R|0,d=S%R|0;else{for(d=Dr/(R[0]+1)|0,d>1&&(R=e(R,d),_=e(_,d),N=R.length,O=_.length),j=N,b=_.slice(0,N),v=b.length;v<N;)b[v++]=0;T=R.slice(),T.unshift(0),C=R[0],R[1]>=Dr/2&&++C;do d=0,s=t(R,b,N,v),s<0?(x=b[0],N!=v&&(x=x*Dr+(b[1]||0)),d=x/C|0,d>1?(d>=Dr&&(d=Dr-1),f=e(R,d),m=f.length,v=b.length,s=t(f,b,m,v),s==1&&(d--,r(f,N<m?T:R,m))):(d==0&&(s=d=1),f=R.slice()),m=f.length,m<v&&f.unshift(0),r(b,f,v),s==-1&&(v=b.length,s=t(R,b,N,v),s<1&&(d++,r(b,N<v?T:R,v))),v=b.length):s===0&&(d++,b=[0]),h[c++]=d,s&&b[0]?b[v++]=_[j]||0:(b=[_[j]],v=1);while((j++<O||b[0]!==void 0)&&k--)}return h[0]||h.shift(),p.e=l,rr(p,i?a+Nr(p)+1:a)}}();function yM(e,t){var r,n,o,a,i,s,l=0,c=0,d=e.constructor,f=d.precision;if(Nr(e)>16)throw Error(Y2+Nr(e));if(!e.s)return new d(kn);for(pr=!1,s=f,i=new d(.03125);e.abs().gte(.1);)e=e.times(i),c+=5;for(n=Math.log(Di(2,c))/Math.LN10*2+5|0,s+=n,r=o=a=new d(kn),d.precision=s;;){if(o=rr(o.times(e),s),r=r.times(++l),i=a.plus(sa(o,r,s)),bo(i.d).slice(0,s)===bo(a.d).slice(0,s)){for(;c--;)a=rr(a.times(a),s);return d.precision=f,t==null?(pr=!0,rr(a,f)):a}a=i}}function Nr(e){for(var t=e.e*cr,r=e.d[0];r>=10;r/=10)t++;return t}function ix(e,t,r){if(t>e.LN10.sd())throw pr=!0,r&&(e.precision=r),Error(Ln+"LN10 precision limit exceeded");return rr(new e(e.LN10),t)}function Ba(e){for(var t="";e--;)t+="0";return t}function Tc(e,t){var r,n,o,a,i,s,l,c,d,f=1,m=10,p=e,h=p.d,b=p.constructor,v=b.precision;if(p.s<1)throw Error(Ln+(p.s?"NaN":"-Infinity"));if(p.eq(kn))return new b(0);if(t==null?(pr=!1,c=v):c=t,p.eq(10))return t==null&&(pr=!0),ix(b,c);if(c+=m,b.precision=c,r=bo(h),n=r.charAt(0),a=Nr(p),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(e),r=bo(p.d),n=r.charAt(0),f++;a=Nr(p),n>1?(p=new b("0."+r),a++):p=new b(n+"."+r.slice(1))}else return l=ix(b,c+2,v).times(a+""),p=Tc(new b(n+"."+r.slice(1)),c-m).plus(l),b.precision=v,t==null?(pr=!0,rr(p,v)):p;for(s=i=p=sa(p.minus(kn),p.plus(kn),c),d=rr(p.times(p),c),o=3;;){if(i=rr(i.times(d),c),l=s.plus(sa(i,new b(o),c)),bo(l.d).slice(0,c)===bo(s.d).slice(0,c))return s=s.times(2),a!==0&&(s=s.plus(ix(b,c+2,v).times(a+""))),s=sa(s,new b(f),c),b.precision=v,t==null?(pr=!0,rr(s,v)):s;s=l,o+=2}}function L3(e,t){var r,n,o;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(o=t.length;t.charCodeAt(o-1)===48;)--o;if(t=t.slice(n,o),t){if(o-=n,r=r-n-1,e.e=tu(r/cr),e.d=[],n=(r+1)%cr,r<0&&(n+=cr),n<o){for(n&&e.d.push(+t.slice(0,n)),o-=cr;n<o;)e.d.push(+t.slice(n,n+=cr));t=t.slice(n),n=cr-t.length}else n-=o;for(;n--;)t+="0";if(e.d.push(+t),pr&&(e.e>Np||e.e<-Np))throw Error(Y2+r)}else e.s=0,e.e=0,e.d=[0];return e}function rr(e,t,r){var n,o,a,i,s,l,c,d,f=e.d;for(i=1,a=f[0];a>=10;a/=10)i++;if(n=t-i,n<0)n+=cr,o=t,c=f[d=0];else{if(d=Math.ceil((n+1)/cr),a=f.length,d>=a)return e;for(c=a=f[d],i=1;a>=10;a/=10)i++;n%=cr,o=n-cr+i}if(r!==void 0&&(a=Di(10,i-o-1),s=c/a%10|0,l=t<0||f[d+1]!==void 0||c%a,l=r<4?(s||l)&&(r==0||r==(e.s<0?3:2)):s>5||s==5&&(r==4||l||r==6&&(n>0?o>0?c/Di(10,i-o):0:f[d-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return l?(a=Nr(e),f.length=1,t=t-a-1,f[0]=Di(10,(cr-t%cr)%cr),e.e=tu(-t/cr)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=d,a=1,d--):(f.length=d+1,a=Di(10,cr-n),f[d]=o>0?(c/Di(10,i-o)%Di(10,o)|0)*a:0),l)for(;;)if(d==0){(f[0]+=a)==Dr&&(f[0]=1,++e.e);break}else{if(f[d]+=a,f[d]!=Dr)break;f[d--]=0,a=1}for(n=f.length;f[--n]===0;)f.pop();if(pr&&(e.e>Np||e.e<-Np))throw Error(Y2+Nr(e));return e}function xM(e,t){var r,n,o,a,i,s,l,c,d,f,m=e.constructor,p=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),pr?rr(t,p):t;if(l=e.d,f=t.d,n=t.e,c=e.e,l=l.slice(),i=c-n,i){for(d=i<0,d?(r=l,i=-i,s=f.length):(r=f,n=c,s=l.length),o=Math.max(Math.ceil(p/cr),s)+2,i>o&&(i=o,r.length=1),r.reverse(),o=i;o--;)r.push(0);r.reverse()}else{for(o=l.length,s=f.length,d=o<s,d&&(s=o),o=0;o<s;o++)if(l[o]!=f[o]){d=l[o]<f[o];break}i=0}for(d&&(r=l,l=f,f=r,t.s=-t.s),s=l.length,o=f.length-s;o>0;--o)l[s++]=0;for(o=f.length;o>i;){if(l[--o]<f[o]){for(a=o;a&&l[--a]===0;)l[a]=Dr-1;--l[a],l[o]+=Dr}l[o]-=f[o]}for(;l[--s]===0;)l.pop();for(;l[0]===0;l.shift())--n;return l[0]?(t.d=l,t.e=n,pr?rr(t,p):t):new m(0)}function fs(e,t,r){var n,o=Nr(e),a=bo(e.d),i=a.length;return t?(r&&(n=r-i)>0?a=a.charAt(0)+"."+a.slice(1)+Ba(n):i>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(o<0?"e":"e+")+o):o<0?(a="0."+Ba(-o-1)+a,r&&(n=r-i)>0&&(a+=Ba(n))):o>=i?(a+=Ba(o+1-i),r&&(n=r-o-1)>0&&(a=a+"."+Ba(n))):((n=o+1)<i&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-i)>0&&(o+1===i&&(a+="."),a+=Ba(n))),e.s<0?"-"+a:a}function R3(e,t){if(e.length>t)return e.length=t,!0}function wM(e){var t,r,n;function o(a){var i=this;if(!(i instanceof o))return new o(a);if(i.constructor=o,a instanceof o){i.s=a.s,i.e=a.e,i.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(ns+a);if(a>0)i.s=1;else if(a<0)a=-a,i.s=-1;else{i.s=0,i.e=0,i.d=[0];return}if(a===~~a&&a<1e7){i.e=0,i.d=[a];return}return L3(i,a.toString())}else if(typeof a!="string")throw Error(ns+a);if(a.charCodeAt(0)===45?(a=a.slice(1),i.s=-1):i.s=1,hX.test(a))L3(i,a);else throw Error(ns+a)}if(o.prototype=Ge,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.clone=wM,o.config=o.set=gX,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return o.config(e),o}function gX(e){if(!e||typeof e!="object")throw Error(Ln+"Object expected");var t,r,n,o=["precision",1,eu,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<o.length;t+=3)if((n=e[r=o[t]])!==void 0)if(tu(n)===n&&n>=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(ns+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(ns+r+": "+n);return this}var X2=wM(mX);kn=new X2(1);const Zt=X2;function bX(e){return wX(e)||xX(e)||yX(e)||vX()}function vX(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
68
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yX(e,t){if(e){if(typeof e=="string")return sw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return sw(e,t)}}function xX(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function wX(e){if(Array.isArray(e))return sw(e)}function sw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var kX=function(e){return e},kM={},jM=function(e){return e===kM},F3=function(e){return function t(){return arguments.length===0||arguments.length===1&&jM(arguments.length<=0?void 0:arguments[0])?t:e.apply(void 0,arguments)}},jX=function e(t,r){return t===1?r:F3(function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];var i=o.filter(function(s){return s!==kM}).length;return i>=t?r.apply(void 0,o):e(t-i,F3(function(){for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];var d=o.map(function(f){return jM(f)?l.shift():f});return r.apply(void 0,bX(d).concat(l))}))})},ah=function(e){return jX(e.length,e)},lw=function(e,t){for(var r=[],n=e;n<t;++n)r[n-e]=n;return r},EX=ah(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(r){return t[r]}).map(e)}),SX=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(!t.length)return kX;var n=t.reverse(),o=n[0],a=n.slice(1);return function(){return a.reduce(function(i,s){return s(i)},o.apply(void 0,arguments))}},uw=function(e){return Array.isArray(e)?e.reverse():e.split("").reverse.join("")},EM=function(e){var t=null,r=null;return function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return t&&o.every(function(i,s){return i===t[s]})||(t=o,r=e.apply(void 0,o)),r}};function NX(e){var t;return e===0?t=1:t=Math.floor(new Zt(e).abs().log(10).toNumber())+1,t}function OX(e,t,r){for(var n=new Zt(e),o=0,a=[];n.lt(t)&&o<1e5;)a.push(n.toNumber()),n=n.add(r),o++;return a}var CX=ah(function(e,t,r){var n=+e,o=+t;return n+r*(o-n)}),PX=ah(function(e,t,r){var n=t-+e;return n=n||1/0,(r-e)/n}),AX=ah(function(e,t,r){var n=t-+e;return n=n||1/0,Math.max(0,Math.min(1,(r-e)/n))});const ih={rangeStep:OX,getDigitCount:NX,interpolateNumber:CX,uninterpolateNumber:PX,uninterpolateTruncation:AX};function cw(e){return _X(e)||MX(e)||SM(e)||TX()}function TX(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
69
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function MX(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function _X(e){if(Array.isArray(e))return dw(e)}function Mc(e,t){return LX(e)||DX(e,t)||SM(e,t)||IX()}function IX(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
70
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function SM(e,t){if(e){if(typeof e=="string")return dw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return dw(e,t)}}function dw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function DX(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,o=!1,a=void 0;try{for(var i=e[Symbol.iterator](),s;!(n=(s=i.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(l){o=!0,a=l}finally{try{!n&&i.return!=null&&i.return()}finally{if(o)throw a}}return r}}function LX(e){if(Array.isArray(e))return e}function NM(e){var t=Mc(e,2),r=t[0],n=t[1],o=r,a=n;return r>n&&(o=n,a=r),[o,a]}function OM(e,t,r){if(e.lte(0))return new Zt(0);var n=ih.getDigitCount(e.toNumber()),o=new Zt(10).pow(n),a=e.div(o),i=n!==1?.05:.1,s=new Zt(Math.ceil(a.div(i).toNumber())).add(r).mul(i),l=s.mul(o);return t?l:new Zt(Math.ceil(l))}function RX(e,t,r){var n=1,o=new Zt(e);if(!o.isint()&&r){var a=Math.abs(e);a<1?(n=new Zt(10).pow(ih.getDigitCount(e)-1),o=new Zt(Math.floor(o.div(n).toNumber())).mul(n)):a>1&&(o=new Zt(Math.floor(e)))}else e===0?o=new Zt(Math.floor((t-1)/2)):r||(o=new Zt(Math.floor(e)));var i=Math.floor((t-1)/2),s=SX(EX(function(l){return o.add(new Zt(l-i).mul(n)).toNumber()}),lw);return s(0,t)}function CM(e,t,r,n){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new Zt(0),tickMin:new Zt(0),tickMax:new Zt(0)};var a=OM(new Zt(t).sub(e).div(r-1),n,o),i;e<=0&&t>=0?i=new Zt(0):(i=new Zt(e).add(t).div(2),i=i.sub(new Zt(i).mod(a)));var s=Math.ceil(i.sub(e).div(a).toNumber()),l=Math.ceil(new Zt(t).sub(i).div(a).toNumber()),c=s+l+1;return c>r?CM(e,t,r,n,o+1):(c<r&&(l=t>0?l+(r-c):l,s=t>0?s:s+(r-c)),{step:a,tickMin:i.sub(new Zt(s).mul(a)),tickMax:i.add(new Zt(l).mul(a))})}function FX(e){var t=Mc(e,2),r=t[0],n=t[1],o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=Math.max(o,2),s=NM([r,n]),l=Mc(s,2),c=l[0],d=l[1];if(c===-1/0||d===1/0){var f=d===1/0?[c].concat(cw(lw(0,o-1).map(function(){return 1/0}))):[].concat(cw(lw(0,o-1).map(function(){return-1/0})),[d]);return r>n?uw(f):f}if(c===d)return RX(c,o,a);var m=CM(c,d,i,a),p=m.step,h=m.tickMin,b=m.tickMax,v=ih.rangeStep(h,b.add(new Zt(.1).mul(p)),p);return r>n?uw(v):v}function $X(e,t){var r=Mc(e,2),n=r[0],o=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=NM([n,o]),s=Mc(i,2),l=s[0],c=s[1];if(l===-1/0||c===1/0)return[n,o];if(l===c)return[l];var d=Math.max(t,2),f=OM(new Zt(c).sub(l).div(d-1),a,0),m=[].concat(cw(ih.rangeStep(new Zt(l),new Zt(c).sub(new Zt(.99).mul(f)),f)),[c]);return n>o?uw(m):m}var BX=EM(FX),zX=EM($X),HX="Invariant failed";function ps(e,t){throw new Error(HX)}var qX=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function jl(e){"@babel/helpers - typeof";return jl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jl(e)}function Op(){return Op=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Op.apply(this,arguments)}function WX(e,t){return GX(e)||VX(e,t)||KX(e,t)||UX()}function UX(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
71
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KX(e,t){if(e){if(typeof e=="string")return $3(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $3(e,t)}}function $3(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function VX(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,a,i,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(d){c=!0,o=d}finally{try{if(!l&&r.return!=null&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}function GX(e){if(Array.isArray(e))return e}function YX(e,t){if(e==null)return{};var r=XX(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function XX(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function ZX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function JX(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,TM(n.key),n)}}function QX(e,t,r){return t&&JX(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function eZ(e,t,r){return t=Cp(t),tZ(e,PM()?Reflect.construct(t,r||[],Cp(e).constructor):t.apply(e,r))}function tZ(e,t){if(t&&(jl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return rZ(e)}function rZ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function PM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(PM=function(){return!!e})()}function Cp(e){return Cp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Cp(e)}function nZ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fw(e,t)}function fw(e,t){return fw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},fw(e,t)}function AM(e,t,r){return t=TM(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function TM(e){var t=oZ(e,"string");return jl(t)=="symbol"?t:t+""}function oZ(e,t){if(jl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(jl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ru=function(e){function t(){return ZX(this,t),eZ(this,t,arguments)}return nZ(t,e),QX(t,[{key:"render",value:function(){var r=this.props,n=r.offset,o=r.layout,a=r.width,i=r.dataKey,s=r.data,l=r.dataPointFormatter,c=r.xAxis,d=r.yAxis,f=YX(r,qX),m=Xe(f,!1);this.props.direction==="x"&&c.type!=="number"&&ps();var p=s.map(function(h){var b=l(h,i),v=b.x,x=b.y,k=b.value,S=b.errorVal;if(!S)return null;var j=[],O,C;if(Array.isArray(S)){var N=WX(S,2);O=N[0],C=N[1]}else O=C=S;if(o==="vertical"){var T=c.scale,M=x+n,I=M+a,_=M-a,R=T(k-O),L=T(k+C);j.push({x1:L,y1:I,x2:L,y2:_}),j.push({x1:R,y1:M,x2:L,y2:M}),j.push({x1:R,y1:I,x2:R,y2:_})}else if(o==="horizontal"){var F=d.scale,B=v+n,U=B-a,$=B+a,z=F(k-O),W=F(k+C);j.push({x1:U,y1:W,x2:$,y2:W}),j.push({x1:B,y1:z,x2:B,y2:W}),j.push({x1:U,y1:z,x2:$,y2:z})}return y.createElement(jt,Op({className:"recharts-errorBar",key:"bar-".concat(j.map(function(K){return"".concat(K.x1,"-").concat(K.x2,"-").concat(K.y1,"-").concat(K.y2)}))},m),j.map(function(K){return y.createElement("line",Op({},K,{key:"line-".concat(K.x1,"-").concat(K.x2,"-").concat(K.y1,"-").concat(K.y2)}))}))});return y.createElement(jt,{className:"recharts-errorBars"},p)}}])}(y.Component);AM(ru,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});AM(ru,"displayName","ErrorBar");function _c(e){"@babel/helpers - typeof";return _c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_c(e)}function B3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Pi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?B3(Object(r),!0).forEach(function(n){aZ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):B3(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function aZ(e,t,r){return t=iZ(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function iZ(e){var t=sZ(e,"string");return _c(t)=="symbol"?t:t+""}function sZ(e,t){if(_c(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(_c(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var MM=function(e){var t=e.children,r=e.formattedGraphicalItems,n=e.legendWidth,o=e.legendContent,a=xn(t,jo);if(!a)return null;var i=jo.defaultProps,s=i!==void 0?Pi(Pi({},i),a.props):{},l;return a.props&&a.props.payload?l=a.props&&a.props.payload:o==="children"?l=(r||[]).reduce(function(c,d){var f=d.item,m=d.props,p=m.sectors||m.data||[];return c.concat(p.map(function(h){return{type:a.props.iconType||f.props.legendType,value:h.name,color:h.fill,payload:h}}))},[]):l=(r||[]).map(function(c){var d=c.item,f=d.type.defaultProps,m=f!==void 0?Pi(Pi({},f),d.props):{},p=m.dataKey,h=m.name,b=m.legendType,v=m.hide;return{inactive:v,dataKey:p,type:s.iconType||b||"square",color:Z2(d),value:h||p,payload:m}}),Pi(Pi(Pi({},s),jo.getWithHeight(a,n)),{},{payload:l,item:a})};function Ic(e){"@babel/helpers - typeof";return Ic=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ic(e)}function z3(e){return dZ(e)||cZ(e)||uZ(e)||lZ()}function lZ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
72
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uZ(e,t){if(e){if(typeof e=="string")return pw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pw(e,t)}}function cZ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function dZ(e){if(Array.isArray(e))return pw(e)}function pw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function H3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function yr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?H3(Object(r),!0).forEach(function(n){tl(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):H3(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function tl(e,t,r){return t=fZ(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fZ(e){var t=pZ(e,"string");return Ic(t)=="symbol"?t:t+""}function pZ(e,t){if(Ic(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ic(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dr(e,t,r){return st(e)||st(t)?r:Mr(t)?Sn(e,t,r):it(t)?t(e):r}function Bf(e,t,r,n){var o=dX(e,function(s){return dr(s,t)});if(r==="number"){var a=o.filter(function(s){return Re(s)||parseFloat(s)});return a.length?[oh(a),Ua(a)]:[1/0,-1/0]}var i=n?o.filter(function(s){return!st(s)}):o;return i.map(function(s){return Mr(s)||s instanceof Date?s:""})}var mZ=function(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,a=-1,i=(t=r?.length)!==null&&t!==void 0?t:0;if(i<=1)return 0;if(o&&o.axisType==="angleAxis"&&Math.abs(Math.abs(o.range[1]-o.range[0])-360)<=1e-6)for(var s=o.range,l=0;l<i;l++){var c=l>0?n[l-1].coordinate:n[i-1].coordinate,d=n[l].coordinate,f=l>=i-1?n[0].coordinate:n[l+1].coordinate,m=void 0;if(en(d-c)!==en(f-d)){var p=[];if(en(f-d)===en(s[1]-s[0])){m=f;var h=d+s[1]-s[0];p[0]=Math.min(h,(h+c)/2),p[1]=Math.max(h,(h+c)/2)}else{m=c;var b=f+s[1]-s[0];p[0]=Math.min(d,(b+d)/2),p[1]=Math.max(d,(b+d)/2)}var v=[Math.min(d,(m+d)/2),Math.max(d,(m+d)/2)];if(e>v[0]&&e<=v[1]||e>=p[0]&&e<=p[1]){a=n[l].index;break}}else{var x=Math.min(c,f),k=Math.max(c,f);if(e>(x+d)/2&&e<=(k+d)/2){a=n[l].index;break}}}else for(var S=0;S<i;S++)if(S===0&&e<=(r[S].coordinate+r[S+1].coordinate)/2||S>0&&S<i-1&&e>(r[S].coordinate+r[S-1].coordinate)/2&&e<=(r[S].coordinate+r[S+1].coordinate)/2||S===i-1&&e>(r[S].coordinate+r[S-1].coordinate)/2){a=r[S].index;break}return a},Z2=function(e){var t,r=e,n=r.type.displayName,o=(t=e.type)!==null&&t!==void 0&&t.defaultProps?yr(yr({},e.type.defaultProps),e.props):e.props,a=o.stroke,i=o.fill,s;switch(n){case"Line":s=a;break;case"Area":case"Radar":s=a&&a!=="none"?a:i;break;default:s=i;break}return s},hZ=function(e){var t=e.barSize,r=e.totalSize,n=e.stackGroups,o=n===void 0?{}:n;if(!o)return{};for(var a={},i=Object.keys(o),s=0,l=i.length;s<l;s++)for(var c=o[i[s]].stackGroups,d=Object.keys(c),f=0,m=d.length;f<m;f++){var p=c[d[f]],h=p.items,b=p.cateAxisId,v=h.filter(function(C){return ia(C.type).indexOf("Bar")>=0});if(v&&v.length){var x=v[0].type.defaultProps,k=x!==void 0?yr(yr({},x),v[0].props):v[0].props,S=k.barSize,j=k[b];a[j]||(a[j]=[]);var O=st(S)?t:S;a[j].push({item:v[0],stackList:v.slice(1),barSize:st(O)?void 0:tn(O,r,0)})}}return a},gZ=function(e){var t=e.barGap,r=e.barCategoryGap,n=e.bandSize,o=e.sizeList,a=o===void 0?[]:o,i=e.maxBarSize,s=a.length;if(s<1)return null;var l=tn(t,n,0,!0),c,d=[];if(a[0].barSize===+a[0].barSize){var f=!1,m=n/s,p=a.reduce(function(S,j){return S+j.barSize||0},0);p+=(s-1)*l,p>=n&&(p-=(s-1)*l,l=0),p>=n&&m>0&&(f=!0,m*=.9,p=s*m);var h=(n-p)/2>>0,b={offset:h-l,size:0};c=a.reduce(function(S,j){var O={item:j.item,position:{offset:b.offset+b.size+l,size:f?m:j.barSize}},C=[].concat(z3(S),[O]);return b=C[C.length-1].position,j.stackList&&j.stackList.length&&j.stackList.forEach(function(N){C.push({item:N,position:b})}),C},d)}else{var v=tn(r,n,0,!0);n-2*v-(s-1)*l<=0&&(l=0);var x=(n-2*v-(s-1)*l)/s;x>1&&(x>>=0);var k=i===+i?Math.min(x,i):x;c=a.reduce(function(S,j,O){var C=[].concat(z3(S),[{item:j.item,position:{offset:v+(x+l)*O+(x-k)/2,size:k}}]);return j.stackList&&j.stackList.length&&j.stackList.forEach(function(N){C.push({item:N,position:C[C.length-1].position})}),C},d)}return c},bZ=function(e,t,r,n){var o=r.children,a=r.width,i=r.margin,s=a-(i.left||0)-(i.right||0),l=MM({children:o,legendWidth:s});if(l){var c=n||{},d=c.width,f=c.height,m=l.align,p=l.verticalAlign,h=l.layout;if((h==="vertical"||h==="horizontal"&&p==="middle")&&m!=="center"&&Re(e[m]))return yr(yr({},e),{},tl({},m,e[m]+(d||0)));if((h==="horizontal"||h==="vertical"&&m==="center")&&p!=="middle"&&Re(e[p]))return yr(yr({},e),{},tl({},p,e[p]+(f||0)))}return e},vZ=function(e,t,r){return st(t)?!0:e==="horizontal"?t==="yAxis":e==="vertical"||r==="x"?t==="xAxis":r==="y"?t==="yAxis":!0},_M=function(e,t,r,n,o){var a=t.props.children,i=on(a,ru).filter(function(l){return vZ(n,o,l.props.direction)});if(i&&i.length){var s=i.map(function(l){return l.props.dataKey});return e.reduce(function(l,c){var d=dr(c,r);if(st(d))return l;var f=Array.isArray(d)?[oh(d),Ua(d)]:[d,d],m=s.reduce(function(p,h){var b=dr(c,h,0),v=f[0]-Math.abs(Array.isArray(b)?b[0]:b),x=f[1]+Math.abs(Array.isArray(b)?b[1]:b);return[Math.min(v,p[0]),Math.max(x,p[1])]},[1/0,-1/0]);return[Math.min(m[0],l[0]),Math.max(m[1],l[1])]},[1/0,-1/0])}return null},yZ=function(e,t,r,n,o){var a=t.map(function(i){return _M(e,i,r,o,n)}).filter(function(i){return!st(i)});return a&&a.length?a.reduce(function(i,s){return[Math.min(i[0],s[0]),Math.max(i[1],s[1])]},[1/0,-1/0]):null},IM=function(e,t,r,n,o){var a=t.map(function(s){var l=s.props.dataKey;return r==="number"&&l&&_M(e,s,l,n)||Bf(e,l,r,o)});if(r==="number")return a.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]);var i={};return a.reduce(function(s,l){for(var c=0,d=l.length;c<d;c++)i[l[c]]||(i[l[c]]=!0,s.push(l[c]));return s},[])},DM=function(e,t){return e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis"},LM=function(e,t,r,n){if(n)return e.map(function(s){return s.coordinate});var o,a,i=e.map(function(s){return s.coordinate===t&&(o=!0),s.coordinate===r&&(a=!0),s.coordinate});return o||i.push(t),a||i.push(r),i},oa=function(e,t,r){if(!e)return null;var n=e.scale,o=e.duplicateDomain,a=e.type,i=e.range,s=e.realScaleType==="scaleBand"?n.bandwidth()/2:2,l=(t||r)&&a==="category"&&n.bandwidth?n.bandwidth()/s:0;if(l=e.axisType==="angleAxis"&&i?.length>=2?en(i[0]-i[1])*2*l:l,t&&(e.ticks||e.niceTicks)){var c=(e.ticks||e.niceTicks).map(function(d){var f=o?o.indexOf(d):d;return{coordinate:n(f)+l,value:d,offset:l}});return c.filter(function(d){return!Zl(d.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(d,f){return{coordinate:n(d)+l,value:d,index:f,offset:l}}):n.ticks&&!r?n.ticks(e.tickCount).map(function(d){return{coordinate:n(d)+l,value:d,offset:l}}):n.domain().map(function(d,f){return{coordinate:n(d)+l,value:o?o[d]:d,index:f,offset:l}})},sx=new WeakMap,wf=function(e,t){if(typeof t!="function")return e;sx.has(e)||sx.set(e,new WeakMap);var r=sx.get(e);if(r.has(t))return r.get(t);var n=function(){e.apply(void 0,arguments),t.apply(void 0,arguments)};return r.set(t,n),n},RM=function(e,t,r){var n=e.scale,o=e.type,a=e.layout,i=e.axisType;if(n==="auto")return a==="radial"&&i==="radiusAxis"?{scale:Nc(),realScaleType:"band"}:a==="radial"&&i==="angleAxis"?{scale:kp(),realScaleType:"linear"}:o==="category"&&t&&(t.indexOf("LineChart")>=0||t.indexOf("AreaChart")>=0||t.indexOf("ComposedChart")>=0&&!r)?{scale:ic(),realScaleType:"point"}:o==="category"?{scale:Nc(),realScaleType:"band"}:{scale:kp(),realScaleType:"linear"};if(gd(n)){var s="scale".concat(Hm(n));return{scale:(O3[s]||ic)(),realScaleType:O3[s]?s:"point"}}return it(n)?{scale:n}:{scale:ic(),realScaleType:"point"}},q3=1e-4,FM=function(e){var t=e.domain();if(!(!t||t.length<=2)){var r=t.length,n=e.range(),o=Math.min(n[0],n[1])-q3,a=Math.max(n[0],n[1])+q3,i=e(t[0]),s=e(t[r-1]);(i<o||i>a||s<o||s>a)&&e.domain([t[0],t[r-1]])}},xZ=function(e,t){if(!e)return null;for(var r=0,n=e.length;r<n;r++)if(e[r].item===t)return e[r].position;return null},wZ=function(e,t){if(!t||t.length!==2||!Re(t[0])||!Re(t[1]))return e;var r=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]),o=[e[0],e[1]];return(!Re(e[0])||e[0]<r)&&(o[0]=r),(!Re(e[1])||e[1]>n)&&(o[1]=n),o[0]>n&&(o[0]=n),o[1]<r&&(o[1]=r),o},kZ=function(e){var t=e.length;if(!(t<=0))for(var r=0,n=e[0].length;r<n;++r)for(var o=0,a=0,i=0;i<t;++i){var s=Zl(e[i][r][1])?e[i][r][0]:e[i][r][1];s>=0?(e[i][r][0]=o,e[i][r][1]=o+s,o=e[i][r][1]):(e[i][r][0]=a,e[i][r][1]=a+s,a=e[i][r][1])}},jZ=function(e){var t=e.length;if(!(t<=0))for(var r=0,n=e[0].length;r<n;++r)for(var o=0,a=0;a<t;++a){var i=Zl(e[a][r][1])?e[a][r][0]:e[a][r][1];i>=0?(e[a][r][0]=o,e[a][r][1]=o+i,o=e[a][r][1]):(e[a][r][0]=0,e[a][r][1]=0)}},EZ={sign:kZ,expand:dW,none:hl,silhouette:fW,wiggle:pW,positive:jZ},SZ=function(e,t,r){var n=t.map(function(i){return i.props.dataKey}),o=EZ[r],a=cW().keys(n).value(function(i,s){return+dr(i,s,0)}).order(q0).offset(o);return a(e)},NZ=function(e,t,r,n,o,a){if(!e)return null;var i=a?t.reverse():t,s={},l=i.reduce(function(d,f){var m,p=(m=f.type)!==null&&m!==void 0&&m.defaultProps?yr(yr({},f.type.defaultProps),f.props):f.props,h=p.stackId,b=p.hide;if(b)return d;var v=p[r],x=d[v]||{hasStack:!1,stackGroups:{}};if(Mr(h)){var k=x.stackGroups[h]||{numericAxisId:r,cateAxisId:n,items:[]};k.items.push(f),x.hasStack=!0,x.stackGroups[h]=k}else x.stackGroups[bi("_stackId_")]={numericAxisId:r,cateAxisId:n,items:[f]};return yr(yr({},d),{},tl({},v,x))},s),c={};return Object.keys(l).reduce(function(d,f){var m=l[f];if(m.hasStack){var p={};m.stackGroups=Object.keys(m.stackGroups).reduce(function(h,b){var v=m.stackGroups[b];return yr(yr({},h),{},tl({},b,{numericAxisId:r,cateAxisId:n,items:v.items,stackedData:SZ(e,v.items,o)}))},p)}return yr(yr({},d),{},tl({},f,m))},c)},$M=function(e,t){var r=t.realScaleType,n=t.type,o=t.tickCount,a=t.originalDomain,i=t.allowDecimals,s=r||t.scale;if(s!=="auto"&&s!=="linear")return null;if(o&&n==="number"&&a&&(a[0]==="auto"||a[1]==="auto")){var l=e.domain();if(!l.length)return null;var c=BX(l,o,i);return e.domain([oh(c),Ua(c)]),{niceTicks:c}}if(o&&n==="number"){var d=e.domain(),f=zX(d,o,i);return{niceTicks:f}}return null};function El(e){var t=e.axis,r=e.ticks,n=e.bandSize,o=e.entry,a=e.index,i=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!st(o[t.dataKey])){var s=op(r,"value",o[t.dataKey]);if(s)return s.coordinate+n/2}return r[a]?r[a].coordinate+n/2:null}var l=dr(o,st(i)?t.dataKey:i);return st(l)?null:t.scale(l)}var W3=function(e){var t=e.axis,r=e.ticks,n=e.offset,o=e.bandSize,a=e.entry,i=e.index;if(t.type==="category")return r[i]?r[i].coordinate+n:null;var s=dr(a,t.dataKey,t.domain[i]);return st(s)?null:t.scale(s)-o/2+n},OZ=function(e){var t=e.numericAxis,r=t.scale.domain();if(t.type==="number"){var n=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);return n<=0&&o>=0?0:o<0?o:n}return r[0]},CZ=function(e,t){var r,n=(r=e.type)!==null&&r!==void 0&&r.defaultProps?yr(yr({},e.type.defaultProps),e.props):e.props,o=n.stackId;if(Mr(o)){var a=t[o];if(a){var i=a.items.indexOf(e);return i>=0?a.stackedData[i]:null}}return null},PZ=function(e){return e.reduce(function(t,r){return[oh(r.concat([t[0]]).filter(Re)),Ua(r.concat([t[1]]).filter(Re))]},[1/0,-1/0])},BM=function(e,t,r){return Object.keys(e).reduce(function(n,o){var a=e[o],i=a.stackedData,s=i.reduce(function(l,c){var d=PZ(c.slice(t,r+1));return[Math.min(l[0],d[0]),Math.max(l[1],d[1])]},[1/0,-1/0]);return[Math.min(s[0],n[0]),Math.max(s[1],n[1])]},[1/0,-1/0]).map(function(n){return n===1/0||n===-1/0?0:n})},U3=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,K3=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,mw=function(e,t,r){if(it(e))return e(t,r);if(!Array.isArray(e))return t;var n=[];if(Re(e[0]))n[0]=r?e[0]:Math.min(e[0],t[0]);else if(U3.test(e[0])){var o=+U3.exec(e[0])[1];n[0]=t[0]-o}else it(e[0])?n[0]=e[0](t[0]):n[0]=t[0];if(Re(e[1]))n[1]=r?e[1]:Math.max(e[1],t[1]);else if(K3.test(e[1])){var a=+K3.exec(e[1])[1];n[1]=t[1]+a}else it(e[1])?n[1]=e[1](t[1]):n[1]=t[1];return n},Pp=function(e,t,r){if(e&&e.scale&&e.scale.bandwidth){var n=e.scale.bandwidth();if(!r||n>0)return n}if(e&&t&&t.length>=2){for(var o=S2(t,function(d){return d.coordinate}),a=1/0,i=1,s=o.length;i<s;i++){var l=o[i],c=o[i-1];a=Math.min((l.coordinate||0)-(c.coordinate||0),a)}return a===1/0?0:a}return r?void 0:0},V3=function(e,t,r){return!e||!e.length||li(e,Sn(r,"type.defaultProps.domain"))?t:e},zM=function(e,t){var r=e.type.defaultProps?yr(yr({},e.type.defaultProps),e.props):e.props,n=r.dataKey,o=r.name,a=r.unit,i=r.formatter,s=r.tooltipType,l=r.chartType,c=r.hide;return yr(yr({},Xe(e,!1)),{},{dataKey:n,unit:a,formatter:i,name:o||n,color:Z2(e),value:dr(t,n),type:s,payload:t,chartType:l,hide:c})};function Dc(e){"@babel/helpers - typeof";return Dc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dc(e)}function G3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Jo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?G3(Object(r),!0).forEach(function(n){HM(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):G3(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function HM(e,t,r){return t=AZ(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function AZ(e){var t=TZ(e,"string");return Dc(t)=="symbol"?t:t+""}function TZ(e,t){if(Dc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Dc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function MZ(e,t){return LZ(e)||DZ(e,t)||IZ(e,t)||_Z()}function _Z(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
73
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function IZ(e,t){if(e){if(typeof e=="string")return Y3(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Y3(e,t)}}function Y3(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function DZ(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,a,i,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(d){c=!0,o=d}finally{try{if(!l&&r.return!=null&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}function LZ(e){if(Array.isArray(e))return e}var Ap=Math.PI/180,RZ=function(e){return e*180/Math.PI},ar=function(e,t,r,n){return{x:e+Math.cos(-Ap*n)*r,y:t+Math.sin(-Ap*n)*r}},qM=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(e-(r.left||0)-(r.right||0)),Math.abs(t-(r.top||0)-(r.bottom||0)))/2},FZ=function(e,t,r,n,o){var a=e.width,i=e.height,s=e.startAngle,l=e.endAngle,c=tn(e.cx,a,a/2),d=tn(e.cy,i,i/2),f=qM(a,i,r),m=tn(e.innerRadius,f,0),p=tn(e.outerRadius,f,f*.8),h=Object.keys(t);return h.reduce(function(b,v){var x=t[v],k=x.domain,S=x.reversed,j;if(st(x.range))n==="angleAxis"?j=[s,l]:n==="radiusAxis"&&(j=[m,p]),S&&(j=[j[1],j[0]]);else{j=x.range;var O=j,C=MZ(O,2);s=C[0],l=C[1]}var N=RM(x,o),T=N.realScaleType,M=N.scale;M.domain(k).range(j),FM(M);var I=$M(M,Jo(Jo({},x),{},{realScaleType:T})),_=Jo(Jo(Jo({},x),I),{},{range:j,radius:p,realScaleType:T,scale:M,cx:c,cy:d,innerRadius:m,outerRadius:p,startAngle:s,endAngle:l});return Jo(Jo({},b),{},HM({},v,_))},{})},$Z=function(e,t){var r=e.x,n=e.y,o=t.x,a=t.y;return Math.sqrt(Math.pow(r-o,2)+Math.pow(n-a,2))},BZ=function(e,t){var r=e.x,n=e.y,o=t.cx,a=t.cy,i=$Z({x:r,y:n},{x:o,y:a});if(i<=0)return{radius:i};var s=(r-o)/i,l=Math.acos(s);return n>a&&(l=2*Math.PI-l),{radius:i,angle:RZ(l),angleInRadian:l}},zZ=function(e){var t=e.startAngle,r=e.endAngle,n=Math.floor(t/360),o=Math.floor(r/360),a=Math.min(n,o);return{startAngle:t-a*360,endAngle:r-a*360}},HZ=function(e,t){var r=t.startAngle,n=t.endAngle,o=Math.floor(r/360),a=Math.floor(n/360),i=Math.min(o,a);return e+i*360},X3=function(e,t){var r=e.x,n=e.y,o=BZ({x:r,y:n},t),a=o.radius,i=o.angle,s=t.innerRadius,l=t.outerRadius;if(a<s||a>l)return!1;if(a===0)return!0;var c=zZ(t),d=c.startAngle,f=c.endAngle,m=i,p;if(d<=f){for(;m>f;)m-=360;for(;m<d;)m+=360;p=m>=d&&m<=f}else{for(;m>d;)m-=360;for(;m<f;)m+=360;p=m>=f&&m<=d}return p?Jo(Jo({},t),{},{radius:a,angle:HZ(m,t)}):null},WM=function(e){return!g.isValidElement(e)&&!it(e)&&typeof e!="boolean"?e.className:""};function Lc(e){"@babel/helpers - typeof";return Lc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lc(e)}var qZ=["offset"];function WZ(e){return GZ(e)||VZ(e)||KZ(e)||UZ()}function UZ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
74
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KZ(e,t){if(e){if(typeof e=="string")return hw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hw(e,t)}}function VZ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function GZ(e){if(Array.isArray(e))return hw(e)}function hw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function YZ(e,t){if(e==null)return{};var r=XZ(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function XZ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Z3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Or(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Z3(Object(r),!0).forEach(function(n){ZZ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z3(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ZZ(e,t,r){return t=JZ(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function JZ(e){var t=QZ(e,"string");return Lc(t)=="symbol"?t:t+""}function QZ(e,t){if(Lc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Lc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rc(){return Rc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Rc.apply(this,arguments)}var eJ=function(e){var t=e.value,r=e.formatter,n=st(e.children)?t:e.children;return it(r)?r(n):n},tJ=function(e,t){var r=en(t-e),n=Math.min(Math.abs(t-e),360);return r*n},rJ=function(e,t,r){var n=e.position,o=e.viewBox,a=e.offset,i=e.className,s=o,l=s.cx,c=s.cy,d=s.innerRadius,f=s.outerRadius,m=s.startAngle,p=s.endAngle,h=s.clockWise,b=(d+f)/2,v=tJ(m,p),x=v>=0?1:-1,k,S;n==="insideStart"?(k=m+x*a,S=h):n==="insideEnd"?(k=p-x*a,S=!h):n==="end"&&(k=p+x*a,S=h),S=v<=0?S:!S;var j=ar(l,c,b,k),O=ar(l,c,b,k+(S?1:-1)*359),C="M".concat(j.x,",").concat(j.y,`
75
+ A`).concat(b,",").concat(b,",0,1,").concat(S?0:1,`,
76
+ `).concat(O.x,",").concat(O.y),N=st(e.id)?bi("recharts-radial-line-"):e.id;return y.createElement("text",Rc({},r,{dominantBaseline:"central",className:wt("recharts-radial-bar-label",i)}),y.createElement("defs",null,y.createElement("path",{id:N,d:C})),y.createElement("textPath",{xlinkHref:"#".concat(N)},t))},nJ=function(e){var t=e.viewBox,r=e.offset,n=e.position,o=t,a=o.cx,i=o.cy,s=o.innerRadius,l=o.outerRadius,c=o.startAngle,d=o.endAngle,f=(c+d)/2;if(n==="outside"){var m=ar(a,i,l+r,f),p=m.x,h=m.y;return{x:p,y:h,textAnchor:p>=a?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:a,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:a,y:i,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:a,y:i,textAnchor:"middle",verticalAnchor:"end"};var b=(s+l)/2,v=ar(a,i,b,f),x=v.x,k=v.y;return{x,y:k,textAnchor:"middle",verticalAnchor:"middle"}},oJ=function(e){var t=e.viewBox,r=e.parentViewBox,n=e.offset,o=e.position,a=t,i=a.x,s=a.y,l=a.width,c=a.height,d=c>=0?1:-1,f=d*n,m=d>0?"end":"start",p=d>0?"start":"end",h=l>=0?1:-1,b=h*n,v=h>0?"end":"start",x=h>0?"start":"end";if(o==="top"){var k={x:i+l/2,y:s-d*n,textAnchor:"middle",verticalAnchor:m};return Or(Or({},k),r?{height:Math.max(s-r.y,0),width:l}:{})}if(o==="bottom"){var S={x:i+l/2,y:s+c+f,textAnchor:"middle",verticalAnchor:p};return Or(Or({},S),r?{height:Math.max(r.y+r.height-(s+c),0),width:l}:{})}if(o==="left"){var j={x:i-b,y:s+c/2,textAnchor:v,verticalAnchor:"middle"};return Or(Or({},j),r?{width:Math.max(j.x-r.x,0),height:c}:{})}if(o==="right"){var O={x:i+l+b,y:s+c/2,textAnchor:x,verticalAnchor:"middle"};return Or(Or({},O),r?{width:Math.max(r.x+r.width-O.x,0),height:c}:{})}var C=r?{width:l,height:c}:{};return o==="insideLeft"?Or({x:i+b,y:s+c/2,textAnchor:x,verticalAnchor:"middle"},C):o==="insideRight"?Or({x:i+l-b,y:s+c/2,textAnchor:v,verticalAnchor:"middle"},C):o==="insideTop"?Or({x:i+l/2,y:s+f,textAnchor:"middle",verticalAnchor:p},C):o==="insideBottom"?Or({x:i+l/2,y:s+c-f,textAnchor:"middle",verticalAnchor:m},C):o==="insideTopLeft"?Or({x:i+b,y:s+f,textAnchor:x,verticalAnchor:p},C):o==="insideTopRight"?Or({x:i+l-b,y:s+f,textAnchor:v,verticalAnchor:p},C):o==="insideBottomLeft"?Or({x:i+b,y:s+c-f,textAnchor:x,verticalAnchor:m},C):o==="insideBottomRight"?Or({x:i+l-b,y:s+c-f,textAnchor:v,verticalAnchor:m},C):Xl(o)&&(Re(o.x)||Ki(o.x))&&(Re(o.y)||Ki(o.y))?Or({x:i+tn(o.x,l),y:s+tn(o.y,c),textAnchor:"end",verticalAnchor:"end"},C):Or({x:i+l/2,y:s+c/2,textAnchor:"middle",verticalAnchor:"middle"},C)},aJ=function(e){return"cx"in e&&Re(e.cx)};function Jt(e){var t=e.offset,r=t===void 0?5:t,n=YZ(e,qZ),o=Or({offset:r},n),a=o.viewBox,i=o.position,s=o.value,l=o.children,c=o.content,d=o.className,f=d===void 0?"":d,m=o.textBreakAll;if(!a||st(s)&&st(l)&&!g.isValidElement(c)&&!it(c))return null;if(g.isValidElement(c))return g.cloneElement(c,o);var p;if(it(c)){if(p=g.createElement(c,o),g.isValidElement(p))return p}else p=eJ(o);var h=aJ(a),b=Xe(o,!0);if(h&&(i==="insideStart"||i==="insideEnd"||i==="end"))return rJ(o,p,b);var v=h?nJ(o):oJ(o);return y.createElement(ds,Rc({className:wt("recharts-label",f)},b,v,{breakAll:m}),p)}Jt.displayName="Label";var UM=function(e){var t=e.cx,r=e.cy,n=e.angle,o=e.startAngle,a=e.endAngle,i=e.r,s=e.radius,l=e.innerRadius,c=e.outerRadius,d=e.x,f=e.y,m=e.top,p=e.left,h=e.width,b=e.height,v=e.clockWise,x=e.labelViewBox;if(x)return x;if(Re(h)&&Re(b)){if(Re(d)&&Re(f))return{x:d,y:f,width:h,height:b};if(Re(m)&&Re(p))return{x:m,y:p,width:h,height:b}}return Re(d)&&Re(f)?{x:d,y:f,width:0,height:0}:Re(t)&&Re(r)?{cx:t,cy:r,startAngle:o||n||0,endAngle:a||n||0,innerRadius:l||0,outerRadius:c||s||i||0,clockWise:v}:e.viewBox?e.viewBox:{}},iJ=function(e,t){return e?e===!0?y.createElement(Jt,{key:"label-implicit",viewBox:t}):Mr(e)?y.createElement(Jt,{key:"label-implicit",viewBox:t,value:e}):g.isValidElement(e)?e.type===Jt?g.cloneElement(e,{key:"label-implicit",viewBox:t}):y.createElement(Jt,{key:"label-implicit",content:e,viewBox:t}):it(e)?y.createElement(Jt,{key:"label-implicit",content:e,viewBox:t}):Xl(e)?y.createElement(Jt,Rc({viewBox:t},e,{key:"label-implicit"})):null:null},sJ=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,o=UM(e),a=on(n,Jt).map(function(s,l){return g.cloneElement(s,{viewBox:t||o,key:"label-".concat(l)})});if(!r)return a;var i=iJ(e.label,t||o);return[i].concat(WZ(a))};Jt.parseViewBox=UM;Jt.renderCallByParent=sJ;var lx,J3;function lJ(){if(J3)return lx;J3=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return lx=e,lx}var uJ=lJ();const cJ=qt(uJ);function Fc(e){"@babel/helpers - typeof";return Fc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fc(e)}var dJ=["valueAccessor"],fJ=["data","dataKey","clockWise","id","textBreakAll"];function pJ(e){return bJ(e)||gJ(e)||hJ(e)||mJ()}function mJ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
77
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hJ(e,t){if(e){if(typeof e=="string")return gw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gw(e,t)}}function gJ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function bJ(e){if(Array.isArray(e))return gw(e)}function gw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Tp(){return Tp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Tp.apply(this,arguments)}function Q3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function e4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Q3(Object(r),!0).forEach(function(n){vJ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Q3(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vJ(e,t,r){return t=yJ(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yJ(e){var t=xJ(e,"string");return Fc(t)=="symbol"?t:t+""}function xJ(e,t){if(Fc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Fc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function t4(e,t){if(e==null)return{};var r=wJ(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function wJ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var kJ=function(e){return Array.isArray(e.value)?cJ(e.value):e.value};function Zn(e){var t=e.valueAccessor,r=t===void 0?kJ:t,n=t4(e,dJ),o=n.data,a=n.dataKey,i=n.clockWise,s=n.id,l=n.textBreakAll,c=t4(n,fJ);return!o||!o.length?null:y.createElement(jt,{className:"recharts-label-list"},o.map(function(d,f){var m=st(a)?r(d,f):dr(d&&d.payload,a),p=st(s)?{}:{id:"".concat(s,"-").concat(f)};return y.createElement(Jt,Tp({},Xe(d,!0),c,p,{parentViewBox:d.parentViewBox,value:m,textBreakAll:l,viewBox:Jt.parseViewBox(st(i)?d:e4(e4({},d),{},{clockWise:i})),key:"label-".concat(f),index:f}))}))}Zn.displayName="LabelList";function jJ(e,t){return e?e===!0?y.createElement(Zn,{key:"labelList-implicit",data:t}):y.isValidElement(e)||it(e)?y.createElement(Zn,{key:"labelList-implicit",data:t,content:e}):Xl(e)?y.createElement(Zn,Tp({data:t},e,{key:"labelList-implicit"})):null:null}function EJ(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,o=on(n,Zn).map(function(i,s){return g.cloneElement(i,{data:t,key:"labelList-".concat(s)})});if(!r)return o;var a=jJ(e.label,t);return[a].concat(pJ(o))}Zn.renderCallByParent=EJ;function $c(e){"@babel/helpers - typeof";return $c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$c(e)}function bw(){return bw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bw.apply(this,arguments)}function r4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function n4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?r4(Object(r),!0).forEach(function(n){SJ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):r4(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function SJ(e,t,r){return t=NJ(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function NJ(e){var t=OJ(e,"string");return $c(t)=="symbol"?t:t+""}function OJ(e,t){if($c(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if($c(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var CJ=function(e,t){var r=en(t-e),n=Math.min(Math.abs(t-e),359.999);return r*n},kf=function(e){var t=e.cx,r=e.cy,n=e.radius,o=e.angle,a=e.sign,i=e.isExternal,s=e.cornerRadius,l=e.cornerIsExternal,c=s*(i?1:-1)+n,d=Math.asin(s/c)/Ap,f=l?o:o+a*d,m=ar(t,r,c,f),p=ar(t,r,n,f),h=l?o-a*d:o,b=ar(t,r,c*Math.cos(d*Ap),h);return{center:m,circleTangency:p,lineTangency:b,theta:d}},KM=function(e){var t=e.cx,r=e.cy,n=e.innerRadius,o=e.outerRadius,a=e.startAngle,i=e.endAngle,s=CJ(a,i),l=a+s,c=ar(t,r,o,a),d=ar(t,r,o,l),f="M ".concat(c.x,",").concat(c.y,`
78
+ A `).concat(o,",").concat(o,`,0,
79
+ `).concat(+(Math.abs(s)>180),",").concat(+(a>l),`,
80
+ `).concat(d.x,",").concat(d.y,`
81
+ `);if(n>0){var m=ar(t,r,n,a),p=ar(t,r,n,l);f+="L ".concat(p.x,",").concat(p.y,`
82
+ A `).concat(n,",").concat(n,`,0,
83
+ `).concat(+(Math.abs(s)>180),",").concat(+(a<=l),`,
84
+ `).concat(m.x,",").concat(m.y," Z")}else f+="L ".concat(t,",").concat(r," Z");return f},PJ=function(e){var t=e.cx,r=e.cy,n=e.innerRadius,o=e.outerRadius,a=e.cornerRadius,i=e.forceCornerRadius,s=e.cornerIsExternal,l=e.startAngle,c=e.endAngle,d=en(c-l),f=kf({cx:t,cy:r,radius:o,angle:l,sign:d,cornerRadius:a,cornerIsExternal:s}),m=f.circleTangency,p=f.lineTangency,h=f.theta,b=kf({cx:t,cy:r,radius:o,angle:c,sign:-d,cornerRadius:a,cornerIsExternal:s}),v=b.circleTangency,x=b.lineTangency,k=b.theta,S=s?Math.abs(l-c):Math.abs(l-c)-h-k;if(S<0)return i?"M ".concat(p.x,",").concat(p.y,`
85
+ a`).concat(a,",").concat(a,",0,0,1,").concat(a*2,`,0
86
+ a`).concat(a,",").concat(a,",0,0,1,").concat(-a*2,`,0
87
+ `):KM({cx:t,cy:r,innerRadius:n,outerRadius:o,startAngle:l,endAngle:c});var j="M ".concat(p.x,",").concat(p.y,`
88
+ A`).concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(m.x,",").concat(m.y,`
89
+ A`).concat(o,",").concat(o,",0,").concat(+(S>180),",").concat(+(d<0),",").concat(v.x,",").concat(v.y,`
90
+ A`).concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(x.x,",").concat(x.y,`
91
+ `);if(n>0){var O=kf({cx:t,cy:r,radius:n,angle:l,sign:d,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),C=O.circleTangency,N=O.lineTangency,T=O.theta,M=kf({cx:t,cy:r,radius:n,angle:c,sign:-d,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),I=M.circleTangency,_=M.lineTangency,R=M.theta,L=s?Math.abs(l-c):Math.abs(l-c)-T-R;if(L<0&&a===0)return"".concat(j,"L").concat(t,",").concat(r,"Z");j+="L".concat(_.x,",").concat(_.y,`
92
+ A`).concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(I.x,",").concat(I.y,`
93
+ A`).concat(n,",").concat(n,",0,").concat(+(L>180),",").concat(+(d>0),",").concat(C.x,",").concat(C.y,`
94
+ A`).concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(N.x,",").concat(N.y,"Z")}else j+="L".concat(t,",").concat(r,"Z");return j},AJ={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},J2=function(e){var t=n4(n4({},AJ),e),r=t.cx,n=t.cy,o=t.innerRadius,a=t.outerRadius,i=t.cornerRadius,s=t.forceCornerRadius,l=t.cornerIsExternal,c=t.startAngle,d=t.endAngle,f=t.className;if(a<o||c===d)return null;var m=wt("recharts-sector",f),p=a-o,h=tn(i,p,0,!0),b;return h>0&&Math.abs(c-d)<360?b=PJ({cx:r,cy:n,innerRadius:o,outerRadius:a,cornerRadius:Math.min(h,p/2),forceCornerRadius:s,cornerIsExternal:l,startAngle:c,endAngle:d}):b=KM({cx:r,cy:n,innerRadius:o,outerRadius:a,startAngle:c,endAngle:d}),y.createElement("path",bw({},Xe(t,!0),{className:m,d:b,role:"img"}))};function Bc(e){"@babel/helpers - typeof";return Bc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bc(e)}function vw(){return vw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vw.apply(this,arguments)}function o4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function a4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?o4(Object(r),!0).forEach(function(n){TJ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o4(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function TJ(e,t,r){return t=MJ(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function MJ(e){var t=_J(e,"string");return Bc(t)=="symbol"?t:t+""}function _J(e,t){if(Bc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Bc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var i4={curveBasisClosed:Qq,curveBasisOpen:eW,curveBasis:Jq,curveBumpX:Fq,curveBumpY:$q,curveLinearClosed:tW,curveLinear:Wm,curveMonotoneX:rW,curveMonotoneY:nW,curveNatural:oW,curveStep:aW,curveStepAfter:sW,curveStepBefore:iW},jf=function(e){return e.x===+e.x&&e.y===+e.y},_u=function(e){return e.x},Iu=function(e){return e.y},IJ=function(e,t){if(it(e))return e;var r="curve".concat(Hm(e));return(r==="curveMonotone"||r==="curveBump")&&t?i4["".concat(r).concat(t==="vertical"?"Y":"X")]:i4[r]||Wm},DJ=function(e){var t=e.type,r=t===void 0?"linear":t,n=e.points,o=n===void 0?[]:n,a=e.baseLine,i=e.layout,s=e.connectNulls,l=s===void 0?!1:s,c=IJ(r,i),d=l?o.filter(function(h){return jf(h)}):o,f;if(Array.isArray(a)){var m=l?a.filter(function(h){return jf(h)}):a,p=d.map(function(h,b){return a4(a4({},h),{},{base:m[b]})});return i==="vertical"?f=mf().y(Iu).x1(_u).x0(function(h){return h.base.x}):f=mf().x(_u).y1(Iu).y0(function(h){return h.base.y}),f.defined(jf).curve(c),f(p)}return i==="vertical"&&Re(a)?f=mf().y(Iu).x1(_u).x0(a):Re(a)?f=mf().x(_u).y1(Iu).y0(a):f=U6().x(_u).y(Iu),f.defined(jf).curve(c),f(d)},ti=function(e){var t=e.className,r=e.points,n=e.path,o=e.pathRef;if((!r||!r.length)&&!n)return null;var a=r&&r.length?DJ(e):n;return y.createElement("path",vw({},Xe(e,!1),ap(e),{className:wt("recharts-curve",t),d:a,ref:o}))},ux={exports:{}},cx,s4;function LJ(){if(s4)return cx;s4=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return cx=e,cx}var dx,l4;function RJ(){if(l4)return dx;l4=1;var e=LJ();function t(){}function r(){}return r.resetWarningCache=t,dx=function(){function n(i,s,l,c,d,f){if(f!==e){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}n.isRequired=n;function o(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:t};return a.PropTypes=a,a},dx}var u4;function FJ(){return u4||(u4=1,ux.exports=RJ()()),ux.exports}var $J=FJ();const Bt=qt($J);var BJ=Object.getOwnPropertyNames,zJ=Object.getOwnPropertySymbols,HJ=Object.prototype.hasOwnProperty;function c4(e,t){return function(r,n,o){return e(r,n,o)&&t(r,n,o)}}function Ef(e){return function(t,r,n){if(!t||!r||typeof t!="object"||typeof r!="object")return e(t,r,n);var o=n.cache,a=o.get(t),i=o.get(r);if(a&&i)return a===r&&i===t;o.set(t,r),o.set(r,t);var s=e(t,r,n);return o.delete(t),o.delete(r),s}}function d4(e){return BJ(e).concat(zJ(e))}var qJ=Object.hasOwn||function(e,t){return HJ.call(e,t)};function ws(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var WJ="__v",UJ="__o",KJ="_owner",f4=Object.getOwnPropertyDescriptor,p4=Object.keys;function VJ(e,t,r){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function GJ(e,t){return ws(e.getTime(),t.getTime())}function YJ(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function XJ(e,t){return e===t}function m4(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var o=new Array(n),a=e.entries(),i,s,l=0;(i=a.next())&&!i.done;){for(var c=t.entries(),d=!1,f=0;(s=c.next())&&!s.done;){if(o[f]){f++;continue}var m=i.value,p=s.value;if(r.equals(m[0],p[0],l,f,e,t,r)&&r.equals(m[1],p[1],m[0],p[0],e,t,r)){d=o[f]=!0;break}f++}if(!d)return!1;l++}return!0}var ZJ=ws;function JJ(e,t,r){var n=p4(e),o=n.length;if(p4(t).length!==o)return!1;for(;o-- >0;)if(!VM(e,t,r,n[o]))return!1;return!0}function Du(e,t,r){var n=d4(e),o=n.length;if(d4(t).length!==o)return!1;for(var a,i,s;o-- >0;)if(a=n[o],!VM(e,t,r,a)||(i=f4(e,a),s=f4(t,a),(i||s)&&(!i||!s||i.configurable!==s.configurable||i.enumerable!==s.enumerable||i.writable!==s.writable)))return!1;return!0}function QJ(e,t){return ws(e.valueOf(),t.valueOf())}function eQ(e,t){return e.source===t.source&&e.flags===t.flags}function h4(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var o=new Array(n),a=e.values(),i,s;(i=a.next())&&!i.done;){for(var l=t.values(),c=!1,d=0;(s=l.next())&&!s.done;){if(!o[d]&&r.equals(i.value,s.value,i.value,s.value,e,t,r)){c=o[d]=!0;break}d++}if(!c)return!1}return!0}function tQ(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function rQ(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function VM(e,t,r,n){return(n===KJ||n===UJ||n===WJ)&&(e.$$typeof||t.$$typeof)?!0:qJ(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var nQ="[object Arguments]",oQ="[object Boolean]",aQ="[object Date]",iQ="[object Error]",sQ="[object Map]",lQ="[object Number]",uQ="[object Object]",cQ="[object RegExp]",dQ="[object Set]",fQ="[object String]",pQ="[object URL]",mQ=Array.isArray,g4=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,b4=Object.assign,hQ=Object.prototype.toString.call.bind(Object.prototype.toString);function gQ(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areErrorsEqual,o=e.areFunctionsEqual,a=e.areMapsEqual,i=e.areNumbersEqual,s=e.areObjectsEqual,l=e.arePrimitiveWrappersEqual,c=e.areRegExpsEqual,d=e.areSetsEqual,f=e.areTypedArraysEqual,m=e.areUrlsEqual;return function(p,h,b){if(p===h)return!0;if(p==null||h==null)return!1;var v=typeof p;if(v!==typeof h)return!1;if(v!=="object")return v==="number"?i(p,h,b):v==="function"?o(p,h,b):!1;var x=p.constructor;if(x!==h.constructor)return!1;if(x===Object)return s(p,h,b);if(mQ(p))return t(p,h,b);if(g4!=null&&g4(p))return f(p,h,b);if(x===Date)return r(p,h,b);if(x===RegExp)return c(p,h,b);if(x===Map)return a(p,h,b);if(x===Set)return d(p,h,b);var k=hQ(p);return k===aQ?r(p,h,b):k===cQ?c(p,h,b):k===sQ?a(p,h,b):k===dQ?d(p,h,b):k===uQ?typeof p.then!="function"&&typeof h.then!="function"&&s(p,h,b):k===pQ?m(p,h,b):k===iQ?n(p,h,b):k===nQ?s(p,h,b):k===oQ||k===lQ||k===fQ?l(p,h,b):!1}}function bQ(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,o={areArraysEqual:n?Du:VJ,areDatesEqual:GJ,areErrorsEqual:YJ,areFunctionsEqual:XJ,areMapsEqual:n?c4(m4,Du):m4,areNumbersEqual:ZJ,areObjectsEqual:n?Du:JJ,arePrimitiveWrappersEqual:QJ,areRegExpsEqual:eQ,areSetsEqual:n?c4(h4,Du):h4,areTypedArraysEqual:n?Du:tQ,areUrlsEqual:rQ};if(r&&(o=b4({},o,r(o))),t){var a=Ef(o.areArraysEqual),i=Ef(o.areMapsEqual),s=Ef(o.areObjectsEqual),l=Ef(o.areSetsEqual);o=b4({},o,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:s,areSetsEqual:l})}return o}function vQ(e){return function(t,r,n,o,a,i,s){return e(t,r,s)}}function yQ(e){var t=e.circular,r=e.comparator,n=e.createState,o=e.equals,a=e.strict;if(n)return function(s,l){var c=n(),d=c.cache,f=d===void 0?t?new WeakMap:void 0:d,m=c.meta;return r(s,l,{cache:f,equals:o,meta:m,strict:a})};if(t)return function(s,l){return r(s,l,{cache:new WeakMap,equals:o,meta:void 0,strict:a})};var i={cache:void 0,equals:o,meta:void 0,strict:a};return function(s,l){return r(s,l,i)}}var xQ=wi();wi({strict:!0});wi({circular:!0});wi({circular:!0,strict:!0});wi({createInternalComparator:function(){return ws}});wi({strict:!0,createInternalComparator:function(){return ws}});wi({circular:!0,createInternalComparator:function(){return ws}});wi({circular:!0,createInternalComparator:function(){return ws},strict:!0});function wi(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,o=e.createState,a=e.strict,i=a===void 0?!1:a,s=bQ(e),l=gQ(s),c=n?n(l):vQ(l);return yQ({circular:r,comparator:l,createState:o,equals:c,strict:i})}function wQ(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function v4(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function o(a){r<0&&(r=a),a-r>t?(e(a),r=-1):wQ(o)};requestAnimationFrame(n)}function yw(e){"@babel/helpers - typeof";return yw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yw(e)}function kQ(e){return NQ(e)||SQ(e)||EQ(e)||jQ()}function jQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
95
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function EQ(e,t){if(e){if(typeof e=="string")return y4(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return y4(e,t)}}function y4(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function SQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function NQ(e){if(Array.isArray(e))return e}function OQ(){var e={},t=function(){return null},r=!1,n=function o(a){if(!r){if(Array.isArray(a)){if(!a.length)return;var i=a,s=kQ(i),l=s[0],c=s.slice(1);if(typeof l=="number"){v4(o.bind(null,c),l);return}o(l),v4(o.bind(null,c));return}yw(a)==="object"&&(e=a,t(e)),typeof a=="function"&&a()}};return{stop:function(){r=!0},start:function(o){r=!1,n(o)},subscribe:function(o){return t=o,function(){t=function(){return null}}}}}function zc(e){"@babel/helpers - typeof";return zc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zc(e)}function x4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function w4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?x4(Object(r),!0).forEach(function(n){GM(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x4(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function GM(e,t,r){return t=CQ(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function CQ(e){var t=PQ(e,"string");return zc(t)==="symbol"?t:String(t)}function PQ(e,t){if(zc(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(zc(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var AQ=function(e,t){return[Object.keys(e),Object.keys(t)].reduce(function(r,n){return r.filter(function(o){return n.includes(o)})})},TQ=function(e){return e},MQ=function(e){return e.replace(/([A-Z])/g,function(t){return"-".concat(t.toLowerCase())})},sc=function(e,t){return Object.keys(t).reduce(function(r,n){return w4(w4({},r),{},GM({},n,e(n,t[n])))},{})},k4=function(e,t,r){return e.map(function(n){return"".concat(MQ(n)," ").concat(t,"ms ").concat(r)}).join(",")};function _Q(e,t){return LQ(e)||DQ(e,t)||YM(e,t)||IQ()}function IQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
96
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DQ(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,a,i,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(d){c=!0,o=d}finally{try{if(!l&&r.return!=null&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}function LQ(e){if(Array.isArray(e))return e}function RQ(e){return BQ(e)||$Q(e)||YM(e)||FQ()}function FQ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
97
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function YM(e,t){if(e){if(typeof e=="string")return xw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xw(e,t)}}function $Q(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function BQ(e){if(Array.isArray(e))return xw(e)}function xw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Mp=1e-4,XM=function(e,t){return[0,3*e,3*t-6*e,3*e-3*t+1]},ZM=function(e,t){return e.map(function(r,n){return r*Math.pow(t,n)}).reduce(function(r,n){return r+n})},j4=function(e,t){return function(r){var n=XM(e,t);return ZM(n,r)}},zQ=function(e,t){return function(r){var n=XM(e,t),o=[].concat(RQ(n.map(function(a,i){return a*i}).slice(1)),[0]);return ZM(o,r)}},E4=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t[0],o=t[1],a=t[2],i=t[3];if(t.length===1)switch(t[0]){case"linear":n=0,o=0,a=1,i=1;break;case"ease":n=.25,o=.1,a=.25,i=1;break;case"ease-in":n=.42,o=0,a=1,i=1;break;case"ease-out":n=.42,o=0,a=.58,i=1;break;case"ease-in-out":n=0,o=0,a=.58,i=1;break;default:{var s=t[0].split("(");if(s[0]==="cubic-bezier"&&s[1].split(")")[0].split(",").length===4){var l=s[1].split(")")[0].split(",").map(function(b){return parseFloat(b)}),c=_Q(l,4);n=c[0],o=c[1],a=c[2],i=c[3]}}}var d=j4(n,a),f=j4(o,i),m=zQ(n,a),p=function(b){return b>1?1:b<0?0:b},h=function(b){for(var v=b>1?1:b,x=v,k=0;k<8;++k){var S=d(x)-v,j=m(x);if(Math.abs(S-v)<Mp||j<Mp)return f(x);x=p(x-S/j)}return f(x)};return h.isStepper=!1,h},HQ=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.stiff,r=t===void 0?100:t,n=e.damping,o=n===void 0?8:n,a=e.dt,i=a===void 0?17:a,s=function(l,c,d){var f=-(l-c)*r,m=d*o,p=d+(f-m)*i/1e3,h=d*i/1e3+l;return Math.abs(h-c)<Mp&&Math.abs(p)<Mp?[c,0]:[h,p]};return s.isStepper=!0,s.dt=i,s},qQ=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t[0];if(typeof n=="string")switch(n){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return E4(n);case"spring":return HQ();default:if(n.split("(")[0]==="cubic-bezier")return E4(n)}return typeof n=="function"?n:null};function Hc(e){"@babel/helpers - typeof";return Hc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hc(e)}function S4(e){return KQ(e)||UQ(e)||JM(e)||WQ()}function WQ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
98
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function KQ(e){if(Array.isArray(e))return kw(e)}function N4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function $r(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?N4(Object(r),!0).forEach(function(n){ww(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N4(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ww(e,t,r){return t=VQ(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function VQ(e){var t=GQ(e,"string");return Hc(t)==="symbol"?t:String(t)}function GQ(e,t){if(Hc(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Hc(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function YQ(e,t){return JQ(e)||ZQ(e,t)||JM(e,t)||XQ()}function XQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
99
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JM(e,t){if(e){if(typeof e=="string")return kw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return kw(e,t)}}function kw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ZQ(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,a,i,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(d){c=!0,o=d}finally{try{if(!l&&r.return!=null&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}function JQ(e){if(Array.isArray(e))return e}var _p=function(e,t,r){return e+(t-e)*r},jw=function(e){var t=e.from,r=e.to;return t!==r},QQ=function e(t,r,n){var o=sc(function(a,i){if(jw(i)){var s=t(i.from,i.to,i.velocity),l=YQ(s,2),c=l[0],d=l[1];return $r($r({},i),{},{from:c,velocity:d})}return i},r);return n<1?sc(function(a,i){return jw(i)?$r($r({},i),{},{velocity:_p(i.velocity,o[a].velocity,n),from:_p(i.from,o[a].from,n)}):i},r):e(t,o,n-1)};const eee=function(e,t,r,n,o){var a=AQ(e,t),i=a.reduce(function(v,x){return $r($r({},v),{},ww({},x,[e[x],t[x]]))},{}),s=a.reduce(function(v,x){return $r($r({},v),{},ww({},x,{from:e[x],velocity:0,to:t[x]}))},{}),l=-1,c,d,f=function(){return null},m=function(){return sc(function(v,x){return x.from},s)},p=function(){return!Object.values(s).filter(jw).length},h=function(v){c||(c=v);var x=v-c,k=x/r.dt;s=QQ(r,s,k),o($r($r($r({},e),t),m())),c=v,p()||(l=requestAnimationFrame(f))},b=function(v){d||(d=v);var x=(v-d)/n,k=sc(function(j,O){return _p.apply(void 0,S4(O).concat([r(x)]))},i);if(o($r($r($r({},e),t),k)),x<1)l=requestAnimationFrame(f);else{var S=sc(function(j,O){return _p.apply(void 0,S4(O).concat([r(1)]))},i);o($r($r($r({},e),t),S))}};return f=r.isStepper?h:b,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(l)}}};function Sl(e){"@babel/helpers - typeof";return Sl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sl(e)}var tee=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function ree(e,t){if(e==null)return{};var r=nee(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function nee(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,a;for(a=0;a<n.length;a++)o=n[a],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function fx(e){return see(e)||iee(e)||aee(e)||oee()}function oee(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
100
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aee(e,t){if(e){if(typeof e=="string")return Ew(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ew(e,t)}}function iee(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function see(e){if(Array.isArray(e))return Ew(e)}function Ew(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function O4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Un(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?O4(Object(r),!0).forEach(function(n){Zu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O4(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Zu(e,t,r){return t=QM(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uee(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,QM(n.key),n)}}function cee(e,t,r){return t&&uee(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function QM(e){var t=dee(e,"string");return Sl(t)==="symbol"?t:String(t)}function dee(e,t){if(Sl(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Sl(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fee(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Sw(e,t)}function Sw(e,t){return Sw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Sw(e,t)}function pee(e){var t=mee();return function(){var r=Ip(e),n;if(t){var o=Ip(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Nw(this,n)}}function Nw(e,t){if(t&&(Sl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ow(e)}function Ow(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mee(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ip(e){return Ip=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ip(e)}var Rn=function(e){fee(r,e);var t=pee(r);function r(n,o){var a;lee(this,r),a=t.call(this,n,o);var i=a.props,s=i.isActive,l=i.attributeName,c=i.from,d=i.to,f=i.steps,m=i.children,p=i.duration;if(a.handleStyleChange=a.handleStyleChange.bind(Ow(a)),a.changeStyle=a.changeStyle.bind(Ow(a)),!s||p<=0)return a.state={style:{}},typeof m=="function"&&(a.state={style:d}),Nw(a);if(f&&f.length)a.state={style:f[0].style};else if(c){if(typeof m=="function")return a.state={style:c},Nw(a);a.state={style:l?Zu({},l,c):c}}else a.state={style:{}};return a}return cee(r,[{key:"componentDidMount",value:function(){var n=this.props,o=n.isActive,a=n.canBegin;this.mounted=!0,!(!o||!a)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(n){var o=this.props,a=o.isActive,i=o.canBegin,s=o.attributeName,l=o.shouldReAnimate,c=o.to,d=o.from,f=this.state.style;if(i){if(!a){var m={style:s?Zu({},s,c):c};this.state&&f&&(s&&f[s]!==c||!s&&f!==c)&&this.setState(m);return}if(!(xQ(n.to,c)&&n.canBegin&&n.isActive)){var p=!n.canBegin||!n.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var h=p||l?d:n.to;if(this.state&&f){var b={style:s?Zu({},s,h):h};(s&&f[s]!==h||!s&&f!==h)&&this.setState(b)}this.runAnimation(Un(Un({},this.props),{},{from:h,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var n=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),n&&n()}},{key:"handleStyleChange",value:function(n){this.changeStyle(n)}},{key:"changeStyle",value:function(n){this.mounted&&this.setState({style:n})}},{key:"runJSAnimation",value:function(n){var o=this,a=n.from,i=n.to,s=n.duration,l=n.easing,c=n.begin,d=n.onAnimationEnd,f=n.onAnimationStart,m=eee(a,i,qQ(l),s,this.changeStyle),p=function(){o.stopJSAnimation=m()};this.manager.start([f,c,p,s,d])}},{key:"runStepAnimation",value:function(n){var o=this,a=n.steps,i=n.begin,s=n.onAnimationStart,l=a[0],c=l.style,d=l.duration,f=d===void 0?0:d,m=function(p,h,b){if(b===0)return p;var v=h.duration,x=h.easing,k=x===void 0?"ease":x,S=h.style,j=h.properties,O=h.onAnimationEnd,C=b>0?a[b-1]:h,N=j||Object.keys(S);if(typeof k=="function"||k==="spring")return[].concat(fx(p),[o.runJSAnimation.bind(o,{from:C.style,to:S,duration:v,easing:k}),v]);var T=k4(N,v,k),M=Un(Un(Un({},C.style),S),{},{transition:T});return[].concat(fx(p),[M,v,O]).filter(TQ)};return this.manager.start([s].concat(fx(a.reduce(m,[c,Math.max(f,i)])),[n.onAnimationEnd]))}},{key:"runAnimation",value:function(n){this.manager||(this.manager=OQ());var o=n.begin,a=n.duration,i=n.attributeName,s=n.to,l=n.easing,c=n.onAnimationStart,d=n.onAnimationEnd,f=n.steps,m=n.children,p=this.manager;if(this.unSubscribe=p.subscribe(this.handleStyleChange),typeof l=="function"||typeof m=="function"||l==="spring"){this.runJSAnimation(n);return}if(f.length>1){this.runStepAnimation(n);return}var h=i?Zu({},i,s):s,b=k4(Object.keys(h),a,l);p.start([c,o,Un(Un({},h),{},{transition:b}),a,d])}},{key:"render",value:function(){var n=this.props,o=n.children;n.begin;var a=n.duration;n.attributeName,n.easing;var i=n.isActive;n.steps,n.from,n.to,n.canBegin,n.onAnimationEnd,n.shouldReAnimate,n.onAnimationReStart;var s=ree(n,tee),l=g.Children.count(o),c=this.state.style;if(typeof o=="function")return o(c);if(!i||l===0||a<=0)return o;var d=function(f){var m=f.props,p=m.style,h=p===void 0?{}:p,b=m.className,v=g.cloneElement(f,Un(Un({},s),{},{style:Un(Un({},h),c),className:b}));return v};return l===1?d(g.Children.only(o)):y.createElement("div",null,g.Children.map(o,function(f){return d(f)}))}}]),r}(g.PureComponent);Rn.displayName="Animate";Rn.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Rn.propTypes={from:Bt.oneOfType([Bt.object,Bt.string]),to:Bt.oneOfType([Bt.object,Bt.string]),attributeName:Bt.string,duration:Bt.number,begin:Bt.number,easing:Bt.oneOfType([Bt.string,Bt.func]),steps:Bt.arrayOf(Bt.shape({duration:Bt.number.isRequired,style:Bt.object.isRequired,easing:Bt.oneOfType([Bt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Bt.func]),properties:Bt.arrayOf("string"),onAnimationEnd:Bt.func})),children:Bt.oneOfType([Bt.node,Bt.func]),isActive:Bt.bool,canBegin:Bt.bool,onAnimationEnd:Bt.func,shouldReAnimate:Bt.bool,onAnimationStart:Bt.func,onAnimationReStart:Bt.func};function qc(e){"@babel/helpers - typeof";return qc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qc(e)}function Dp(){return Dp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Dp.apply(this,arguments)}function hee(e,t){return yee(e)||vee(e,t)||bee(e,t)||gee()}function gee(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
101
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bee(e,t){if(e){if(typeof e=="string")return C4(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return C4(e,t)}}function C4(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function vee(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,a,i,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(d){c=!0,o=d}finally{try{if(!l&&r.return!=null&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}function yee(e){if(Array.isArray(e))return e}function P4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function A4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?P4(Object(r),!0).forEach(function(n){xee(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):P4(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xee(e,t,r){return t=wee(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wee(e){var t=kee(e,"string");return qc(t)=="symbol"?t:t+""}function kee(e,t){if(qc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(qc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var T4=function(e,t,r,n,o){var a=Math.min(Math.abs(r)/2,Math.abs(n)/2),i=n>=0?1:-1,s=r>=0?1:-1,l=n>=0&&r>=0||n<0&&r<0?1:0,c;if(a>0&&o instanceof Array){for(var d=[0,0,0,0],f=0,m=4;f<m;f++)d[f]=o[f]>a?a:o[f];c="M".concat(e,",").concat(t+i*d[0]),d[0]>0&&(c+="A ".concat(d[0],",").concat(d[0],",0,0,").concat(l,",").concat(e+s*d[0],",").concat(t)),c+="L ".concat(e+r-s*d[1],",").concat(t),d[1]>0&&(c+="A ".concat(d[1],",").concat(d[1],",0,0,").concat(l,`,
102
+ `).concat(e+r,",").concat(t+i*d[1])),c+="L ".concat(e+r,",").concat(t+n-i*d[2]),d[2]>0&&(c+="A ".concat(d[2],",").concat(d[2],",0,0,").concat(l,`,
103
+ `).concat(e+r-s*d[2],",").concat(t+n)),c+="L ".concat(e+s*d[3],",").concat(t+n),d[3]>0&&(c+="A ".concat(d[3],",").concat(d[3],",0,0,").concat(l,`,
104
+ `).concat(e,",").concat(t+n-i*d[3])),c+="Z"}else if(a>0&&o===+o&&o>0){var p=Math.min(a,o);c="M ".concat(e,",").concat(t+i*p,`
105
+ A `).concat(p,",").concat(p,",0,0,").concat(l,",").concat(e+s*p,",").concat(t,`
106
+ L `).concat(e+r-s*p,",").concat(t,`
107
+ A `).concat(p,",").concat(p,",0,0,").concat(l,",").concat(e+r,",").concat(t+i*p,`
108
+ L `).concat(e+r,",").concat(t+n-i*p,`
109
+ A `).concat(p,",").concat(p,",0,0,").concat(l,",").concat(e+r-s*p,",").concat(t+n,`
110
+ L `).concat(e+s*p,",").concat(t+n,`
111
+ A `).concat(p,",").concat(p,",0,0,").concat(l,",").concat(e,",").concat(t+n-i*p," Z")}else c="M ".concat(e,",").concat(t," h ").concat(r," v ").concat(n," h ").concat(-r," Z");return c},jee=function(e,t){if(!e||!t)return!1;var r=e.x,n=e.y,o=t.x,a=t.y,i=t.width,s=t.height;if(Math.abs(i)>0&&Math.abs(s)>0){var l=Math.min(o,o+i),c=Math.max(o,o+i),d=Math.min(a,a+s),f=Math.max(a,a+s);return r>=l&&r<=c&&n>=d&&n<=f}return!1},Eee={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Q2=function(e){var t=A4(A4({},Eee),e),r=g.useRef(),n=g.useState(-1),o=hee(n,2),a=o[0],i=o[1];g.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var S=r.current.getTotalLength();S&&i(S)}catch{}},[]);var s=t.x,l=t.y,c=t.width,d=t.height,f=t.radius,m=t.className,p=t.animationEasing,h=t.animationDuration,b=t.animationBegin,v=t.isAnimationActive,x=t.isUpdateAnimationActive;if(s!==+s||l!==+l||c!==+c||d!==+d||c===0||d===0)return null;var k=wt("recharts-rectangle",m);return x?y.createElement(Rn,{canBegin:a>0,from:{width:c,height:d,x:s,y:l},to:{width:c,height:d,x:s,y:l},duration:h,animationEasing:p,isActive:x},function(S){var j=S.width,O=S.height,C=S.x,N=S.y;return y.createElement(Rn,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:h,isActive:v,easing:p},y.createElement("path",Dp({},Xe(t,!0),{className:k,d:T4(C,N,j,O,f),ref:r})))}):y.createElement("path",Dp({},Xe(t,!0),{className:k,d:T4(s,l,c,d,f)}))},See=["points","className","baseLinePoints","connectNulls"];function Us(){return Us=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Us.apply(this,arguments)}function Nee(e,t){if(e==null)return{};var r=Oee(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Oee(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function M4(e){return Tee(e)||Aee(e)||Pee(e)||Cee()}function Cee(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
112
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pee(e,t){if(e){if(typeof e=="string")return Cw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Cw(e,t)}}function Aee(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Tee(e){if(Array.isArray(e))return Cw(e)}function Cw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var _4=function(e){return e&&e.x===+e.x&&e.y===+e.y},Mee=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=[[]];return e.forEach(function(r){_4(r)?t[t.length-1].push(r):t[t.length-1].length>0&&t.push([])}),_4(e[0])&&t[t.length-1].push(e[0]),t[t.length-1].length<=0&&(t=t.slice(0,-1)),t},lc=function(e,t){var r=Mee(e);t&&(r=[r.reduce(function(o,a){return[].concat(M4(o),M4(a))},[])]);var n=r.map(function(o){return o.reduce(function(a,i,s){return"".concat(a).concat(s===0?"M":"L").concat(i.x,",").concat(i.y)},"")}).join("");return r.length===1?"".concat(n,"Z"):n},_ee=function(e,t,r){var n=lc(e,r);return"".concat(n.slice(-1)==="Z"?n.slice(0,-1):n,"L").concat(lc(t.reverse(),r).slice(1))},Iee=function(e){var t=e.points,r=e.className,n=e.baseLinePoints,o=e.connectNulls,a=Nee(e,See);if(!t||!t.length)return null;var i=wt("recharts-polygon",r);if(n&&n.length){var s=a.stroke&&a.stroke!=="none",l=_ee(t,n,o);return y.createElement("g",{className:i},y.createElement("path",Us({},Xe(a,!0),{fill:l.slice(-1)==="Z"?a.fill:"none",stroke:"none",d:l})),s?y.createElement("path",Us({},Xe(a,!0),{fill:"none",d:lc(t,o)})):null,s?y.createElement("path",Us({},Xe(a,!0),{fill:"none",d:lc(n,o)})):null)}var c=lc(t,o);return y.createElement("path",Us({},Xe(a,!0),{fill:c.slice(-1)==="Z"?a.fill:"none",className:i,d:c}))};function Pw(){return Pw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Pw.apply(this,arguments)}var To=function(e){var t=e.cx,r=e.cy,n=e.r,o=e.className,a=wt("recharts-dot",o);return t===+t&&r===+r&&n===+n?y.createElement("circle",Pw({},Xe(e,!1),ap(e),{className:a,cx:t,cy:r,r:n})):null};function Wc(e){"@babel/helpers - typeof";return Wc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wc(e)}var Dee=["x","y","top","left","width","height","className"];function Aw(){return Aw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Aw.apply(this,arguments)}function I4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Lee(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?I4(Object(r),!0).forEach(function(n){Ree(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):I4(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ree(e,t,r){return t=Fee(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fee(e){var t=$ee(e,"string");return Wc(t)=="symbol"?t:t+""}function $ee(e,t){if(Wc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Wc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Bee(e,t){if(e==null)return{};var r=zee(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function zee(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Hee=function(e,t,r,n,o,a){return"M".concat(e,",").concat(o,"v").concat(n,"M").concat(a,",").concat(t,"h").concat(r)},qee=function(e){var t=e.x,r=t===void 0?0:t,n=e.y,o=n===void 0?0:n,a=e.top,i=a===void 0?0:a,s=e.left,l=s===void 0?0:s,c=e.width,d=c===void 0?0:c,f=e.height,m=f===void 0?0:f,p=e.className,h=Bee(e,Dee),b=Lee({x:r,y:o,top:i,left:l,width:d,height:m},h);return!Re(r)||!Re(o)||!Re(d)||!Re(m)||!Re(i)||!Re(l)?null:y.createElement("path",Aw({},Xe(b,!0),{className:wt("recharts-cross",p),d:Hee(r,o,d,m,i,l)}))},px,D4;function Wee(){if(D4)return px;D4=1;var e=nh(),t=hM(),r=$o();function n(o,a){return o&&o.length?e(o,r(a,2),t):void 0}return px=n,px}var Uee=Wee();const Kee=qt(Uee);var mx,L4;function Vee(){if(L4)return mx;L4=1;var e=nh(),t=$o(),r=gM();function n(o,a){return o&&o.length?e(o,t(a,2),r):void 0}return mx=n,mx}var Gee=Vee();const Yee=qt(Gee);var Xee=["cx","cy","angle","ticks","axisLine"],Zee=["ticks","tick","angle","tickFormatter","stroke"];function Nl(e){"@babel/helpers - typeof";return Nl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nl(e)}function uc(){return uc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},uc.apply(this,arguments)}function R4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ai(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?R4(Object(r),!0).forEach(function(n){sh(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R4(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function F4(e,t){if(e==null)return{};var r=Jee(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Jee(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Qee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $4(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,t_(n.key),n)}}function ete(e,t,r){return t&&$4(e.prototype,t),r&&$4(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function tte(e,t,r){return t=Lp(t),rte(e,e_()?Reflect.construct(t,r||[],Lp(e).constructor):t.apply(e,r))}function rte(e,t){if(t&&(Nl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nte(e)}function nte(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function e_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(e_=function(){return!!e})()}function Lp(e){return Lp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Lp(e)}function ote(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Tw(e,t)}function Tw(e,t){return Tw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Tw(e,t)}function sh(e,t,r){return t=t_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t_(e){var t=ate(e,"string");return Nl(t)=="symbol"?t:t+""}function ate(e,t){if(Nl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Nl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var lh=function(e){function t(){return Qee(this,t),tte(this,t,arguments)}return ote(t,e),ete(t,[{key:"getTickValueCoord",value:function(r){var n=r.coordinate,o=this.props,a=o.angle,i=o.cx,s=o.cy;return ar(i,s,n,a)}},{key:"getTickTextAnchor",value:function(){var r=this.props.orientation,n;switch(r){case"left":n="end";break;case"right":n="start";break;default:n="middle";break}return n}},{key:"getViewBox",value:function(){var r=this.props,n=r.cx,o=r.cy,a=r.angle,i=r.ticks,s=Kee(i,function(c){return c.coordinate||0}),l=Yee(i,function(c){return c.coordinate||0});return{cx:n,cy:o,startAngle:a,endAngle:a,innerRadius:l.coordinate||0,outerRadius:s.coordinate||0}}},{key:"renderAxisLine",value:function(){var r=this.props,n=r.cx,o=r.cy,a=r.angle,i=r.ticks,s=r.axisLine,l=F4(r,Xee),c=i.reduce(function(p,h){return[Math.min(p[0],h.coordinate),Math.max(p[1],h.coordinate)]},[1/0,-1/0]),d=ar(n,o,c[0],a),f=ar(n,o,c[1],a),m=Ai(Ai(Ai({},Xe(l,!1)),{},{fill:"none"},Xe(s,!1)),{},{x1:d.x,y1:d.y,x2:f.x,y2:f.y});return y.createElement("line",uc({className:"recharts-polar-radius-axis-line"},m))}},{key:"renderTicks",value:function(){var r=this,n=this.props,o=n.ticks,a=n.tick,i=n.angle,s=n.tickFormatter,l=n.stroke,c=F4(n,Zee),d=this.getTickTextAnchor(),f=Xe(c,!1),m=Xe(a,!1),p=o.map(function(h,b){var v=r.getTickValueCoord(h),x=Ai(Ai(Ai(Ai({textAnchor:d,transform:"rotate(".concat(90-i,", ").concat(v.x,", ").concat(v.y,")")},f),{},{stroke:"none",fill:l},m),{},{index:b},v),{},{payload:h});return y.createElement(jt,uc({className:wt("recharts-polar-radius-axis-tick",WM(a)),key:"tick-".concat(h.coordinate)},si(r.props,h,b)),t.renderTickItem(a,x,s?s(h.value,b):h.value))});return y.createElement(jt,{className:"recharts-polar-radius-axis-ticks"},p)}},{key:"render",value:function(){var r=this.props,n=r.ticks,o=r.axisLine,a=r.tick;return!n||!n.length?null:y.createElement(jt,{className:wt("recharts-polar-radius-axis",this.props.className)},o&&this.renderAxisLine(),a&&this.renderTicks(),Jt.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,n,o){var a;return y.isValidElement(r)?a=y.cloneElement(r,n):it(r)?a=r(n):a=y.createElement(ds,uc({},n,{className:"recharts-polar-radius-axis-tick-value"}),o),a}}])}(g.PureComponent);sh(lh,"displayName","PolarRadiusAxis");sh(lh,"axisType","radiusAxis");sh(lh,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function Ol(e){"@babel/helpers - typeof";return Ol=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ol(e)}function $i(){return $i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$i.apply(this,arguments)}function B4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ti(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?B4(Object(r),!0).forEach(function(n){uh(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):B4(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ite(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function z4(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n_(n.key),n)}}function ste(e,t,r){return t&&z4(e.prototype,t),r&&z4(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function lte(e,t,r){return t=Rp(t),ute(e,r_()?Reflect.construct(t,r||[],Rp(e).constructor):t.apply(e,r))}function ute(e,t){if(t&&(Ol(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cte(e)}function cte(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function r_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(r_=function(){return!!e})()}function Rp(e){return Rp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Rp(e)}function dte(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Mw(e,t)}function Mw(e,t){return Mw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Mw(e,t)}function uh(e,t,r){return t=n_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n_(e){var t=fte(e,"string");return Ol(t)=="symbol"?t:t+""}function fte(e,t){if(Ol(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ol(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var pte=Math.PI/180,mte=1e-5,ch=function(e){function t(){return ite(this,t),lte(this,t,arguments)}return dte(t,e),ste(t,[{key:"getTickLineCoord",value:function(r){var n=this.props,o=n.cx,a=n.cy,i=n.radius,s=n.orientation,l=n.tickSize,c=l||8,d=ar(o,a,i,r.coordinate),f=ar(o,a,i+(s==="inner"?-1:1)*c,r.coordinate);return{x1:d.x,y1:d.y,x2:f.x,y2:f.y}}},{key:"getTickTextAnchor",value:function(r){var n=this.props.orientation,o=Math.cos(-r.coordinate*pte),a;return o>mte?a=n==="outer"?"start":"end":o<-1e-5?a=n==="outer"?"end":"start":a="middle",a}},{key:"renderAxisLine",value:function(){var r=this.props,n=r.cx,o=r.cy,a=r.radius,i=r.axisLine,s=r.axisLineType,l=Ti(Ti({},Xe(this.props,!1)),{},{fill:"none"},Xe(i,!1));if(s==="circle")return y.createElement(To,$i({className:"recharts-polar-angle-axis-line"},l,{cx:n,cy:o,r:a}));var c=this.props.ticks,d=c.map(function(f){return ar(n,o,a,f.coordinate)});return y.createElement(Iee,$i({className:"recharts-polar-angle-axis-line"},l,{points:d}))}},{key:"renderTicks",value:function(){var r=this,n=this.props,o=n.ticks,a=n.tick,i=n.tickLine,s=n.tickFormatter,l=n.stroke,c=Xe(this.props,!1),d=Xe(a,!1),f=Ti(Ti({},c),{},{fill:"none"},Xe(i,!1)),m=o.map(function(p,h){var b=r.getTickLineCoord(p),v=r.getTickTextAnchor(p),x=Ti(Ti(Ti({textAnchor:v},c),{},{stroke:"none",fill:l},d),{},{index:h,payload:p,x:b.x2,y:b.y2});return y.createElement(jt,$i({className:wt("recharts-polar-angle-axis-tick",WM(a)),key:"tick-".concat(p.coordinate)},si(r.props,p,h)),i&&y.createElement("line",$i({className:"recharts-polar-angle-axis-tick-line"},f,b)),a&&t.renderTickItem(a,x,s?s(p.value,h):p.value))});return y.createElement(jt,{className:"recharts-polar-angle-axis-ticks"},m)}},{key:"render",value:function(){var r=this.props,n=r.ticks,o=r.radius,a=r.axisLine;return o<=0||!n||!n.length?null:y.createElement(jt,{className:wt("recharts-polar-angle-axis",this.props.className)},a&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,n,o){var a;return y.isValidElement(r)?a=y.cloneElement(r,n):it(r)?a=r(n):a=y.createElement(ds,$i({},n,{className:"recharts-polar-angle-axis-tick-value"}),o),a}}])}(g.PureComponent);uh(ch,"displayName","PolarAngleAxis");uh(ch,"axisType","angleAxis");uh(ch,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var hx,H4;function hte(){if(H4)return hx;H4=1;var e=m7(),t=e(Object.getPrototypeOf,Object);return hx=t,hx}var gx,q4;function gte(){if(q4)return gx;q4=1;var e=ba(),t=hte(),r=va(),n="[object Object]",o=Function.prototype,a=Object.prototype,i=o.toString,s=a.hasOwnProperty,l=i.call(Object);function c(d){if(!r(d)||e(d)!=n)return!1;var f=t(d);if(f===null)return!0;var m=s.call(f,"constructor")&&f.constructor;return typeof m=="function"&&m instanceof m&&i.call(m)==l}return gx=c,gx}var bte=gte();const vte=qt(bte);var bx,W4;function yte(){if(W4)return bx;W4=1;var e=ba(),t=va(),r="[object Boolean]";function n(o){return o===!0||o===!1||t(o)&&e(o)==r}return bx=n,bx}var xte=yte();const wte=qt(xte);function Uc(e){"@babel/helpers - typeof";return Uc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uc(e)}function Fp(){return Fp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Fp.apply(this,arguments)}function kte(e,t){return Nte(e)||Ste(e,t)||Ete(e,t)||jte()}function jte(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
113
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ete(e,t){if(e){if(typeof e=="string")return U4(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return U4(e,t)}}function U4(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ste(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,a,i,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(d){c=!0,o=d}finally{try{if(!l&&r.return!=null&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}function Nte(e){if(Array.isArray(e))return e}function K4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function V4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?K4(Object(r),!0).forEach(function(n){Ote(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):K4(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ote(e,t,r){return t=Cte(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Cte(e){var t=Pte(e,"string");return Uc(t)=="symbol"?t:t+""}function Pte(e,t){if(Uc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Uc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var G4=function(e,t,r,n,o){var a=r-n,i;return i="M ".concat(e,",").concat(t),i+="L ".concat(e+r,",").concat(t),i+="L ".concat(e+r-a/2,",").concat(t+o),i+="L ".concat(e+r-a/2-n,",").concat(t+o),i+="L ".concat(e,",").concat(t," Z"),i},Ate={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Tte=function(e){var t=V4(V4({},Ate),e),r=g.useRef(),n=g.useState(-1),o=kte(n,2),a=o[0],i=o[1];g.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var k=r.current.getTotalLength();k&&i(k)}catch{}},[]);var s=t.x,l=t.y,c=t.upperWidth,d=t.lowerWidth,f=t.height,m=t.className,p=t.animationEasing,h=t.animationDuration,b=t.animationBegin,v=t.isUpdateAnimationActive;if(s!==+s||l!==+l||c!==+c||d!==+d||f!==+f||c===0&&d===0||f===0)return null;var x=wt("recharts-trapezoid",m);return v?y.createElement(Rn,{canBegin:a>0,from:{upperWidth:0,lowerWidth:0,height:f,x:s,y:l},to:{upperWidth:c,lowerWidth:d,height:f,x:s,y:l},duration:h,animationEasing:p,isActive:v},function(k){var S=k.upperWidth,j=k.lowerWidth,O=k.height,C=k.x,N=k.y;return y.createElement(Rn,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:h,easing:p},y.createElement("path",Fp({},Xe(t,!0),{className:x,d:G4(C,N,S,j,O),ref:r})))}):y.createElement("g",null,y.createElement("path",Fp({},Xe(t,!0),{className:x,d:G4(s,l,c,d,f)})))},Mte=["option","shapeType","propTransformer","activeClassName","isActive"];function Kc(e){"@babel/helpers - typeof";return Kc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kc(e)}function _te(e,t){if(e==null)return{};var r=Ite(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ite(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Y4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function $p(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Y4(Object(r),!0).forEach(function(n){Dte(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Y4(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Dte(e,t,r){return t=Lte(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lte(e){var t=Rte(e,"string");return Kc(t)=="symbol"?t:t+""}function Rte(e,t){if(Kc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Kc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fte(e,t){return $p($p({},t),e)}function $te(e,t){return e==="symbols"}function X4(e){var t=e.shapeType,r=e.elementProps;switch(t){case"rectangle":return y.createElement(Q2,r);case"trapezoid":return y.createElement(Tte,r);case"sector":return y.createElement(J2,r);case"symbols":if($te(t))return y.createElement(Km,r);break;default:return null}}function Bte(e){return g.isValidElement(e)?e.props:e}function Bp(e){var t=e.option,r=e.shapeType,n=e.propTransformer,o=n===void 0?Fte:n,a=e.activeClassName,i=a===void 0?"recharts-active-shape":a,s=e.isActive,l=_te(e,Mte),c;if(g.isValidElement(t))c=g.cloneElement(t,$p($p({},l),Bte(t)));else if(it(t))c=t(l);else if(vte(t)&&!wte(t)){var d=o(t,l);c=y.createElement(X4,{shapeType:r,elementProps:d})}else{var f=l;c=y.createElement(X4,{shapeType:r,elementProps:f})}return s?y.createElement(jt,{className:i},c):c}function dh(e,t){return t!=null&&"trapezoids"in e.props}function fh(e,t){return t!=null&&"sectors"in e.props}function Vc(e,t){return t!=null&&"points"in e.props}function zte(e,t){var r,n,o=e.x===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.x)||e.x===t.x,a=e.y===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.y)||e.y===t.y;return o&&a}function Hte(e,t){var r=e.endAngle===t.endAngle,n=e.startAngle===t.startAngle;return r&&n}function qte(e,t){var r=e.x===t.x,n=e.y===t.y,o=e.z===t.z;return r&&n&&o}function Wte(e,t){var r;return dh(e,t)?r=zte:fh(e,t)?r=Hte:Vc(e,t)&&(r=qte),r}function Ute(e,t){var r;return dh(e,t)?r="trapezoids":fh(e,t)?r="sectors":Vc(e,t)&&(r="points"),r}function Kte(e,t){if(dh(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}if(fh(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}return Vc(e,t)?t.payload:{}}function Vte(e){var t=e.activeTooltipItem,r=e.graphicalItem,n=e.itemData,o=Ute(r,t),a=Kte(r,t),i=n.filter(function(l,c){var d=li(a,l),f=r.props[o].filter(function(h){var b=Wte(r,t);return b(h,t)}),m=r.props[o].indexOf(f[f.length-1]),p=c===m;return d&&p}),s=n.indexOf(i[i.length-1]);return s}var zf;function Cl(e){"@babel/helpers - typeof";return Cl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cl(e)}function Ks(){return Ks=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ks.apply(this,arguments)}function Z4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function or(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Z4(Object(r),!0).forEach(function(n){In(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z4(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Gte(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function J4(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a_(n.key),n)}}function Yte(e,t,r){return t&&J4(e.prototype,t),r&&J4(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Xte(e,t,r){return t=zp(t),Zte(e,o_()?Reflect.construct(t,r||[],zp(e).constructor):t.apply(e,r))}function Zte(e,t){if(t&&(Cl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Jte(e)}function Jte(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function o_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(o_=function(){return!!e})()}function zp(e){return zp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},zp(e)}function Qte(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_w(e,t)}function _w(e,t){return _w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},_w(e,t)}function In(e,t,r){return t=a_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a_(e){var t=ere(e,"string");return Cl(t)=="symbol"?t:t+""}function ere(e,t){if(Cl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Cl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var wa=function(e){function t(r){var n;return Gte(this,t),n=Xte(this,t,[r]),In(n,"pieRef",null),In(n,"sectorRefs",[]),In(n,"id",bi("recharts-pie-")),In(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),it(o)&&o()}),In(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),it(o)&&o()}),n.state={isAnimationFinished:!r.isAnimationActive,prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,sectorToFocus:0},n}return Qte(t,e),Yte(t,[{key:"isActiveIndex",value:function(r){var n=this.props.activeIndex;return Array.isArray(n)?n.indexOf(r)!==-1:r===n}},{key:"hasActiveIndex",value:function(){var r=this.props.activeIndex;return Array.isArray(r)?r.length!==0:r||r===0}},{key:"renderLabels",value:function(r){var n=this.props.isAnimationActive;if(n&&!this.state.isAnimationFinished)return null;var o=this.props,a=o.label,i=o.labelLine,s=o.dataKey,l=o.valueKey,c=Xe(this.props,!1),d=Xe(a,!1),f=Xe(i,!1),m=a&&a.offsetRadius||20,p=r.map(function(h,b){var v=(h.startAngle+h.endAngle)/2,x=ar(h.cx,h.cy,h.outerRadius+m,v),k=or(or(or(or({},c),h),{},{stroke:"none"},d),{},{index:b,textAnchor:t.getTextAnchor(x.x,h.cx)},x),S=or(or(or(or({},c),h),{},{fill:"none",stroke:h.fill},f),{},{index:b,points:[ar(h.cx,h.cy,h.outerRadius,v),x]}),j=s;return st(s)&&st(l)?j="value":st(s)&&(j=l),y.createElement(jt,{key:"label-".concat(h.startAngle,"-").concat(h.endAngle,"-").concat(h.midAngle,"-").concat(b)},i&&t.renderLabelLineItem(i,S,"line"),t.renderLabelItem(a,k,dr(h,j)))});return y.createElement(jt,{className:"recharts-pie-labels"},p)}},{key:"renderSectorsStatically",value:function(r){var n=this,o=this.props,a=o.activeShape,i=o.blendStroke,s=o.inactiveShape;return r.map(function(l,c){if(l?.startAngle===0&&l?.endAngle===0&&r.length!==1)return null;var d=n.isActiveIndex(c),f=s&&n.hasActiveIndex()?s:null,m=d?a:f,p=or(or({},l),{},{stroke:i?l.fill:l.stroke,tabIndex:-1});return y.createElement(jt,Ks({ref:function(h){h&&!n.sectorRefs.includes(h)&&n.sectorRefs.push(h)},tabIndex:-1,className:"recharts-pie-sector"},si(n.props,l,c),{key:"sector-".concat(l?.startAngle,"-").concat(l?.endAngle,"-").concat(l.midAngle,"-").concat(c)}),y.createElement(Bp,Ks({option:m,isActive:d,shapeType:"sector"},p)))})}},{key:"renderSectorsWithAnimation",value:function(){var r=this,n=this.props,o=n.sectors,a=n.isAnimationActive,i=n.animationBegin,s=n.animationDuration,l=n.animationEasing,c=n.animationId,d=this.state,f=d.prevSectors,m=d.prevIsAnimationActive;return y.createElement(Rn,{begin:i,duration:s,isActive:a,easing:l,from:{t:0},to:{t:1},key:"pie-".concat(c,"-").concat(m),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(p){var h=p.t,b=[],v=o&&o[0],x=v.startAngle;return o.forEach(function(k,S){var j=f&&f[S],O=S>0?Sn(k,"paddingAngle",0):0;if(j){var C=gr(j.endAngle-j.startAngle,k.endAngle-k.startAngle),N=or(or({},k),{},{startAngle:x+O,endAngle:x+C(h)+O});b.push(N),x=N.endAngle}else{var T=k.endAngle,M=k.startAngle,I=gr(0,T-M),_=I(h),R=or(or({},k),{},{startAngle:x+O,endAngle:x+_+O});b.push(R),x=R.endAngle}}),y.createElement(jt,null,r.renderSectorsStatically(b))})}},{key:"attachKeyboardHandlers",value:function(r){var n=this;r.onkeydown=function(o){if(!o.altKey)switch(o.key){case"ArrowLeft":{var a=++n.state.sectorToFocus%n.sectorRefs.length;n.sectorRefs[a].focus(),n.setState({sectorToFocus:a});break}case"ArrowRight":{var i=--n.state.sectorToFocus<0?n.sectorRefs.length-1:n.state.sectorToFocus%n.sectorRefs.length;n.sectorRefs[i].focus(),n.setState({sectorToFocus:i});break}case"Escape":{n.sectorRefs[n.state.sectorToFocus].blur(),n.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,n=r.sectors,o=r.isAnimationActive,a=this.state.prevSectors;return o&&n&&n.length&&(!a||!li(a,n))?this.renderSectorsWithAnimation():this.renderSectorsStatically(n)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,n=this.props,o=n.hide,a=n.sectors,i=n.className,s=n.label,l=n.cx,c=n.cy,d=n.innerRadius,f=n.outerRadius,m=n.isAnimationActive,p=this.state.isAnimationFinished;if(o||!a||!a.length||!Re(l)||!Re(c)||!Re(d)||!Re(f))return null;var h=wt("recharts-pie",i);return y.createElement(jt,{tabIndex:this.props.rootTabIndex,className:h,ref:function(b){r.pieRef=b}},this.renderSectors(),s&&this.renderLabels(a),Jt.renderCallByParent(this.props,null,!1),(!m||p)&&Zn.renderCallByParent(this.props,a,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,n){return n.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==n.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:n.curSectors,isAnimationFinished:!0}:r.sectors!==n.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,n){return r>n?"start":r<n?"end":"middle"}},{key:"renderLabelLineItem",value:function(r,n,o){if(y.isValidElement(r))return y.cloneElement(r,n);if(it(r))return r(n);var a=wt("recharts-pie-label-line",typeof r!="boolean"?r.className:"");return y.createElement(ti,Ks({},n,{key:o,type:"linear",className:a}))}},{key:"renderLabelItem",value:function(r,n,o){if(y.isValidElement(r))return y.cloneElement(r,n);var a=o;if(it(r)&&(a=r(n),y.isValidElement(a)))return a;var i=wt("recharts-pie-label-text",typeof r!="boolean"&&!it(r)?r.className:"");return y.createElement(ds,Ks({},n,{alignmentBaseline:"middle",className:i}),a)}}])}(g.PureComponent);zf=wa;In(wa,"displayName","Pie");In(wa,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!ya.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});In(wa,"parseDeltaAngle",function(e,t){var r=en(t-e),n=Math.min(Math.abs(t-e),360);return r*n});In(wa,"getRealPieData",function(e){var t=e.data,r=e.children,n=Xe(e,!1),o=on(r,Xm);return t&&t.length?t.map(function(a,i){return or(or(or({payload:a},n),a),o&&o[i]&&o[i].props)}):o&&o.length?o.map(function(a){return or(or({},n),a.props)}):[]});In(wa,"parseCoordinateOfPie",function(e,t){var r=t.top,n=t.left,o=t.width,a=t.height,i=qM(o,a),s=n+tn(e.cx,o,o/2),l=r+tn(e.cy,a,a/2),c=tn(e.innerRadius,i,0),d=tn(e.outerRadius,i,i*.8),f=e.maxRadius||Math.sqrt(o*o+a*a)/2;return{cx:s,cy:l,innerRadius:c,outerRadius:d,maxRadius:f}});In(wa,"getComposedData",function(e){var t=e.item,r=e.offset,n=t.type.defaultProps!==void 0?or(or({},t.type.defaultProps),t.props):t.props,o=zf.getRealPieData(n);if(!o||!o.length)return null;var a=n.cornerRadius,i=n.startAngle,s=n.endAngle,l=n.paddingAngle,c=n.dataKey,d=n.nameKey,f=n.valueKey,m=n.tooltipType,p=Math.abs(n.minAngle),h=zf.parseCoordinateOfPie(n,r),b=zf.parseDeltaAngle(i,s),v=Math.abs(b),x=c;st(c)&&st(f)?(Xn(!1,`Use "dataKey" to specify the value of pie,
114
+ the props "valueKey" will be deprecated in 1.1.0`),x="value"):st(c)&&(Xn(!1,`Use "dataKey" to specify the value of pie,
115
+ the props "valueKey" will be deprecated in 1.1.0`),x=f);var k=o.filter(function(T){return dr(T,x,0)!==0}).length,S=(v>=360?k:k-1)*l,j=v-k*p-S,O=o.reduce(function(T,M){var I=dr(M,x,0);return T+(Re(I)?I:0)},0),C;if(O>0){var N;C=o.map(function(T,M){var I=dr(T,x,0),_=dr(T,d,M),R=(Re(I)?I:0)/O,L;M?L=N.endAngle+en(b)*l*(I!==0?1:0):L=i;var F=L+en(b)*((I!==0?p:0)+R*j),B=(L+F)/2,U=(h.innerRadius+h.outerRadius)/2,$=[{name:_,value:I,payload:T,dataKey:x,type:m}],z=ar(h.cx,h.cy,U,B);return N=or(or(or({percent:R,cornerRadius:a,name:_,tooltipPayload:$,midAngle:B,middleRadius:U,tooltipPosition:z},T),h),{},{value:dr(T,x),startAngle:L,endAngle:F,payload:T,paddingAngle:en(b)*l}),N})}return or(or({},h),{},{sectors:C,data:o})});var vx,Q4;function tre(){if(Q4)return vx;Q4=1;var e=Math.ceil,t=Math.max;function r(n,o,a,i){for(var s=-1,l=t(e((o-n)/(a||1)),0),c=Array(l);l--;)c[i?l:++s]=n,n+=a;return c}return vx=r,vx}var yx,e1;function i_(){if(e1)return yx;e1=1;var e=A7(),t=1/0,r=17976931348623157e292;function n(o){if(!o)return o===0?o:0;if(o=e(o),o===t||o===-1/0){var a=o<0?-1:1;return a*r}return o===o?o:0}return yx=n,yx}var xx,t1;function rre(){if(t1)return xx;t1=1;var e=tre(),t=Ym(),r=i_();function n(o){return function(a,i,s){return s&&typeof s!="number"&&t(a,i,s)&&(i=s=void 0),a=r(a),i===void 0?(i=a,a=0):i=r(i),s=s===void 0?a<i?1:-1:r(s),e(a,i,s,o)}}return xx=n,xx}var wx,r1;function nre(){if(r1)return wx;r1=1;var e=rre(),t=e();return wx=t,wx}var ore=nre();const Hp=qt(ore);function Gc(e){"@babel/helpers - typeof";return Gc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gc(e)}function n1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function o1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?n1(Object(r),!0).forEach(function(n){s_(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function s_(e,t,r){return t=are(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function are(e){var t=ire(e,"string");return Gc(t)=="symbol"?t:t+""}function ire(e,t){if(Gc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Gc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var sre=["Webkit","Moz","O","ms"],lre=function(e,t){var r=e.replace(/(\w)/,function(o){return o.toUpperCase()}),n=sre.reduce(function(o,a){return o1(o1({},o),{},s_({},a+r,t))},{});return n[e]=t,n};function Pl(e){"@babel/helpers - typeof";return Pl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pl(e)}function qp(){return qp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qp.apply(this,arguments)}function a1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function kx(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?a1(Object(r),!0).forEach(function(n){yn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ure(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u_(n.key),n)}}function cre(e,t,r){return t&&i1(e.prototype,t),r&&i1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function dre(e,t,r){return t=Wp(t),fre(e,l_()?Reflect.construct(t,r||[],Wp(e).constructor):t.apply(e,r))}function fre(e,t){if(t&&(Pl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pre(e)}function pre(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(l_=function(){return!!e})()}function Wp(e){return Wp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Wp(e)}function mre(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Iw(e,t)}function Iw(e,t){return Iw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Iw(e,t)}function yn(e,t,r){return t=u_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u_(e){var t=hre(e,"string");return Pl(t)=="symbol"?t:t+""}function hre(e,t){if(Pl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Pl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var gre=function(e){var t=e.data,r=e.startIndex,n=e.endIndex,o=e.x,a=e.width,i=e.travellerWidth;if(!t||!t.length)return{};var s=t.length,l=ic().domain(Hp(0,s)).range([o,o+a-i]),c=l.domain().map(function(d){return l(d)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:l(r),endX:l(n),scale:l,scaleValues:c}},s1=function(e){return e.changedTouches&&!!e.changedTouches.length},Al=function(e){function t(r){var n;return ure(this,t),n=dre(this,t,[r]),yn(n,"handleDrag",function(o){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(o):n.state.isSlideMoving&&n.handleSlideDrag(o)}),yn(n,"handleTouchMove",function(o){o.changedTouches!=null&&o.changedTouches.length>0&&n.handleDrag(o.changedTouches[0])}),yn(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var o=n.props,a=o.endIndex,i=o.onDragEnd,s=o.startIndex;i?.({endIndex:a,startIndex:s})}),n.detachDragEndListener()}),yn(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),yn(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),yn(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),yn(n,"handleSlideDragStart",function(o){var a=s1(o)?o.changedTouches[0]:o;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return mre(t,e),cre(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var n=r.startX,o=r.endX,a=this.state.scaleValues,i=this.props,s=i.gap,l=i.data,c=l.length-1,d=Math.min(n,o),f=Math.max(n,o),m=t.getIndexInRange(a,d),p=t.getIndexInRange(a,f);return{startIndex:m-m%s,endIndex:p===c?c:p-p%s}}},{key:"getTextOfTick",value:function(r){var n=this.props,o=n.data,a=n.tickFormatter,i=n.dataKey,s=dr(o[r],i,r);return it(a)?a(s,r):s}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var n=this.state,o=n.slideMoveStartX,a=n.startX,i=n.endX,s=this.props,l=s.x,c=s.width,d=s.travellerWidth,f=s.startIndex,m=s.endIndex,p=s.onChange,h=r.pageX-o;h>0?h=Math.min(h,l+c-d-i,l+c-d-a):h<0&&(h=Math.max(h,l-a,l-i));var b=this.getIndex({startX:a+h,endX:i+h});(b.startIndex!==f||b.endIndex!==m)&&p&&p(b),this.setState({startX:a+h,endX:i+h,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,n){var o=s1(n)?n.changedTouches[0]:n;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var n=this.state,o=n.brushMoveStartX,a=n.movingTravellerId,i=n.endX,s=n.startX,l=this.state[a],c=this.props,d=c.x,f=c.width,m=c.travellerWidth,p=c.onChange,h=c.gap,b=c.data,v={startX:this.state.startX,endX:this.state.endX},x=r.pageX-o;x>0?x=Math.min(x,d+f-m-l):x<0&&(x=Math.max(x,d-l)),v[a]=l+x;var k=this.getIndex(v),S=k.startIndex,j=k.endIndex,O=function(){var C=b.length-1;return a==="startX"&&(i>s?S%h===0:j%h===0)||i<s&&j===C||a==="endX"&&(i>s?j%h===0:S%h===0)||i>s&&j===C};this.setState(yn(yn({},a,l+x),"brushMoveStartX",r.pageX),function(){p&&O()&&p(k)})}},{key:"handleTravellerMoveKeyboard",value:function(r,n){var o=this,a=this.state,i=a.scaleValues,s=a.startX,l=a.endX,c=this.state[n],d=i.indexOf(c);if(d!==-1){var f=d+r;if(!(f===-1||f>=i.length)){var m=i[f];n==="startX"&&m>=l||n==="endX"&&m<=s||this.setState(yn({},n,m),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,n=r.x,o=r.y,a=r.width,i=r.height,s=r.fill,l=r.stroke;return y.createElement("rect",{stroke:l,fill:s,x:n,y:o,width:a,height:i})}},{key:"renderPanorama",value:function(){var r=this.props,n=r.x,o=r.y,a=r.width,i=r.height,s=r.data,l=r.children,c=r.padding,d=g.Children.only(l);return d?y.cloneElement(d,{x:n,y:o,width:a,height:i,margin:c,compact:!0,data:s}):null}},{key:"renderTravellerLayer",value:function(r,n){var o,a,i=this,s=this.props,l=s.y,c=s.travellerWidth,d=s.height,f=s.traveller,m=s.ariaLabel,p=s.data,h=s.startIndex,b=s.endIndex,v=Math.max(r,this.props.x),x=kx(kx({},Xe(this.props,!1)),{},{x:v,y:l,width:c,height:d}),k=m||"Min value: ".concat((o=p[h])===null||o===void 0?void 0:o.name,", Max value: ").concat((a=p[b])===null||a===void 0?void 0:a.name);return y.createElement(jt,{tabIndex:0,role:"slider","aria-label":k,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[n],onTouchStart:this.travellerDragStartHandlers[n],onKeyDown:function(S){["ArrowLeft","ArrowRight"].includes(S.key)&&(S.preventDefault(),S.stopPropagation(),i.handleTravellerMoveKeyboard(S.key==="ArrowRight"?1:-1,n))},onFocus:function(){i.setState({isTravellerFocused:!0})},onBlur:function(){i.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(f,x))}},{key:"renderSlide",value:function(r,n){var o=this.props,a=o.y,i=o.height,s=o.stroke,l=o.travellerWidth,c=Math.min(r,n)+l,d=Math.max(Math.abs(n-r)-l,0);return y.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:s,fillOpacity:.2,x:c,y:a,width:d,height:i})}},{key:"renderText",value:function(){var r=this.props,n=r.startIndex,o=r.endIndex,a=r.y,i=r.height,s=r.travellerWidth,l=r.stroke,c=this.state,d=c.startX,f=c.endX,m=5,p={pointerEvents:"none",fill:l};return y.createElement(jt,{className:"recharts-brush-texts"},y.createElement(ds,qp({textAnchor:"end",verticalAnchor:"middle",x:Math.min(d,f)-m,y:a+i/2},p),this.getTextOfTick(n)),y.createElement(ds,qp({textAnchor:"start",verticalAnchor:"middle",x:Math.max(d,f)+s+m,y:a+i/2},p),this.getTextOfTick(o)))}},{key:"render",value:function(){var r=this.props,n=r.data,o=r.className,a=r.children,i=r.x,s=r.y,l=r.width,c=r.height,d=r.alwaysShowText,f=this.state,m=f.startX,p=f.endX,h=f.isTextActive,b=f.isSlideMoving,v=f.isTravellerMoving,x=f.isTravellerFocused;if(!n||!n.length||!Re(i)||!Re(s)||!Re(l)||!Re(c)||l<=0||c<=0)return null;var k=wt("recharts-brush",o),S=y.Children.count(a)===1,j=lre("userSelect","none");return y.createElement(jt,{className:k,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:j},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(m,p),this.renderTravellerLayer(m,"startX"),this.renderTravellerLayer(p,"endX"),(h||b||v||x||d)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var n=r.x,o=r.y,a=r.width,i=r.height,s=r.stroke,l=Math.floor(o+i/2)-1;return y.createElement(y.Fragment,null,y.createElement("rect",{x:n,y:o,width:a,height:i,fill:s,stroke:"none"}),y.createElement("line",{x1:n+1,y1:l,x2:n+a-1,y2:l,fill:"none",stroke:"#fff"}),y.createElement("line",{x1:n+1,y1:l+2,x2:n+a-1,y2:l+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,n){var o;return y.isValidElement(r)?o=y.cloneElement(r,n):it(r)?o=r(n):o=t.renderDefaultTraveller(n),o}},{key:"getDerivedStateFromProps",value:function(r,n){var o=r.data,a=r.width,i=r.x,s=r.travellerWidth,l=r.updateId,c=r.startIndex,d=r.endIndex;if(o!==n.prevData||l!==n.prevUpdateId)return kx({prevData:o,prevTravellerWidth:s,prevUpdateId:l,prevX:i,prevWidth:a},o&&o.length?gre({data:o,width:a,x:i,travellerWidth:s,startIndex:c,endIndex:d}):{scale:null,scaleValues:null});if(n.scale&&(a!==n.prevWidth||i!==n.prevX||s!==n.prevTravellerWidth)){n.scale.range([i,i+a-s]);var f=n.scale.domain().map(function(m){return n.scale(m)});return{prevData:o,prevTravellerWidth:s,prevUpdateId:l,prevX:i,prevWidth:a,startX:n.scale(r.startIndex),endX:n.scale(r.endIndex),scaleValues:f}}return null}},{key:"getIndexInRange",value:function(r,n){for(var o=r.length,a=0,i=o-1;i-a>1;){var s=Math.floor((a+i)/2);r[s]>n?i=s:a=s}return n>=r[i]?i:a}}])}(g.PureComponent);yn(Al,"displayName","Brush");yn(Al,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var jx,l1;function bre(){if(l1)return jx;l1=1;var e=E2();function t(r,n){var o;return e(r,function(a,i,s){return o=n(a,i,s),!o}),!!o}return jx=t,jx}var Ex,u1;function vre(){if(u1)return Ex;u1=1;var e=s7(),t=$o(),r=bre(),n=gn(),o=Ym();function a(i,s,l){var c=n(i)?e:r;return l&&o(i,s,l)&&(s=void 0),c(i,t(s,3))}return Ex=a,Ex}var yre=vre();const xre=qt(yre);var So=function(e,t){var r=e.alwaysShow,n=e.ifOverflow;return r&&(n="extendDomain"),n===t},Sx,c1;function wre(){if(c1)return Sx;c1=1;var e=S7();function t(r,n,o){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:o,writable:!0}):r[n]=o}return Sx=t,Sx}var Nx,d1;function kre(){if(d1)return Nx;d1=1;var e=wre(),t=j7(),r=$o();function n(o,a){var i={};return a=r(a,3),t(o,function(s,l,c){e(i,l,a(s,l,c))}),i}return Nx=n,Nx}var jre=kre();const Ere=qt(jre);var Ox,f1;function Sre(){if(f1)return Ox;f1=1;function e(t,r){for(var n=-1,o=t==null?0:t.length;++n<o;)if(!r(t[n],n,t))return!1;return!0}return Ox=e,Ox}var Cx,p1;function Nre(){if(p1)return Cx;p1=1;var e=E2();function t(r,n){var o=!0;return e(r,function(a,i,s){return o=!!n(a,i,s),o}),o}return Cx=t,Cx}var Px,m1;function Ore(){if(m1)return Px;m1=1;var e=Sre(),t=Nre(),r=$o(),n=gn(),o=Ym();function a(i,s,l){var c=n(i)?e:t;return l&&o(i,s,l)&&(s=void 0),c(i,r(s,3))}return Px=a,Px}var Cre=Ore();const c_=qt(Cre);var Pre=["x","y"];function Yc(e){"@babel/helpers - typeof";return Yc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yc(e)}function Dw(){return Dw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Dw.apply(this,arguments)}function h1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Lu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?h1(Object(r),!0).forEach(function(n){Are(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Are(e,t,r){return t=Tre(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Tre(e){var t=Mre(e,"string");return Yc(t)=="symbol"?t:t+""}function Mre(e,t){if(Yc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Yc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _re(e,t){if(e==null)return{};var r=Ire(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ire(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Dre(e,t){var r=e.x,n=e.y,o=_re(e,Pre),a="".concat(r),i=parseInt(a,10),s="".concat(n),l=parseInt(s,10),c="".concat(t.height||o.height),d=parseInt(c,10),f="".concat(t.width||o.width),m=parseInt(f,10);return Lu(Lu(Lu(Lu(Lu({},t),o),i?{x:i}:{}),l?{y:l}:{}),{},{height:d,width:m,name:t.name,radius:t.radius})}function g1(e){return y.createElement(Bp,Dw({shapeType:"rectangle",propTransformer:Dre,activeClassName:"recharts-active-bar"},e))}var Lre=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,n){if(typeof e=="number")return e;var o=typeof r=="number";return o?e(r,n):(o||ps(),t)}},Rre=["value","background"],d_;function Tl(e){"@babel/helpers - typeof";return Tl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tl(e)}function Fre(e,t){if(e==null)return{};var r=$re(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function $re(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Up(){return Up=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Up.apply(this,arguments)}function b1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function jr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?b1(Object(r),!0).forEach(function(n){Ka(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Bre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,p_(n.key),n)}}function zre(e,t,r){return t&&v1(e.prototype,t),r&&v1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Hre(e,t,r){return t=Kp(t),qre(e,f_()?Reflect.construct(t,r||[],Kp(e).constructor):t.apply(e,r))}function qre(e,t){if(t&&(Tl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Wre(e)}function Wre(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(f_=function(){return!!e})()}function Kp(e){return Kp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Kp(e)}function Ure(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Lw(e,t)}function Lw(e,t){return Lw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Lw(e,t)}function Ka(e,t,r){return t=p_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p_(e){var t=Kre(e,"string");return Tl(t)=="symbol"?t:t+""}function Kre(e,t){if(Tl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Tl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ki=function(e){function t(){var r;Bre(this,t);for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return r=Hre(this,t,[].concat(o)),Ka(r,"state",{isAnimationFinished:!1}),Ka(r,"id",bi("recharts-bar-")),Ka(r,"handleAnimationEnd",function(){var i=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),i&&i()}),Ka(r,"handleAnimationStart",function(){var i=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),i&&i()}),r}return Ure(t,e),zre(t,[{key:"renderRectanglesStatically",value:function(r){var n=this,o=this.props,a=o.shape,i=o.dataKey,s=o.activeIndex,l=o.activeBar,c=Xe(this.props,!1);return r&&r.map(function(d,f){var m=f===s,p=m?l:a,h=jr(jr(jr({},c),d),{},{isActive:m,option:p,index:f,dataKey:i,onAnimationStart:n.handleAnimationStart,onAnimationEnd:n.handleAnimationEnd});return y.createElement(jt,Up({className:"recharts-bar-rectangle"},si(n.props,d,f),{key:"rectangle-".concat(d?.x,"-").concat(d?.y,"-").concat(d?.value,"-").concat(f)}),y.createElement(g1,h))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,n=this.props,o=n.data,a=n.layout,i=n.isAnimationActive,s=n.animationBegin,l=n.animationDuration,c=n.animationEasing,d=n.animationId,f=this.state.prevData;return y.createElement(Rn,{begin:s,duration:l,isActive:i,easing:c,from:{t:0},to:{t:1},key:"bar-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(m){var p=m.t,h=o.map(function(b,v){var x=f&&f[v];if(x){var k=gr(x.x,b.x),S=gr(x.y,b.y),j=gr(x.width,b.width),O=gr(x.height,b.height);return jr(jr({},b),{},{x:k(p),y:S(p),width:j(p),height:O(p)})}if(a==="horizontal"){var C=gr(0,b.height),N=C(p);return jr(jr({},b),{},{y:b.y+b.height-N,height:N})}var T=gr(0,b.width),M=T(p);return jr(jr({},b),{},{width:M})});return y.createElement(jt,null,r.renderRectanglesStatically(h))})}},{key:"renderRectangles",value:function(){var r=this.props,n=r.data,o=r.isAnimationActive,a=this.state.prevData;return o&&n&&n.length&&(!a||!li(a,n))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(n)}},{key:"renderBackground",value:function(){var r=this,n=this.props,o=n.data,a=n.dataKey,i=n.activeIndex,s=Xe(this.props.background,!1);return o.map(function(l,c){l.value;var d=l.background,f=Fre(l,Rre);if(!d)return null;var m=jr(jr(jr(jr(jr({},f),{},{fill:"#eee"},d),s),si(r.props,l,c)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:a,index:c,className:"recharts-bar-background-rectangle"});return y.createElement(g1,Up({key:"background-bar-".concat(c),option:r.props.background,isActive:c===i},m))})}},{key:"renderErrorBar",value:function(r,n){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,a=o.data,i=o.xAxis,s=o.yAxis,l=o.layout,c=o.children,d=on(c,ru);if(!d)return null;var f=l==="vertical"?a[0].height/2:a[0].width/2,m=function(h,b){var v=Array.isArray(h.value)?h.value[1]:h.value;return{x:h.x,y:h.y,value:v,errorVal:dr(h,b)}},p={clipPath:r?"url(#clipPath-".concat(n,")"):null};return y.createElement(jt,p,d.map(function(h){return y.cloneElement(h,{key:"error-bar-".concat(n,"-").concat(h.props.dataKey),data:a,xAxis:i,yAxis:s,layout:l,offset:f,dataPointFormatter:m})}))}},{key:"render",value:function(){var r=this.props,n=r.hide,o=r.data,a=r.className,i=r.xAxis,s=r.yAxis,l=r.left,c=r.top,d=r.width,f=r.height,m=r.isAnimationActive,p=r.background,h=r.id;if(n||!o||!o.length)return null;var b=this.state.isAnimationFinished,v=wt("recharts-bar",a),x=i&&i.allowDataOverflow,k=s&&s.allowDataOverflow,S=x||k,j=st(h)?this.id:h;return y.createElement(jt,{className:v},x||k?y.createElement("defs",null,y.createElement("clipPath",{id:"clipPath-".concat(j)},y.createElement("rect",{x:x?l:l-d/2,y:k?c:c-f/2,width:x?d:d*2,height:k?f:f*2}))):null,y.createElement(jt,{className:"recharts-bar-rectangles",clipPath:S?"url(#clipPath-".concat(j,")"):null},p?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(S,j),(!m||b)&&Zn.renderCallByParent(this.props,o))}}],[{key:"getDerivedStateFromProps",value:function(r,n){return r.animationId!==n.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:n.curData}:r.data!==n.curData?{curData:r.data}:null}}])}(g.PureComponent);d_=ki;Ka(ki,"displayName","Bar");Ka(ki,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!ya.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Ka(ki,"getComposedData",function(e){var t=e.props,r=e.item,n=e.barPosition,o=e.bandSize,a=e.xAxis,i=e.yAxis,s=e.xAxisTicks,l=e.yAxisTicks,c=e.stackedData,d=e.dataStartIndex,f=e.displayedData,m=e.offset,p=xZ(n,r);if(!p)return null;var h=t.layout,b=r.type.defaultProps,v=b!==void 0?jr(jr({},b),r.props):r.props,x=v.dataKey,k=v.children,S=v.minPointSize,j=h==="horizontal"?i:a,O=c?j.scale.domain():null,C=OZ({numericAxis:j}),N=on(k,Xm),T=f.map(function(M,I){var _,R,L,F,B,U;c?_=wZ(c[d+I],O):(_=dr(M,x),Array.isArray(_)||(_=[C,_]));var $=Lre(S,d_.defaultProps.minPointSize)(_[1],I);if(h==="horizontal"){var z,W=[i.scale(_[0]),i.scale(_[1])],K=W[0],q=W[1];R=W3({axis:a,ticks:s,bandSize:o,offset:p.offset,entry:M,index:I}),L=(z=q??K)!==null&&z!==void 0?z:void 0,F=p.size;var J=K-q;if(B=Number.isNaN(J)?0:J,U={x:R,y:i.y,width:F,height:i.height},Math.abs($)>0&&Math.abs(B)<Math.abs($)){var V=en(B||$)*(Math.abs($)-Math.abs(B));L-=V,B+=V}}else{var me=[a.scale(_[0]),a.scale(_[1])],X=me[0],ce=me[1];if(R=X,L=W3({axis:i,ticks:l,bandSize:o,offset:p.offset,entry:M,index:I}),F=ce-X,B=p.size,U={x:a.x,y:L,width:a.width,height:B},Math.abs($)>0&&Math.abs(F)<Math.abs($)){var oe=en(F||$)*(Math.abs($)-Math.abs(F));F+=oe}}return jr(jr(jr({},M),{},{x:R,y:L,width:F,height:B,value:c?_:_[1],payload:M,background:U},N&&N[I]&&N[I].props),{},{tooltipPayload:[zM(r,M)],tooltipPosition:{x:R+F/2,y:L+B/2}})});return jr({data:T,layout:h},m)});function Xc(e){"@babel/helpers - typeof";return Xc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xc(e)}function Vre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,m_(n.key),n)}}function Gre(e,t,r){return t&&y1(e.prototype,t),r&&y1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function x1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Kn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?x1(Object(r),!0).forEach(function(n){ph(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ph(e,t,r){return t=m_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function m_(e){var t=Yre(e,"string");return Xc(t)=="symbol"?t:t+""}function Yre(e,t){if(Xc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Xc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var mh=function(e,t,r,n,o){var a=e.width,i=e.height,s=e.layout,l=e.children,c=Object.keys(t),d={left:r.left,leftMirror:r.left,right:a-r.right,rightMirror:a-r.right,top:r.top,topMirror:r.top,bottom:i-r.bottom,bottomMirror:i-r.bottom},f=!!xn(l,ki);return c.reduce(function(m,p){var h=t[p],b=h.orientation,v=h.domain,x=h.padding,k=x===void 0?{}:x,S=h.mirror,j=h.reversed,O="".concat(b).concat(S?"Mirror":""),C,N,T,M,I;if(h.type==="number"&&(h.padding==="gap"||h.padding==="no-gap")){var _=v[1]-v[0],R=1/0,L=h.categoricalDomain.sort();if(L.forEach(function(V,me){me>0&&(R=Math.min((V||0)-(L[me-1]||0),R))}),Number.isFinite(R)){var F=R/_,B=h.layout==="vertical"?r.height:r.width;if(h.padding==="gap"&&(C=F*B/2),h.padding==="no-gap"){var U=tn(e.barCategoryGap,F*B),$=F*B/2;C=$-U-($-U)/B*U}}}n==="xAxis"?N=[r.left+(k.left||0)+(C||0),r.left+r.width-(k.right||0)-(C||0)]:n==="yAxis"?N=s==="horizontal"?[r.top+r.height-(k.bottom||0),r.top+(k.top||0)]:[r.top+(k.top||0)+(C||0),r.top+r.height-(k.bottom||0)-(C||0)]:N=h.range,j&&(N=[N[1],N[0]]);var z=RM(h,o,f),W=z.scale,K=z.realScaleType;W.domain(v).range(N),FM(W);var q=$M(W,Kn(Kn({},h),{},{realScaleType:K}));n==="xAxis"?(I=b==="top"&&!S||b==="bottom"&&S,T=r.left,M=d[O]-I*h.height):n==="yAxis"&&(I=b==="left"&&!S||b==="right"&&S,T=d[O]-I*h.width,M=r.top);var J=Kn(Kn(Kn({},h),q),{},{realScaleType:K,x:T,y:M,scale:W,width:n==="xAxis"?r.width:h.width,height:n==="yAxis"?r.height:h.height});return J.bandSize=Pp(J,q),!h.hide&&n==="xAxis"?d[O]+=(I?-1:1)*J.height:h.hide||(d[O]+=(I?-1:1)*J.width),Kn(Kn({},m),{},ph({},p,J))},{})},h_=function(e,t){var r=e.x,n=e.y,o=t.x,a=t.y;return{x:Math.min(r,o),y:Math.min(n,a),width:Math.abs(o-r),height:Math.abs(a-n)}},Xre=function(e){var t=e.x1,r=e.y1,n=e.x2,o=e.y2;return h_({x:t,y:r},{x:n,y:o})},g_=function(){function e(t){Vre(this,e),this.scale=t}return Gre(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=r.bandAware,o=r.position;if(t!==void 0){if(o)switch(o){case"start":return this.scale(t);case"middle":{var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+a}case"end":{var i=this.bandwidth?this.bandwidth():0;return this.scale(t)+i}default:return this.scale(t)}if(n){var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+s}return this.scale(t)}}},{key:"isInRange",value:function(t){var r=this.range(),n=r[0],o=r[r.length-1];return n<=o?t>=n&&t<=o:t>=o&&t<=n}}],[{key:"create",value:function(t){return new e(t)}}])}();ph(g_,"EPS",1e-4);var ej=function(e){var t=Object.keys(e).reduce(function(r,n){return Kn(Kn({},r),{},ph({},n,g_.create(e[n])))},{});return Kn(Kn({},t),{},{apply:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=n.bandAware,a=n.position;return Ere(r,function(i,s){return t[s].apply(i,{bandAware:o,position:a})})},isInRange:function(r){return c_(r,function(n,o){return t[o].isInRange(n)})}})};function Zre(e){return(e%180+180)%180}var Jre=function(e){var t=e.width,r=e.height,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=Zre(n),a=o*Math.PI/180,i=Math.atan(r/t),s=a>i&&a<Math.PI-i?r/Math.sin(a):t/Math.cos(a);return Math.abs(s)},Ax,w1;function Qre(){if(w1)return Ax;w1=1;var e=$o(),t=bd(),r=Vm();function n(o){return function(a,i,s){var l=Object(a);if(!t(a)){var c=e(i,3);a=r(a),i=function(f){return c(l[f],f,l)}}var d=o(a,i,s);return d>-1?l[c?a[d]:d]:void 0}}return Ax=n,Ax}var Tx,k1;function ene(){if(k1)return Tx;k1=1;var e=i_();function t(r){var n=e(r),o=n%1;return n===n?o?n-o:n:0}return Tx=t,Tx}var Mx,j1;function tne(){if(j1)return Mx;j1=1;var e=v7(),t=$o(),r=ene(),n=Math.max;function o(a,i,s){var l=a==null?0:a.length;if(!l)return-1;var c=s==null?0:r(s);return c<0&&(c=n(l+c,0)),e(a,t(i,3),c)}return Mx=o,Mx}var _x,E1;function rne(){if(E1)return _x;E1=1;var e=Qre(),t=tne(),r=e(t);return _x=r,_x}var nne=rne();const one=qt(nne);var ane=_6();const ine=qt(ane);var sne=ine(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),tj=g.createContext(void 0),rj=g.createContext(void 0),b_=g.createContext(void 0),v_=g.createContext({}),y_=g.createContext(void 0),x_=g.createContext(0),w_=g.createContext(0),S1=function(e){var t=e.state,r=t.xAxisMap,n=t.yAxisMap,o=t.offset,a=e.clipPathId,i=e.children,s=e.width,l=e.height,c=sne(o);return y.createElement(tj.Provider,{value:r},y.createElement(rj.Provider,{value:n},y.createElement(v_.Provider,{value:o},y.createElement(b_.Provider,{value:c},y.createElement(y_.Provider,{value:a},y.createElement(x_.Provider,{value:l},y.createElement(w_.Provider,{value:s},i)))))))},lne=function(){return g.useContext(y_)},k_=function(e){var t=g.useContext(tj);t==null&&ps();var r=t[e];return r==null&&ps(),r},une=function(){var e=g.useContext(tj);return Ha(e)},cne=function(){var e=g.useContext(rj),t=one(e,function(r){return c_(r.domain,Number.isFinite)});return t||Ha(e)},j_=function(e){var t=g.useContext(rj);t==null&&ps();var r=t[e];return r==null&&ps(),r},dne=function(){var e=g.useContext(b_);return e},fne=function(){return g.useContext(v_)},nj=function(){return g.useContext(w_)},oj=function(){return g.useContext(x_)};function Ml(e){"@babel/helpers - typeof";return Ml=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ml(e)}function pne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mne(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,S_(n.key),n)}}function hne(e,t,r){return t&&mne(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function gne(e,t,r){return t=Vp(t),bne(e,E_()?Reflect.construct(t,r||[],Vp(e).constructor):t.apply(e,r))}function bne(e,t){if(t&&(Ml(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vne(e)}function vne(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(E_=function(){return!!e})()}function Vp(e){return Vp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Vp(e)}function yne(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Rw(e,t)}function Rw(e,t){return Rw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Rw(e,t)}function N1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function O1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?N1(Object(r),!0).forEach(function(n){aj(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function aj(e,t,r){return t=S_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function S_(e){var t=xne(e,"string");return Ml(t)=="symbol"?t:t+""}function xne(e,t){if(Ml(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ml(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function wne(e,t){return Sne(e)||Ene(e,t)||jne(e,t)||kne()}function kne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
116
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jne(e,t){if(e){if(typeof e=="string")return C1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return C1(e,t)}}function C1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ene(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,a,i,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(d){c=!0,o=d}finally{try{if(!l&&r.return!=null&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}function Sne(e){if(Array.isArray(e))return e}function Fw(){return Fw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Fw.apply(this,arguments)}var Nne=function(e,t){var r;return y.isValidElement(e)?r=y.cloneElement(e,t):it(e)?r=e(t):r=y.createElement("line",Fw({},t,{className:"recharts-reference-line-line"})),r},One=function(e,t,r,n,o,a,i,s,l){var c=o.x,d=o.y,f=o.width,m=o.height;if(r){var p=l.y,h=e.y.apply(p,{position:a});if(So(l,"discard")&&!e.y.isInRange(h))return null;var b=[{x:c+f,y:h},{x:c,y:h}];return s==="left"?b.reverse():b}if(t){var v=l.x,x=e.x.apply(v,{position:a});if(So(l,"discard")&&!e.x.isInRange(x))return null;var k=[{x,y:d+m},{x,y:d}];return i==="top"?k.reverse():k}if(n){var S=l.segment,j=S.map(function(O){return e.apply(O,{position:a})});return So(l,"discard")&&xre(j,function(O){return!e.isInRange(O)})?null:j}return null};function Cne(e){var t=e.x,r=e.y,n=e.segment,o=e.xAxisId,a=e.yAxisId,i=e.shape,s=e.className,l=e.alwaysShow,c=lne(),d=k_(o),f=j_(a),m=dne();if(!c||!m)return null;Xn(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=ej({x:d.scale,y:f.scale}),h=Mr(t),b=Mr(r),v=n&&n.length===2,x=One(p,h,b,v,m,e.position,d.orientation,f.orientation,e);if(!x)return null;var k=wne(x,2),S=k[0],j=S.x,O=S.y,C=k[1],N=C.x,T=C.y,M=So(e,"hidden")?"url(#".concat(c,")"):void 0,I=O1(O1({clipPath:M},Xe(e,!0)),{},{x1:j,y1:O,x2:N,y2:T});return y.createElement(jt,{className:wt("recharts-reference-line",s)},Nne(i,I),Jt.renderCallByParent(e,Xre({x1:j,y1:O,x2:N,y2:T})))}var ij=function(e){function t(){return pne(this,t),gne(this,t,arguments)}return yne(t,e),hne(t,[{key:"render",value:function(){return y.createElement(Cne,this.props)}}])}(y.Component);aj(ij,"displayName","ReferenceLine");aj(ij,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function $w(){return $w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$w.apply(this,arguments)}function _l(e){"@babel/helpers - typeof";return _l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_l(e)}function P1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function A1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?P1(Object(r),!0).forEach(function(n){hh(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):P1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Pne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ane(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,O_(n.key),n)}}function Tne(e,t,r){return t&&Ane(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Mne(e,t,r){return t=Gp(t),_ne(e,N_()?Reflect.construct(t,r||[],Gp(e).constructor):t.apply(e,r))}function _ne(e,t){if(t&&(_l(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ine(e)}function Ine(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function N_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(N_=function(){return!!e})()}function Gp(e){return Gp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Gp(e)}function Dne(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bw(e,t)}function Bw(e,t){return Bw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Bw(e,t)}function hh(e,t,r){return t=O_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function O_(e){var t=Lne(e,"string");return _l(t)=="symbol"?t:t+""}function Lne(e,t){if(_l(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(_l(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Rne=function(e){var t=e.x,r=e.y,n=e.xAxis,o=e.yAxis,a=ej({x:n.scale,y:o.scale}),i=a.apply({x:t,y:r},{bandAware:!0});return So(e,"discard")&&!a.isInRange(i)?null:i},gh=function(e){function t(){return Pne(this,t),Mne(this,t,arguments)}return Dne(t,e),Tne(t,[{key:"render",value:function(){var r=this.props,n=r.x,o=r.y,a=r.r,i=r.alwaysShow,s=r.clipPathId,l=Mr(n),c=Mr(o);if(Xn(i===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!l||!c)return null;var d=Rne(this.props);if(!d)return null;var f=d.x,m=d.y,p=this.props,h=p.shape,b=p.className,v=So(this.props,"hidden")?"url(#".concat(s,")"):void 0,x=A1(A1({clipPath:v},Xe(this.props,!0)),{},{cx:f,cy:m});return y.createElement(jt,{className:wt("recharts-reference-dot",b)},t.renderDot(h,x),Jt.renderCallByParent(this.props,{x:f-a,y:m-a,width:2*a,height:2*a}))}}])}(y.Component);hh(gh,"displayName","ReferenceDot");hh(gh,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});hh(gh,"renderDot",function(e,t){var r;return y.isValidElement(e)?r=y.cloneElement(e,t):it(e)?r=e(t):r=y.createElement(To,$w({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),r});function zw(){return zw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zw.apply(this,arguments)}function Il(e){"@babel/helpers - typeof";return Il=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Il(e)}function T1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function M1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?T1(Object(r),!0).forEach(function(n){bh(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Fne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $ne(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,P_(n.key),n)}}function Bne(e,t,r){return t&&$ne(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function zne(e,t,r){return t=Yp(t),Hne(e,C_()?Reflect.construct(t,r||[],Yp(e).constructor):t.apply(e,r))}function Hne(e,t){if(t&&(Il(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qne(e)}function qne(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function C_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(C_=function(){return!!e})()}function Yp(e){return Yp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Yp(e)}function Wne(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hw(e,t)}function Hw(e,t){return Hw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Hw(e,t)}function bh(e,t,r){return t=P_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function P_(e){var t=Une(e,"string");return Il(t)=="symbol"?t:t+""}function Une(e,t){if(Il(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Il(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Kne=function(e,t,r,n,o){var a=o.x1,i=o.x2,s=o.y1,l=o.y2,c=o.xAxis,d=o.yAxis;if(!c||!d)return null;var f=ej({x:c.scale,y:d.scale}),m={x:e?f.x.apply(a,{position:"start"}):f.x.rangeMin,y:r?f.y.apply(s,{position:"start"}):f.y.rangeMin},p={x:t?f.x.apply(i,{position:"end"}):f.x.rangeMax,y:n?f.y.apply(l,{position:"end"}):f.y.rangeMax};return So(o,"discard")&&(!f.isInRange(m)||!f.isInRange(p))?null:h_(m,p)},vh=function(e){function t(){return Fne(this,t),zne(this,t,arguments)}return Wne(t,e),Bne(t,[{key:"render",value:function(){var r=this.props,n=r.x1,o=r.x2,a=r.y1,i=r.y2,s=r.className,l=r.alwaysShow,c=r.clipPathId;Xn(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var d=Mr(n),f=Mr(o),m=Mr(a),p=Mr(i),h=this.props.shape;if(!d&&!f&&!m&&!p&&!h)return null;var b=Kne(d,f,m,p,this.props);if(!b&&!h)return null;var v=So(this.props,"hidden")?"url(#".concat(c,")"):void 0;return y.createElement(jt,{className:wt("recharts-reference-area",s)},t.renderRect(h,M1(M1({clipPath:v},Xe(this.props,!0)),b)),Jt.renderCallByParent(this.props,b))}}])}(y.Component);bh(vh,"displayName","ReferenceArea");bh(vh,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});bh(vh,"renderRect",function(e,t){var r;return y.isValidElement(e)?r=y.cloneElement(e,t):it(e)?r=e(t):r=y.createElement(Q2,zw({},t,{className:"recharts-reference-area-rect"})),r});function A_(e,t,r){if(t<1)return[];if(t===1&&r===void 0)return e;for(var n=[],o=0;o<e.length;o+=t)n.push(e[o]);return n}function Vne(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return Jre(n,r)}function Gne(e,t,r){var n=r==="width",o=e.x,a=e.y,i=e.width,s=e.height;return t===1?{start:n?o:a,end:n?o+i:a+s}:{start:n?o+i:a+s,end:n?o:a}}function Xp(e,t,r,n,o){if(e*t<e*n||e*t>e*o)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-o)<=0}function Yne(e,t){return A_(e,t+1)}function Xne(e,t,r,n,o){for(var a=(n||[]).slice(),i=t.start,s=t.end,l=0,c=1,d=i,f=function(){var p=n?.[l];if(p===void 0)return{v:A_(n,c)};var h=l,b,v=function(){return b===void 0&&(b=r(p,h)),b},x=p.coordinate,k=l===0||Xp(e,x,v,d,s);k||(l=0,d=i,c+=1),k&&(d=x+e*(v()/2+o),l+=c)},m;c<=a.length;)if(m=f(),m)return m.v;return[]}function Zc(e){"@babel/helpers - typeof";return Zc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zc(e)}function _1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ur(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_1(Object(r),!0).forEach(function(n){Zne(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Zne(e,t,r){return t=Jne(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Jne(e){var t=Qne(e,"string");return Zc(t)=="symbol"?t:t+""}function Qne(e,t){if(Zc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Zc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function eoe(e,t,r,n,o){for(var a=(n||[]).slice(),i=a.length,s=t.start,l=t.end,c=function(f){var m=a[f],p,h=function(){return p===void 0&&(p=r(m,f)),p};if(f===i-1){var b=e*(m.coordinate+e*h()/2-l);a[f]=m=Ur(Ur({},m),{},{tickCoord:b>0?m.coordinate-b*e:m.coordinate})}else a[f]=m=Ur(Ur({},m),{},{tickCoord:m.coordinate});var v=Xp(e,m.tickCoord,h,s,l);v&&(l=m.tickCoord-e*(h()/2+o),a[f]=Ur(Ur({},m),{},{isShow:!0}))},d=i-1;d>=0;d--)c(d);return a}function toe(e,t,r,n,o,a){var i=(n||[]).slice(),s=i.length,l=t.start,c=t.end;if(a){var d=n[s-1],f=r(d,s-1),m=e*(d.coordinate+e*f/2-c);i[s-1]=d=Ur(Ur({},d),{},{tickCoord:m>0?d.coordinate-m*e:d.coordinate});var p=Xp(e,d.tickCoord,function(){return f},l,c);p&&(c=d.tickCoord-e*(f/2+o),i[s-1]=Ur(Ur({},d),{},{isShow:!0}))}for(var h=a?s-1:s,b=function(x){var k=i[x],S,j=function(){return S===void 0&&(S=r(k,x)),S};if(x===0){var O=e*(k.coordinate-e*j()/2-l);i[x]=k=Ur(Ur({},k),{},{tickCoord:O<0?k.coordinate-O*e:k.coordinate})}else i[x]=k=Ur(Ur({},k),{},{tickCoord:k.coordinate});var C=Xp(e,k.tickCoord,j,l,c);C&&(l=k.tickCoord+e*(j()/2+o),i[x]=Ur(Ur({},k),{},{isShow:!0}))},v=0;v<h;v++)b(v);return i}function sj(e,t,r){var n=e.tick,o=e.ticks,a=e.viewBox,i=e.minTickGap,s=e.orientation,l=e.interval,c=e.tickFormatter,d=e.unit,f=e.angle;if(!o||!o.length||!n)return[];if(Re(l)||ya.isSsr)return Yne(o,typeof l=="number"&&Re(l)?l:0);var m=[],p=s==="top"||s==="bottom"?"width":"height",h=d&&p==="width"?ac(d,{fontSize:t,letterSpacing:r}):{width:0,height:0},b=function(k,S){var j=it(c)?c(k.value,S):k.value;return p==="width"?Vne(ac(j,{fontSize:t,letterSpacing:r}),h,f):ac(j,{fontSize:t,letterSpacing:r})[p]},v=o.length>=2?en(o[1].coordinate-o[0].coordinate):1,x=Gne(a,v,p);return l==="equidistantPreserveStart"?Xne(v,x,b,o,i):(l==="preserveStart"||l==="preserveStartEnd"?m=toe(v,x,b,o,i,l==="preserveStartEnd"):m=eoe(v,x,b,o,i),m.filter(function(k){return k.isShow}))}var roe=["viewBox"],noe=["viewBox"],ooe=["ticks"];function Dl(e){"@babel/helpers - typeof";return Dl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dl(e)}function Vs(){return Vs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vs.apply(this,arguments)}function I1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Zr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?I1(Object(r),!0).forEach(function(n){lj(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):I1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ix(e,t){if(e==null)return{};var r=aoe(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function aoe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function ioe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function D1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,M_(n.key),n)}}function soe(e,t,r){return t&&D1(e.prototype,t),r&&D1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function loe(e,t,r){return t=Zp(t),uoe(e,T_()?Reflect.construct(t,r||[],Zp(e).constructor):t.apply(e,r))}function uoe(e,t){if(t&&(Dl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return coe(e)}function coe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function T_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(T_=function(){return!!e})()}function Zp(e){return Zp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Zp(e)}function doe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qw(e,t)}function qw(e,t){return qw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},qw(e,t)}function lj(e,t,r){return t=M_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function M_(e){var t=foe(e,"string");return Dl(t)=="symbol"?t:t+""}function foe(e,t){if(Dl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Dl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var nu=function(e){function t(r){var n;return ioe(this,t),n=loe(this,t,[r]),n.state={fontSize:"",letterSpacing:""},n}return doe(t,e),soe(t,[{key:"shouldComponentUpdate",value:function(r,n){var o=r.viewBox,a=Ix(r,roe),i=this.props,s=i.viewBox,l=Ix(i,noe);return!Qs(o,s)||!Qs(a,l)||!Qs(n,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var n=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];n&&this.setState({fontSize:window.getComputedStyle(n).fontSize,letterSpacing:window.getComputedStyle(n).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var n=this.props,o=n.x,a=n.y,i=n.width,s=n.height,l=n.orientation,c=n.tickSize,d=n.mirror,f=n.tickMargin,m,p,h,b,v,x,k=d?-1:1,S=r.tickSize||c,j=Re(r.tickCoord)?r.tickCoord:r.coordinate;switch(l){case"top":m=p=r.coordinate,b=a+ +!d*s,h=b-k*S,x=h-k*f,v=j;break;case"left":h=b=r.coordinate,p=o+ +!d*i,m=p-k*S,v=m-k*f,x=j;break;case"right":h=b=r.coordinate,p=o+ +d*i,m=p+k*S,v=m+k*f,x=j;break;default:m=p=r.coordinate,b=a+ +d*s,h=b+k*S,x=h+k*f,v=j;break}return{line:{x1:m,y1:h,x2:p,y2:b},tick:{x:v,y:x}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,n=r.orientation,o=r.mirror,a;switch(n){case"left":a=o?"start":"end";break;case"right":a=o?"end":"start";break;default:a="middle";break}return a}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,n=r.orientation,o=r.mirror,a="end";switch(n){case"left":case"right":a="middle";break;case"top":a=o?"start":"end";break;default:a=o?"end":"start";break}return a}},{key:"renderAxisLine",value:function(){var r=this.props,n=r.x,o=r.y,a=r.width,i=r.height,s=r.orientation,l=r.mirror,c=r.axisLine,d=Zr(Zr(Zr({},Xe(this.props,!1)),Xe(c,!1)),{},{fill:"none"});if(s==="top"||s==="bottom"){var f=+(s==="top"&&!l||s==="bottom"&&l);d=Zr(Zr({},d),{},{x1:n,y1:o+f*i,x2:n+a,y2:o+f*i})}else{var m=+(s==="left"&&!l||s==="right"&&l);d=Zr(Zr({},d),{},{x1:n+m*a,y1:o,x2:n+m*a,y2:o+i})}return y.createElement("line",Vs({},d,{className:wt("recharts-cartesian-axis-line",Sn(c,"className"))}))}},{key:"renderTicks",value:function(r,n,o){var a=this,i=this.props,s=i.tickLine,l=i.stroke,c=i.tick,d=i.tickFormatter,f=i.unit,m=sj(Zr(Zr({},this.props),{},{ticks:r}),n,o),p=this.getTickTextAnchor(),h=this.getTickVerticalAnchor(),b=Xe(this.props,!1),v=Xe(c,!1),x=Zr(Zr({},b),{},{fill:"none"},Xe(s,!1)),k=m.map(function(S,j){var O=a.getTickLineCoord(S),C=O.line,N=O.tick,T=Zr(Zr(Zr(Zr({textAnchor:p,verticalAnchor:h},b),{},{stroke:"none",fill:l},v),N),{},{index:j,payload:S,visibleTicksCount:m.length,tickFormatter:d});return y.createElement(jt,Vs({className:"recharts-cartesian-axis-tick",key:"tick-".concat(S.value,"-").concat(S.coordinate,"-").concat(S.tickCoord)},si(a.props,S,j)),s&&y.createElement("line",Vs({},x,C,{className:wt("recharts-cartesian-axis-tick-line",Sn(s,"className"))})),c&&t.renderTickItem(c,T,"".concat(it(d)?d(S.value,j):S.value).concat(f||"")))});return y.createElement("g",{className:"recharts-cartesian-axis-ticks"},k)}},{key:"render",value:function(){var r=this,n=this.props,o=n.axisLine,a=n.width,i=n.height,s=n.ticksGenerator,l=n.className,c=n.hide;if(c)return null;var d=this.props,f=d.ticks,m=Ix(d,ooe),p=f;return it(s)&&(p=f&&f.length>0?s(this.props):s(m)),a<=0||i<=0||!p||!p.length?null:y.createElement(jt,{className:wt("recharts-cartesian-axis",l),ref:function(h){r.layerReference=h}},o&&this.renderAxisLine(),this.renderTicks(p,this.state.fontSize,this.state.letterSpacing),Jt.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,n,o){var a;return y.isValidElement(r)?a=y.cloneElement(r,n):it(r)?a=r(n):a=y.createElement(ds,Vs({},n,{className:"recharts-cartesian-axis-tick-value"}),o),a}}])}(g.Component);lj(nu,"displayName","CartesianAxis");lj(nu,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var poe=["x1","y1","x2","y2","key"],moe=["offset"];function ms(e){"@babel/helpers - typeof";return ms=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ms(e)}function L1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Kr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?L1(Object(r),!0).forEach(function(n){hoe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hoe(e,t,r){return t=goe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function goe(e){var t=boe(e,"string");return ms(t)=="symbol"?t:t+""}function boe(e,t){if(ms(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ms(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Yi(){return Yi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Yi.apply(this,arguments)}function R1(e,t){if(e==null)return{};var r=voe(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function voe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var yoe=function(e){var t=e.fill;if(!t||t==="none")return null;var r=e.fillOpacity,n=e.x,o=e.y,a=e.width,i=e.height,s=e.ry;return y.createElement("rect",{x:n,y:o,ry:s,width:a,height:i,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function __(e,t){var r;if(y.isValidElement(e))r=y.cloneElement(e,t);else if(it(e))r=e(t);else{var n=t.x1,o=t.y1,a=t.x2,i=t.y2,s=t.key,l=R1(t,poe),c=Xe(l,!1);c.offset;var d=R1(c,moe);r=y.createElement("line",Yi({},d,{x1:n,y1:o,x2:a,y2:i,fill:"none",key:s}))}return r}function xoe(e){var t=e.x,r=e.width,n=e.horizontal,o=n===void 0?!0:n,a=e.horizontalPoints;if(!o||!a||!a.length)return null;var i=a.map(function(s,l){var c=Kr(Kr({},e),{},{x1:t,y1:s,x2:t+r,y2:s,key:"line-".concat(l),index:l});return __(o,c)});return y.createElement("g",{className:"recharts-cartesian-grid-horizontal"},i)}function woe(e){var t=e.y,r=e.height,n=e.vertical,o=n===void 0?!0:n,a=e.verticalPoints;if(!o||!a||!a.length)return null;var i=a.map(function(s,l){var c=Kr(Kr({},e),{},{x1:s,y1:t,x2:s,y2:t+r,key:"line-".concat(l),index:l});return __(o,c)});return y.createElement("g",{className:"recharts-cartesian-grid-vertical"},i)}function koe(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,o=e.y,a=e.width,i=e.height,s=e.horizontalPoints,l=e.horizontal,c=l===void 0?!0:l;if(!c||!t||!t.length)return null;var d=s.map(function(m){return Math.round(m+o-o)}).sort(function(m,p){return m-p});o!==d[0]&&d.unshift(0);var f=d.map(function(m,p){var h=!d[p+1],b=h?o+i-m:d[p+1]-m;if(b<=0)return null;var v=p%t.length;return y.createElement("rect",{key:"react-".concat(p),y:m,x:n,height:b,width:a,stroke:"none",fill:t[v],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return y.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function joe(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,o=e.fillOpacity,a=e.x,i=e.y,s=e.width,l=e.height,c=e.verticalPoints;if(!r||!n||!n.length)return null;var d=c.map(function(m){return Math.round(m+a-a)}).sort(function(m,p){return m-p});a!==d[0]&&d.unshift(0);var f=d.map(function(m,p){var h=!d[p+1],b=h?a+s-m:d[p+1]-m;if(b<=0)return null;var v=p%n.length;return y.createElement("rect",{key:"react-".concat(p),x:m,y:i,width:b,height:l,stroke:"none",fill:n[v],fillOpacity:o,className:"recharts-cartesian-grid-bg"})});return y.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var Eoe=function(e,t){var r=e.xAxis,n=e.width,o=e.height,a=e.offset;return LM(sj(Kr(Kr(Kr({},nu.defaultProps),r),{},{ticks:oa(r,!0),viewBox:{x:0,y:0,width:n,height:o}})),a.left,a.left+a.width,t)},Soe=function(e,t){var r=e.yAxis,n=e.width,o=e.height,a=e.offset;return LM(sj(Kr(Kr(Kr({},nu.defaultProps),r),{},{ticks:oa(r,!0),viewBox:{x:0,y:0,width:n,height:o}})),a.top,a.top+a.height,t)},Fs={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function kd(e){var t,r,n,o,a,i,s=nj(),l=oj(),c=fne(),d=Kr(Kr({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Fs.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Fs.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Fs.horizontal,horizontalFill:(o=e.horizontalFill)!==null&&o!==void 0?o:Fs.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:Fs.vertical,verticalFill:(i=e.verticalFill)!==null&&i!==void 0?i:Fs.verticalFill,x:Re(e.x)?e.x:c.left,y:Re(e.y)?e.y:c.top,width:Re(e.width)?e.width:c.width,height:Re(e.height)?e.height:c.height}),f=d.x,m=d.y,p=d.width,h=d.height,b=d.syncWithTicks,v=d.horizontalValues,x=d.verticalValues,k=une(),S=cne();if(!Re(p)||p<=0||!Re(h)||h<=0||!Re(f)||f!==+f||!Re(m)||m!==+m)return null;var j=d.verticalCoordinatesGenerator||Eoe,O=d.horizontalCoordinatesGenerator||Soe,C=d.horizontalPoints,N=d.verticalPoints;if((!C||!C.length)&&it(O)){var T=v&&v.length,M=O({yAxis:S?Kr(Kr({},S),{},{ticks:T?v:S.ticks}):void 0,width:s,height:l,offset:c},T?!0:b);Xn(Array.isArray(M),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(ms(M),"]")),Array.isArray(M)&&(C=M)}if((!N||!N.length)&&it(j)){var I=x&&x.length,_=j({xAxis:k?Kr(Kr({},k),{},{ticks:I?x:k.ticks}):void 0,width:s,height:l,offset:c},I?!0:b);Xn(Array.isArray(_),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(ms(_),"]")),Array.isArray(_)&&(N=_)}return y.createElement("g",{className:"recharts-cartesian-grid"},y.createElement(yoe,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),y.createElement(xoe,Yi({},d,{offset:c,horizontalPoints:C,xAxis:k,yAxis:S})),y.createElement(woe,Yi({},d,{offset:c,verticalPoints:N,xAxis:k,yAxis:S})),y.createElement(koe,Yi({},d,{horizontalPoints:C})),y.createElement(joe,Yi({},d,{verticalPoints:N})))}kd.displayName="CartesianGrid";var Noe=["type","layout","connectNulls","ref"],Ooe=["key"];function Ll(e){"@babel/helpers - typeof";return Ll=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ll(e)}function F1(e,t){if(e==null)return{};var r=Coe(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Coe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function cc(){return cc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cc.apply(this,arguments)}function $1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function vn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$1(Object(r),!0).forEach(function(n){Vn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $s(e){return Moe(e)||Toe(e)||Aoe(e)||Poe()}function Poe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
117
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Aoe(e,t){if(e){if(typeof e=="string")return Ww(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ww(e,t)}}function Toe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Moe(e){if(Array.isArray(e))return Ww(e)}function Ww(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _oe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function B1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,D_(n.key),n)}}function Ioe(e,t,r){return t&&B1(e.prototype,t),r&&B1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Doe(e,t,r){return t=Jp(t),Loe(e,I_()?Reflect.construct(t,r||[],Jp(e).constructor):t.apply(e,r))}function Loe(e,t){if(t&&(Ll(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Roe(e)}function Roe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function I_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(I_=function(){return!!e})()}function Jp(e){return Jp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Jp(e)}function Foe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Uw(e,t)}function Uw(e,t){return Uw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Uw(e,t)}function Vn(e,t,r){return t=D_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function D_(e){var t=$oe(e,"string");return Ll(t)=="symbol"?t:t+""}function $oe(e,t){if(Ll(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ll(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ui=function(e){function t(){var r;_oe(this,t);for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return r=Doe(this,t,[].concat(o)),Vn(r,"state",{isAnimationFinished:!0,totalLength:0}),Vn(r,"generateSimpleStrokeDasharray",function(i,s){return"".concat(s,"px ").concat(i-s,"px")}),Vn(r,"getStrokeDasharray",function(i,s,l){var c=l.reduce(function(x,k){return x+k});if(!c)return r.generateSimpleStrokeDasharray(s,i);for(var d=Math.floor(i/c),f=i%c,m=s-i,p=[],h=0,b=0;h<l.length;b+=l[h],++h)if(b+l[h]>f){p=[].concat($s(l.slice(0,h)),[f-b]);break}var v=p.length%2===0?[0,m]:[m];return[].concat($s(t.repeat(l,d)),$s(p),v).map(function(x){return"".concat(x,"px")}).join(", ")}),Vn(r,"id",bi("recharts-line-")),Vn(r,"pathRef",function(i){r.mainCurve=i}),Vn(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Vn(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return Foe(t,e),Ioe(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,n){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,a=o.points,i=o.xAxis,s=o.yAxis,l=o.layout,c=o.children,d=on(c,ru);if(!d)return null;var f=function(p,h){return{x:p.x,y:p.y,value:p.value,errorVal:dr(p.payload,h)}},m={clipPath:r?"url(#clipPath-".concat(n,")"):null};return y.createElement(jt,m,d.map(function(p){return y.cloneElement(p,{key:"bar-".concat(p.props.dataKey),data:a,xAxis:i,yAxis:s,layout:l,dataPointFormatter:f})}))}},{key:"renderDots",value:function(r,n,o){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var i=this.props,s=i.dot,l=i.points,c=i.dataKey,d=Xe(this.props,!1),f=Xe(s,!0),m=l.map(function(h,b){var v=vn(vn(vn({key:"dot-".concat(b),r:3},d),f),{},{index:b,cx:h.x,cy:h.y,value:h.value,dataKey:c,payload:h.payload,points:l});return t.renderDotItem(s,v)}),p={clipPath:r?"url(#clipPath-".concat(n?"":"dots-").concat(o,")"):null};return y.createElement(jt,cc({className:"recharts-line-dots",key:"dots"},p),m)}},{key:"renderCurveStatically",value:function(r,n,o,a){var i=this.props,s=i.type,l=i.layout,c=i.connectNulls;i.ref;var d=F1(i,Noe),f=vn(vn(vn({},Xe(d,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:n?"url(#clipPath-".concat(o,")"):null,points:r},a),{},{type:s,layout:l,connectNulls:c});return y.createElement(ti,cc({},f,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,n){var o=this,a=this.props,i=a.points,s=a.strokeDasharray,l=a.isAnimationActive,c=a.animationBegin,d=a.animationDuration,f=a.animationEasing,m=a.animationId,p=a.animateNewValues,h=a.width,b=a.height,v=this.state,x=v.prevPoints,k=v.totalLength;return y.createElement(Rn,{begin:c,duration:d,isActive:l,easing:f,from:{t:0},to:{t:1},key:"line-".concat(m),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(S){var j=S.t;if(x){var O=x.length/i.length,C=i.map(function(_,R){var L=Math.floor(R*O);if(x[L]){var F=x[L],B=gr(F.x,_.x),U=gr(F.y,_.y);return vn(vn({},_),{},{x:B(j),y:U(j)})}if(p){var $=gr(h*2,_.x),z=gr(b/2,_.y);return vn(vn({},_),{},{x:$(j),y:z(j)})}return vn(vn({},_),{},{x:_.x,y:_.y})});return o.renderCurveStatically(C,r,n)}var N=gr(0,k),T=N(j),M;if(s){var I="".concat(s).split(/[,\s]+/gim).map(function(_){return parseFloat(_)});M=o.getStrokeDasharray(T,k,I)}else M=o.generateSimpleStrokeDasharray(k,T);return o.renderCurveStatically(i,r,n,{strokeDasharray:M})})}},{key:"renderCurve",value:function(r,n){var o=this.props,a=o.points,i=o.isAnimationActive,s=this.state,l=s.prevPoints,c=s.totalLength;return i&&a&&a.length&&(!l&&c>0||!li(l,a))?this.renderCurveWithAnimation(r,n):this.renderCurveStatically(a,r,n)}},{key:"render",value:function(){var r,n=this.props,o=n.hide,a=n.dot,i=n.points,s=n.className,l=n.xAxis,c=n.yAxis,d=n.top,f=n.left,m=n.width,p=n.height,h=n.isAnimationActive,b=n.id;if(o||!i||!i.length)return null;var v=this.state.isAnimationFinished,x=i.length===1,k=wt("recharts-line",s),S=l&&l.allowDataOverflow,j=c&&c.allowDataOverflow,O=S||j,C=st(b)?this.id:b,N=(r=Xe(a,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},T=N.r,M=T===void 0?3:T,I=N.strokeWidth,_=I===void 0?2:I,R=F6(a)?a:{},L=R.clipDot,F=L===void 0?!0:L,B=M*2+_;return y.createElement(jt,{className:k},S||j?y.createElement("defs",null,y.createElement("clipPath",{id:"clipPath-".concat(C)},y.createElement("rect",{x:S?f:f-m/2,y:j?d:d-p/2,width:S?m:m*2,height:j?p:p*2})),!F&&y.createElement("clipPath",{id:"clipPath-dots-".concat(C)},y.createElement("rect",{x:f-B/2,y:d-B/2,width:m+B,height:p+B}))):null,!x&&this.renderCurve(O,C),this.renderErrorBar(O,C),(x||a)&&this.renderDots(O,F,C),(!h||v)&&Zn.renderCallByParent(this.props,i))}}],[{key:"getDerivedStateFromProps",value:function(r,n){return r.animationId!==n.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:n.curPoints}:r.points!==n.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,n){for(var o=r.length%2!==0?[].concat($s(r),[0]):r,a=[],i=0;i<n;++i)a=[].concat($s(a),$s(o));return a}},{key:"renderDotItem",value:function(r,n){var o;if(y.isValidElement(r))o=y.cloneElement(r,n);else if(it(r))o=r(n);else{var a=n.key,i=F1(n,Ooe),s=wt("recharts-line-dot",typeof r!="boolean"?r.className:"");o=y.createElement(To,cc({key:a},i,{className:s}))}return o}}])}(g.PureComponent);Vn(ui,"displayName","Line");Vn(ui,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!ya.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Vn(ui,"getComposedData",function(e){var t=e.props,r=e.xAxis,n=e.yAxis,o=e.xAxisTicks,a=e.yAxisTicks,i=e.dataKey,s=e.bandSize,l=e.displayedData,c=e.offset,d=t.layout,f=l.map(function(m,p){var h=dr(m,i);return d==="horizontal"?{x:El({axis:r,ticks:o,bandSize:s,entry:m,index:p}),y:st(h)?null:n.scale(h),value:h,payload:m}:{x:st(h)?null:r.scale(h),y:El({axis:n,ticks:a,bandSize:s,entry:m,index:p}),value:h,payload:m}});return vn({points:f,layout:d},c)});var Boe=["layout","type","stroke","connectNulls","isRange","ref"],zoe=["key"],L_;function Rl(e){"@babel/helpers - typeof";return Rl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rl(e)}function R_(e,t){if(e==null)return{};var r=Hoe(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Hoe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Xi(){return Xi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xi.apply(this,arguments)}function z1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function $a(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?z1(Object(r),!0).forEach(function(n){vo(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):z1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qoe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function H1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,$_(n.key),n)}}function Woe(e,t,r){return t&&H1(e.prototype,t),r&&H1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Uoe(e,t,r){return t=Qp(t),Koe(e,F_()?Reflect.construct(t,r||[],Qp(e).constructor):t.apply(e,r))}function Koe(e,t){if(t&&(Rl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Voe(e)}function Voe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function F_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(F_=function(){return!!e})()}function Qp(e){return Qp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Qp(e)}function Goe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Kw(e,t)}function Kw(e,t){return Kw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Kw(e,t)}function vo(e,t,r){return t=$_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $_(e){var t=Yoe(e,"string");return Rl(t)=="symbol"?t:t+""}function Yoe(e,t){if(Rl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Rl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ka=function(e){function t(){var r;qoe(this,t);for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return r=Uoe(this,t,[].concat(o)),vo(r,"state",{isAnimationFinished:!0}),vo(r,"id",bi("recharts-area-")),vo(r,"handleAnimationEnd",function(){var i=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),it(i)&&i()}),vo(r,"handleAnimationStart",function(){var i=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),it(i)&&i()}),r}return Goe(t,e),Woe(t,[{key:"renderDots",value:function(r,n,o){var a=this.props.isAnimationActive,i=this.state.isAnimationFinished;if(a&&!i)return null;var s=this.props,l=s.dot,c=s.points,d=s.dataKey,f=Xe(this.props,!1),m=Xe(l,!0),p=c.map(function(b,v){var x=$a($a($a({key:"dot-".concat(v),r:3},f),m),{},{index:v,cx:b.x,cy:b.y,dataKey:d,value:b.value,payload:b.payload,points:c});return t.renderDotItem(l,x)}),h={clipPath:r?"url(#clipPath-".concat(n?"":"dots-").concat(o,")"):null};return y.createElement(jt,Xi({className:"recharts-area-dots"},h),p)}},{key:"renderHorizontalRect",value:function(r){var n=this.props,o=n.baseLine,a=n.points,i=n.strokeWidth,s=a[0].x,l=a[a.length-1].x,c=r*Math.abs(s-l),d=Ua(a.map(function(f){return f.y||0}));return Re(o)&&typeof o=="number"?d=Math.max(o,d):o&&Array.isArray(o)&&o.length&&(d=Math.max(Ua(o.map(function(f){return f.y||0})),d)),Re(d)?y.createElement("rect",{x:s<l?s:s-c,y:0,width:c,height:Math.floor(d+(i?parseInt("".concat(i),10):1))}):null}},{key:"renderVerticalRect",value:function(r){var n=this.props,o=n.baseLine,a=n.points,i=n.strokeWidth,s=a[0].y,l=a[a.length-1].y,c=r*Math.abs(s-l),d=Ua(a.map(function(f){return f.x||0}));return Re(o)&&typeof o=="number"?d=Math.max(o,d):o&&Array.isArray(o)&&o.length&&(d=Math.max(Ua(o.map(function(f){return f.x||0})),d)),Re(d)?y.createElement("rect",{x:0,y:s<l?s:s-c,width:d+(i?parseInt("".concat(i),10):1),height:Math.floor(c)}):null}},{key:"renderClipRect",value:function(r){var n=this.props.layout;return n==="vertical"?this.renderVerticalRect(r):this.renderHorizontalRect(r)}},{key:"renderAreaStatically",value:function(r,n,o,a){var i=this.props,s=i.layout,l=i.type,c=i.stroke,d=i.connectNulls,f=i.isRange;i.ref;var m=R_(i,Boe);return y.createElement(jt,{clipPath:o?"url(#clipPath-".concat(a,")"):null},y.createElement(ti,Xi({},Xe(m,!0),{points:r,connectNulls:d,type:l,baseLine:n,layout:s,stroke:"none",className:"recharts-area-area"})),c!=="none"&&y.createElement(ti,Xi({},Xe(this.props,!1),{className:"recharts-area-curve",layout:s,type:l,connectNulls:d,fill:"none",points:r})),c!=="none"&&f&&y.createElement(ti,Xi({},Xe(this.props,!1),{className:"recharts-area-curve",layout:s,type:l,connectNulls:d,fill:"none",points:n})))}},{key:"renderAreaWithAnimation",value:function(r,n){var o=this,a=this.props,i=a.points,s=a.baseLine,l=a.isAnimationActive,c=a.animationBegin,d=a.animationDuration,f=a.animationEasing,m=a.animationId,p=this.state,h=p.prevPoints,b=p.prevBaseLine;return y.createElement(Rn,{begin:c,duration:d,isActive:l,easing:f,from:{t:0},to:{t:1},key:"area-".concat(m),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(v){var x=v.t;if(h){var k=h.length/i.length,S=i.map(function(N,T){var M=Math.floor(T*k);if(h[M]){var I=h[M],_=gr(I.x,N.x),R=gr(I.y,N.y);return $a($a({},N),{},{x:_(x),y:R(x)})}return N}),j;if(Re(s)&&typeof s=="number"){var O=gr(b,s);j=O(x)}else if(st(s)||Zl(s)){var C=gr(b,0);j=C(x)}else j=s.map(function(N,T){var M=Math.floor(T*k);if(b[M]){var I=b[M],_=gr(I.x,N.x),R=gr(I.y,N.y);return $a($a({},N),{},{x:_(x),y:R(x)})}return N});return o.renderAreaStatically(S,j,r,n)}return y.createElement(jt,null,y.createElement("defs",null,y.createElement("clipPath",{id:"animationClipPath-".concat(n)},o.renderClipRect(x))),y.createElement(jt,{clipPath:"url(#animationClipPath-".concat(n,")")},o.renderAreaStatically(i,s,r,n)))})}},{key:"renderArea",value:function(r,n){var o=this.props,a=o.points,i=o.baseLine,s=o.isAnimationActive,l=this.state,c=l.prevPoints,d=l.prevBaseLine,f=l.totalLength;return s&&a&&a.length&&(!c&&f>0||!li(c,a)||!li(d,i))?this.renderAreaWithAnimation(r,n):this.renderAreaStatically(a,i,r,n)}},{key:"render",value:function(){var r,n=this.props,o=n.hide,a=n.dot,i=n.points,s=n.className,l=n.top,c=n.left,d=n.xAxis,f=n.yAxis,m=n.width,p=n.height,h=n.isAnimationActive,b=n.id;if(o||!i||!i.length)return null;var v=this.state.isAnimationFinished,x=i.length===1,k=wt("recharts-area",s),S=d&&d.allowDataOverflow,j=f&&f.allowDataOverflow,O=S||j,C=st(b)?this.id:b,N=(r=Xe(a,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},T=N.r,M=T===void 0?3:T,I=N.strokeWidth,_=I===void 0?2:I,R=F6(a)?a:{},L=R.clipDot,F=L===void 0?!0:L,B=M*2+_;return y.createElement(jt,{className:k},S||j?y.createElement("defs",null,y.createElement("clipPath",{id:"clipPath-".concat(C)},y.createElement("rect",{x:S?c:c-m/2,y:j?l:l-p/2,width:S?m:m*2,height:j?p:p*2})),!F&&y.createElement("clipPath",{id:"clipPath-dots-".concat(C)},y.createElement("rect",{x:c-B/2,y:l-B/2,width:m+B,height:p+B}))):null,x?null:this.renderArea(O,C),(a||x)&&this.renderDots(O,F,C),(!h||v)&&Zn.renderCallByParent(this.props,i))}}],[{key:"getDerivedStateFromProps",value:function(r,n){return r.animationId!==n.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,curBaseLine:r.baseLine,prevPoints:n.curPoints,prevBaseLine:n.curBaseLine}:r.points!==n.curPoints||r.baseLine!==n.curBaseLine?{curPoints:r.points,curBaseLine:r.baseLine}:null}}])}(g.PureComponent);L_=ka;vo(ka,"displayName","Area");vo(ka,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!ya.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});vo(ka,"getBaseValue",function(e,t,r,n){var o=e.layout,a=e.baseValue,i=t.props.baseValue,s=i??a;if(Re(s)&&typeof s=="number")return s;var l=o==="horizontal"?n:r,c=l.scale.domain();if(l.type==="number"){var d=Math.max(c[0],c[1]),f=Math.min(c[0],c[1]);return s==="dataMin"?f:s==="dataMax"||d<0?d:Math.max(Math.min(c[0],c[1]),0)}return s==="dataMin"?c[0]:s==="dataMax"?c[1]:c[0]});vo(ka,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,o=e.yAxis,a=e.xAxisTicks,i=e.yAxisTicks,s=e.bandSize,l=e.dataKey,c=e.stackedData,d=e.dataStartIndex,f=e.displayedData,m=e.offset,p=t.layout,h=c&&c.length,b=L_.getBaseValue(t,r,n,o),v=p==="horizontal",x=!1,k=f.map(function(j,O){var C;h?C=c[d+O]:(C=dr(j,l),Array.isArray(C)?x=!0:C=[b,C]);var N=C[1]==null||h&&dr(j,l)==null;return v?{x:El({axis:n,ticks:a,bandSize:s,entry:j,index:O}),y:N?null:o.scale(C[1]),value:C,payload:j}:{x:N?null:n.scale(C[1]),y:El({axis:o,ticks:i,bandSize:s,entry:j,index:O}),value:C,payload:j}}),S;return h||x?S=k.map(function(j){var O=Array.isArray(j.value)?j.value[0]:null;return v?{x:j.x,y:O!=null&&j.y!=null?o.scale(O):null}:{x:O!=null?n.scale(O):null,y:j.y}}):S=v?o.scale(b):n.scale(b),$a({points:k,baseLine:S,layout:p,isRange:x},m)});vo(ka,"renderDotItem",function(e,t){var r;if(y.isValidElement(e))r=y.cloneElement(e,t);else if(it(e))r=e(t);else{var n=wt("recharts-area-dot",typeof e!="boolean"?e.className:""),o=t.key,a=R_(t,zoe);r=y.createElement(To,Xi({},a,{key:o,className:n}))}return r});function Fl(e){"@babel/helpers - typeof";return Fl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fl(e)}function Xoe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zoe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,H_(n.key),n)}}function Joe(e,t,r){return t&&Zoe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Qoe(e,t,r){return t=em(t),eae(e,B_()?Reflect.construct(t,r||[],em(e).constructor):t.apply(e,r))}function eae(e,t){if(t&&(Fl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tae(e)}function tae(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function B_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(B_=function(){return!!e})()}function em(e){return em=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},em(e)}function rae(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vw(e,t)}function Vw(e,t){return Vw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Vw(e,t)}function z_(e,t,r){return t=H_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function H_(e){var t=nae(e,"string");return Fl(t)=="symbol"?t:t+""}function nae(e,t){if(Fl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Fl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var jd=function(e){function t(){return Xoe(this,t),Qoe(this,t,arguments)}return rae(t,e),Joe(t,[{key:"render",value:function(){return null}}])}(y.Component);z_(jd,"displayName","ZAxis");z_(jd,"defaultProps",{zAxisId:0,range:[64,64],scale:"auto",type:"number"});var oae=["option","isActive"];function dc(){return dc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dc.apply(this,arguments)}function aae(e,t){if(e==null)return{};var r=iae(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function iae(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function sae(e){var t=e.option,r=e.isActive,n=aae(e,oae);return typeof t=="string"?y.createElement(Bp,dc({option:y.createElement(Km,dc({type:t},n)),isActive:r,shapeType:"symbols"},n)):y.createElement(Bp,dc({option:t,isActive:r,shapeType:"symbols"},n))}function $l(e){"@babel/helpers - typeof";return $l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$l(e)}function fc(){return fc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fc.apply(this,arguments)}function q1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function _n(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?q1(Object(r),!0).forEach(function(n){Va(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function lae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function W1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,W_(n.key),n)}}function uae(e,t,r){return t&&W1(e.prototype,t),r&&W1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function cae(e,t,r){return t=tm(t),dae(e,q_()?Reflect.construct(t,r||[],tm(e).constructor):t.apply(e,r))}function dae(e,t){if(t&&($l(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fae(e)}function fae(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function q_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(q_=function(){return!!e})()}function tm(e){return tm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},tm(e)}function pae(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gw(e,t)}function Gw(e,t){return Gw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Gw(e,t)}function Va(e,t,r){return t=W_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function W_(e){var t=mae(e,"string");return $l(t)=="symbol"?t:t+""}function mae(e,t){if($l(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if($l(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Ed=function(e){function t(){var r;lae(this,t);for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return r=cae(this,t,[].concat(o)),Va(r,"state",{isAnimationFinished:!1}),Va(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0})}),Va(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1})}),Va(r,"id",bi("recharts-scatter-")),r}return pae(t,e),uae(t,[{key:"renderSymbolsStatically",value:function(r){var n=this,o=this.props,a=o.shape,i=o.activeShape,s=o.activeIndex,l=Xe(this.props,!1);return r.map(function(c,d){var f=s===d,m=f?i:a,p=_n(_n({},l),c);return y.createElement(jt,fc({className:"recharts-scatter-symbol",key:"symbol-".concat(c?.cx,"-").concat(c?.cy,"-").concat(c?.size,"-").concat(d)},si(n.props,c,d),{role:"img"}),y.createElement(sae,fc({option:m,isActive:f,key:"symbol-".concat(d)},p)))})}},{key:"renderSymbolsWithAnimation",value:function(){var r=this,n=this.props,o=n.points,a=n.isAnimationActive,i=n.animationBegin,s=n.animationDuration,l=n.animationEasing,c=n.animationId,d=this.state.prevPoints;return y.createElement(Rn,{begin:i,duration:s,isActive:a,easing:l,from:{t:0},to:{t:1},key:"pie-".concat(c),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(f){var m=f.t,p=o.map(function(h,b){var v=d&&d[b];if(v){var x=gr(v.cx,h.cx),k=gr(v.cy,h.cy),S=gr(v.size,h.size);return _n(_n({},h),{},{cx:x(m),cy:k(m),size:S(m)})}var j=gr(0,h.size);return _n(_n({},h),{},{size:j(m)})});return y.createElement(jt,null,r.renderSymbolsStatically(p))})}},{key:"renderSymbols",value:function(){var r=this.props,n=r.points,o=r.isAnimationActive,a=this.state.prevPoints;return o&&n&&n.length&&(!a||!li(a,n))?this.renderSymbolsWithAnimation():this.renderSymbolsStatically(n)}},{key:"renderErrorBar",value:function(){var r=this.props.isAnimationActive;if(r&&!this.state.isAnimationFinished)return null;var n=this.props,o=n.points,a=n.xAxis,i=n.yAxis,s=n.children,l=on(s,ru);return l?l.map(function(c,d){var f=c.props,m=f.direction,p=f.dataKey;return y.cloneElement(c,{key:"".concat(m,"-").concat(p,"-").concat(o[d]),data:o,xAxis:a,yAxis:i,layout:m==="x"?"vertical":"horizontal",dataPointFormatter:function(h,b){return{x:h.cx,y:h.cy,value:m==="x"?+h.node.x:+h.node.y,errorVal:dr(h,b)}}})}):null}},{key:"renderLine",value:function(){var r=this.props,n=r.points,o=r.line,a=r.lineType,i=r.lineJointType,s=Xe(this.props,!1),l=Xe(o,!1),c,d;if(a==="joint")c=n.map(function(k){return{x:k.cx,y:k.cy}});else if(a==="fitting"){var f=uq(n),m=f.xmin,p=f.xmax,h=f.a,b=f.b,v=function(k){return h*k+b};c=[{x:m,y:v(m)},{x:p,y:v(p)}]}var x=_n(_n(_n({},s),{},{fill:"none",stroke:s&&s.fill},l),{},{points:c});return y.isValidElement(o)?d=y.cloneElement(o,x):it(o)?d=o(x):d=y.createElement(ti,fc({},x,{type:i})),y.createElement(jt,{className:"recharts-scatter-line",key:"recharts-scatter-line"},d)}},{key:"render",value:function(){var r=this.props,n=r.hide,o=r.points,a=r.line,i=r.className,s=r.xAxis,l=r.yAxis,c=r.left,d=r.top,f=r.width,m=r.height,p=r.id,h=r.isAnimationActive;if(n||!o||!o.length)return null;var b=this.state.isAnimationFinished,v=wt("recharts-scatter",i),x=s&&s.allowDataOverflow,k=l&&l.allowDataOverflow,S=x||k,j=st(p)?this.id:p;return y.createElement(jt,{className:v,clipPath:S?"url(#clipPath-".concat(j,")"):null},x||k?y.createElement("defs",null,y.createElement("clipPath",{id:"clipPath-".concat(j)},y.createElement("rect",{x:x?c:c-f/2,y:k?d:d-m/2,width:x?f:f*2,height:k?m:m*2}))):null,a&&this.renderLine(),this.renderErrorBar(),y.createElement(jt,{key:"recharts-scatter-symbols"},this.renderSymbols()),(!h||b)&&Zn.renderCallByParent(this.props,o))}}],[{key:"getDerivedStateFromProps",value:function(r,n){return r.animationId!==n.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:n.curPoints}:r.points!==n.curPoints?{curPoints:r.points}:null}}])}(g.PureComponent);Va(Ed,"displayName","Scatter");Va(Ed,"defaultProps",{xAxisId:0,yAxisId:0,zAxisId:0,legendType:"circle",lineType:"joint",lineJointType:"linear",data:[],shape:"circle",hide:!1,isAnimationActive:!ya.isSsr,animationBegin:0,animationDuration:400,animationEasing:"linear"});Va(Ed,"getComposedData",function(e){var t=e.xAxis,r=e.yAxis,n=e.zAxis,o=e.item,a=e.displayedData,i=e.xAxisTicks,s=e.yAxisTicks,l=e.offset,c=o.props.tooltipType,d=on(o.props.children,Xm),f=st(t.dataKey)?o.props.dataKey:t.dataKey,m=st(r.dataKey)?o.props.dataKey:r.dataKey,p=n&&n.dataKey,h=n?n.range:jd.defaultProps.range,b=h&&h[0],v=t.scale.bandwidth?t.scale.bandwidth():0,x=r.scale.bandwidth?r.scale.bandwidth():0,k=a.map(function(S,j){var O=dr(S,f),C=dr(S,m),N=!st(p)&&dr(S,p)||"-",T=[{name:st(t.dataKey)?o.props.name:t.name||t.dataKey,unit:t.unit||"",value:O,payload:S,dataKey:f,type:c},{name:st(r.dataKey)?o.props.name:r.name||r.dataKey,unit:r.unit||"",value:C,payload:S,dataKey:m,type:c}];N!=="-"&&T.push({name:n.name||n.dataKey,unit:n.unit||"",value:N,payload:S,dataKey:p,type:c});var M=El({axis:t,ticks:i,bandSize:v,entry:S,index:j,dataKey:f}),I=El({axis:r,ticks:s,bandSize:x,entry:S,index:j,dataKey:m}),_=N!=="-"?n.scale(N):b,R=Math.sqrt(Math.max(_,0)/Math.PI);return _n(_n({},S),{},{cx:M,cy:I,x:M-R,y:I-R,xAxis:t,yAxis:r,zAxis:n,width:2*R,height:2*R,size:_,node:{x:O,y:C,z:N},tooltipPayload:T,tooltipPosition:{x:M,y:I},payload:S},d&&d[j]&&d[j].props)});return _n({points:k},l)});function Bl(e){"@babel/helpers - typeof";return Bl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bl(e)}function hae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gae(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,V_(n.key),n)}}function bae(e,t,r){return t&&gae(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function vae(e,t,r){return t=rm(t),yae(e,U_()?Reflect.construct(t,r||[],rm(e).constructor):t.apply(e,r))}function yae(e,t){if(t&&(Bl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xae(e)}function xae(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function U_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(U_=function(){return!!e})()}function rm(e){return rm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},rm(e)}function wae(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yw(e,t)}function Yw(e,t){return Yw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Yw(e,t)}function K_(e,t,r){return t=V_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function V_(e){var t=kae(e,"string");return Bl(t)=="symbol"?t:t+""}function kae(e,t){if(Bl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Bl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Xw(){return Xw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xw.apply(this,arguments)}function jae(e){var t=e.xAxisId,r=nj(),n=oj(),o=k_(t);return o==null?null:y.createElement(nu,Xw({},o,{className:wt("recharts-".concat(o.axisType," ").concat(o.axisType),o.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(a){return oa(a,!0)}}))}var pn=function(e){function t(){return hae(this,t),vae(this,t,arguments)}return wae(t,e),bae(t,[{key:"render",value:function(){return y.createElement(jae,this.props)}}])}(y.Component);K_(pn,"displayName","XAxis");K_(pn,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function zl(e){"@babel/helpers - typeof";return zl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zl(e)}function Eae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sae(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,X_(n.key),n)}}function Nae(e,t,r){return t&&Sae(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Oae(e,t,r){return t=nm(t),Cae(e,G_()?Reflect.construct(t,r||[],nm(e).constructor):t.apply(e,r))}function Cae(e,t){if(t&&(zl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Pae(e)}function Pae(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function G_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(G_=function(){return!!e})()}function nm(e){return nm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},nm(e)}function Aae(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zw(e,t)}function Zw(e,t){return Zw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Zw(e,t)}function Y_(e,t,r){return t=X_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function X_(e){var t=Tae(e,"string");return zl(t)=="symbol"?t:t+""}function Tae(e,t){if(zl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(zl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Jw(){return Jw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jw.apply(this,arguments)}var Mae=function(e){var t=e.yAxisId,r=nj(),n=oj(),o=j_(t);return o==null?null:y.createElement(nu,Jw({},o,{className:wt("recharts-".concat(o.axisType," ").concat(o.axisType),o.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(a){return oa(a,!0)}}))},mn=function(e){function t(){return Eae(this,t),Oae(this,t,arguments)}return Aae(t,e),Nae(t,[{key:"render",value:function(){return y.createElement(Mae,this.props)}}])}(y.Component);Y_(mn,"displayName","YAxis");Y_(mn,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function U1(e){return Lae(e)||Dae(e)||Iae(e)||_ae()}function _ae(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
118
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Iae(e,t){if(e){if(typeof e=="string")return Qw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Qw(e,t)}}function Dae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Lae(e){if(Array.isArray(e))return Qw(e)}function Qw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ek=function(e,t,r,n,o){var a=on(e,ij),i=on(e,gh),s=[].concat(U1(a),U1(i)),l=on(e,vh),c="".concat(n,"Id"),d=n[0],f=t;if(s.length&&(f=s.reduce(function(h,b){if(b.props[c]===r&&So(b.props,"extendDomain")&&Re(b.props[d])){var v=b.props[d];return[Math.min(h[0],v),Math.max(h[1],v)]}return h},f)),l.length){var m="".concat(d,"1"),p="".concat(d,"2");f=l.reduce(function(h,b){if(b.props[c]===r&&So(b.props,"extendDomain")&&Re(b.props[m])&&Re(b.props[p])){var v=b.props[m],x=b.props[p];return[Math.min(h[0],v,x),Math.max(h[1],v,x)]}return h},f)}return o&&o.length&&(f=o.reduce(function(h,b){return Re(b)?[Math.min(h[0],b),Math.max(h[1],b)]:h},f)),f},K1={exports:{}},V1;function Rae(){return V1||(V1=1,function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function o(l,c,d){this.fn=l,this.context=c,this.once=d||!1}function a(l,c,d,f,m){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new o(d,f||l,m),h=r?r+c:c;return l._events[h]?l._events[h].fn?l._events[h]=[l._events[h],p]:l._events[h].push(p):(l._events[h]=p,l._eventsCount++),l}function i(l,c){--l._eventsCount===0?l._events=new n:delete l._events[c]}function s(){this._events=new n,this._eventsCount=0}s.prototype.eventNames=function(){var l=[],c,d;if(this._eventsCount===0)return l;for(d in c=this._events)t.call(c,d)&&l.push(r?d.slice(1):d);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},s.prototype.listeners=function(l){var c=r?r+l:l,d=this._events[c];if(!d)return[];if(d.fn)return[d.fn];for(var f=0,m=d.length,p=new Array(m);f<m;f++)p[f]=d[f].fn;return p},s.prototype.listenerCount=function(l){var c=r?r+l:l,d=this._events[c];return d?d.fn?1:d.length:0},s.prototype.emit=function(l,c,d,f,m,p){var h=r?r+l:l;if(!this._events[h])return!1;var b=this._events[h],v=arguments.length,x,k;if(b.fn){switch(b.once&&this.removeListener(l,b.fn,void 0,!0),v){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,c),!0;case 3:return b.fn.call(b.context,c,d),!0;case 4:return b.fn.call(b.context,c,d,f),!0;case 5:return b.fn.call(b.context,c,d,f,m),!0;case 6:return b.fn.call(b.context,c,d,f,m,p),!0}for(k=1,x=new Array(v-1);k<v;k++)x[k-1]=arguments[k];b.fn.apply(b.context,x)}else{var S=b.length,j;for(k=0;k<S;k++)switch(b[k].once&&this.removeListener(l,b[k].fn,void 0,!0),v){case 1:b[k].fn.call(b[k].context);break;case 2:b[k].fn.call(b[k].context,c);break;case 3:b[k].fn.call(b[k].context,c,d);break;case 4:b[k].fn.call(b[k].context,c,d,f);break;default:if(!x)for(j=1,x=new Array(v-1);j<v;j++)x[j-1]=arguments[j];b[k].fn.apply(b[k].context,x)}}return!0},s.prototype.on=function(l,c,d){return a(this,l,c,d,!1)},s.prototype.once=function(l,c,d){return a(this,l,c,d,!0)},s.prototype.removeListener=function(l,c,d,f){var m=r?r+l:l;if(!this._events[m])return this;if(!c)return i(this,m),this;var p=this._events[m];if(p.fn)p.fn===c&&(!f||p.once)&&(!d||p.context===d)&&i(this,m);else{for(var h=0,b=[],v=p.length;h<v;h++)(p[h].fn!==c||f&&!p[h].once||d&&p[h].context!==d)&&b.push(p[h]);b.length?this._events[m]=b.length===1?b[0]:b:i(this,m)}return this},s.prototype.removeAllListeners=function(l){var c;return l?(c=r?r+l:l,this._events[c]&&i(this,c)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=r,s.EventEmitter=s,e.exports=s}(K1)),K1.exports}var Fae=Rae();const $ae=qt(Fae);var Dx=new $ae,Lx="recharts.syncMouseEvents";function Jc(e){"@babel/helpers - typeof";return Jc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jc(e)}function Bae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zae(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Z_(n.key),n)}}function Hae(e,t,r){return t&&zae(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Rx(e,t,r){return t=Z_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Z_(e){var t=qae(e,"string");return Jc(t)=="symbol"?t:t+""}function qae(e,t){if(Jc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Jc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Wae=function(){function e(){Bae(this,e),Rx(this,"activeIndex",0),Rx(this,"coordinateList",[]),Rx(this,"layout","horizontal")}return Hae(e,[{key:"setDetails",value:function(t){var r,n=t.coordinateList,o=n===void 0?null:n,a=t.container,i=a===void 0?null:a,s=t.layout,l=s===void 0?null:s,c=t.offset,d=c===void 0?null:c,f=t.mouseHandlerCallback,m=f===void 0?null:f;this.coordinateList=(r=o??this.coordinateList)!==null&&r!==void 0?r:[],this.container=i??this.container,this.layout=l??this.layout,this.offset=d??this.offset,this.mouseHandlerCallback=m??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(t){if(this.coordinateList.length!==0)switch(t.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(t){this.activeIndex=t}},{key:"spoofMouse",value:function(){var t,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var n=this.container.getBoundingClientRect(),o=n.x,a=n.y,i=n.height,s=this.coordinateList[this.activeIndex].coordinate,l=((t=window)===null||t===void 0?void 0:t.scrollX)||0,c=((r=window)===null||r===void 0?void 0:r.scrollY)||0,d=o+s+l,f=a+this.offset.top+i/2+c;this.mouseHandlerCallback({pageX:d,pageY:f})}}}])}();function Uae(e,t,r){if(r==="number"&&t===!0&&Array.isArray(e)){var n=e?.[0],o=e?.[1];if(n&&o&&Re(n)&&Re(o))return!0}return!1}function Kae(e,t,r,n){var o=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-o:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-o,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}function J_(e){var t=e.cx,r=e.cy,n=e.radius,o=e.startAngle,a=e.endAngle,i=ar(t,r,n,o),s=ar(t,r,n,a);return{points:[i,s],cx:t,cy:r,radius:n,startAngle:o,endAngle:a}}function Vae(e,t,r){var n,o,a,i;if(e==="horizontal")n=t.x,a=n,o=r.top,i=r.top+r.height;else if(e==="vertical")o=t.y,i=o,n=r.left,a=r.left+r.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var s=t.cx,l=t.cy,c=t.innerRadius,d=t.outerRadius,f=t.angle,m=ar(s,l,c,f),p=ar(s,l,d,f);n=m.x,o=m.y,a=p.x,i=p.y}else return J_(t);return[{x:n,y:o},{x:a,y:i}]}function Qc(e){"@babel/helpers - typeof";return Qc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qc(e)}function G1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Sf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?G1(Object(r),!0).forEach(function(n){Gae(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):G1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Gae(e,t,r){return t=Yae(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Yae(e){var t=Xae(e,"string");return Qc(t)=="symbol"?t:t+""}function Xae(e,t){if(Qc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Qc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Zae(e){var t,r,n=e.element,o=e.tooltipEventType,a=e.isActive,i=e.activeCoordinate,s=e.activePayload,l=e.offset,c=e.activeTooltipIndex,d=e.tooltipAxisBandSize,f=e.layout,m=e.chartName,p=(t=n.props.cursor)!==null&&t!==void 0?t:(r=n.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!n||!p||!a||!i||m!=="ScatterChart"&&o!=="axis")return null;var h,b=ti;if(m==="ScatterChart")h=i,b=qee;else if(m==="BarChart")h=Kae(f,i,l,d),b=Q2;else if(f==="radial"){var v=J_(i),x=v.cx,k=v.cy,S=v.radius,j=v.startAngle,O=v.endAngle;h={cx:x,cy:k,startAngle:j,endAngle:O,innerRadius:S,outerRadius:S},b=J2}else h={points:Vae(f,i,l)},b=ti;var C=Sf(Sf(Sf(Sf({stroke:"#ccc",pointerEvents:"none"},l),h),Xe(p,!1)),{},{payload:s,payloadIndex:c,className:wt("recharts-tooltip-cursor",p.className)});return g.isValidElement(p)?g.cloneElement(p,C):g.createElement(b,C)}var Jae=["item"],Qae=["children","className","width","height","style","compact","title","desc"];function Hl(e){"@babel/helpers - typeof";return Hl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hl(e)}function Gs(){return Gs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gs.apply(this,arguments)}function Y1(e,t){return rie(e)||tie(e,t)||e9(e,t)||eie()}function eie(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
119
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tie(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,a,i,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(d){c=!0,o=d}finally{try{if(!l&&r.return!=null&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}function rie(e){if(Array.isArray(e))return e}function X1(e,t){if(e==null)return{};var r=nie(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function nie(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function oie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aie(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,t9(n.key),n)}}function iie(e,t,r){return t&&aie(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function sie(e,t,r){return t=om(t),lie(e,Q_()?Reflect.construct(t,r||[],om(e).constructor):t.apply(e,r))}function lie(e,t){if(t&&(Hl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return uie(e)}function uie(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Q_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Q_=function(){return!!e})()}function om(e){return om=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},om(e)}function cie(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tk(e,t)}function tk(e,t){return tk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},tk(e,t)}function ql(e){return pie(e)||fie(e)||e9(e)||die()}function die(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
120
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e9(e,t){if(e){if(typeof e=="string")return rk(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return rk(e,t)}}function fie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function pie(e){if(Array.isArray(e))return rk(e)}function rk(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Z1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ee(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Z1(Object(r),!0).forEach(function(n){lt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function lt(e,t,r){return t=t9(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t9(e){var t=mie(e,"string");return Hl(t)=="symbol"?t:t+""}function mie(e,t){if(Hl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Hl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hie={xAxis:["bottom","top"],yAxis:["left","right"]},gie={width:"100%",height:"100%"},r9={x:0,y:0};function Nf(e){return e}var bie=function(e,t){return t==="horizontal"?e.x:t==="vertical"?e.y:t==="centric"?e.angle:e.radius},vie=function(e,t,r,n){var o=t.find(function(c){return c&&c.index===r});if(o){if(e==="horizontal")return{x:o.coordinate,y:n.y};if(e==="vertical")return{x:n.x,y:o.coordinate};if(e==="centric"){var a=o.coordinate,i=n.radius;return Ee(Ee(Ee({},n),ar(n.cx,n.cy,i,a)),{},{angle:a,radius:i})}var s=o.coordinate,l=n.angle;return Ee(Ee(Ee({},n),ar(n.cx,n.cy,s,l)),{},{angle:l,radius:s})}return r9},yh=function(e,t){var r=t.graphicalItems,n=t.dataStartIndex,o=t.dataEndIndex,a=(r??[]).reduce(function(i,s){var l=s.props.data;return l&&l.length?[].concat(ql(i),ql(l)):i},[]);return a.length>0?a:e&&e.length&&Re(n)&&Re(o)?e.slice(n,o+1):[]};function n9(e){return e==="number"?[0,"auto"]:void 0}var nk=function(e,t,r,n){var o=e.graphicalItems,a=e.tooltipAxis,i=yh(t,e);return r<0||!o||!o.length||r>=i.length?null:o.reduce(function(s,l){var c,d=(c=l.props.data)!==null&&c!==void 0?c:t;d&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=r&&(d=d.slice(e.dataStartIndex,e.dataEndIndex+1));var f;if(a.dataKey&&!a.allowDuplicatedCategory){var m=d===void 0?i:d;f=op(m,a.dataKey,n)}else f=d&&d[r]||i[r];return f?[].concat(ql(s),[zM(l,f)]):s},[])},J1=function(e,t,r,n){var o=n||{x:e.chartX,y:e.chartY},a=bie(o,r),i=e.orderedTooltipTicks,s=e.tooltipAxis,l=e.tooltipTicks,c=mZ(a,i,l,s);if(c>=0&&l){var d=l[c]&&l[c].value,f=nk(e,t,c,d),m=vie(r,i,c,o);return{activeTooltipIndex:c,activeLabel:d,activePayload:f,activeCoordinate:m}}return null},yie=function(e,t){var r=t.axes,n=t.graphicalItems,o=t.axisType,a=t.axisIdKey,i=t.stackGroups,s=t.dataStartIndex,l=t.dataEndIndex,c=e.layout,d=e.children,f=e.stackOffset,m=DM(c,o);return r.reduce(function(p,h){var b,v=h.type.defaultProps!==void 0?Ee(Ee({},h.type.defaultProps),h.props):h.props,x=v.type,k=v.dataKey,S=v.allowDataOverflow,j=v.allowDuplicatedCategory,O=v.scale,C=v.ticks,N=v.includeHidden,T=v[a];if(p[T])return p;var M=yh(e.data,{graphicalItems:n.filter(function(q){var J,V=a in q.props?q.props[a]:(J=q.type.defaultProps)===null||J===void 0?void 0:J[a];return V===T}),dataStartIndex:s,dataEndIndex:l}),I=M.length,_,R,L;Uae(v.domain,S,x)&&(_=mw(v.domain,null,S),m&&(x==="number"||O!=="auto")&&(L=Bf(M,k,"category")));var F=n9(x);if(!_||_.length===0){var B,U=(B=v.domain)!==null&&B!==void 0?B:F;if(k){if(_=Bf(M,k,x),x==="category"&&m){var $=lq(_);j&&$?(R=_,_=Hp(0,I)):j||(_=V3(U,_,h).reduce(function(q,J){return q.indexOf(J)>=0?q:[].concat(ql(q),[J])},[]))}else if(x==="category")j?_=_.filter(function(q){return q!==""&&!st(q)}):_=V3(U,_,h).reduce(function(q,J){return q.indexOf(J)>=0||J===""||st(J)?q:[].concat(ql(q),[J])},[]);else if(x==="number"){var z=yZ(M,n.filter(function(q){var J,V,me=a in q.props?q.props[a]:(J=q.type.defaultProps)===null||J===void 0?void 0:J[a],X="hide"in q.props?q.props.hide:(V=q.type.defaultProps)===null||V===void 0?void 0:V.hide;return me===T&&(N||!X)}),k,o,c);z&&(_=z)}m&&(x==="number"||O!=="auto")&&(L=Bf(M,k,"category"))}else m?_=Hp(0,I):i&&i[T]&&i[T].hasStack&&x==="number"?_=f==="expand"?[0,1]:BM(i[T].stackGroups,s,l):_=IM(M,n.filter(function(q){var J=a in q.props?q.props[a]:q.type.defaultProps[a],V="hide"in q.props?q.props.hide:q.type.defaultProps.hide;return J===T&&(N||!V)}),x,c,!0);if(x==="number")_=ek(d,_,T,o,C),U&&(_=mw(U,_,S));else if(x==="category"&&U){var W=U,K=_.every(function(q){return W.indexOf(q)>=0});K&&(_=W)}}return Ee(Ee({},p),{},lt({},T,Ee(Ee({},v),{},{axisType:o,domain:_,categoricalDomain:L,duplicateDomain:R,originalDomain:(b=v.domain)!==null&&b!==void 0?b:F,isCategorical:m,layout:c})))},{})},xie=function(e,t){var r=t.graphicalItems,n=t.Axis,o=t.axisType,a=t.axisIdKey,i=t.stackGroups,s=t.dataStartIndex,l=t.dataEndIndex,c=e.layout,d=e.children,f=yh(e.data,{graphicalItems:r,dataStartIndex:s,dataEndIndex:l}),m=f.length,p=DM(c,o),h=-1;return r.reduce(function(b,v){var x=v.type.defaultProps!==void 0?Ee(Ee({},v.type.defaultProps),v.props):v.props,k=x[a],S=n9("number");if(!b[k]){h++;var j;return p?j=Hp(0,m):i&&i[k]&&i[k].hasStack?(j=BM(i[k].stackGroups,s,l),j=ek(d,j,k,o)):(j=mw(S,IM(f,r.filter(function(O){var C,N,T=a in O.props?O.props[a]:(C=O.type.defaultProps)===null||C===void 0?void 0:C[a],M="hide"in O.props?O.props.hide:(N=O.type.defaultProps)===null||N===void 0?void 0:N.hide;return T===k&&!M}),"number",c),n.defaultProps.allowDataOverflow),j=ek(d,j,k,o)),Ee(Ee({},b),{},lt({},k,Ee(Ee({axisType:o},n.defaultProps),{},{hide:!0,orientation:Sn(hie,"".concat(o,".").concat(h%2),null),domain:j,originalDomain:S,isCategorical:p,layout:c})))}return b},{})},wie=function(e,t){var r=t.axisType,n=r===void 0?"xAxis":r,o=t.AxisComp,a=t.graphicalItems,i=t.stackGroups,s=t.dataStartIndex,l=t.dataEndIndex,c=e.children,d="".concat(n,"Id"),f=on(c,o),m={};return f&&f.length?m=yie(e,{axes:f,graphicalItems:a,axisType:n,axisIdKey:d,stackGroups:i,dataStartIndex:s,dataEndIndex:l}):a&&a.length&&(m=xie(e,{Axis:o,graphicalItems:a,axisType:n,axisIdKey:d,stackGroups:i,dataStartIndex:s,dataEndIndex:l})),m},kie=function(e){var t=Ha(e),r=oa(t,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:S2(r,function(n){return n.coordinate}),tooltipAxis:t,tooltipAxisBandSize:Pp(t,r)}},Q1=function(e){var t=e.children,r=e.defaultShowTooltip,n=xn(t,Al),o=0,a=0;return e.data&&e.data.length!==0&&(a=e.data.length-1),n&&n.props&&(n.props.startIndex>=0&&(o=n.props.startIndex),n.props.endIndex>=0&&(a=n.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!r}},jie=function(e){return!e||!e.length?!1:e.some(function(t){var r=ia(t&&t.type);return r&&r.indexOf("Bar")>=0})},eP=function(e){return e==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:e==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:e==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Eie=function(e,t){var r=e.props,n=e.graphicalItems,o=e.xAxisMap,a=o===void 0?{}:o,i=e.yAxisMap,s=i===void 0?{}:i,l=r.width,c=r.height,d=r.children,f=r.margin||{},m=xn(d,Al),p=xn(d,jo),h=Object.keys(s).reduce(function(j,O){var C=s[O],N=C.orientation;return!C.mirror&&!C.hide?Ee(Ee({},j),{},lt({},N,j[N]+C.width)):j},{left:f.left||0,right:f.right||0}),b=Object.keys(a).reduce(function(j,O){var C=a[O],N=C.orientation;return!C.mirror&&!C.hide?Ee(Ee({},j),{},lt({},N,Sn(j,"".concat(N))+C.height)):j},{top:f.top||0,bottom:f.bottom||0}),v=Ee(Ee({},b),h),x=v.bottom;m&&(v.bottom+=m.props.height||Al.defaultProps.height),p&&t&&(v=bZ(v,n,r,t));var k=l-v.left-v.right,S=c-v.top-v.bottom;return Ee(Ee({brushBottom:x},v),{},{width:Math.max(k,0),height:Math.max(S,0)})},Sie=function(e,t){if(t==="xAxis")return e[t].width;if(t==="yAxis")return e[t].height},Sd=function(e){var t=e.chartName,r=e.GraphicalChild,n=e.defaultTooltipEventType,o=n===void 0?"axis":n,a=e.validateTooltipEventTypes,i=a===void 0?["axis"]:a,s=e.axisComponents,l=e.legendContent,c=e.formatAxisMap,d=e.defaultProps,f=function(b,v){var x=v.graphicalItems,k=v.stackGroups,S=v.offset,j=v.updateId,O=v.dataStartIndex,C=v.dataEndIndex,N=b.barSize,T=b.layout,M=b.barGap,I=b.barCategoryGap,_=b.maxBarSize,R=eP(T),L=R.numericAxisName,F=R.cateAxisName,B=jie(x),U=[];return x.forEach(function($,z){var W=yh(b.data,{graphicalItems:[$],dataStartIndex:O,dataEndIndex:C}),K=$.type.defaultProps!==void 0?Ee(Ee({},$.type.defaultProps),$.props):$.props,q=K.dataKey,J=K.maxBarSize,V=K["".concat(L,"Id")],me=K["".concat(F,"Id")],X={},ce=s.reduce(function(Ve,$e){var Ze=v["".concat($e.axisType,"Map")],rt=K["".concat($e.axisType,"Id")];Ze&&Ze[rt]||$e.axisType==="zAxis"||ps();var nt=Ze[rt];return Ee(Ee({},Ve),{},lt(lt({},$e.axisType,nt),"".concat($e.axisType,"Ticks"),oa(nt)))},X),oe=ce[F],Oe=ce["".concat(F,"Ticks")],te=k&&k[V]&&k[V].hasStack&&CZ($,k[V].stackGroups),Ne=ia($.type).indexOf("Bar")>=0,ve=Pp(oe,Oe),G=[],ye=B&&hZ({barSize:N,stackGroups:k,totalSize:Sie(ce,F)});if(Ne){var le,ge,Ce=st(J)?_:J,Me=(le=(ge=Pp(oe,Oe,!0))!==null&&ge!==void 0?ge:Ce)!==null&&le!==void 0?le:0;G=gZ({barGap:M,barCategoryGap:I,bandSize:Me!==ve?Me:ve,sizeList:ye[me],maxBarSize:Ce}),Me!==ve&&(G=G.map(function(Ve){return Ee(Ee({},Ve),{},{position:Ee(Ee({},Ve.position),{},{offset:Ve.position.offset-Me/2})})}))}var Ye=$&&$.type&&$.type.getComposedData;Ye&&U.push({props:Ee(Ee({},Ye(Ee(Ee({},ce),{},{displayedData:W,props:b,dataKey:q,item:$,bandSize:ve,barPosition:G,offset:S,stackedData:te,layout:T,dataStartIndex:O,dataEndIndex:C}))),{},lt(lt(lt({key:$.key||"item-".concat(z)},L,ce[L]),F,ce[F]),"animationId",j)),childIndex:xq($,b.children),item:$})}),U},m=function(b,v){var x=b.props,k=b.dataStartIndex,S=b.dataEndIndex,j=b.updateId;if(!lO({props:x}))return null;var O=x.children,C=x.layout,N=x.stackOffset,T=x.data,M=x.reverseStackOrder,I=eP(C),_=I.numericAxisName,R=I.cateAxisName,L=on(O,r),F=NZ(T,L,"".concat(_,"Id"),"".concat(R,"Id"),N,M),B=s.reduce(function(K,q){var J="".concat(q.axisType,"Map");return Ee(Ee({},K),{},lt({},J,wie(x,Ee(Ee({},q),{},{graphicalItems:L,stackGroups:q.axisType===_&&F,dataStartIndex:k,dataEndIndex:S}))))},{}),U=Eie(Ee(Ee({},B),{},{props:x,graphicalItems:L}),v?.legendBBox);Object.keys(B).forEach(function(K){B[K]=c(x,B[K],U,K.replace("Map",""),t)});var $=B["".concat(R,"Map")],z=kie($),W=f(x,Ee(Ee({},B),{},{dataStartIndex:k,dataEndIndex:S,updateId:j,graphicalItems:L,stackGroups:F,offset:U}));return Ee(Ee({formattedGraphicalItems:W,graphicalItems:L,offset:U,stackGroups:F},z),B)},p=function(b){function v(x){var k,S,j;return oie(this,v),j=sie(this,v,[x]),lt(j,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),lt(j,"accessibilityManager",new Wae),lt(j,"handleLegendBBoxUpdate",function(O){if(O){var C=j.state,N=C.dataStartIndex,T=C.dataEndIndex,M=C.updateId;j.setState(Ee({legendBBox:O},m({props:j.props,dataStartIndex:N,dataEndIndex:T,updateId:M},Ee(Ee({},j.state),{},{legendBBox:O}))))}}),lt(j,"handleReceiveSyncEvent",function(O,C,N){if(j.props.syncId===O){if(N===j.eventEmitterSymbol&&typeof j.props.syncMethod!="function")return;j.applySyncEvent(C)}}),lt(j,"handleBrushChange",function(O){var C=O.startIndex,N=O.endIndex;if(C!==j.state.dataStartIndex||N!==j.state.dataEndIndex){var T=j.state.updateId;j.setState(function(){return Ee({dataStartIndex:C,dataEndIndex:N},m({props:j.props,dataStartIndex:C,dataEndIndex:N,updateId:T},j.state))}),j.triggerSyncEvent({dataStartIndex:C,dataEndIndex:N})}}),lt(j,"handleMouseEnter",function(O){var C=j.getMouseInfo(O);if(C){var N=Ee(Ee({},C),{},{isTooltipActive:!0});j.setState(N),j.triggerSyncEvent(N);var T=j.props.onMouseEnter;it(T)&&T(N,O)}}),lt(j,"triggeredAfterMouseMove",function(O){var C=j.getMouseInfo(O),N=C?Ee(Ee({},C),{},{isTooltipActive:!0}):{isTooltipActive:!1};j.setState(N),j.triggerSyncEvent(N);var T=j.props.onMouseMove;it(T)&&T(N,O)}),lt(j,"handleItemMouseEnter",function(O){j.setState(function(){return{isTooltipActive:!0,activeItem:O,activePayload:O.tooltipPayload,activeCoordinate:O.tooltipPosition||{x:O.cx,y:O.cy}}})}),lt(j,"handleItemMouseLeave",function(){j.setState(function(){return{isTooltipActive:!1}})}),lt(j,"handleMouseMove",function(O){O.persist(),j.throttleTriggeredAfterMouseMove(O)}),lt(j,"handleMouseLeave",function(O){j.throttleTriggeredAfterMouseMove.cancel();var C={isTooltipActive:!1};j.setState(C),j.triggerSyncEvent(C);var N=j.props.onMouseLeave;it(N)&&N(C,O)}),lt(j,"handleOuterEvent",function(O){var C=yq(O),N=Sn(j.props,"".concat(C));if(C&&it(N)){var T,M;/.*touch.*/i.test(C)?M=j.getMouseInfo(O.changedTouches[0]):M=j.getMouseInfo(O),N((T=M)!==null&&T!==void 0?T:{},O)}}),lt(j,"handleClick",function(O){var C=j.getMouseInfo(O);if(C){var N=Ee(Ee({},C),{},{isTooltipActive:!0});j.setState(N),j.triggerSyncEvent(N);var T=j.props.onClick;it(T)&&T(N,O)}}),lt(j,"handleMouseDown",function(O){var C=j.props.onMouseDown;if(it(C)){var N=j.getMouseInfo(O);C(N,O)}}),lt(j,"handleMouseUp",function(O){var C=j.props.onMouseUp;if(it(C)){var N=j.getMouseInfo(O);C(N,O)}}),lt(j,"handleTouchMove",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&j.throttleTriggeredAfterMouseMove(O.changedTouches[0])}),lt(j,"handleTouchStart",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&j.handleMouseDown(O.changedTouches[0])}),lt(j,"handleTouchEnd",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&j.handleMouseUp(O.changedTouches[0])}),lt(j,"handleDoubleClick",function(O){var C=j.props.onDoubleClick;if(it(C)){var N=j.getMouseInfo(O);C(N,O)}}),lt(j,"handleContextMenu",function(O){var C=j.props.onContextMenu;if(it(C)){var N=j.getMouseInfo(O);C(N,O)}}),lt(j,"triggerSyncEvent",function(O){j.props.syncId!==void 0&&Dx.emit(Lx,j.props.syncId,O,j.eventEmitterSymbol)}),lt(j,"applySyncEvent",function(O){var C=j.props,N=C.layout,T=C.syncMethod,M=j.state.updateId,I=O.dataStartIndex,_=O.dataEndIndex;if(O.dataStartIndex!==void 0||O.dataEndIndex!==void 0)j.setState(Ee({dataStartIndex:I,dataEndIndex:_},m({props:j.props,dataStartIndex:I,dataEndIndex:_,updateId:M},j.state)));else if(O.activeTooltipIndex!==void 0){var R=O.chartX,L=O.chartY,F=O.activeTooltipIndex,B=j.state,U=B.offset,$=B.tooltipTicks;if(!U)return;if(typeof T=="function")F=T($,O);else if(T==="value"){F=-1;for(var z=0;z<$.length;z++)if($[z].value===O.activeLabel){F=z;break}}var W=Ee(Ee({},U),{},{x:U.left,y:U.top}),K=Math.min(R,W.x+W.width),q=Math.min(L,W.y+W.height),J=$[F]&&$[F].value,V=nk(j.state,j.props.data,F),me=$[F]?{x:N==="horizontal"?$[F].coordinate:K,y:N==="horizontal"?q:$[F].coordinate}:r9;j.setState(Ee(Ee({},O),{},{activeLabel:J,activeCoordinate:me,activePayload:V,activeTooltipIndex:F}))}else j.setState(O)}),lt(j,"renderCursor",function(O){var C,N=j.state,T=N.isTooltipActive,M=N.activeCoordinate,I=N.activePayload,_=N.offset,R=N.activeTooltipIndex,L=N.tooltipAxisBandSize,F=j.getTooltipEventType(),B=(C=O.props.active)!==null&&C!==void 0?C:T,U=j.props.layout,$=O.key||"_recharts-cursor";return y.createElement(Zae,{key:$,activeCoordinate:M,activePayload:I,activeTooltipIndex:R,chartName:t,element:O,isActive:B,layout:U,offset:_,tooltipAxisBandSize:L,tooltipEventType:F})}),lt(j,"renderPolarAxis",function(O,C,N){var T=Sn(O,"type.axisType"),M=Sn(j.state,"".concat(T,"Map")),I=O.type.defaultProps,_=I!==void 0?Ee(Ee({},I),O.props):O.props,R=M&&M[_["".concat(T,"Id")]];return g.cloneElement(O,Ee(Ee({},R),{},{className:wt(T,R.className),key:O.key||"".concat(C,"-").concat(N),ticks:oa(R,!0)}))}),lt(j,"renderPolarGrid",function(O){var C=O.props,N=C.radialLines,T=C.polarAngles,M=C.polarRadius,I=j.state,_=I.radiusAxisMap,R=I.angleAxisMap,L=Ha(_),F=Ha(R),B=F.cx,U=F.cy,$=F.innerRadius,z=F.outerRadius;return g.cloneElement(O,{polarAngles:Array.isArray(T)?T:oa(F,!0).map(function(W){return W.coordinate}),polarRadius:Array.isArray(M)?M:oa(L,!0).map(function(W){return W.coordinate}),cx:B,cy:U,innerRadius:$,outerRadius:z,key:O.key||"polar-grid",radialLines:N})}),lt(j,"renderLegend",function(){var O=j.state.formattedGraphicalItems,C=j.props,N=C.children,T=C.width,M=C.height,I=j.props.margin||{},_=T-(I.left||0)-(I.right||0),R=MM({children:N,formattedGraphicalItems:O,legendWidth:_,legendContent:l});if(!R)return null;var L=R.item,F=X1(R,Jae);return g.cloneElement(L,Ee(Ee({},F),{},{chartWidth:T,chartHeight:M,margin:I,onBBoxUpdate:j.handleLegendBBoxUpdate}))}),lt(j,"renderTooltip",function(){var O,C=j.props,N=C.children,T=C.accessibilityLayer,M=xn(N,ln);if(!M)return null;var I=j.state,_=I.isTooltipActive,R=I.activeCoordinate,L=I.activePayload,F=I.activeLabel,B=I.offset,U=(O=M.props.active)!==null&&O!==void 0?O:_;return g.cloneElement(M,{viewBox:Ee(Ee({},B),{},{x:B.left,y:B.top}),active:U,label:F,payload:U?L:[],coordinate:R,accessibilityLayer:T})}),lt(j,"renderBrush",function(O){var C=j.props,N=C.margin,T=C.data,M=j.state,I=M.offset,_=M.dataStartIndex,R=M.dataEndIndex,L=M.updateId;return g.cloneElement(O,{key:O.key||"_recharts-brush",onChange:wf(j.handleBrushChange,O.props.onChange),data:T,x:Re(O.props.x)?O.props.x:I.left,y:Re(O.props.y)?O.props.y:I.top+I.height+I.brushBottom-(N.bottom||0),width:Re(O.props.width)?O.props.width:I.width,startIndex:_,endIndex:R,updateId:"brush-".concat(L)})}),lt(j,"renderReferenceElement",function(O,C,N){if(!O)return null;var T=j,M=T.clipPathId,I=j.state,_=I.xAxisMap,R=I.yAxisMap,L=I.offset,F=O.type.defaultProps||{},B=O.props,U=B.xAxisId,$=U===void 0?F.xAxisId:U,z=B.yAxisId,W=z===void 0?F.yAxisId:z;return g.cloneElement(O,{key:O.key||"".concat(C,"-").concat(N),xAxis:_[$],yAxis:R[W],viewBox:{x:L.left,y:L.top,width:L.width,height:L.height},clipPathId:M})}),lt(j,"renderActivePoints",function(O){var C=O.item,N=O.activePoint,T=O.basePoint,M=O.childIndex,I=O.isRange,_=[],R=C.props.key,L=C.item.type.defaultProps!==void 0?Ee(Ee({},C.item.type.defaultProps),C.item.props):C.item.props,F=L.activeDot,B=L.dataKey,U=Ee(Ee({index:M,dataKey:B,cx:N.x,cy:N.y,r:4,fill:Z2(C.item),strokeWidth:2,stroke:"#fff",payload:N.payload,value:N.value},Xe(F,!1)),ap(F));return _.push(v.renderActiveDot(F,U,"".concat(R,"-activePoint-").concat(M))),T?_.push(v.renderActiveDot(F,Ee(Ee({},U),{},{cx:T.x,cy:T.y}),"".concat(R,"-basePoint-").concat(M))):I&&_.push(null),_}),lt(j,"renderGraphicChild",function(O,C,N){var T=j.filterFormatItem(O,C,N);if(!T)return null;var M=j.getTooltipEventType(),I=j.state,_=I.isTooltipActive,R=I.tooltipAxis,L=I.activeTooltipIndex,F=I.activeLabel,B=j.props.children,U=xn(B,ln),$=T.props,z=$.points,W=$.isRange,K=$.baseLine,q=T.item.type.defaultProps!==void 0?Ee(Ee({},T.item.type.defaultProps),T.item.props):T.item.props,J=q.activeDot,V=q.hide,me=q.activeBar,X=q.activeShape,ce=!!(!V&&_&&U&&(J||me||X)),oe={};M!=="axis"&&U&&U.props.trigger==="click"?oe={onClick:wf(j.handleItemMouseEnter,O.props.onClick)}:M!=="axis"&&(oe={onMouseLeave:wf(j.handleItemMouseLeave,O.props.onMouseLeave),onMouseEnter:wf(j.handleItemMouseEnter,O.props.onMouseEnter)});var Oe=g.cloneElement(O,Ee(Ee({},T.props),oe));function te(Ze){return typeof R.dataKey=="function"?R.dataKey(Ze.payload):null}if(ce)if(L>=0){var Ne,ve;if(R.dataKey&&!R.allowDuplicatedCategory){var G=typeof R.dataKey=="function"?te:"payload.".concat(R.dataKey.toString());Ne=op(z,G,F),ve=W&&K&&op(K,G,F)}else Ne=z?.[L],ve=W&&K&&K[L];if(X||me){var ye=O.props.activeIndex!==void 0?O.props.activeIndex:L;return[g.cloneElement(O,Ee(Ee(Ee({},T.props),oe),{},{activeIndex:ye})),null,null]}if(!st(Ne))return[Oe].concat(ql(j.renderActivePoints({item:T,activePoint:Ne,basePoint:ve,childIndex:L,isRange:W})))}else{var le,ge=(le=j.getItemByXY(j.state.activeCoordinate))!==null&&le!==void 0?le:{graphicalItem:Oe},Ce=ge.graphicalItem,Me=Ce.item,Ye=Me===void 0?O:Me,Ve=Ce.childIndex,$e=Ee(Ee(Ee({},T.props),oe),{},{activeIndex:Ve});return[g.cloneElement(Ye,$e),null,null]}return W?[Oe,null,null]:[Oe,null]}),lt(j,"renderCustomized",function(O,C,N){return g.cloneElement(O,Ee(Ee({key:"recharts-customized-".concat(N)},j.props),j.state))}),lt(j,"renderMap",{CartesianGrid:{handler:Nf,once:!0},ReferenceArea:{handler:j.renderReferenceElement},ReferenceLine:{handler:Nf},ReferenceDot:{handler:j.renderReferenceElement},XAxis:{handler:Nf},YAxis:{handler:Nf},Brush:{handler:j.renderBrush,once:!0},Bar:{handler:j.renderGraphicChild},Line:{handler:j.renderGraphicChild},Area:{handler:j.renderGraphicChild},Radar:{handler:j.renderGraphicChild},RadialBar:{handler:j.renderGraphicChild},Scatter:{handler:j.renderGraphicChild},Pie:{handler:j.renderGraphicChild},Funnel:{handler:j.renderGraphicChild},Tooltip:{handler:j.renderCursor,once:!0},PolarGrid:{handler:j.renderPolarGrid,once:!0},PolarAngleAxis:{handler:j.renderPolarAxis},PolarRadiusAxis:{handler:j.renderPolarAxis},Customized:{handler:j.renderCustomized}}),j.clipPathId="".concat((k=x.id)!==null&&k!==void 0?k:bi("recharts"),"-clip"),j.throttleTriggeredAfterMouseMove=T7(j.triggeredAfterMouseMove,(S=x.throttleDelay)!==null&&S!==void 0?S:1e3/60),j.state={},j}return cie(v,b),iie(v,[{key:"componentDidMount",value:function(){var x,k;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(x=this.props.margin.left)!==null&&x!==void 0?x:0,top:(k=this.props.margin.top)!==null&&k!==void 0?k:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var x=this.props,k=x.children,S=x.data,j=x.height,O=x.layout,C=xn(k,ln);if(C){var N=C.props.defaultIndex;if(!(typeof N!="number"||N<0||N>this.state.tooltipTicks.length-1)){var T=this.state.tooltipTicks[N]&&this.state.tooltipTicks[N].value,M=nk(this.state,S,N,T),I=this.state.tooltipTicks[N].coordinate,_=(this.state.offset.top+j)/2,R=O==="horizontal",L=R?{x:I,y:_}:{y:I,x:_},F=this.state.formattedGraphicalItems.find(function(U){var $=U.item;return $.type.name==="Scatter"});F&&(L=Ee(Ee({},L),F.props.points[N].tooltipPosition),M=F.props.points[N].tooltipPayload);var B={activeTooltipIndex:N,isTooltipActive:!0,activeLabel:T,activePayload:M,activeCoordinate:L};this.setState(B),this.renderCursor(C),this.accessibilityManager.setIndex(N)}}}},{key:"getSnapshotBeforeUpdate",value:function(x,k){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==k.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==x.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==x.margin){var S,j;this.accessibilityManager.setDetails({offset:{left:(S=this.props.margin.left)!==null&&S!==void 0?S:0,top:(j=this.props.margin.top)!==null&&j!==void 0?j:0}})}return null}},{key:"componentDidUpdate",value:function(x){L0([xn(x.children,ln)],[xn(this.props.children,ln)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var x=xn(this.props.children,ln);if(x&&typeof x.props.shared=="boolean"){var k=x.props.shared?"axis":"item";return i.indexOf(k)>=0?k:o}return o}},{key:"getMouseInfo",value:function(x){if(!this.container)return null;var k=this.container,S=k.getBoundingClientRect(),j=iV(S),O={chartX:Math.round(x.pageX-j.left),chartY:Math.round(x.pageY-j.top)},C=S.width/k.offsetWidth||1,N=this.inRange(O.chartX,O.chartY,C);if(!N)return null;var T=this.state,M=T.xAxisMap,I=T.yAxisMap,_=this.getTooltipEventType(),R=J1(this.state,this.props.data,this.props.layout,N);if(_!=="axis"&&M&&I){var L=Ha(M).scale,F=Ha(I).scale,B=L&&L.invert?L.invert(O.chartX):null,U=F&&F.invert?F.invert(O.chartY):null;return Ee(Ee({},O),{},{xValue:B,yValue:U},R)}return R?Ee(Ee({},O),R):null}},{key:"inRange",value:function(x,k){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,j=this.props.layout,O=x/S,C=k/S;if(j==="horizontal"||j==="vertical"){var N=this.state.offset,T=O>=N.left&&O<=N.left+N.width&&C>=N.top&&C<=N.top+N.height;return T?{x:O,y:C}:null}var M=this.state,I=M.angleAxisMap,_=M.radiusAxisMap;if(I&&_){var R=Ha(I);return X3({x:O,y:C},R)}return null}},{key:"parseEventsOfWrapper",value:function(){var x=this.props.children,k=this.getTooltipEventType(),S=xn(x,ln),j={};S&&k==="axis"&&(S.props.trigger==="click"?j={onClick:this.handleClick}:j={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var O=ap(this.props,this.handleOuterEvent);return Ee(Ee({},O),j)}},{key:"addListener",value:function(){Dx.on(Lx,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Dx.removeListener(Lx,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(x,k,S){for(var j=this.state.formattedGraphicalItems,O=0,C=j.length;O<C;O++){var N=j[O];if(N.item===x||N.props.key===x.key||k===ia(N.item.type)&&S===N.childIndex)return N}return null}},{key:"renderClipPath",value:function(){var x=this.clipPathId,k=this.state.offset,S=k.left,j=k.top,O=k.height,C=k.width;return y.createElement("defs",null,y.createElement("clipPath",{id:x},y.createElement("rect",{x:S,y:j,height:O,width:C})))}},{key:"getXScales",value:function(){var x=this.state.xAxisMap;return x?Object.entries(x).reduce(function(k,S){var j=Y1(S,2),O=j[0],C=j[1];return Ee(Ee({},k),{},lt({},O,C.scale))},{}):null}},{key:"getYScales",value:function(){var x=this.state.yAxisMap;return x?Object.entries(x).reduce(function(k,S){var j=Y1(S,2),O=j[0],C=j[1];return Ee(Ee({},k),{},lt({},O,C.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(x){var k;return(k=this.state.xAxisMap)===null||k===void 0||(k=k[x])===null||k===void 0?void 0:k.scale}},{key:"getYScaleByAxisId",value:function(x){var k;return(k=this.state.yAxisMap)===null||k===void 0||(k=k[x])===null||k===void 0?void 0:k.scale}},{key:"getItemByXY",value:function(x){var k=this.state,S=k.formattedGraphicalItems,j=k.activeItem;if(S&&S.length)for(var O=0,C=S.length;O<C;O++){var N=S[O],T=N.props,M=N.item,I=M.type.defaultProps!==void 0?Ee(Ee({},M.type.defaultProps),M.props):M.props,_=ia(M.type);if(_==="Bar"){var R=(T.data||[]).find(function(U){return jee(x,U)});if(R)return{graphicalItem:N,payload:R}}else if(_==="RadialBar"){var L=(T.data||[]).find(function(U){return X3(x,U)});if(L)return{graphicalItem:N,payload:L}}else if(dh(N,j)||fh(N,j)||Vc(N,j)){var F=Vte({graphicalItem:N,activeTooltipItem:j,itemData:I.data}),B=I.activeIndex===void 0?F:I.activeIndex;return{graphicalItem:Ee(Ee({},N),{},{childIndex:B}),payload:Vc(N,j)?I.data[F]:N.props.data[F]}}}return null}},{key:"render",value:function(){var x=this;if(!lO(this))return null;var k=this.props,S=k.children,j=k.className,O=k.width,C=k.height,N=k.style,T=k.compact,M=k.title,I=k.desc,_=X1(k,Qae),R=Xe(_,!1);if(T)return y.createElement(S1,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},y.createElement(F0,Gs({},R,{width:O,height:C,title:M,desc:I}),this.renderClipPath(),cO(S,this.renderMap)));if(this.props.accessibilityLayer){var L,F;R.tabIndex=(L=this.props.tabIndex)!==null&&L!==void 0?L:0,R.role=(F=this.props.role)!==null&&F!==void 0?F:"application",R.onKeyDown=function(U){x.accessibilityManager.keyboardEvent(U)},R.onFocus=function(){x.accessibilityManager.focus()}}var B=this.parseEventsOfWrapper();return y.createElement(S1,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},y.createElement("div",Gs({className:wt("recharts-wrapper",j),style:Ee({position:"relative",cursor:"default",width:O,height:C},N)},B,{ref:function(U){x.container=U}}),y.createElement(F0,Gs({},R,{width:O,height:C,title:M,desc:I,style:gie}),this.renderClipPath(),cO(S,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(g.Component);lt(p,"displayName",t),lt(p,"defaultProps",Ee({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},d)),lt(p,"getDerivedStateFromProps",function(b,v){var x=b.dataKey,k=b.data,S=b.children,j=b.width,O=b.height,C=b.layout,N=b.stackOffset,T=b.margin,M=v.dataStartIndex,I=v.dataEndIndex;if(v.updateId===void 0){var _=Q1(b);return Ee(Ee(Ee({},_),{},{updateId:0},m(Ee(Ee({props:b},_),{},{updateId:0}),v)),{},{prevDataKey:x,prevData:k,prevWidth:j,prevHeight:O,prevLayout:C,prevStackOffset:N,prevMargin:T,prevChildren:S})}if(x!==v.prevDataKey||k!==v.prevData||j!==v.prevWidth||O!==v.prevHeight||C!==v.prevLayout||N!==v.prevStackOffset||!Qs(T,v.prevMargin)){var R=Q1(b),L={chartX:v.chartX,chartY:v.chartY,isTooltipActive:v.isTooltipActive},F=Ee(Ee({},J1(v,k,C)),{},{updateId:v.updateId+1}),B=Ee(Ee(Ee({},R),L),F);return Ee(Ee(Ee({},B),m(Ee({props:b},B),v)),{},{prevDataKey:x,prevData:k,prevWidth:j,prevHeight:O,prevLayout:C,prevStackOffset:N,prevMargin:T,prevChildren:S})}if(!L0(S,v.prevChildren)){var U,$,z,W,K=xn(S,Al),q=K&&(U=($=K.props)===null||$===void 0?void 0:$.startIndex)!==null&&U!==void 0?U:M,J=K&&(z=(W=K.props)===null||W===void 0?void 0:W.endIndex)!==null&&z!==void 0?z:I,V=q!==M||J!==I,me=!st(k),X=me&&!V?v.updateId:v.updateId+1;return Ee(Ee({updateId:X},m(Ee(Ee({props:b},v),{},{updateId:X,dataStartIndex:q,dataEndIndex:J}),v)),{},{prevChildren:S,dataStartIndex:q,dataEndIndex:J})}return null}),lt(p,"renderActiveDot",function(b,v,x){var k;return g.isValidElement(b)?k=g.cloneElement(b,v):it(b)?k=b(v):k=y.createElement(To,v),y.createElement(jt,{className:"recharts-active-dot",key:x},k)});var h=g.forwardRef(function(b,v){return y.createElement(p,Gs({},b,{ref:v}))});return h.displayName=p.displayName,h},o9=Sd({chartName:"LineChart",GraphicalChild:ui,axisComponents:[{axisType:"xAxis",AxisComp:pn},{axisType:"yAxis",AxisComp:mn}],formatAxisMap:mh}),a9=Sd({chartName:"BarChart",GraphicalChild:ki,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:pn},{axisType:"yAxis",AxisComp:mn}],formatAxisMap:mh}),Nie=Sd({chartName:"PieChart",GraphicalChild:wa,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:ch},{axisType:"radiusAxis",AxisComp:lh}],formatAxisMap:FZ,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),Oie=Sd({chartName:"ScatterChart",GraphicalChild:Ed,defaultTooltipEventType:"item",validateTooltipEventTypes:["item"],axisComponents:[{axisType:"xAxis",AxisComp:pn},{axisType:"yAxis",AxisComp:mn},{axisType:"zAxis",AxisComp:jd}],formatAxisMap:mh}),i9=Sd({chartName:"AreaChart",GraphicalChild:ka,axisComponents:[{axisType:"xAxis",AxisComp:pn},{axisType:"yAxis",AxisComp:mn}],formatAxisMap:mh});const Cie=e=>{g.useEffect(()=>{const t=()=>{e()};return t(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[e])},tr={Increase:"increase",ModerateIncrease:"moderateIncrease",Decrease:"decrease",ModerateDecrease:"moderateDecrease",Unchanged:"unchanged"},qe={Slate:"slate",Gray:"gray",Zinc:"zinc",Neutral:"neutral",Stone:"stone",Red:"red",Orange:"orange",Amber:"amber",Yellow:"yellow",Lime:"lime",Green:"green",Emerald:"emerald",Teal:"teal",Cyan:"cyan",Sky:"sky",Blue:"blue",Indigo:"indigo",Violet:"violet",Purple:"purple",Fuchsia:"fuchsia",Pink:"pink",Rose:"rose"},xh={SM:"sm"},rl={Left:"left",Right:"right"},tP={Top:"top",Bottom:"bottom"},Le={background:500,darkBackground:600,border:500,darkBorder:700,ring:300,iconRing:500,lightText:400,text:500,iconText:600,darkText:700},Bo=[qe.Blue,qe.Cyan,qe.Sky,qe.Indigo,qe.Violet,qe.Purple,qe.Fuchsia,qe.Slate,qe.Gray,qe.Zinc,qe.Neutral,qe.Stone,qe.Red,qe.Orange,qe.Amber,qe.Yellow,qe.Lime,qe.Green,qe.Emerald,qe.Teal,qe.Pink,qe.Rose],uj="-",Pie=e=>{const t=Tie(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const a=o.split(uj);return a[0]===""&&a.length!==1&&a.shift(),s9(a,t)||Aie(o)},getConflictingClassGroupIds:(o,a)=>{const i=r[o]||[];return a&&n[o]?[...i,...n[o]]:i}}},s9=(e,t)=>{var r;if(e.length===0)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),a=o?s9(e.slice(1),o):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(uj);return(r=t.validators.find(({validator:s})=>s(i)))==null?void 0:r.classGroupId},rP=/^\[(.+)\]$/,Aie=e=>{if(rP.test(e)){const t=rP.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Tie=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return _ie(Object.entries(e.classGroups),r).forEach(([o,a])=>{ok(a,n,o,t)}),n},ok=(e,t,r,n)=>{e.forEach(o=>{if(typeof o=="string"){const a=o===""?t:nP(t,o);a.classGroupId=r;return}if(typeof o=="function"){if(Mie(o)){ok(o(n),t,r,n);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([a,i])=>{ok(i,nP(t,a),r,n)})})},nP=(e,t)=>{let r=e;return t.split(uj).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},Mie=e=>e.isThemeGetter,_ie=(e,t)=>t?e.map(([r,n])=>{const o=n.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([i,s])=>[t+i,s])):a);return[r,o]}):e,Iie=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const o=(a,i)=>{r.set(a,i),t++,t>e&&(t=0,n=r,r=new Map)};return{get(a){let i=r.get(a);if(i!==void 0)return i;if((i=n.get(a))!==void 0)return o(a,i),i},set(a,i){r.has(a)?r.set(a,i):o(a,i)}}},l9="!",Die=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,o=t[0],a=t.length,i=s=>{const l=[];let c=0,d=0,f;for(let v=0;v<s.length;v++){let x=s[v];if(c===0){if(x===o&&(n||s.slice(v,v+a)===t)){l.push(s.slice(d,v)),d=v+a;continue}if(x==="/"){f=v;continue}}x==="["?c++:x==="]"&&c--}const m=l.length===0?s:s.substring(d),p=m.startsWith(l9),h=p?m.substring(1):m,b=f&&f>d?f-d:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:b}};return r?s=>r({className:s,parseClassName:i}):i},Lie=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},Rie=e=>({cache:Iie(e.cacheSize),parseClassName:Die(e),...Pie(e)}),Fie=/\s+/,$ie=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,a=[],i=e.trim().split(Fie);let s="";for(let l=i.length-1;l>=0;l-=1){const c=i[l],{modifiers:d,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:p}=r(c);let h=!!p,b=n(h?m.substring(0,p):m);if(!b){if(!h){s=c+(s.length>0?" "+s:s);continue}if(b=n(m),!b){s=c+(s.length>0?" "+s:s);continue}h=!1}const v=Lie(d).join(":"),x=f?v+l9:v,k=x+b;if(a.includes(k))continue;a.push(k);const S=o(b,h);for(let j=0;j<S.length;++j){const O=S[j];a.push(x+O)}s=c+(s.length>0?" "+s:s)}return s};function Bie(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=u9(t))&&(n&&(n+=" "),n+=r);return n}const u9=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=u9(e[n]))&&(r&&(r+=" "),r+=t);return r};function oP(e,...t){let r,n,o,a=i;function i(l){const c=t.reduce((d,f)=>f(d),e());return r=Rie(c),n=r.cache.get,o=r.cache.set,a=s,s(l)}function s(l){const c=n(l);if(c)return c;const d=$ie(l,r);return o(l,d),d}return function(){return a(Bie.apply(null,arguments))}}const lr=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},c9=/^\[(?:([a-z-]+):)?(.+)\]$/i,zie=/^\d+\/\d+$/,Hie=new Set(["px","full","screen"]),qie=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Wie=/\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$/,Uie=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Kie=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Vie=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Yo=e=>nl(e)||Hie.has(e)||zie.test(e),Ia=e=>ou(e,"length",tse),nl=e=>!!e&&!Number.isNaN(Number(e)),Fx=e=>ou(e,"number",nl),Ru=e=>!!e&&Number.isInteger(Number(e)),Gie=e=>e.endsWith("%")&&nl(e.slice(0,-1)),Et=e=>c9.test(e),Da=e=>qie.test(e),Yie=new Set(["length","size","percentage"]),Xie=e=>ou(e,Yie,d9),Zie=e=>ou(e,"position",d9),Jie=new Set(["image","url"]),Qie=e=>ou(e,Jie,nse),ese=e=>ou(e,"",rse),Fu=()=>!0,ou=(e,t,r)=>{const n=c9.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},tse=e=>Wie.test(e)&&!Uie.test(e),d9=()=>!1,rse=e=>Kie.test(e),nse=e=>Vie.test(e),aP=()=>{const e=lr("colors"),t=lr("spacing"),r=lr("blur"),n=lr("brightness"),o=lr("borderColor"),a=lr("borderRadius"),i=lr("borderSpacing"),s=lr("borderWidth"),l=lr("contrast"),c=lr("grayscale"),d=lr("hueRotate"),f=lr("invert"),m=lr("gap"),p=lr("gradientColorStops"),h=lr("gradientColorStopPositions"),b=lr("inset"),v=lr("margin"),x=lr("opacity"),k=lr("padding"),S=lr("saturate"),j=lr("scale"),O=lr("sepia"),C=lr("skew"),N=lr("space"),T=lr("translate"),M=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto",Et,t],R=()=>[Et,t],L=()=>["",Yo,Ia],F=()=>["auto",nl,Et],B=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],z=()=>["start","end","center","between","around","evenly","stretch"],W=()=>["","0",Et],K=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[nl,Et];return{cacheSize:500,separator:":",theme:{colors:[Fu],spacing:[Yo,Ia],blur:["none","",Da,Et],brightness:q(),borderColor:[e],borderRadius:["none","","full",Da,Et],borderSpacing:R(),borderWidth:L(),contrast:q(),grayscale:W(),hueRotate:q(),invert:W(),gap:R(),gradientColorStops:[e],gradientColorStopPositions:[Gie,Ia],inset:_(),margin:_(),opacity:q(),padding:R(),saturate:q(),scale:q(),sepia:W(),skew:q(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",Et]}],container:["container"],columns:[{columns:[Da]}],"break-after":[{"break-after":K()}],"break-before":[{"break-before":K()}],"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"],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:[...B(),Et]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ru,Et]}],basis:[{basis:_()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Et]}],grow:[{grow:W()}],shrink:[{shrink:W()}],order:[{order:["first","last","none",Ru,Et]}],"grid-cols":[{"grid-cols":[Fu]}],"col-start-end":[{col:["auto",{span:["full",Ru,Et]},Et]}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":[Fu]}],"row-start-end":[{row:["auto",{span:[Ru,Et]},Et]}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Et]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Et]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...z()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...z(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...z(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[k]}],px:[{px:[k]}],py:[{py:[k]}],ps:[{ps:[k]}],pe:[{pe:[k]}],pt:[{pt:[k]}],pr:[{pr:[k]}],pb:[{pb:[k]}],pl:[{pl:[k]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Et,t]}],"min-w":[{"min-w":[Et,t,"min","max","fit"]}],"max-w":[{"max-w":[Et,t,"none","full","min","max","fit","prose",{screen:[Da]},Da]}],h:[{h:[Et,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Et,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Et,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Et,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Da,Ia]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Fx]}],"font-family":[{font:[Fu]}],"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:["tighter","tight","normal","wide","wider","widest",Et]}],"line-clamp":[{"line-clamp":["none",nl,Fx]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Yo,Et]}],"list-image":[{"list-image":["none",Et]}],"list-style-type":[{list:["none","disc","decimal",Et]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Yo,Ia]}],"underline-offset":[{"underline-offset":["auto",Yo,Et]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Et]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Et]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...B(),Zie]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Xie]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Qie]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...U(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:U()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...U()]}],"outline-offset":[{"outline-offset":[Yo,Et]}],"outline-w":[{outline:[Yo,Ia]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[Yo,Ia]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Da,ese]}],"shadow-color":[{shadow:[Fu]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...$(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":$()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Da,Et]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[S]}],sepia:[{sepia:[O]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[O]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Et]}],duration:[{duration:q()}],ease:[{ease:["linear","in","out","in-out",Et]}],delay:[{delay:q()}],animate:[{animate:["none","spin","ping","pulse","bounce",Et]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[j]}],"scale-x":[{"scale-x":[j]}],"scale-y":[{"scale-y":[j]}],rotate:[{rotate:[Ru,Et]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Et]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",Et]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"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",Et]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Yo,Ia,Fx]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},ose=(e,{cacheSize:t,prefix:r,separator:n,experimentalParseClassName:o,extend:a={},override:i={}})=>{Ju(e,"cacheSize",t),Ju(e,"prefix",r),Ju(e,"separator",n),Ju(e,"experimentalParseClassName",o);for(const s in i)ase(e[s],i[s]);for(const s in a)ise(e[s],a[s]);return e},Ju=(e,t,r)=>{r!==void 0&&(e[t]=r)},ase=(e,t)=>{if(t)for(const r in t)Ju(e,r,t[r])},ise=(e,t)=>{if(t)for(const r in t){const n=t[r];n!==void 0&&(e[r]=(e[r]||[]).concat(n))}},sse=(e,...t)=>typeof e=="function"?oP(aP,e,...t):oP(()=>ose(aP(),e),...t),Y=sse({extend:{classGroups:{shadow:[{shadow:[{tremor:["input","card","dropdown"],"dark-tremor":["input","card","dropdown"]}]}],rounded:[{rounded:[{tremor:["small","default","full"],"dark-tremor":["small","default","full"]}]}],"font-size":[{text:[{tremor:["default","title","metric"],"dark-tremor":["default","title","metric"]}]}]}}}),lse=["slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"],use=e=>lse.includes(e),f9=(e,t)=>{if(t||e===tr.Unchanged)return e;switch(e){case tr.Increase:return tr.Decrease;case tr.ModerateIncrease:return tr.ModerateDecrease;case tr.Decrease:return tr.Increase;case tr.ModerateDecrease:return tr.ModerateIncrease}return""},No=e=>e.toString(),cj=e=>e.reduce((t,r)=>t+r,0),cse=(e,t)=>{for(let r=0;r<t.length;r++)if(t[r]===e)return!0;return!1};function ja(e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}function at(e){return t=>`tremor-${e}-${t}`}function _e(e,t){const r=use(e);if(e==="white"||e==="black"||e==="transparent"||!t||!r){const n=(o=>o.includes("#")||o.includes("--")||o.includes("rgb"))(e)?`[${e}]`:e;return{bgColor:`bg-${n} dark:bg-${n}`,hoverBgColor:`hover:bg-${n} dark:hover:bg-${n}`,selectBgColor:`data-[selected]:bg-${n} dark:data-[selected]:bg-${n}`,textColor:`text-${n} dark:text-${n}`,selectTextColor:`data-[selected]:text-${n} dark:data-[selected]:text-${n}`,hoverTextColor:`hover:text-${n} dark:hover:text-${n}`,borderColor:`border-${n} dark:border-${n}`,selectBorderColor:`data-[selected]:border-${n} dark:data-[selected]:border-${n}`,hoverBorderColor:`hover:border-${n} dark:hover:border-${n}`,ringColor:`ring-${n} dark:ring-${n}`,strokeColor:`stroke-${n} dark:stroke-${n}`,fillColor:`fill-${n} dark:fill-${n}`}}return{bgColor:`bg-${e}-${t} dark:bg-${e}-${t}`,selectBgColor:`data-[selected]:bg-${e}-${t} dark:data-[selected]:bg-${e}-${t}`,hoverBgColor:`hover:bg-${e}-${t} dark:hover:bg-${e}-${t}`,textColor:`text-${e}-${t} dark:text-${e}-${t}`,selectTextColor:`data-[selected]:text-${e}-${t} dark:data-[selected]:text-${e}-${t}`,hoverTextColor:`hover:text-${e}-${t} dark:hover:text-${e}-${t}`,borderColor:`border-${e}-${t} dark:border-${e}-${t}`,selectBorderColor:`data-[selected]:border-${e}-${t} dark:data-[selected]:border-${e}-${t}`,hoverBorderColor:`hover:border-${e}-${t} dark:hover:border-${e}-${t}`,ringColor:`ring-${e}-${t} dark:ring-${e}-${t}`,strokeColor:`stroke-${e}-${t} dark:stroke-${e}-${t}`,fillColor:`fill-${e}-${t} dark:fill-${e}-${t}`}}const dse=e=>{var t=Te(e,[]);return y.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),y.createElement("path",{d:"M8 12L14 6V18L8 12Z"}))},fse=e=>{var t=Te(e,[]);return y.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),y.createElement("path",{d:"M16 12L10 18V6L16 12Z"}))},dj=at("Legend"),pse=({name:e,color:t,onClick:r,activeLegend:n})=>{const o=!!r;return y.createElement("li",{className:Y(dj("legendItem"),"group inline-flex items-center px-2 py-0.5 rounded-tremor-small transition whitespace-nowrap",o?"cursor-pointer":"cursor-default","text-tremor-content",o?"hover:bg-tremor-background-subtle":"","dark:text-dark-tremor-content",o?"dark:hover:bg-dark-tremor-background-subtle":""),onClick:a=>{a.stopPropagation(),r?.(e,t)}},y.createElement("svg",{className:Y("flex-none h-2 w-2 mr-1.5",_e(t,Le.text).textColor,n&&n!==e?"opacity-40":"opacity-100"),fill:"currentColor",viewBox:"0 0 8 8"},y.createElement("circle",{cx:4,cy:4,r:4})),y.createElement("p",{className:Y("whitespace-nowrap truncate text-tremor-default","text-tremor-content",o?"group-hover:text-tremor-content-emphasis":"","dark:text-dark-tremor-content",n&&n!==e?"opacity-40":"opacity-100",o?"dark:group-hover:text-dark-tremor-content-emphasis":"")},e))},iP=({icon:e,onClick:t,disabled:r})=>{const n=e,[o,a]=y.useState(!1),i=y.useRef(null);return y.useEffect(()=>(o?i.current=setInterval(()=>{t?.()},300):clearInterval(i.current),()=>clearInterval(i.current)),[o,t]),g.useEffect(()=>{r&&(clearInterval(i.current),a(!1))},[r]),y.createElement("button",{type:"button",className:Y(dj("legendSliderButton"),"w-5 group inline-flex items-center truncate rounded-tremor-small transition",r?"cursor-not-allowed":"cursor-pointer",r?"text-tremor-content-subtle":"text-tremor-content hover:text-tremor-content-emphasis hover:bg-tremor-background-subtle",r?"dark:text-dark-tremor-subtle":"dark:text-dark-tremor dark:hover:text-tremor-content-emphasis dark:hover:bg-dark-tremor-background-subtle"),disabled:r,onClick:s=>{s.stopPropagation(),t?.()},onMouseDown:s=>{s.stopPropagation(),a(!0)},onMouseUp:s=>{s.stopPropagation(),a(!1)}},y.createElement(n,{className:"w-full"}))},p9=y.forwardRef((e,t)=>{const{categories:r,colors:n=Bo,className:o,onClickLegendItem:a,activeLegend:i,enableLegendSlider:s=!1}=e,l=Te(e,["categories","colors","className","onClickLegendItem","activeLegend","enableLegendSlider"]),c=y.useRef(null),d=y.useRef(null),[f,m]=y.useState(null),[p,h]=y.useState(null),b=y.useRef(null),v=g.useCallback(()=>{const j=c?.current;if(!j)return;const O=j.scrollLeft>0,C=j.scrollWidth-j.clientWidth>j.scrollLeft;m({left:O,right:C})},[m]),x=g.useCallback(j=>{var O,C;const N=c?.current,T=d?.current,M=(O=N?.clientWidth)!==null&&O!==void 0?O:0,I=(C=T?.clientWidth)!==null&&C!==void 0?C:0;N&&s&&(N.scrollTo({left:j==="left"?N.scrollLeft-M+I:N.scrollLeft+M-I,behavior:"smooth"}),setTimeout(()=>{v()},400))},[s,v]);y.useEffect(()=>{const j=O=>{O==="ArrowLeft"?x("left"):O==="ArrowRight"&&x("right")};return p?(j(p),b.current=setInterval(()=>{j(p)},300)):clearInterval(b.current),()=>clearInterval(b.current)},[p,x]);const k=j=>{j.stopPropagation(),j.key!=="ArrowLeft"&&j.key!=="ArrowRight"||(j.preventDefault(),h(j.key))},S=j=>{j.stopPropagation(),h(null)};return y.useEffect(()=>{const j=c?.current;return s&&(v(),j?.addEventListener("keydown",k),j?.addEventListener("keyup",S)),()=>{j?.removeEventListener("keydown",k),j?.removeEventListener("keyup",S)}},[v,s]),y.createElement("ol",Object.assign({ref:t,className:Y(dj("root"),"relative overflow-hidden",o)},l),y.createElement("div",{ref:c,tabIndex:0,className:Y("h-full flex",s?f!=null&&f.right||f!=null&&f.left?"pl-4 pr-12 items-center overflow-auto snap-mandatory [&::-webkit-scrollbar]:hidden [scrollbar-width:none]":"":"flex-wrap")},r.map((j,O)=>y.createElement(pse,{key:`item-${O}`,name:j,color:n[O%n.length],onClick:a,activeLegend:i}))),s&&(f!=null&&f.right||f!=null&&f.left)?y.createElement(y.Fragment,null,y.createElement("div",{className:Y("bg-tremor-background","dark:bg-dark-tremor-background","absolute flex top-0 pr-1 bottom-0 right-0 items-center justify-center h-full"),ref:d},y.createElement(iP,{icon:dse,onClick:()=>{h(null),x("left")},disabled:!(f!=null&&f.left)}),y.createElement(iP,{icon:fse,onClick:()=>{h(null),x("right")},disabled:!(f!=null&&f.right)}))):null)});p9.displayName="Legend";const wh=({payload:e},t,r,n,o,a)=>{const i=g.useRef(null);Cie(()=>{var l,c;r((c=(l=i.current)===null||l===void 0?void 0:l.clientHeight)?Number(c)+20:60)});const s=e.filter(l=>l.type!=="none");return y.createElement("div",{ref:i,className:"flex items-center justify-end"},y.createElement(p9,{categories:s.map(l=>l.value),colors:s.map(l=>t.get(l.value)),onClickLegendItem:o,activeLegend:n,enableLegendSlider:a}))},fj=({children:e})=>y.createElement("div",{className:Y("rounded-tremor-default text-tremor-default border","bg-tremor-background shadow-tremor-dropdown border-tremor-border","dark:bg-dark-tremor-background dark:shadow-dark-tremor-dropdown dark:border-dark-tremor-border")},e),pj=({value:e,name:t,color:r})=>y.createElement("div",{className:"flex items-center justify-between space-x-8"},y.createElement("div",{className:"flex items-center space-x-2"},y.createElement("span",{className:Y("shrink-0 rounded-tremor-full border-2 h-3 w-3","border-tremor-background shadow-tremor-card","dark:border-dark-tremor-background dark:shadow-dark-tremor-card",_e(r,Le.background).bgColor)}),y.createElement("p",{className:Y("text-right whitespace-nowrap","text-tremor-content","dark:text-dark-tremor-content")},t)),y.createElement("p",{className:Y("font-medium tabular-nums text-right whitespace-nowrap","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e)),mj=({active:e,payload:t,label:r,categoryColors:n,valueFormatter:o})=>{if(e&&t){const a=t.filter(i=>i.type!=="none");return y.createElement(fj,null,y.createElement("div",{className:Y("border-tremor-border border-b px-4 py-2","dark:border-dark-tremor-border")},y.createElement("p",{className:Y("font-medium","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},r)),y.createElement("div",{className:Y("px-4 py-2 space-y-1")},a.map(({value:i,name:s},l)=>{var c;return y.createElement(pj,{key:`id-${l}`,value:o(i),name:s,color:(c=n.get(s))!==null&&c!==void 0?c:qe.Blue})})))}return null},Ea=({className:e,noDataText:t="No data"})=>y.createElement("div",{className:Y("flex items-center justify-center w-full h-full border border-dashed rounded-tremor-default","border-tremor-border","dark:border-dark-tremor-border",e)},y.createElement("p",{className:Y("text-tremor-content text-tremor-default","dark:text-dark-tremor-content")},t)),ks=(e,t)=>{const r=new Map;return e.forEach((n,o)=>{r.set(n,t[o%t.length])}),r},ci=(e,t,r)=>[e?"auto":t??0,r??"auto"],mse=(e,t)=>{if(!t)return[];const r=new Set;return e.forEach(n=>{r.add(n[t])}),Array.from(r)};function ed(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e===null||t===null)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const o of r)if(!n.includes(o)||!ed(e[o],t[o]))return!1;return!0}function ol(e,t){const r=[];for(const n of e)if(Object.prototype.hasOwnProperty.call(n,t)&&(r.push(n[t]),r.length>1))return!1;return!0}const td=y.forwardRef((e,t)=>{const{data:r=[],categories:n=[],index:o,stack:a=!1,colors:i=Bo,valueFormatter:s=No,startEndOnly:l=!1,showXAxis:c=!0,showYAxis:d=!0,yAxisWidth:f=56,intervalType:m="equidistantPreserveStart",showAnimation:p=!1,animationDuration:h=900,showTooltip:b=!0,showLegend:v=!0,showGridLines:x=!0,showGradient:k=!0,autoMinValue:S=!1,curveType:j="linear",minValue:O,maxValue:C,connectNulls:N=!1,allowDecimals:T=!0,noDataText:M,className:I,onValueChange:_,enableLegendSlider:R=!1,customTooltip:L,rotateLabelX:F,padding:B=!c&&!d||l&&!d?{left:0,right:0}:{left:20,right:20},tickGap:U=5,xAxisLabel:$,yAxisLabel:z}=e,W=Te(e,["data","categories","index","stack","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","showAnimation","animationDuration","showTooltip","showLegend","showGridLines","showGradient","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","padding","tickGap","xAxisLabel","yAxisLabel"]),K=L,[q,J]=g.useState(60),[V,me]=g.useState(void 0),[X,ce]=g.useState(void 0),oe=ks(n,i),Oe=ci(S,O,C),te=!!_;function Ne(ve){te&&(ve===X&&!V||ol(r,ve)&&V&&V.dataKey===ve?(ce(void 0),_?.(null)):(ce(ve),_?.({eventType:"category",categoryClicked:ve})),me(void 0))}return y.createElement("div",Object.assign({ref:t,className:Y("w-full h-80",I)},W),y.createElement(vi,{className:"h-full w-full"},r!=null&&r.length?y.createElement(i9,{data:r,onClick:te&&(X||V)?()=>{me(void 0),ce(void 0),_?.(null)}:void 0,margin:{bottom:$?30:void 0,left:z?20:void 0,right:z?5:void 0,top:5}},x?y.createElement(kd,{className:Y("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,y.createElement(pn,{padding:B,hide:!c,dataKey:o,tick:{transform:"translate(0, 6)"},ticks:l?[r[0][o],r[r.length-1][o]]:void 0,fill:"",stroke:"",className:Y("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),interval:l?"preserveStartEnd":m,tickLine:!1,axisLine:!1,minTickGap:U,angle:F?.angle,dy:F?.verticalShift,height:F?.xAxisHeight},$&&y.createElement(Jt,{position:"insideBottom",offset:-20,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},$)),y.createElement(mn,{width:f,hide:!d,axisLine:!1,tickLine:!1,type:"number",domain:Oe,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:Y("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:s,allowDecimals:T},z&&y.createElement(Jt,{position:"insideLeft",style:{textAnchor:"middle"},angle:-90,offset:-15,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},z)),y.createElement(ln,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:b?({active:ve,payload:G,label:ye})=>K?y.createElement(K,{payload:G?.map(le=>{var ge;return Object.assign(Object.assign({},le),{color:(ge=oe.get(le.dataKey))!==null&&ge!==void 0?ge:qe.Gray})}),active:ve,label:ye}):y.createElement(mj,{active:ve,payload:G,label:ye,valueFormatter:s,categoryColors:oe}):y.createElement(y.Fragment,null),position:{y:0}}),v?y.createElement(jo,{verticalAlign:"top",height:q,content:({payload:ve})=>wh({payload:ve},oe,J,X,te?G=>Ne(G):void 0,R)}):null,n.map(ve=>{var G,ye,le;const ge=((G=oe.get(ve))!==null&&G!==void 0?G:qe.Gray).replace("#","");return y.createElement("defs",{key:ve},k?y.createElement("linearGradient",{className:_e((ye=oe.get(ve))!==null&&ye!==void 0?ye:qe.Gray,Le.text).textColor,id:ge,x1:"0",y1:"0",x2:"0",y2:"1"},y.createElement("stop",{offset:"5%",stopColor:"currentColor",stopOpacity:V||X&&X!==ve?.15:.4}),y.createElement("stop",{offset:"95%",stopColor:"currentColor",stopOpacity:0})):y.createElement("linearGradient",{className:_e((le=oe.get(ve))!==null&&le!==void 0?le:qe.Gray,Le.text).textColor,id:ge,x1:"0",y1:"0",x2:"0",y2:"1"},y.createElement("stop",{stopColor:"currentColor",stopOpacity:V||X&&X!==ve?.1:.3})))}),n.map(ve=>{var G,ye;const le=((G=oe.get(ve))!==null&&G!==void 0?G:qe.Gray).replace("#","");return y.createElement(ka,{className:_e((ye=oe.get(ve))!==null&&ye!==void 0?ye:qe.Gray,Le.text).strokeColor,strokeOpacity:V||X&&X!==ve?.3:1,activeDot:ge=>{var Ce;const{cx:Me,cy:Ye,stroke:Ve,strokeLinecap:$e,strokeLinejoin:Ze,strokeWidth:rt,dataKey:nt}=ge;return y.createElement(To,{className:Y("stroke-tremor-background dark:stroke-dark-tremor-background",_?"cursor-pointer":"",_e((Ce=oe.get(nt))!==null&&Ce!==void 0?Ce:qe.Gray,Le.text).fillColor),cx:Me,cy:Ye,r:5,fill:"",stroke:Ve,strokeLinecap:$e,strokeLinejoin:Ze,strokeWidth:rt,onClick:(ht,ft)=>function(vt,Qt){Qt.stopPropagation(),te&&(vt.index===V?.index&&vt.dataKey===V?.dataKey||ol(r,vt.dataKey)&&X&&X===vt.dataKey?(ce(void 0),me(void 0),_?.(null)):(ce(vt.dataKey),me({index:vt.index,dataKey:vt.dataKey}),_?.(Object.assign({eventType:"dot",categoryClicked:vt.dataKey},vt.payload))))}(ge,ft)})},dot:ge=>{var Ce;const{stroke:Me,strokeLinecap:Ye,strokeLinejoin:Ve,strokeWidth:$e,cx:Ze,cy:rt,dataKey:nt,index:ht}=ge;return ol(r,ve)&&!(V||X&&X!==ve)||V?.index===ht&&V?.dataKey===ve?y.createElement(To,{key:ht,cx:Ze,cy:rt,r:5,stroke:Me,fill:"",strokeLinecap:Ye,strokeLinejoin:Ve,strokeWidth:$e,className:Y("stroke-tremor-background dark:stroke-dark-tremor-background",_?"cursor-pointer":"",_e((Ce=oe.get(nt))!==null&&Ce!==void 0?Ce:qe.Gray,Le.text).fillColor)}):y.createElement(g.Fragment,{key:ht})},key:ve,name:ve,type:j,dataKey:ve,stroke:"",fill:`url(#${le})`,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:p,animationDuration:h,stackId:a?"a":void 0,connectNulls:N})}),_?n.map(ve=>y.createElement(ui,{className:Y("cursor-pointer"),strokeOpacity:0,key:ve,name:ve,type:j,dataKey:ve,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:N,onClick:(G,ye)=>{ye.stopPropagation();const{name:le}=G;Ne(le)}})):null):y.createElement(Ea,{noDataText:M})))});td.displayName="AreaChart";const ak=y.forwardRef((e,t)=>{const{data:r=[],categories:n=[],index:o,colors:a=Bo,valueFormatter:i=No,layout:s="horizontal",stack:l=!1,relative:c=!1,startEndOnly:d=!1,animationDuration:f=900,showAnimation:m=!1,showXAxis:p=!0,showYAxis:h=!0,yAxisWidth:b=56,intervalType:v="equidistantPreserveStart",showTooltip:x=!0,showLegend:k=!0,showGridLines:S=!0,autoMinValue:j=!1,minValue:O,maxValue:C,allowDecimals:N=!0,noDataText:T,onValueChange:M,enableLegendSlider:I=!1,customTooltip:_,rotateLabelX:R,barCategoryGap:L,tickGap:F=5,xAxisLabel:B,yAxisLabel:U,className:$,padding:z=p||h?{left:20,right:20}:{left:0,right:0}}=e,W=Te(e,["data","categories","index","colors","valueFormatter","layout","stack","relative","startEndOnly","animationDuration","showAnimation","showXAxis","showYAxis","yAxisWidth","intervalType","showTooltip","showLegend","showGridLines","autoMinValue","minValue","maxValue","allowDecimals","noDataText","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","barCategoryGap","tickGap","xAxisLabel","yAxisLabel","className","padding"]),K=_,[q,J]=g.useState(60),V=ks(n,a),[me,X]=y.useState(void 0),[ce,oe]=g.useState(void 0),Oe=!!M;function te(ve,G,ye){var le,ge,Ce,Me;ye.stopPropagation(),M&&(ed(me,Object.assign(Object.assign({},ve.payload),{value:ve.value}))?(oe(void 0),X(void 0),M?.(null)):(oe((ge=(le=ve.tooltipPayload)===null||le===void 0?void 0:le[0])===null||ge===void 0?void 0:ge.dataKey),X(Object.assign(Object.assign({},ve.payload),{value:ve.value})),M?.(Object.assign({eventType:"bar",categoryClicked:(Me=(Ce=ve.tooltipPayload)===null||Ce===void 0?void 0:Ce[0])===null||Me===void 0?void 0:Me.dataKey},ve.payload))))}const Ne=ci(j,O,C);return y.createElement("div",Object.assign({ref:t,className:Y("w-full h-80",$)},W),y.createElement(vi,{className:"h-full w-full"},r!=null&&r.length?y.createElement(a9,{barCategoryGap:L,data:r,stackOffset:l?"sign":c?"expand":"none",layout:s==="vertical"?"vertical":"horizontal",onClick:Oe&&(ce||me)?()=>{X(void 0),oe(void 0),M?.(null)}:void 0,margin:{bottom:B?30:void 0,left:U?20:void 0,right:U?5:void 0,top:5}},S?y.createElement(kd,{className:Y("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:s!=="vertical",vertical:s==="vertical"}):null,s!=="vertical"?y.createElement(pn,{padding:z,hide:!p,dataKey:o,interval:d?"preserveStartEnd":v,tick:{transform:"translate(0, 6)"},ticks:d?[r[0][o],r[r.length-1][o]]:void 0,fill:"",stroke:"",className:Y("mt-4 text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,angle:R?.angle,dy:R?.verticalShift,height:R?.xAxisHeight,minTickGap:F},B&&y.createElement(Jt,{position:"insideBottom",offset:-20,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},B)):y.createElement(pn,{hide:!p,type:"number",tick:{transform:"translate(-3, 0)"},domain:Ne,fill:"",stroke:"",className:Y("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,tickFormatter:i,minTickGap:F,allowDecimals:N,angle:R?.angle,dy:R?.verticalShift,height:R?.xAxisHeight},B&&y.createElement(Jt,{position:"insideBottom",offset:-20,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},B)),s!=="vertical"?y.createElement(mn,{width:b,hide:!h,axisLine:!1,tickLine:!1,type:"number",domain:Ne,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:Y("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:c?ve=>`${(100*ve).toString()} %`:i,allowDecimals:N},U&&y.createElement(Jt,{position:"insideLeft",style:{textAnchor:"middle"},angle:-90,offset:-15,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},U)):y.createElement(mn,{width:b,hide:!h,dataKey:o,axisLine:!1,tickLine:!1,ticks:d?[r[0][o],r[r.length-1][o]]:void 0,type:"category",interval:"preserveStartEnd",tick:{transform:"translate(0, 6)"},fill:"",stroke:"",className:Y("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content")},U&&y.createElement(Jt,{position:"insideLeft",style:{textAnchor:"middle"},angle:-90,offset:-15,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},U)),y.createElement(ln,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{fill:"#d1d5db",opacity:"0.15"},content:x?({active:ve,payload:G,label:ye})=>K?y.createElement(K,{payload:G?.map(le=>{var ge;return Object.assign(Object.assign({},le),{color:(ge=V.get(le.dataKey))!==null&&ge!==void 0?ge:qe.Gray})}),active:ve,label:ye}):y.createElement(mj,{active:ve,payload:G,label:ye,valueFormatter:i,categoryColors:V}):y.createElement(y.Fragment,null),position:{y:0}}),k?y.createElement(jo,{verticalAlign:"top",height:q,content:({payload:ve})=>wh({payload:ve},V,J,ce,Oe?G=>{return ye=G,void(Oe&&(ye!==ce||me?(oe(ye),M?.({eventType:"category",categoryClicked:ye})):(oe(void 0),M?.(null)),X(void 0)));var ye}:void 0,I)}):null,n.map(ve=>{var G;return y.createElement(ki,{className:Y(_e((G=V.get(ve))!==null&&G!==void 0?G:qe.Gray,Le.background).fillColor,M?"cursor-pointer":""),key:ve,name:ve,type:"linear",stackId:l||c?"a":void 0,dataKey:ve,fill:"",isAnimationActive:m,animationDuration:f,shape:ye=>((le,ge,Ce,Me)=>{const{fillOpacity:Ye,name:Ve,payload:$e,value:Ze}=le;let{x:rt,width:nt,y:ht,height:ft}=le;return Me==="horizontal"&&ft<0?(ht+=ft,ft=Math.abs(ft)):Me==="vertical"&&nt<0&&(rt+=nt,nt=Math.abs(nt)),y.createElement("rect",{x:rt,y:ht,width:nt,height:ft,opacity:ge||Ce&&Ce!==Ve?ed(ge,Object.assign(Object.assign({},$e),{value:Ze}))?Ye:.3:Ye})})(ye,me,ce,s),onClick:te})})):y.createElement(Ea,{noDataText:T})))});ak.displayName="BarChart";const hse=({active:e,payload:t,valueFormatter:r})=>{if(e&&t!=null&&t[0]){const n=t?.[0];return y.createElement(fj,null,y.createElement("div",{className:Y("px-4 py-2")},y.createElement(pj,{value:r(n.value),name:n.name,color:n.payload.color})))}return null},gse=(e,t)=>e.map((r,n)=>{const o=n<t.length?t[n]:qe.Gray;return Object.assign(Object.assign({},r),{color:o,className:_e(o??qe.Gray,Le.background).fillColor,fill:""})}),bse=(e,t,r,n)=>e||t(((o,a)=>cj(o.map(i=>i[a])))(r,n)),vse=e=>{const{cx:t,cy:r,innerRadius:n,outerRadius:o,startAngle:a,endAngle:i,className:s}=e;return y.createElement("g",null,y.createElement(J2,{cx:t,cy:r,innerRadius:n,outerRadius:o,startAngle:a,endAngle:i,className:s,fill:"",opacity:.3,style:{outline:"none"}}))},m9=y.forwardRef((e,t)=>{const{data:r=[],category:n="value",index:o="name",colors:a=Bo,variant:i="donut",valueFormatter:s=No,label:l,showLabel:c=!0,animationDuration:d=900,showAnimation:f=!1,showTooltip:m=!0,noDataText:p,onValueChange:h,customTooltip:b,className:v}=e,x=Te(e,["data","category","index","colors","variant","valueFormatter","label","showLabel","animationDuration","showAnimation","showTooltip","noDataText","onValueChange","customTooltip","className"]),k=b,S=i=="donut",j=bse(l,s,r,n),[O,C]=y.useState(void 0),N=!!h;return g.useEffect(()=>{const T=document.querySelectorAll(".recharts-pie-sector");T&&T.forEach(M=>{M.setAttribute("style","outline: none")})},[O]),y.createElement("div",Object.assign({ref:t,className:Y("w-full h-40",v)},x),y.createElement(vi,{className:"h-full w-full"},r!=null&&r.length?y.createElement(Nie,{onClick:N&&O?()=>{C(void 0),h?.(null)}:void 0,margin:{top:0,left:0,right:0,bottom:0}},c&&S?y.createElement("text",{className:Y("fill-tremor-content-emphasis","dark:fill-dark-tremor-content-emphasis"),x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle"},j):null,y.createElement(wa,{className:Y("stroke-tremor-background dark:stroke-dark-tremor-background",h?"cursor-pointer":"cursor-default"),data:gse(r,a),cx:"50%",cy:"50%",startAngle:90,endAngle:-270,innerRadius:S?"75%":"0%",outerRadius:"100%",stroke:"",strokeLinejoin:"round",dataKey:n,nameKey:o,isAnimationActive:f,animationDuration:d,onClick:function(T,M,I){I.stopPropagation(),N&&(O===M?(C(void 0),h?.(null)):(C(M),h?.(Object.assign({eventType:"slice"},T.payload.payload))))},activeIndex:O,inactiveShape:vse,style:{outline:"none"}}),y.createElement(ln,{wrapperStyle:{outline:"none"},isAnimationActive:!1,content:m?({active:T,payload:M})=>{var I;return k?y.createElement(k,{payload:M?.map(_=>{var R,L,F;return Object.assign(Object.assign({},_),{color:(F=(L=(R=M?.[0])===null||R===void 0?void 0:R.payload)===null||L===void 0?void 0:L.color)!==null&&F!==void 0?F:qe.Gray})}),active:T,label:(I=M?.[0])===null||I===void 0?void 0:I.name}):y.createElement(hse,{active:T,payload:M,valueFormatter:s})}:y.createElement(y.Fragment,null)})):y.createElement(Ea,{noDataText:p})))});m9.displayName="DonutChart";const h9=y.forwardRef((e,t)=>{const{data:r=[],categories:n=[],index:o,colors:a=Bo,valueFormatter:i=No,startEndOnly:s=!1,showXAxis:l=!0,showYAxis:c=!0,yAxisWidth:d=56,intervalType:f="equidistantPreserveStart",animationDuration:m=900,showAnimation:p=!1,showTooltip:h=!0,showLegend:b=!0,showGridLines:v=!0,autoMinValue:x=!1,curveType:k="linear",minValue:S,maxValue:j,connectNulls:O=!1,allowDecimals:C=!0,noDataText:N,className:T,onValueChange:M,enableLegendSlider:I=!1,customTooltip:_,rotateLabelX:R,padding:L=l||c?{left:20,right:20}:{left:0,right:0},tickGap:F=5,xAxisLabel:B,yAxisLabel:U}=e,$=Te(e,["data","categories","index","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","animationDuration","showAnimation","showTooltip","showLegend","showGridLines","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","padding","tickGap","xAxisLabel","yAxisLabel"]),z=_,[W,K]=g.useState(60),[q,J]=g.useState(void 0),[V,me]=g.useState(void 0),X=ks(n,a),ce=ci(x,S,j),oe=!!M;function Oe(te){oe&&(te===V&&!q||ol(r,te)&&q&&q.dataKey===te?(me(void 0),M?.(null)):(me(te),M?.({eventType:"category",categoryClicked:te})),J(void 0))}return y.createElement("div",Object.assign({ref:t,className:Y("w-full h-80",T)},$),y.createElement(vi,{className:"h-full w-full"},r!=null&&r.length?y.createElement(o9,{data:r,onClick:oe&&(V||q)?()=>{J(void 0),me(void 0),M?.(null)}:void 0,margin:{bottom:B?30:void 0,left:U?20:void 0,right:U?5:void 0,top:5}},v?y.createElement(kd,{className:Y("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,y.createElement(pn,{padding:L,hide:!l,dataKey:o,interval:s?"preserveStartEnd":f,tick:{transform:"translate(0, 6)"},ticks:s?[r[0][o],r[r.length-1][o]]:void 0,fill:"",stroke:"",className:Y("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,minTickGap:F,angle:R?.angle,dy:R?.verticalShift,height:R?.xAxisHeight},B&&y.createElement(Jt,{position:"insideBottom",offset:-20,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},B)),y.createElement(mn,{width:d,hide:!c,axisLine:!1,tickLine:!1,type:"number",domain:ce,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:Y("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:i,allowDecimals:C},U&&y.createElement(Jt,{position:"insideLeft",style:{textAnchor:"middle"},angle:-90,offset:-15,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},U)),y.createElement(ln,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:h?({active:te,payload:Ne,label:ve})=>z?y.createElement(z,{payload:Ne?.map(G=>{var ye;return Object.assign(Object.assign({},G),{color:(ye=X.get(G.dataKey))!==null&&ye!==void 0?ye:qe.Gray})}),active:te,label:ve}):y.createElement(mj,{active:te,payload:Ne,label:ve,valueFormatter:i,categoryColors:X}):y.createElement(y.Fragment,null),position:{y:0}}),b?y.createElement(jo,{verticalAlign:"top",height:W,content:({payload:te})=>wh({payload:te},X,K,V,oe?Ne=>Oe(Ne):void 0,I)}):null,n.map(te=>{var Ne;return y.createElement(ui,{className:Y(_e((Ne=X.get(te))!==null&&Ne!==void 0?Ne:qe.Gray,Le.text).strokeColor),strokeOpacity:q||V&&V!==te?.3:1,activeDot:ve=>{var G;const{cx:ye,cy:le,stroke:ge,strokeLinecap:Ce,strokeLinejoin:Me,strokeWidth:Ye,dataKey:Ve}=ve;return y.createElement(To,{className:Y("stroke-tremor-background dark:stroke-dark-tremor-background",M?"cursor-pointer":"",_e((G=X.get(Ve))!==null&&G!==void 0?G:qe.Gray,Le.text).fillColor),cx:ye,cy:le,r:5,fill:"",stroke:ge,strokeLinecap:Ce,strokeLinejoin:Me,strokeWidth:Ye,onClick:($e,Ze)=>function(rt,nt){nt.stopPropagation(),oe&&(rt.index===q?.index&&rt.dataKey===q?.dataKey||ol(r,rt.dataKey)&&V&&V===rt.dataKey?(me(void 0),J(void 0),M?.(null)):(me(rt.dataKey),J({index:rt.index,dataKey:rt.dataKey}),M?.(Object.assign({eventType:"dot",categoryClicked:rt.dataKey},rt.payload))))}(ve,Ze)})},dot:ve=>{var G;const{stroke:ye,strokeLinecap:le,strokeLinejoin:ge,strokeWidth:Ce,cx:Me,cy:Ye,dataKey:Ve,index:$e}=ve;return ol(r,te)&&!(q||V&&V!==te)||q?.index===$e&&q?.dataKey===te?y.createElement(To,{key:$e,cx:Me,cy:Ye,r:5,stroke:ye,fill:"",strokeLinecap:le,strokeLinejoin:ge,strokeWidth:Ce,className:Y("stroke-tremor-background dark:stroke-dark-tremor-background",M?"cursor-pointer":"",_e((G=X.get(Ve))!==null&&G!==void 0?G:qe.Gray,Le.text).fillColor)}):y.createElement(g.Fragment,{key:$e})},key:te,name:te,type:k,dataKey:te,stroke:"",strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:p,animationDuration:m,connectNulls:O})}),M?n.map(te=>y.createElement(ui,{className:Y("cursor-pointer"),strokeOpacity:0,key:te,name:te,type:k,dataKey:te,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:O,onClick:(Ne,ve)=>{ve.stopPropagation();const{name:G}=Ne;Oe(G)}})):null):y.createElement(Ea,{noDataText:N})))});h9.displayName="LineChart";const yse=({children:e})=>y.createElement("div",{className:Y("rounded-tremor-default text-tremor-default border","bg-tremor-background shadow-tremor-dropdown border-tremor-border","dark:bg-dark-tremor-background dark:shadow-dark-tremor-dropdown dark:border-dark-tremor-border")},e),xse=({value:e,name:t})=>y.createElement("div",{className:"flex items-center justify-between space-x-8"},y.createElement("div",{className:"flex items-center space-x-2"},y.createElement("p",{className:Y("text-right whitespace-nowrap","text-tremor-content","dark:text-dark-tremor-content")},t)),y.createElement("p",{className:Y("font-medium tabular-nums text-right whitespace-nowrap","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e)),wse=({label:e,active:t,payload:r,valueFormatter:n,axis:o,category:a,categoryColors:i})=>{var s,l;return t&&r?y.createElement(yse,null,y.createElement("div",{className:Y("flex items-center space-x-2 border-b px-4 py-2","border-tremor-border","dark:border-dark-tremor-border")},y.createElement("span",{className:Y("shrink-0 rounded-tremor-full border-2 h-3 w-3","border-tremor-background shadow-tremor-card","dark:border-dark-tremor-background dark:shadow-dark-tremor-card",_e(a&&(l=i.get((s=r?.[0])===null||s===void 0?void 0:s.payload[a]))!==null&&l!==void 0?l:qe.Blue,Le.background).bgColor)}),y.createElement("p",{className:Y("font-medium","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e)),y.createElement("div",{className:Y("px-4 py-2 space-y-1")},r.map(({value:c,name:d},f)=>{var m,p;const h=(m=Object.keys(o).find(v=>o[v]===d))!==null&&m!==void 0?m:"",b=(p=n[h])!==null&&p!==void 0?p:No;return y.createElement(xse,{key:`id-${f}`,value:n&&b?b(c):`${c}`,name:d})}))):null},kse=y.forwardRef((e,t)=>{const{data:r=[],x:n,y:o,size:a,category:i,colors:s=Bo,showOpacity:l=!1,sizeRange:c=[1,1e3],valueFormatter:d={x:No,y:No,size:No},startEndOnly:f=!1,showXAxis:m=!0,showYAxis:p=!0,yAxisWidth:h=56,intervalType:b="equidistantPreserveStart",animationDuration:v=900,showAnimation:x=!1,showTooltip:k=!0,showLegend:S=!0,showGridLines:j=!0,autoMinXValue:O=!1,minXValue:C,maxXValue:N,autoMinYValue:T=!1,minYValue:M,maxYValue:I,allowDecimals:_=!0,noDataText:R,onValueChange:L,customTooltip:F,rotateLabelX:B,className:U,enableLegendSlider:$=!1,tickGap:z=5,xAxisLabel:W,yAxisLabel:K}=e,q=Te(e,["data","x","y","size","category","colors","showOpacity","sizeRange","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","animationDuration","showAnimation","showTooltip","showLegend","showGridLines","autoMinXValue","minXValue","maxXValue","autoMinYValue","minYValue","maxYValue","allowDecimals","noDataText","onValueChange","customTooltip","rotateLabelX","className","enableLegendSlider","tickGap","xAxisLabel","yAxisLabel"]),J=F,[V,me]=g.useState(60),[X,ce]=y.useState(void 0),[oe,Oe]=g.useState(void 0),te=!!L;function Ne(ge,Ce,Me){Me.stopPropagation(),te&&(ed(X,ge.node)?(Oe(void 0),ce(void 0),L?.(null)):(ce(ge.node),Oe(ge.payload[i]),L?.(Object.assign({eventType:"bubble",categoryClicked:ge.payload[i]},ge.payload))))}const ve=mse(r,i),G=ks(ve,s),ye=ci(O,C,N),le=ci(T,M,I);return y.createElement("div",Object.assign({ref:t,className:Y("w-full h-80",U)},q),y.createElement(vi,{className:"h-full w-full"},r!=null&&r.length?y.createElement(Oie,{onClick:te&&(oe||X)?()=>{ce(void 0),Oe(void 0),L?.(null)}:void 0,margin:{bottom:W?20:void 0,left:20,right:20,top:5}},j?y.createElement(kd,{className:Y("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!0}):null,n?y.createElement(pn,{hide:!m,dataKey:n,interval:f?"preserveStartEnd":b,tick:{transform:"translate(0, 6)"},ticks:f?[r[0][n],r[r.length-1][n]]:void 0,type:"number",name:n,fill:"",stroke:"",className:Y("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,tickFormatter:d.x,axisLine:!1,minTickGap:z,domain:ye,allowDataOverflow:!0,angle:B?.angle,dy:B?.verticalShift,height:B?.xAxisHeight},W&&y.createElement(Jt,{position:"insideBottom",offset:-20,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},W)):null,o?y.createElement(mn,{width:h,hide:!p,axisLine:!1,tickLine:!1,dataKey:o,type:"number",name:o,domain:le,tick:{transform:"translate(-3, 0)"},tickFormatter:d.y,fill:"",stroke:"",className:Y("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),allowDecimals:_,allowDataOverflow:!0},K&&y.createElement(Jt,{position:"insideLeft",style:{textAnchor:"middle"},angle:-90,offset:-15,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},K)):null,y.createElement(ln,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:k?({active:ge,payload:Ce,label:Me})=>{var Ye,Ve;const $e=i?(Ve=(Ye=Ce?.[0])===null||Ye===void 0?void 0:Ye.payload)===null||Ve===void 0?void 0:Ve[i]:Me;return J?y.createElement(J,{payload:Ce?.map(Ze=>{var rt;return Object.assign(Object.assign({},Ze),{color:(rt=G.get($e))!==null&&rt!==void 0?rt:qe.Gray})}),active:ge,label:$e}):y.createElement(wse,{active:ge,payload:Ce,label:$e,valueFormatter:d,axis:{x:n,y:o,size:a},category:i,categoryColors:G})}:y.createElement(y.Fragment,null)}),a?y.createElement(jd,{dataKey:a,type:"number",range:c,name:a}):null,ve.map(ge=>{var Ce,Me;return y.createElement(Ed,{className:Y(_e((Ce=G.get(ge))!==null&&Ce!==void 0?Ce:qe.Gray,Le.text).fillColor,l?_e((Me=G.get(ge))!==null&&Me!==void 0?Me:qe.Gray,Le.text).strokeColor:"",L?"cursor-pointer":""),fill:`url(#${G.get(ge)})`,fillOpacity:l?.7:1,key:ge,name:ge,data:i?r.filter(Ye=>Ye[i]===ge):r,isAnimationActive:x,animationDuration:v,shape:Ye=>((Ve,$e,Ze)=>{const{cx:rt,cy:nt,width:ht,node:ft,fillOpacity:vt,name:Qt}=Ve;return y.createElement(To,{cx:rt,cy:nt,r:ht/2,opacity:$e||Ze&&Ze!==Qt?ed($e,ft)?vt:.3:vt})})(Ye,X,oe),onClick:Ne})}),S?y.createElement(jo,{verticalAlign:"top",height:V,content:({payload:ge})=>wh({payload:ge},G,me,oe,te?Ce=>{return Me=Ce,void(te&&(Me!==oe||X?(Oe(Me),L?.({eventType:"category",categoryClicked:Me})):(Oe(void 0),L?.(null)),ce(void 0)));var Me}:void 0,$)}):null):y.createElement(Ea,{noDataText:R})))});kse.displayName="ScatterChart";const g9=e=>{var t=Te(e,[]);return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),y.createElement("path",{d:"M16.1716 10.9999L10.8076 5.63589L12.2218 4.22168L20 11.9999L12.2218 19.778L10.8076 18.3638L16.1716 12.9999H4V10.9999H16.1716Z"}))},jse=["100%","75%","50%","25%","0%"],Ese=y.forwardRef((e,t)=>{var r,n;const{data:o,evolutionGradient:a=!1,gradient:i=!0,valueFormatter:s=No,className:l,calculateFrom:c="first",color:d,variant:f="base",showGridLines:m=!0,showYAxis:p=c!=="previous",showXAxis:h=!0,showArrow:b=!0,xAxisLabel:v="",yAxisLabel:x="",yAxisPadding:k=p?x?70:45:0,showTooltip:S=!0,onValueChange:j,customTooltip:O,noDataText:C,rotateLabelX:N,barGap:T="20%"}=e,M=Te(e,["data","evolutionGradient","gradient","valueFormatter","className","calculateFrom","color","variant","showGridLines","showYAxis","showXAxis","showArrow","xAxisLabel","yAxisLabel","yAxisPadding","showTooltip","onValueChange","customTooltip","noDataText","rotateLabelX","barGap"]),I=h&&v?25:15,_=O,R=y.useRef(null),L=y.useRef(null),[F,B]=y.useState(0),[U,$]=y.useState(0),[z,W]=y.useState({x:0,y:0}),[K,q]=y.useState(void 0),J=!!j,V=y.useMemo(()=>Math.max(...o.map(G=>G.value)),[o]),me=F-10-k,X=y.useMemo(()=>{if(typeof T=="number")return T;if(typeof T=="string"&&T.endsWith("%")){const G=parseFloat(T.slice(0,-1));return me*G/100/(o.length-1)}return console.error('Invalid barGap value. It must be a number or a percentage string (e.g., "10%").'),30},[me,o.length,T]),ce=y.useMemo(()=>(me-(o.length-1)*X-X)/o.length,[me,X,o.length]),oe=U-10-(h?(N?.xAxisHeight||I)+(h&&v?30:10):0),Oe=c==="previous",te=f==="center";y.useLayoutEffect(()=>{const G=()=>{if(R.current){const ye=R.current.getBoundingClientRect();B(ye.width),$(ye.height)}};return G(),window.addEventListener("resize",G),()=>{window.removeEventListener("resize",G)}},[l]),y.useEffect(()=>{const G=()=>{if(L.current){const ye=L.current.getBoundingClientRect();ye.right>window.innerWidth&&(L.current.style.left=F-ye.width+"px")}};return G(),window.addEventListener("resize",G),()=>{window.removeEventListener("resize",G)}},[z,F]);const Ne=y.useMemo(()=>oe<=0?[]:o.reduce((G,ye,le)=>{var ge,Ce,Me,Ye;const Ve=G[le-1],$e=ye.value,Ze=Oe&&(ge=Ve?.value)!==null&&ge!==void 0?ge:V,rt=Oe&&(Ce=Ve?.barHeight)!==null&&Ce!==void 0?Ce:oe,nt=$e/Ze,ht=nt*rt,ft=le*(ce+X)+.5*X,vt=rt-ht+(Oe?oe-((Me=Ve?.barHeight)!==null&&Me!==void 0?Me:oe):0),Qt=(Ye=o[le+1])===null||Ye===void 0?void 0:Ye.value,Je=Qt/Ze,dt=Je*rt,Gt=(le+1)*(ce+X)+.5*X;return G.push({value:$e,normalizedValue:nt,name:ye.name,startX:ft,startY:vt,barHeight:ht,nextValue:Qt,nextNormalizedValue:Je,nextBarHeight:dt,nextStartX:Gt}),G},[]),[o,oe,Oe,ce,X,V]),ve=G=>{var ye;const le=(ye=R.current)===null||ye===void 0?void 0:ye.getBoundingClientRect();if(!le)return;const ge=le.x,Ce=le.y+window.scrollY,Me=ge+window.scrollX+k+5,Ye=Me+(le.width-k-5),Ve=Ce+(le.height-5-(h?I:0));if(G.pageX<Me||G.pageX>Ye||G.pageY<Ce||G.pageY>Ve)return console.log("out of bounds"),W({x:0,y:0});const $e=G.pageX-ge-ce/2-k-5,Ze=Ne.reduce((nt,ht)=>Math.abs(ht.startX-$e)<Math.abs(nt.startX-$e)?ht:nt),rt=Ne.findIndex(nt=>nt===Ze);W({x:Ze.startX,y:Ze.startY,data:{dataKey:Ze.name,name:Ze.name,value:Ze.value,color:d??qe.Blue,className:Y(_e(d??qe.Blue,Le.text).textColor,J?"cursor-pointer":"cursor-default"),fill:"",payload:Ze},index:rt})};return y.createElement("div",Object.assign({ref:t,className:Y("tremor-wrapper relative w-full h-80",l)},M),o!=null&&o.length?y.createElement(y.Fragment,null,y.createElement("svg",{ref:R,xmlns:"http://www.w3.org/2000/svg",className:Y("w-full h-full"),onMouseMove:G=>{const ye={clientX:G.clientX,clientY:G.clientY,pageX:G.pageX,pageY:G.pageY};ve(ye)},onTouchMove:G=>{const ye=G.touches[0];ve(ye)},onMouseLeave:()=>W({x:0,y:0}),onTouchEnd:()=>W({x:0,y:0})},jse.map((G,ye)=>y.createElement(y.Fragment,{key:`y-axis-${ye}`},m?y.createElement("line",{x1:k+5,y1:ye*oe/4+5,x2:F-5,y2:ye*oe/4+5,stroke:"currentColor",className:Y("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border")}):null,y.createElement("text",{x:k-10+5,y:ye*oe/4+5+5,textAnchor:"end",fill:"",stroke:"",className:Y("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content")},G))),Ne.map((G,ye)=>{var le,ge;return y.createElement("g",{key:`bar-${ye}`},y.createElement("rect",{x:G.startX-.5*X+5+k,y:5,width:ce+X,height:oe,fill:"currentColor",className:Y("z-0",z.index===ye?"text-[#d1d5db]/15":"text-transparent")}),i?y.createElement("rect",{x:G.startX+5+k,y:oe-(Oe&&((le=Ne[ye-1])===null||le===void 0?void 0:le.barHeight)||oe)+5,width:ce,height:(oe-G.barHeight-(Oe&&oe-((ge=Ne[ye-1])===null||ge===void 0?void 0:ge.barHeight)||0))/(te?2:1),fill:"url(#base-gradient)",className:Y(K&&K.index!==ye?"opacity-30":"")}):null,y.createElement("rect",{x:G.startX+5+k,y:(te?oe/2-G.barHeight/2:G.startY)+5,width:ce,height:G.barHeight,fill:"currentColor",className:Y(_e(d??qe.Blue,Le.text).textColor,K&&K.index!==ye?"opacity-30":"",J?"cursor-pointer":"cursor-default"),onClick:Ce=>function(Me,Ye,Ve){Ve.stopPropagation(),J&&(Ye===K?.index?(q(void 0),j(void 0)):(q({data:Me,index:Ye}),j({eventType:"bar",categoryClicked:Me.name,[Me.name]:Me.value,percentage:Me.normalizedValue})))}(G,ye,Ce)}),i&&te?y.createElement("rect",{x:G.startX+5+k,y:oe/2+G.barHeight/2+5,width:ce,height:(oe-G.barHeight)/2,fill:"url(#base-gradient-revert)",className:Y(K&&K.index!==ye?"opacity-30":"")}):null,h?y.createElement("foreignObject",{x:G.startX+5+k,y:oe+5+10,width:ce,height:N?.xAxisHeight||I,transform:N?`rotate(${N?.angle}, ${G.startX+ce/2+5+k}, ${oe+(N?.xAxisHeight||I)/2+5+(N?.verticalShift||0)})`:void 0},y.createElement("div",{className:Y("truncate text-center !text-tremor-label","text-tremor-content","dark:text-dark-tremor-content"),title:G.name},G.name)):null)}),Ne.map((G,ye)=>y.createElement(y.Fragment,{key:`gradient-${ye}`},ye<o.length-1&&a?y.createElement(y.Fragment,null,te?y.createElement(y.Fragment,null,y.createElement("polygon",{points:`
121
+ ${G.startX+ce+5+k}, ${oe/2+G.nextBarHeight/4+5}
122
+ ${G.nextStartX+5+k}, ${oe/2+G.nextBarHeight/4+5}
123
+ ${G.nextStartX+5+k}, ${oe/2-G.nextBarHeight/2+5}
124
+ ${G.startX+ce+5+k}, ${oe/2-G.barHeight/2+5}
125
+ `,fill:"url(#base-gradient)",className:Y("z-10",K&&K.index!==ye?"opacity-30":"")}),y.createElement("polygon",{points:`
126
+ ${G.startX+ce+5+k}, ${oe/2+G.barHeight/2+5}
127
+ ${G.nextStartX+5+k}, ${oe/2+G.nextBarHeight/2+5}
128
+ ${G.nextStartX+5+k}, ${oe/2-G.nextBarHeight/4+5}
129
+ ${G.startX+ce+5+k}, ${oe/2-G.nextBarHeight/4+5}
130
+ `,fill:"url(#base-gradient-revert)",className:Y("z-10",K&&K.index!==ye?"opacity-30":"")})):y.createElement("polygon",{points:`
131
+ ${G.startX+ce+5+k}, ${G.startY+5}
132
+ ${G.nextStartX+5+k}, ${oe-G.nextBarHeight+5}
133
+ ${G.nextStartX+5+k}, ${oe+5}
134
+ ${G.startX+ce+5+k}, ${oe+5}
135
+ `,fill:"url(#base-gradient)",className:Y("z-10",K&&K.index!==ye?"opacity-30":"")})):null,ye<o.length-1&&h&&b&&X>=14?y.createElement("foreignObject",{x:G.startX+ce+5+k-6+X/2,y:oe+5+11,width:12,height:N?.xAxisHeight||I},y.createElement("div",{className:Y("text-tremor-content","dark:text-dark-tremor-content")},y.createElement(g9,{className:"size-3.5 shrink-0"}))):null)),y.createElement("linearGradient",{id:"base-gradient",x1:"0%",y1:"0%",x2:"0%",y2:"100%",className:Y(_e(d??qe.Blue,Le.text).textColor)},y.createElement("stop",{offset:"5%",stopColor:"currentColor",stopOpacity:.4}),y.createElement("stop",{offset:"95%",stopColor:"currentColor",stopOpacity:0})),y.createElement("linearGradient",{id:"base-gradient-revert",x1:"0%",y1:"0%",x2:"0%",y2:"100%",className:Y(_e(d??qe.Blue,Le.text).textColor)},y.createElement("stop",{offset:"5%",stopColor:"currentColor",stopOpacity:0}),y.createElement("stop",{offset:"95%",stopColor:"currentColor",stopOpacity:.4})),h&&v?y.createElement("text",{x:F/2+k/2,y:oe+5+50,style:{textAnchor:"middle"},fill:"",stroke:"",className:Y("text-tremor-default cursor-default font-medium","fill-tremor-content-emphasis","dark:fill-dark-tremor-content-emphasis")},v):null,p&&x?y.createElement("text",{x:-5,y:oe/2+10,textAnchor:"middle",style:{textAnchor:"middle"},transform:`rotate(-90, 0, ${oe/2})`,fill:"",stroke:"",className:Y("text-tremor-default cursor-default font-medium","fill-tremor-content-emphasis","dark:fill-dark-tremor-content-emphasis")},x):null),S?y.createElement("div",{ref:L,className:Y("absolute top-0 pointer-events-none",z.data?"visible":"hidden"),tabIndex:-1,role:"dialog",style:{left:z.x+.66*ce}},_?y.createElement(_,{payload:z.data?[z.data]:[],active:!!z.data,label:(r=z.data)===null||r===void 0?void 0:r.name}):y.createElement(fj,null,y.createElement("div",{className:Y("border-tremor-border border-b px-4 py-2","dark:border-dark-tremor-border")},y.createElement("p",{className:Y("font-medium","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},(n=z?.data)===null||n===void 0?void 0:n.name)),y.createElement("div",{className:Y("px-4 py-2 space-y-1")},z.data?y.createElement(pj,{value:s(z.data.value),name:`${(100*z.data.payload.normalizedValue).toFixed(2)}%`,color:d??qe.Blue}):null))):null):y.createElement(Ea,{noDataText:C}))});Ese.displayName="FunnelChart";var Hf=typeof document<"u"?g.useLayoutEffect:g.useEffect;function am(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!am(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const a=o[n];if(!(a==="_owner"&&e.$$typeof)&&!am(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function sP(e){const t=g.useRef(e);return Hf(()=>{t.current=e}),t}function Sse(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,whileElementsMounted:a,open:i}=e,[s,l]=g.useState({x:null,y:null,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[c,d]=g.useState(n);am(c,n)||d(n);const f=g.useRef(null),m=g.useRef(null),p=g.useRef(s),h=sP(a),b=sP(o),[v,x]=g.useState(null),[k,S]=g.useState(null),j=g.useCallback(I=>{f.current!==I&&(f.current=I,x(I))},[]),O=g.useCallback(I=>{m.current!==I&&(m.current=I,S(I))},[]),C=g.useCallback(()=>{if(!f.current||!m.current)return;const I={placement:t,strategy:r,middleware:c};b.current&&(I.platform=b.current),Wk(f.current,m.current,I).then(_=>{const R={..._,isPositioned:!0};N.current&&!am(p.current,R)&&(p.current=R,Ht.flushSync(()=>{l(R)}))})},[c,t,r,b]);Hf(()=>{i===!1&&p.current.isPositioned&&(p.current.isPositioned=!1,l(I=>({...I,isPositioned:!1})))},[i]);const N=g.useRef(!1);Hf(()=>(N.current=!0,()=>{N.current=!1}),[]),Hf(()=>{if(v&&k){if(h.current)return h.current(v,k,C);C()}},[v,k,C,h]);const T=g.useMemo(()=>({reference:f,floating:m,setReference:j,setFloating:O}),[j,O]),M=g.useMemo(()=>({reference:v,floating:k}),[v,k]);return g.useMemo(()=>({...s,update:C,refs:T,elements:M,reference:j,floating:O}),[s,C,T,M,j,O])}var rd=typeof document<"u"?g.useLayoutEffect:g.useEffect;let $x=!1,Nse=0;const lP=()=>"floating-ui-"+Nse++;function Ose(){const[e,t]=g.useState(()=>$x?lP():void 0);return rd(()=>{e==null&&t(lP())},[]),g.useEffect(()=>{$x||($x=!0)},[]),e}const Cse=g.useId,uP=Cse||Ose;function Pse(){const e=new Map;return{emit(t,r){var n;(n=e.get(t))==null||n.forEach(o=>o(r))},on(t,r){e.set(t,[...e.get(t)||[],r])},off(t,r){e.set(t,(e.get(t)||[]).filter(n=>n!==r))}}}const Ase=g.createContext(null),Tse=g.createContext(null),b9=()=>{var e;return((e=g.useContext(Ase))==null?void 0:e.id)||null},hj=()=>g.useContext(Tse);function Ga(e){return e?.ownerDocument||document}function Mse(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function _se(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:r,version:n}=t;return r+"/"+n}).join(" "):navigator.userAgent}function gj(e){return Ga(e).defaultView||window}function yo(e){return e?e instanceof gj(e).Element:!1}function v9(e){return e?e instanceof gj(e).HTMLElement:!1}function Ise(e){if(typeof ShadowRoot>"u")return!1;const t=gj(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Dse(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(Mse())||t.test(_se()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Lse(e){return e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType!=="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0}function y9(e,t){const r=["mouse","pen"];return r.push("",void 0),r.includes(e)}function cP(e){const t=g.useRef(e);return rd(()=>{t.current=e}),t}const dP="data-floating-ui-safe-polygon";function Bx(e,t,r){return r&&!y9(r)?0:typeof e=="number"?e:e?.[t]}const Rse=function(e,t){let{enabled:r=!0,delay:n=0,handleClose:o=null,mouseOnly:a=!1,restMs:i=0,move:s=!0}=t===void 0?{}:t;const{open:l,onOpenChange:c,dataRef:d,events:f,elements:{domReference:m,floating:p},refs:h}=e,b=hj(),v=b9(),x=cP(o),k=cP(n),S=g.useRef(),j=g.useRef(),O=g.useRef(),C=g.useRef(),N=g.useRef(!0),T=g.useRef(!1),M=g.useRef(()=>{}),I=g.useCallback(()=>{var F;const B=(F=d.current.openEvent)==null?void 0:F.type;return B?.includes("mouse")&&B!=="mousedown"},[d]);g.useEffect(()=>{if(!r)return;function F(){clearTimeout(j.current),clearTimeout(C.current),N.current=!0}return f.on("dismiss",F),()=>{f.off("dismiss",F)}},[r,f]),g.useEffect(()=>{if(!r||!x.current||!l)return;function F(){I()&&c(!1)}const B=Ga(p).documentElement;return B.addEventListener("mouseleave",F),()=>{B.removeEventListener("mouseleave",F)}},[p,l,c,r,x,d,I]);const _=g.useCallback(function(F){F===void 0&&(F=!0);const B=Bx(k.current,"close",S.current);B&&!O.current?(clearTimeout(j.current),j.current=setTimeout(()=>c(!1),B)):F&&(clearTimeout(j.current),c(!1))},[k,c]),R=g.useCallback(()=>{M.current(),O.current=void 0},[]),L=g.useCallback(()=>{if(T.current){const F=Ga(h.floating.current).body;F.style.pointerEvents="",F.removeAttribute(dP),T.current=!1}},[h]);return g.useEffect(()=>{if(!r)return;function F(){return d.current.openEvent?["click","mousedown"].includes(d.current.openEvent.type):!1}function B(z){if(clearTimeout(j.current),N.current=!1,a&&!y9(S.current)||i>0&&Bx(k.current,"open")===0)return;d.current.openEvent=z;const W=Bx(k.current,"open",S.current);W?j.current=setTimeout(()=>{c(!0)},W):c(!0)}function U(z){if(F())return;M.current();const W=Ga(p);if(clearTimeout(C.current),x.current){l||clearTimeout(j.current),O.current=x.current({...e,tree:b,x:z.clientX,y:z.clientY,onClose(){L(),R(),_()}});const K=O.current;W.addEventListener("mousemove",K),M.current=()=>{W.removeEventListener("mousemove",K)};return}_()}function $(z){F()||x.current==null||x.current({...e,tree:b,x:z.clientX,y:z.clientY,onClose(){L(),R(),_()}})(z)}if(yo(m)){const z=m;return l&&z.addEventListener("mouseleave",$),p?.addEventListener("mouseleave",$),s&&z.addEventListener("mousemove",B,{once:!0}),z.addEventListener("mouseenter",B),z.addEventListener("mouseleave",U),()=>{l&&z.removeEventListener("mouseleave",$),p?.removeEventListener("mouseleave",$),s&&z.removeEventListener("mousemove",B),z.removeEventListener("mouseenter",B),z.removeEventListener("mouseleave",U)}}},[m,p,r,e,a,i,s,_,R,L,c,l,b,k,x,d]),rd(()=>{var F;if(r&&l&&(F=x.current)!=null&&F.__options.blockPointerEvents&&I()){const $=Ga(p).body;if($.setAttribute(dP,""),$.style.pointerEvents="none",T.current=!0,yo(m)&&p){var B,U;const z=m,W=b==null||(B=b.nodesRef.current.find(K=>K.id===v))==null||(U=B.context)==null?void 0:U.elements.floating;return W&&(W.style.pointerEvents=""),z.style.pointerEvents="auto",p.style.pointerEvents="auto",()=>{z.style.pointerEvents="",p.style.pointerEvents=""}}}},[r,l,v,p,m,b,x,d,I]),rd(()=>{l||(S.current=void 0,R(),L())},[l,R,L]),g.useEffect(()=>()=>{R(),clearTimeout(j.current),clearTimeout(C.current),L()},[r,R,L]),g.useMemo(()=>{if(!r)return{};function F(B){S.current=B.pointerType}return{reference:{onPointerDown:F,onPointerEnter:F,onMouseMove(){l||i===0||(clearTimeout(C.current),C.current=setTimeout(()=>{N.current||c(!0)},i))}},floating:{onMouseEnter(){clearTimeout(j.current)},onMouseLeave(){f.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),_(!1)}}}},[f,r,i,l,c,_])};function Fse(e){let t=e.activeElement;for(;((r=t)==null||(n=r.shadowRoot)==null?void 0:n.activeElement)!=null;){var r,n;t=t.shadowRoot.activeElement}return t}function fP(e,t){if(!e||!t)return!1;const r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&Ise(r)){let n=t;do{if(n&&e===n)return!0;n=n.parentNode||n.host}while(n)}return!1}function zx(e,t){let r=e.filter(o=>{var a;return o.parentId===t&&((a=o.context)==null?void 0:a.open)})||[],n=r;for(;n.length;)n=e.filter(o=>{var a;return(a=n)==null?void 0:a.some(i=>{var s;return o.parentId===i.id&&((s=o.context)==null?void 0:s.open)})})||[],r=r.concat(n);return r}function $se(e){return"composedPath"in e?e.composedPath()[0]:e.target}const Bse=g.useInsertionEffect,zse=Bse||(e=>e());function x9(e){const t=g.useRef(()=>{});return zse(()=>{t.current=e}),g.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}function qf(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const r=e;return r.target!=null&&t.contains(r.target)}const Hse={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},qse={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Wse=function(e){var t,r;return e===void 0&&(e=!0),{escapeKeyBubbles:typeof e=="boolean"?e:(t=e.escapeKey)!=null?t:!0,outsidePressBubbles:typeof e=="boolean"?e:(r=e.outsidePress)!=null?r:!0}},Use=function(e,t){let{open:r,onOpenChange:n,events:o,nodeId:a,elements:{reference:i,domReference:s,floating:l},dataRef:c}=e,{enabled:d=!0,escapeKey:f=!0,outsidePress:m=!0,outsidePressEvent:p="pointerdown",referencePress:h=!1,referencePressEvent:b="pointerdown",ancestorScroll:v=!1,bubbles:x=!0}={};const k=hj(),S=b9()!=null,j=x9(typeof m=="function"?m:()=>!1),O=typeof m=="function"?j:m,C=g.useRef(!1),{escapeKeyBubbles:N,outsidePressBubbles:T}=Wse(x);return g.useEffect(()=>{if(!r||!d)return;c.current.__escapeKeyBubbles=N,c.current.__outsidePressBubbles=T;function M(F){if(F.key==="Escape"){const B=k?zx(k.nodesRef.current,a):[];if(B.length>0){let U=!0;if(B.forEach($=>{var z;if((z=$.context)!=null&&z.open&&!$.context.dataRef.current.__escapeKeyBubbles){U=!1;return}}),!U)return}o.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),n(!1)}}function I(F){const B=C.current;if(C.current=!1,B||typeof O=="function"&&!O(F))return;const U=$se(F);if(v9(U)&&l){const W=l.ownerDocument.defaultView||window,K=U.scrollWidth>U.clientWidth,q=U.scrollHeight>U.clientHeight;let J=q&&F.offsetX>U.clientWidth;if(q&&W.getComputedStyle(U).direction==="rtl"&&(J=F.offsetX<=U.offsetWidth-U.clientWidth),J||K&&F.offsetY>U.clientHeight)return}const $=k&&zx(k.nodesRef.current,a).some(W=>{var K;return qf(F,(K=W.context)==null?void 0:K.elements.floating)});if(qf(F,l)||qf(F,s)||$)return;const z=k?zx(k.nodesRef.current,a):[];if(z.length>0){let W=!0;if(z.forEach(K=>{var q;if((q=K.context)!=null&&q.open&&!K.context.dataRef.current.__outsidePressBubbles){W=!1;return}}),!W)return}o.emit("dismiss",{type:"outsidePress",data:{returnFocus:S?{preventScroll:!0}:Dse(F)||Lse(F)}}),n(!1)}function _(){n(!1)}const R=Ga(l);f&&R.addEventListener("keydown",M),O&&R.addEventListener(p,I);let L=[];return v&&(yo(s)&&(L=Ja(s)),yo(l)&&(L=L.concat(Ja(l))),!yo(i)&&i&&i.contextElement&&(L=L.concat(Ja(i.contextElement)))),L=L.filter(F=>{var B;return F!==((B=R.defaultView)==null?void 0:B.visualViewport)}),L.forEach(F=>{F.addEventListener("scroll",_,{passive:!0})}),()=>{f&&R.removeEventListener("keydown",M),O&&R.removeEventListener(p,I),L.forEach(F=>{F.removeEventListener("scroll",_)})}},[c,l,s,i,f,O,p,o,k,a,r,n,v,d,N,T,S]),g.useEffect(()=>{C.current=!1},[O,p]),g.useMemo(()=>d?{reference:{[Hse[b]]:()=>{h&&(o.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),n(!1))}},floating:{[qse[p]]:()=>{C.current=!0}}}:{},[d,o,h,p,b,n])},Kse=function(e,t){let{open:r,onOpenChange:n,dataRef:o,events:a,refs:i,elements:{floating:s,domReference:l}}=e,{enabled:c=!0,keyboardOnly:d=!0}={};const f=g.useRef(""),m=g.useRef(!1),p=g.useRef();return g.useEffect(()=>{if(!c)return;const h=Ga(s).defaultView||window;function b(){!r&&v9(l)&&l===Fse(Ga(l))&&(m.current=!0)}return h.addEventListener("blur",b),()=>{h.removeEventListener("blur",b)}},[s,l,r,c]),g.useEffect(()=>{if(!c)return;function h(b){(b.type==="referencePress"||b.type==="escapeKey")&&(m.current=!0)}return a.on("dismiss",h),()=>{a.off("dismiss",h)}},[a,c]),g.useEffect(()=>()=>{clearTimeout(p.current)},[]),g.useMemo(()=>c?{reference:{onPointerDown(h){let{pointerType:b}=h;f.current=b,m.current=!!(b&&d)},onMouseLeave(){m.current=!1},onFocus(h){var b;m.current||h.type==="focus"&&((b=o.current.openEvent)==null?void 0:b.type)==="mousedown"&&o.current.openEvent&&qf(o.current.openEvent,l)||(o.current.openEvent=h.nativeEvent,n(!0))},onBlur(h){m.current=!1;const b=h.relatedTarget,v=yo(b)&&b.hasAttribute("data-floating-ui-focus-guard")&&b.getAttribute("data-type")==="outside";p.current=setTimeout(()=>{fP(i.floating.current,b)||fP(l,b)||v||n(!1)})}}}:{},[c,d,l,i,o,n])},Vse=function(e,t){let{open:r}=e,{enabled:n=!0,role:o="dialog"}=t===void 0?{}:t;const a=uP(),i=uP();return g.useMemo(()=>{const s={id:a,role:o};return n?o==="tooltip"?{reference:{"aria-describedby":r?a:void 0},floating:s}:{reference:{"aria-expanded":r?"true":"false","aria-haspopup":o==="alertdialog"?"dialog":o,"aria-controls":r?a:void 0,...o==="listbox"&&{role:"combobox"},...o==="menu"&&{id:i}},floating:{...s,...o==="menu"&&{"aria-labelledby":i}}}:{}},[n,o,r,a,i])};function Gse(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:r,nodeId:n}=e,o=Sse(e),a=hj(),i=g.useRef(null),s=g.useRef({}),l=g.useState(()=>Pse())[0],[c,d]=g.useState(null),f=g.useCallback(x=>{const k=yo(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),contextElement:x}:x;o.refs.setReference(k)},[o.refs]),m=g.useCallback(x=>{(yo(x)||x===null)&&(i.current=x,d(x)),(yo(o.refs.reference.current)||o.refs.reference.current===null||x!==null&&!yo(x))&&o.refs.setReference(x)},[o.refs]),p=g.useMemo(()=>({...o.refs,setReference:m,setPositionReference:f,domReference:i}),[o.refs,m,f]),h=g.useMemo(()=>({...o.elements,domReference:c}),[o.elements,c]),b=x9(r),v=g.useMemo(()=>({...o,refs:p,elements:h,dataRef:s,nodeId:n,events:l,open:t,onOpenChange:b}),[o,n,l,t,b,p,h]);return rd(()=>{const x=a?.nodesRef.current.find(k=>k.id===n);x&&(x.context=v)}),g.useMemo(()=>({...o,context:v,refs:p,reference:m,positionReference:f}),[o,p,v,m,f])}function Hx(e,t,r){const n=new Map;return{...r==="floating"&&{tabIndex:-1},...e,...t.map(o=>o?o[r]:null).concat(e).reduce((o,a)=>(a&&Object.entries(a).forEach(i=>{let[s,l]=i;if(s.indexOf("on")===0){if(n.has(s)||n.set(s,[]),typeof l=="function"){var c;(c=n.get(s))==null||c.push(l),o[s]=function(){for(var d,f=arguments.length,m=new Array(f),p=0;p<f;p++)m[p]=arguments[p];(d=n.get(s))==null||d.forEach(h=>h(...m))}}}else o[s]=l}),o),{})}}const Yse=function(e){e===void 0&&(e=[]);const t=e,r=g.useCallback(a=>Hx(a,e,"reference"),t),n=g.useCallback(a=>Hx(a,e,"floating"),t),o=g.useCallback(a=>Hx(a,e,"item"),e.map(a=>a?.item));return g.useMemo(()=>({getReferenceProps:r,getFloatingProps:n,getItemProps:o}),[r,n,o])},Fn=e=>{const[t,r]=g.useState(!1),[n,o]=g.useState(),{x:a,y:i,refs:s,strategy:l,context:c}=Gse({open:t,onOpenChange:v=>{if(v&&e){const x=setTimeout(()=>{r(v)},e);o(x)}else clearTimeout(n),r(v)},placement:"top",whileElementsMounted:Nm,middleware:[zk(5),qk({fallbackAxisSideDirection:"start"}),Hk()]}),d=Rse(c,{move:!1}),f=Kse(c),m=Use(c),p=Vse(c,{role:"tooltip"}),{getReferenceProps:h,getFloatingProps:b}=Yse([d,f,m,p]);return{tooltipProps:{open:t,x:a,y:i,refs:s,strategy:l,getFloatingProps:b},getReferenceProps:h}},On=({text:e,open:t,x:r,y:n,refs:o,strategy:a,getFloatingProps:i})=>t&&e?y.createElement("div",Object.assign({className:Y("max-w-xs text-sm z-20 rounded-tremor-default opacity-100 px-2.5 py-1","text-white bg-tremor-background-emphasis","dark:text-tremor-content-emphasis dark:bg-white"),ref:o.setFloating,style:{position:a,top:n??0,left:r??0}},i()),e):null;On.displayName="Tooltip";const qx={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-0.5",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-0.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-0.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-1",fontSize:"text-xl"}},pP={xs:{height:"h-4",width:"w-4"},sm:{height:"h-4",width:"w-4"},md:{height:"h-4",width:"w-4"},lg:{height:"h-5",width:"w-5"},xl:{height:"h-6",width:"w-6"}},Wx=at("Badge"),kh=y.forwardRef((e,t)=>{const{color:r,icon:n,size:o=xh.SM,tooltip:a,className:i,children:s}=e,l=Te(e,["color","icon","size","tooltip","className","children"]),c=n||null,{tooltipProps:d,getReferenceProps:f}=Fn();return y.createElement("span",Object.assign({ref:ja([t,d.refs.setReference]),className:Y(Wx("root"),"w-max shrink-0 inline-flex justify-center items-center cursor-default rounded-tremor-small ring-1 ring-inset",r?Y(_e(r,Le.background).bgColor,_e(r,Le.iconText).textColor,_e(r,Le.iconRing).ringColor,"bg-opacity-10 ring-opacity-20","dark:bg-opacity-5 dark:ring-opacity-60"):Y("bg-tremor-brand-faint text-tremor-brand-emphasis ring-tremor-brand/20","dark:bg-dark-tremor-brand-muted/50 dark:text-dark-tremor-brand dark:ring-dark-tremor-subtle/20"),qx[o].paddingX,qx[o].paddingY,qx[o].fontSize,i)},f,l),y.createElement(On,Object.assign({text:a},d)),c?y.createElement(c,{className:Y(Wx("icon"),"shrink-0 -ml-1 mr-1.5",pP[o].height,pP[o].width)}):null,y.createElement("span",{className:Y(Wx("text"),"whitespace-nowrap")},s))});kh.displayName="Badge";const Xse=e=>{var t=Te(e,[]);return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),y.createElement("path",{d:"M13.0001 16.1716L18.3641 10.8076L19.7783 12.2218L12.0001 20L4.22192 12.2218L5.63614 10.8076L11.0001 16.1716V4H13.0001V16.1716Z"}))},Zse=e=>{var t=Te(e,[]);return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),y.createElement("path",{d:"M14.5895 16.0032L5.98291 7.39664L7.39712 5.98242L16.0037 14.589V7.00324H18.0037V18.0032H7.00373V16.0032H14.5895Z"}))},Jse=e=>{var t=Te(e,[]);return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),y.createElement("path",{d:"M13.0001 7.82843V20H11.0001V7.82843L5.63614 13.1924L4.22192 11.7782L12.0001 4L19.7783 11.7782L18.3641 13.1924L13.0001 7.82843Z"}))},Qse=e=>{var t=Te(e,[]);return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),y.createElement("path",{d:"M16.0037 9.41421L7.39712 18.0208L5.98291 16.6066L14.5895 8H7.00373V6H18.0037V17H16.0037V9.41421Z"}))},ele={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-1",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-1.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-1.5",fontSize:"text-lg"},xl:{paddingX:"px-3.5",paddingY:"py-1.5",fontSize:"text-xl"}},tle={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-0.5",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-0.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-0.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-1",fontSize:"text-xl"}},mP={xs:{height:"h-4",width:"w-4"},sm:{height:"h-4",width:"w-4"},md:{height:"h-4",width:"w-4"},lg:{height:"h-5",width:"w-5"},xl:{height:"h-6",width:"w-6"}},Ux={[tr.Increase]:{bgColor:_e(qe.Emerald,Le.background).bgColor,textColor:_e(qe.Emerald,Le.iconText).textColor,ringColor:_e(qe.Emerald,Le.iconRing).ringColor},[tr.ModerateIncrease]:{bgColor:_e(qe.Emerald,Le.background).bgColor,textColor:_e(qe.Emerald,Le.iconText).textColor,ringColor:_e(qe.Emerald,Le.iconRing).ringColor},[tr.Decrease]:{bgColor:_e(qe.Red,Le.background).bgColor,textColor:_e(qe.Red,Le.iconText).textColor,ringColor:_e(qe.Red,Le.iconRing).ringColor},[tr.ModerateDecrease]:{bgColor:_e(qe.Red,Le.background).bgColor,textColor:_e(qe.Red,Le.iconText).textColor,ringColor:_e(qe.Red,Le.iconRing).ringColor},[tr.Unchanged]:{bgColor:_e(qe.Orange,Le.background).bgColor,textColor:_e(qe.Orange,Le.iconText).textColor,ringColor:_e(qe.Orange,Le.iconRing).ringColor}},rle={[tr.Increase]:Jse,[tr.ModerateIncrease]:Qse,[tr.Decrease]:Xse,[tr.ModerateDecrease]:Zse,[tr.Unchanged]:g9},Kx=at("BadgeDelta"),nle=y.forwardRef((e,t)=>{const{deltaType:r=tr.Increase,isIncreasePositive:n=!0,size:o=xh.SM,tooltip:a,children:i,className:s}=e,l=Te(e,["deltaType","isIncreasePositive","size","tooltip","children","className"]),c=rle[r],d=f9(r,n),f=i?tle:ele,{tooltipProps:m,getReferenceProps:p}=Fn();return y.createElement("span",Object.assign({ref:ja([t,m.refs.setReference]),className:Y(Kx("root"),"w-max shrink-0 inline-flex justify-center items-center cursor-default rounded-tremor-small ring-1 ring-inset",Ux[d].bgColor,Ux[d].textColor,Ux[d].ringColor,f[o].paddingX,f[o].paddingY,f[o].fontSize,"bg-opacity-10 ring-opacity-20","dark:bg-opacity-5 dark:ring-opacity-60",s)},p,l),y.createElement(On,Object.assign({text:a},m)),y.createElement(c,{className:Y(Kx("icon"),"shrink-0",i?Y("-ml-1 mr-1.5"):mP[o].height,mP[o].width)}),i?y.createElement("span",{className:Y(Kx("text"),"whitespace-nowrap")},i):null)});nle.displayName="BadgeDelta";const hP={xs:{paddingX:"px-1.5",paddingY:"py-1.5"},sm:{paddingX:"px-1.5",paddingY:"py-1.5"},md:{paddingX:"px-2",paddingY:"py-2"},lg:{paddingX:"px-2",paddingY:"py-2"},xl:{paddingX:"px-2.5",paddingY:"py-2.5"}},gP={xs:{height:"h-3",width:"w-3"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-7",width:"w-7"},xl:{height:"h-9",width:"w-9"}},Of={simple:{rounded:"",border:"",ring:"",shadow:""},light:{rounded:"rounded-tremor-default",border:"",ring:"",shadow:""},shadow:{rounded:"rounded-tremor-default",border:"border",ring:"",shadow:"shadow-tremor-card dark:shadow-dark-tremor-card"},solid:{rounded:"rounded-tremor-default",border:"border-2",ring:"ring-1",shadow:""},outlined:{rounded:"rounded-tremor-default",border:"border",ring:"ring-2",shadow:""}},ole=(e,t)=>{switch(e){case"simple":return{textColor:t?_e(t,Le.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:t?_e(t,Le.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?Y(_e(t,Le.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:t?_e(t,Le.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?Y(_e(t,Le.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:"border-tremor-border dark:border-dark-tremor-border",ringColor:""};case"solid":return{textColor:t?_e(t,Le.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:t?Y(_e(t,Le.background).bgColor,"bg-opacity-20"):"bg-tremor-brand dark:bg-dark-tremor-brand",borderColor:"border-tremor-brand-inverted dark:border-dark-tremor-brand-inverted",ringColor:"ring-tremor-ring dark:ring-dark-tremor-ring"};case"outlined":return{textColor:t?_e(t,Le.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?Y(_e(t,Le.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:t?_e(t,Le.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:t?Y(_e(t,Le.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}},bP=at("Icon"),ale={Simple:"simple"},w9=y.forwardRef((e,t)=>{const{icon:r,variant:n=ale.Simple,tooltip:o,size:a=xh.SM,color:i,className:s}=e,l=Te(e,["icon","variant","tooltip","size","color","className"]),c=r,d=ole(n,i),{tooltipProps:f,getReferenceProps:m}=Fn();return y.createElement("span",Object.assign({ref:ja([t,f.refs.setReference]),className:Y(bP("root"),"inline-flex shrink-0 items-center justify-center",d.bgColor,d.textColor,d.borderColor,d.ringColor,Of[n].rounded,Of[n].border,Of[n].shadow,Of[n].ring,hP[a].paddingX,hP[a].paddingY,s)},m,l),y.createElement(On,Object.assign({text:o},f)),y.createElement(c,{className:Y(bP("icon"),"shrink-0",gP[a].height,gP[a].width)}))});w9.displayName="Icon";const ik=0,sk=1,im=2,sm=3,lm=4,ile=5,k9=6,sle=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],j9=e=>({_s:e,status:sle[e],isEnter:e<sm,isMounted:e!==k9,isResolved:e===im||e>lm}),lk=e=>e?k9:ile,lle=(e,t)=>{switch(e){case sk:case ik:return im;case lm:case sm:return lk(t)}},ule=e=>typeof e=="object"?[e.enter,e.exit]:[e,e],cle=(e,t)=>setTimeout(()=>{isNaN(document.body.offsetTop)||e(t+1)},0),vP=(e,t,r,n,o)=>{clearTimeout(n.current);const a=j9(e);t(a),r.current=a,o&&o({current:a})},dle=({enter:e=!0,exit:t=!0,preEnter:r,preExit:n,timeout:o,initialEntered:a,mountOnEnter:i,unmountOnExit:s,onStateChange:l}={})=>{const[c,d]=g.useState(()=>j9(a?im:lk(i))),f=g.useRef(c),m=g.useRef(),[p,h]=ule(o),b=g.useCallback(()=>{const x=lle(f.current._s,s);x&&vP(x,d,f,m,l)},[l,s]),v=g.useCallback(x=>{const k=j=>{switch(vP(j,d,f,m,l),j){case sk:p>=0&&(m.current=setTimeout(b,p));break;case lm:h>=0&&(m.current=setTimeout(b,h));break;case ik:case sm:m.current=cle(k,j);break}},S=f.current.isEnter;typeof x!="boolean"&&(x=!S),x?!S&&k(e?r?ik:sk:im):S&&k(t?n?sm:lm:lk(s))},[b,l,e,t,r,n,p,h,s]);return[c,v,b]},fle=e=>{var t=Te(e,[]);return y.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),y.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),y.createElement("path",{d:"M18.364 5.636L16.95 7.05A7 7 0 1 0 19 12h2a9 9 0 1 1-2.636-6.364z"}))},yP={xs:{height:"h-4",width:"w-4"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-6",width:"w-6"},xl:{height:"h-6",width:"w-6"}},ple=e=>e!=="light"?{xs:{paddingX:"px-2.5",paddingY:"py-1.5",fontSize:"text-xs"},sm:{paddingX:"px-4",paddingY:"py-2",fontSize:"text-sm"},md:{paddingX:"px-4",paddingY:"py-2",fontSize:"text-md"},lg:{paddingX:"px-4",paddingY:"py-2.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-3",fontSize:"text-xl"}}:{xs:{paddingX:"",paddingY:"",fontSize:"text-xs"},sm:{paddingX:"",paddingY:"",fontSize:"text-sm"},md:{paddingX:"",paddingY:"",fontSize:"text-md"},lg:{paddingX:"",paddingY:"",fontSize:"text-lg"},xl:{paddingX:"",paddingY:"",fontSize:"text-xl"}},Cf=(e,t)=>{switch(e){case"primary":return{textColor:t?_e("white").textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",hoverTextColor:t?_e("white").textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:t?_e(t,Le.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",hoverBgColor:t?_e(t,Le.darkBackground).hoverBgColor:"hover:bg-tremor-brand-emphasis dark:hover:bg-dark-tremor-brand-emphasis",borderColor:t?_e(t,Le.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand",hoverBorderColor:t?_e(t,Le.darkBorder).hoverBorderColor:"hover:border-tremor-brand-emphasis dark:hover:border-dark-tremor-brand-emphasis"};case"secondary":return{textColor:t?_e(t,Le.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",hoverTextColor:t?_e(t,Le.text).textColor:"hover:text-tremor-brand-emphasis dark:hover:text-dark-tremor-brand-emphasis",bgColor:_e("transparent").bgColor,hoverBgColor:t?Y(_e(t,Le.background).hoverBgColor,"hover:bg-opacity-20 dark:hover:bg-opacity-20"):"hover:bg-tremor-brand-faint dark:hover:bg-dark-tremor-brand-faint",borderColor:t?_e(t,Le.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand"};case"light":return{textColor:t?_e(t,Le.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",hoverTextColor:t?_e(t,Le.darkText).hoverTextColor:"hover:text-tremor-brand-emphasis dark:hover:text-dark-tremor-brand-emphasis",bgColor:_e("transparent").bgColor,borderColor:"",hoverBorderColor:""}}},um=at("Button"),xP=({loading:e,iconSize:t,iconPosition:r,Icon:n,needMargin:o,transitionStatus:a})=>{const i=o?r===rl.Left?Y("-ml-1","mr-1.5"):Y("-mr-1","ml-1.5"):"",s=Y("w-0 h-0"),l={default:s,entering:s,entered:t,exiting:t,exited:s};return e?y.createElement(fle,{className:Y(um("icon"),"animate-spin shrink-0",i,l.default,l[a]),style:{transition:"width 150ms"}}):y.createElement(n,{className:Y(um("icon"),"shrink-0",t,i)})},al=y.forwardRef((e,t)=>{const{icon:r,iconPosition:n=rl.Left,size:o=xh.SM,color:a,variant:i="primary",disabled:s,loading:l=!1,loadingText:c,children:d,tooltip:f,className:m}=e,p=Te(e,["icon","iconPosition","size","color","variant","disabled","loading","loadingText","children","tooltip","className"]),h=r,b=l||s,v=h!==void 0||l,x=l&&c,k=!(!d&&!x),S=Y(yP[o].height,yP[o].width),j=i!=="light"?Y("rounded-tremor-default border","shadow-tremor-input","dark:shadow-dark-tremor-input"):"",O=Cf(i,a),C=ple(i)[o],{tooltipProps:N,getReferenceProps:T}=Fn(300),[M,I]=dle({timeout:50});return g.useEffect(()=>{I(l)},[l]),y.createElement("button",Object.assign({ref:ja([t,N.refs.setReference]),className:Y(um("root"),"shrink-0 inline-flex justify-center items-center group font-medium outline-none",j,C.paddingX,C.paddingY,C.fontSize,O.textColor,O.bgColor,O.borderColor,O.hoverBorderColor,b?"opacity-50 cursor-not-allowed":Y(Cf(i,a).hoverTextColor,Cf(i,a).hoverBgColor,Cf(i,a).hoverBorderColor),m),disabled:b},T,p),y.createElement(On,Object.assign({text:f},N)),v&&n!==rl.Right?y.createElement(xP,{loading:l,iconSize:S,iconPosition:n,Icon:h,transitionStatus:M.status,needMargin:k}):null,x||d?y.createElement("span",{className:Y(um("text"),"text-tremor-default whitespace-nowrap")},x?c:d):null,v&&n===rl.Right?y.createElement(xP,{loading:l,iconSize:S,iconPosition:n,Icon:h,transitionStatus:M.status,needMargin:k}):null)});al.displayName="Button";function _t(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function hn(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Jr(e,t){const r=_t(e);return isNaN(t)?hn(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function $n(e,t){const r=_t(e);if(isNaN(t))return hn(e,NaN);if(!t)return r;const n=r.getDate(),o=hn(e,r.getTime());o.setMonth(r.getMonth()+t+1,0);const a=o.getDate();return n>=a?o:(r.setFullYear(o.getFullYear(),o.getMonth(),n),r)}const bj=6048e5,mle=864e5;let hle={};function Nd(){return hle}function Mo(e,t){var r,n,o,a;const i=Nd(),s=t?.weekStartsOn??((n=(r=t?.locale)==null?void 0:r.options)==null?void 0:n.weekStartsOn)??i.weekStartsOn??((a=(o=i.locale)==null?void 0:o.options)==null?void 0:a.weekStartsOn)??0,l=_t(e),c=l.getDay(),d=(c<s?7:0)+c-s;return l.setDate(l.getDate()-d),l.setHours(0,0,0,0),l}function hs(e){return Mo(e,{weekStartsOn:1})}function E9(e){const t=_t(e),r=t.getFullYear(),n=hn(e,0);n.setFullYear(r+1,0,4),n.setHours(0,0,0,0);const o=hs(n),a=hn(e,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const i=hs(a);return t.getTime()>=o.getTime()?r+1:t.getTime()>=i.getTime()?r:r-1}function _o(e){const t=_t(e);return t.setHours(0,0,0,0),t}function cm(e){const t=_t(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function xo(e,t){const r=_o(e),n=_o(t),o=+r-cm(r),a=+n-cm(n);return Math.round((o-a)/mle)}function gle(e){const t=E9(e),r=hn(e,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),hs(r)}function uk(e,t){const r=t*7;return Jr(e,r)}function ck(e,t){return $n(e,t*12)}function S9(e){let t;return e.forEach(function(r){const n=_t(r);(t===void 0||t<n||isNaN(Number(n)))&&(t=n)}),t||new Date(NaN)}function N9(e){let t;return e.forEach(r=>{const n=_t(r);(!t||t>n||isNaN(+n))&&(t=n)}),t||new Date(NaN)}function fn(e,t){const r=_o(e),n=_o(t);return+r==+n}function vj(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ble(e){if(!vj(e)&&typeof e!="number")return!1;const t=_t(e);return!isNaN(Number(t))}function nd(e,t){const r=_t(e),n=_t(t),o=r.getFullYear()-n.getFullYear(),a=r.getMonth()-n.getMonth();return o*12+a}function vle(e,t,r){const n=Mo(e,r),o=Mo(t,r),a=+n-cm(n),i=+o-cm(o);return Math.round((a-i)/bj)}function yj(e){const t=_t(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(23,59,59,999),t}function zr(e){const t=_t(e);return t.setDate(1),t.setHours(0,0,0,0),t}function xj(e){const t=_t(e),r=hn(e,0);return r.setFullYear(t.getFullYear(),0,1),r.setHours(0,0,0,0),r}function wj(e,t){var r,n,o,a;const i=Nd(),s=t?.weekStartsOn??((n=(r=t?.locale)==null?void 0:r.options)==null?void 0:n.weekStartsOn)??i.weekStartsOn??((a=(o=i.locale)==null?void 0:o.options)==null?void 0:a.weekStartsOn)??0,l=_t(e),c=l.getDay(),d=(c<s?-7:0)+6-(c-s);return l.setDate(l.getDate()+d),l.setHours(23,59,59,999),l}function O9(e){return wj(e,{weekStartsOn:1})}const yle={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},xle=(e,t,r)=>{let n;const o=yle[e];return typeof o=="string"?n=o:t===1?n=o.one:n=o.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function Vx(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const wle={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},kle={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},jle={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ele={date:Vx({formats:wle,defaultWidth:"full"}),time:Vx({formats:kle,defaultWidth:"full"}),dateTime:Vx({formats:jle,defaultWidth:"full"})},Sle={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Nle=(e,t,r,n)=>Sle[e];function $u(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let o;if(n==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,s=r!=null&&r.width?String(r.width):i;o=e.formattingValues[s]||e.formattingValues[i]}else{const i=e.defaultWidth,s=r!=null&&r.width?String(r.width):e.defaultWidth;o=e.values[s]||e.values[i]}const a=e.argumentCallback?e.argumentCallback(t):t;return o[a]}}const Ole={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Cle={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ple={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Ale={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Tle={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Mle={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},_le=(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},Ile={ordinalNumber:_le,era:$u({values:Ole,defaultWidth:"wide"}),quarter:$u({values:Cle,defaultWidth:"wide",argumentCallback:e=>e-1}),month:$u({values:Ple,defaultWidth:"wide"}),day:$u({values:Ale,defaultWidth:"wide"}),dayPeriod:$u({values:Tle,defaultWidth:"wide",formattingValues:Mle,defaultFormattingWidth:"wide"})};function Bu(e){return(t,r={})=>{const n=r.width,o=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=t.match(o);if(!a)return null;const i=a[0],s=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?Lle(s,f=>f.test(i)):Dle(s,f=>f.test(i));let c;c=e.valueCallback?e.valueCallback(l):l,c=r.valueCallback?r.valueCallback(c):c;const d=t.slice(i.length);return{value:c,rest:d}}}function Dle(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function Lle(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function Rle(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const o=n[0],a=t.match(e.parsePattern);if(!a)return null;let i=e.valueCallback?e.valueCallback(a[0]):a[0];i=r.valueCallback?r.valueCallback(i):i;const s=t.slice(o.length);return{value:i,rest:s}}}const Fle=/^(\d+)(th|st|nd|rd)?/i,$le=/\d+/i,Ble={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},zle={any:[/^b/i,/^(a|c)/i]},Hle={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},qle={any:[/1/i,/2/i,/3/i,/4/i]},Wle={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Ule={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Kle={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Vle={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Gle={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Yle={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Xle={ordinalNumber:Rle({matchPattern:Fle,parsePattern:$le,valueCallback:e=>parseInt(e,10)}),era:Bu({matchPatterns:Ble,defaultMatchWidth:"wide",parsePatterns:zle,defaultParseWidth:"any"}),quarter:Bu({matchPatterns:Hle,defaultMatchWidth:"wide",parsePatterns:qle,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Bu({matchPatterns:Wle,defaultMatchWidth:"wide",parsePatterns:Ule,defaultParseWidth:"any"}),day:Bu({matchPatterns:Kle,defaultMatchWidth:"wide",parsePatterns:Vle,defaultParseWidth:"any"}),dayPeriod:Bu({matchPatterns:Gle,defaultMatchWidth:"any",parsePatterns:Yle,defaultParseWidth:"any"})},jh={code:"en-US",formatDistance:xle,formatLong:Ele,formatRelative:Nle,localize:Ile,match:Xle,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Zle(e){const t=_t(e);return xo(t,xj(t))+1}function C9(e){const t=_t(e),r=+hs(t)-+gle(t);return Math.round(r/bj)+1}function P9(e,t){var r,n,o,a;const i=_t(e),s=i.getFullYear(),l=Nd(),c=t?.firstWeekContainsDate??((n=(r=t?.locale)==null?void 0:r.options)==null?void 0:n.firstWeekContainsDate)??l.firstWeekContainsDate??((a=(o=l.locale)==null?void 0:o.options)==null?void 0:a.firstWeekContainsDate)??1,d=hn(e,0);d.setFullYear(s+1,0,c),d.setHours(0,0,0,0);const f=Mo(d,t),m=hn(e,0);m.setFullYear(s,0,c),m.setHours(0,0,0,0);const p=Mo(m,t);return i.getTime()>=f.getTime()?s+1:i.getTime()>=p.getTime()?s:s-1}function Jle(e,t){var r,n,o,a;const i=Nd(),s=t?.firstWeekContainsDate??((n=(r=t?.locale)==null?void 0:r.options)==null?void 0:n.firstWeekContainsDate)??i.firstWeekContainsDate??((a=(o=i.locale)==null?void 0:o.options)==null?void 0:a.firstWeekContainsDate)??1,l=P9(e,t),c=hn(e,0);return c.setFullYear(l,0,s),c.setHours(0,0,0,0),Mo(c,t)}function A9(e,t){const r=_t(e),n=+Mo(r,t)-+Jle(r,t);return Math.round(n/bj)+1}function Ut(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const La={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return Ut(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):Ut(r+1,2)},d(e,t){return Ut(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return Ut(e.getHours()%12||12,t.length)},H(e,t){return Ut(e.getHours(),t.length)},m(e,t){return Ut(e.getMinutes(),t.length)},s(e,t){return Ut(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),o=Math.trunc(n*Math.pow(10,r-3));return Ut(o,t.length)}},Bs={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wP={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),o=n>0?n:1-n;return r.ordinalNumber(o,{unit:"year"})}return La.y(e,t)},Y:function(e,t,r,n){const o=P9(e,n),a=o>0?o:1-o;if(t==="YY"){const i=a%100;return Ut(i,2)}return t==="Yo"?r.ordinalNumber(a,{unit:"year"}):Ut(a,t.length)},R:function(e,t){const r=E9(e);return Ut(r,t.length)},u:function(e,t){const r=e.getFullYear();return Ut(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return Ut(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return Ut(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return La.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return Ut(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const o=A9(e,n);return t==="wo"?r.ordinalNumber(o,{unit:"week"}):Ut(o,t.length)},I:function(e,t,r){const n=C9(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):Ut(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):La.d(e,t)},D:function(e,t,r){const n=Zle(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):Ut(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const o=e.getDay(),a=(o-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return Ut(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});case"eeee":default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const o=e.getDay(),a=(o-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return Ut(a,t.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});case"cccc":default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),o=n===0?7:n;switch(t){case"i":return String(o);case"ii":return Ut(o,t.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let o;switch(n===12?o=Bs.noon:n===0?o=Bs.midnight:o=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let o;switch(n>=17?o=Bs.evening:n>=12?o=Bs.afternoon:n>=4?o=Bs.morning:o=Bs.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return La.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):La.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):Ut(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):Ut(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):La.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):La.s(e,t)},S:function(e,t){return La.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return jP(n);case"XXXX":case"XX":return Li(n);case"XXXXX":case"XXX":default:return Li(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return jP(n);case"xxxx":case"xx":return Li(n);case"xxxxx":case"xxx":default:return Li(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+kP(n,":");case"OOOO":default:return"GMT"+Li(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+kP(n,":");case"zzzz":default:return"GMT"+Li(n,":")}},t:function(e,t,r){const n=Math.trunc(e.getTime()/1e3);return Ut(n,t.length)},T:function(e,t,r){const n=e.getTime();return Ut(n,t.length)}};function kP(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),o=Math.trunc(n/60),a=n%60;return a===0?r+String(o):r+String(o)+t+Ut(a,2)}function jP(e,t){return e%60===0?(e>0?"-":"+")+Ut(Math.abs(e)/60,2):Li(e,t)}function Li(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),o=Ut(Math.trunc(n/60),2),a=Ut(n%60,2);return r+o+t+a}const EP=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},T9=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Qle=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],o=r[2];if(!o)return EP(e,t);let a;switch(n){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",EP(n,t)).replace("{{time}}",T9(o,t))},eue={p:T9,P:Qle},tue=/^D+$/,rue=/^Y+$/,nue=["D","DD","YY","YYYY"];function oue(e){return tue.test(e)}function aue(e){return rue.test(e)}function iue(e,t,r){const n=sue(e,t,r);if(console.warn(n),nue.includes(e))throw new RangeError(n)}function sue(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const lue=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,uue=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,cue=/^'([^]*?)'?$/,due=/''/g,fue=/[a-zA-Z]/;function un(e,t,r){var n,o,a,i,s,l,c,d;const f=Nd(),m=r?.locale??f.locale??jh,p=r?.firstWeekContainsDate??((o=(n=r?.locale)==null?void 0:n.options)==null?void 0:o.firstWeekContainsDate)??f.firstWeekContainsDate??((i=(a=f.locale)==null?void 0:a.options)==null?void 0:i.firstWeekContainsDate)??1,h=r?.weekStartsOn??((l=(s=r?.locale)==null?void 0:s.options)==null?void 0:l.weekStartsOn)??f.weekStartsOn??((d=(c=f.locale)==null?void 0:c.options)==null?void 0:d.weekStartsOn)??0,b=_t(e);if(!ble(b))throw new RangeError("Invalid time value");let v=t.match(uue).map(k=>{const S=k[0];if(S==="p"||S==="P"){const j=eue[S];return j(k,m.formatLong)}return k}).join("").match(lue).map(k=>{if(k==="''")return{isToken:!1,value:"'"};const S=k[0];if(S==="'")return{isToken:!1,value:pue(k)};if(wP[S])return{isToken:!0,value:k};if(S.match(fue))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:k}});m.localize.preprocessor&&(v=m.localize.preprocessor(b,v));const x={firstWeekContainsDate:p,weekStartsOn:h,locale:m};return v.map(k=>{if(!k.isToken)return k.value;const S=k.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&aue(S)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&oue(S))&&iue(S,t,String(e));const j=wP[S[0]];return j(b,S,m.localize,x)}).join("")}function pue(e){const t=e.match(cue);return t?t[1].replace(due,"'"):e}function mue(e){const t=_t(e),r=t.getFullYear(),n=t.getMonth(),o=hn(e,0);return o.setFullYear(r,n+1,0),o.setHours(0,0,0,0),o.getDate()}function hue(e){return Math.trunc(+_t(e)/1e3)}function gue(e){const t=_t(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(0,0,0,0),t}function bue(e,t){return vle(gue(e),zr(e),t)+1}function dk(e,t){const r=_t(e),n=_t(t);return r.getTime()>n.getTime()}function M9(e,t){const r=_t(e),n=_t(t);return+r<+n}function vue(e,t){const r=_t(e),n=_t(t);return+r==+n}function kj(e,t){const r=_t(e),n=_t(t);return r.getFullYear()===n.getFullYear()&&r.getMonth()===n.getMonth()}function yue(e,t){const r=_t(e),n=_t(t);return r.getFullYear()===n.getFullYear()}function Wf(e,t){return Jr(e,-t)}function Gx(e,t){const r=_t(e),n=r.getFullYear(),o=r.getDate(),a=hn(e,0);a.setFullYear(n,t,15),a.setHours(0,0,0,0);const i=mue(a);return r.setMonth(t,Math.min(o,i)),r}function SP(e,t){const r=_t(e);return isNaN(+r)?hn(e,NaN):(r.setFullYear(t),r)}function qa(){return _o(Date.now())}function xue(e,t){return $n(e,-t)}function NP(e,t){const{years:r=0,months:n=0,weeks:o=0,days:a=0,hours:i=0,minutes:s=0,seconds:l=0}=t,c=xue(e,n+r*12),d=Wf(c,a+o*7),f=s+i*60,m=(l+f*60)*1e3;return hn(e,d.getTime()-m)}var wue=Object.defineProperty,kue=(e,t,r)=>t in e?wue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Yx=(e,t,r)=>(kue(e,typeof t!="symbol"?t+"":t,r),r);let jue=class{constructor(){Yx(this,"current",this.detect()),Yx(this,"handoffState","pending"),Yx(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},os=new jue;function zo(e){return os.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function Od(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function to(){let e=[],t={addEventListener(r,n,o,a){return r.addEventListener(n,o,a),t.add(()=>r.removeEventListener(n,o,a))},requestAnimationFrame(...r){let n=requestAnimationFrame(...r);return t.add(()=>cancelAnimationFrame(n))},nextFrame(...r){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...r))},setTimeout(...r){let n=setTimeout(...r);return t.add(()=>clearTimeout(n))},microTask(...r){let n={current:!0};return Od(()=>{n.current&&r[0]()}),t.add(()=>{n.current=!1})},style(r,n,o){let a=r.style.getPropertyValue(n);return Object.assign(r.style,{[n]:o}),this.add(()=>{Object.assign(r.style,{[n]:a})})},group(r){let n=to();return r(n),this.add(()=>n.dispose())},add(r){return e.includes(r)||e.push(r),()=>{let n=e.indexOf(r);if(n>=0)for(let o of e.splice(n,1))o()}},dispose(){for(let r of e.splice(0))r()}};return t}function Ho(){let[e]=g.useState(to);return g.useEffect(()=>()=>e.dispose(),[e]),e}let Ot=(e,t)=>{os.isServer?g.useEffect(e,t):g.useLayoutEffect(e,t)};function nn(e){let t=g.useRef(e);return Ot(()=>{t.current=e},[e]),t}let Se=function(e){let t=nn(e);return y.useCallback((...r)=>t.current(...r),[t])};function Eue(e){let t=e.width/2,r=e.height/2;return{top:e.clientY-r,right:e.clientX+t,bottom:e.clientY+r,left:e.clientX-t}}function Sue(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function au({disabled:e=!1}={}){let t=g.useRef(null),[r,n]=g.useState(!1),o=Ho(),a=Se(()=>{t.current=null,n(!1),o.dispose()}),i=Se(s=>{if(o.dispose(),t.current===null){t.current=s.currentTarget,n(!0);{let l=zo(s.currentTarget);o.addEventListener(l,"pointerup",a,!1),o.addEventListener(l,"pointermove",c=>{if(t.current){let d=Eue(c);n(Sue(d,t.current.getBoundingClientRect()))}},!1),o.addEventListener(l,"pointercancel",a,!1)}}});return{pressed:r,pressProps:e?{}:{onPointerDown:i,onPointerUp:a,onClick:a}}}let Nue=g.createContext(void 0);function Cd(){return g.useContext(Nue)}function fk(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function Mt(e,t,...r){if(e in t){let o=t[e];return typeof o=="function"?o(...r):o}let n=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Mt),n}var Vr=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Vr||{}),Ya=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Ya||{});function Pt(){let e=Cue();return g.useCallback(t=>Oue({mergeRefs:e,...t}),[e])}function Oue({ourProps:e,theirProps:t,slot:r,defaultTag:n,features:o,visible:a=!0,name:i,mergeRefs:s}){s=s??Pue;let l=_9(t,e);if(a)return Pf(l,r,n,i,s);let c=o??0;if(c&2){let{static:d=!1,...f}=l;if(d)return Pf(f,r,n,i,s)}if(c&1){let{unmount:d=!0,...f}=l;return Mt(d?0:1,{0(){return null},1(){return Pf({...f,hidden:!0,style:{display:"none"}},r,n,i,s)}})}return Pf(l,r,n,i,s)}function Pf(e,t={},r,n,o){let{as:a=r,children:i,refName:s="ref",...l}=Xx(e,["unmount","static"]),c=e.ref!==void 0?{[s]:e.ref}:{},d=typeof i=="function"?i(t):i;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t)),l["aria-labelledby"]&&l["aria-labelledby"]===l.id&&(l["aria-labelledby"]=void 0);let f={};if(t){let m=!1,p=[];for(let[h,b]of Object.entries(t))typeof b=="boolean"&&(m=!0),b===!0&&p.push(h.replace(/([A-Z])/g,v=>`-${v.toLowerCase()}`));if(m){f["data-headlessui-state"]=p.join(" ");for(let h of p)f[`data-${h}`]=""}}if(a===g.Fragment&&(Object.keys(za(l)).length>0||Object.keys(za(f)).length>0))if(!g.isValidElement(d)||Array.isArray(d)&&d.length>1){if(Object.keys(za(l)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(za(l)).concat(Object.keys(za(f))).map(m=>` - ${m}`).join(`
136
+ `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(m=>` - ${m}`).join(`
137
+ `)].join(`
138
+ `))}else{let m=d.props,p=m?.className,h=typeof p=="function"?(...x)=>fk(p(...x),l.className):fk(p,l.className),b=h?{className:h}:{},v=_9(d.props,za(Xx(l,["ref"])));for(let x in f)x in v&&delete f[x];return g.cloneElement(d,Object.assign({},v,f,c,{ref:o(Aue(d),c.ref)},b))}return g.createElement(a,Object.assign({},Xx(l,["ref"]),a!==g.Fragment&&c,a!==g.Fragment&&f),d)}function Cue(){let e=g.useRef([]),t=g.useCallback(r=>{for(let n of e.current)n!=null&&(typeof n=="function"?n(r):n.current=r)},[]);return(...r)=>{if(!r.every(n=>n==null))return e.current=r,t}}function Pue(...e){return e.every(t=>t==null)?void 0:t=>{for(let r of e)r!=null&&(typeof r=="function"?r(t):r.current=t)}}function _9(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let n of e)for(let o in n)o.startsWith("on")&&typeof n[o]=="function"?(r[o]!=null||(r[o]=[]),r[o].push(n[o])):t[o]=n[o];if(t.disabled||t["aria-disabled"])for(let n in r)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(n)&&(r[n]=[o=>{var a;return(a=o?.preventDefault)==null?void 0:a.call(o)}]);for(let n in r)Object.assign(t,{[n](o,...a){let i=r[n];for(let s of i){if((o instanceof Event||o?.nativeEvent instanceof Event)&&o.defaultPrevented)return;s(o,...a)}}});return t}function io(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let n of e)for(let o in n)o.startsWith("on")&&typeof n[o]=="function"?(r[o]!=null||(r[o]=[]),r[o].push(n[o])):t[o]=n[o];for(let n in r)Object.assign(t,{[n](...o){let a=r[n];for(let i of a)i?.(...o)}});return t}function Nt(e){var t;return Object.assign(g.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function za(e){let t=Object.assign({},e);for(let r in t)t[r]===void 0&&delete t[r];return t}function Xx(e,t=[]){let r=Object.assign({},e);for(let n of t)n in r&&delete r[n];return r}function Aue(e){return y.version.split(".")[0]>="19"?e.props.ref:e.ref}function jj(e,t,r){let[n,o]=g.useState(r),a=e!==void 0,i=g.useRef(a),s=g.useRef(!1),l=g.useRef(!1);return a&&!i.current&&!s.current?(s.current=!0,i.current=a,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!a&&i.current&&!l.current&&(l.current=!0,i.current=a,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[a?e:n,Se(c=>(a||o(c),t?.(c)))]}function Ej(e){let[t]=g.useState(e);return t}function I9(e={},t=null,r=[]){for(let[n,o]of Object.entries(e))L9(r,D9(t,n),o);return r}function D9(e,t){return e?e+"["+t+"]":t}function L9(e,t,r){if(Array.isArray(r))for(let[n,o]of r.entries())L9(e,D9(t,n.toString()),o);else r instanceof Date?e.push([t,r.toISOString()]):typeof r=="boolean"?e.push([t,r?"1":"0"]):typeof r=="string"?e.push([t,r]):typeof r=="number"?e.push([t,`${r}`]):r==null?e.push([t,""]):I9(r,t,e)}function R9(e){var t,r;let n=(t=e?.form)!=null?t:e.closest("form");if(n){for(let o of n.elements)if(o!==e&&(o.tagName==="INPUT"&&o.type==="submit"||o.tagName==="BUTTON"&&o.type==="submit"||o.nodeName==="INPUT"&&o.type==="image")){o.click();return}(r=n.requestSubmit)==null||r.call(n)}}let Tue="span";var Io=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Io||{});function Mue(e,t){var r;let{features:n=1,...o}=e,a={ref:t,"aria-hidden":(n&2)===2?!0:(r=o["aria-hidden"])!=null?r:void 0,hidden:(n&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return Pt()({ourProps:a,theirProps:o,slot:{},defaultTag:Tue,name:"Hidden"})}let Do=Nt(Mue),_ue=g.createContext(null);function Iue({children:e}){let t=g.useContext(_ue);if(!t)return y.createElement(y.Fragment,null,e);let{target:r}=t;return r?Ht.createPortal(y.createElement(y.Fragment,null,e),r):null}function Sj({data:e,form:t,disabled:r,onReset:n,overrides:o}){let[a,i]=g.useState(null),s=Ho();return g.useEffect(()=>{if(n&&a)return s.addEventListener(a,"reset",n)},[a,t,n]),y.createElement(Iue,null,y.createElement(Due,{setForm:i,formId:t}),I9(e).map(([l,c])=>y.createElement(Do,{features:Io.Hidden,...za({key:l,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:r,name:l,value:c,...o})})))}function Due({setForm:e,formId:t}){return g.useEffect(()=>{if(t){let r=document.getElementById(t);r&&e(r)}},[e,t]),t?null:y.createElement(Do,{features:Io.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:r=>{if(!r)return;let n=r.closest("form");n&&e(n)}})}let Lue=g.createContext(void 0);function Eh(){return g.useContext(Lue)}function iu(e){let t=e.parentElement,r=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(r=t),t=t.parentElement;let n=t?.getAttribute("disabled")==="";return n&&Rue(r)?!1:n}function Rue(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let F9=Symbol();function Nj(e,t=!0){return Object.assign(e,{[F9]:t})}function It(...e){let t=g.useRef(e);g.useEffect(()=>{t.current=e},[e]);let r=Se(n=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(n):o.current=n)});return e.every(n=>n==null||n?.[F9])?void 0:r}let Sh=g.createContext(null);Sh.displayName="DescriptionContext";function $9(){let e=g.useContext(Sh);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,$9),t}return e}function Oj(){var e,t;return(t=(e=g.useContext(Sh))==null?void 0:e.value)!=null?t:void 0}function B9(){let[e,t]=g.useState([]);return[e.length>0?e.join(" "):void 0,g.useMemo(()=>function(r){let n=Se(a=>(t(i=>[...i,a]),()=>t(i=>{let s=i.slice(),l=s.indexOf(a);return l!==-1&&s.splice(l,1),s}))),o=g.useMemo(()=>({register:n,slot:r.slot,name:r.name,props:r.props,value:r.value}),[n,r.slot,r.name,r.props,r.value]);return y.createElement(Sh.Provider,{value:o},r.children)},[t])]}let Fue="p";function $ue(e,t){let r=g.useId(),n=Cd(),{id:o=`headlessui-description-${r}`,...a}=e,i=$9(),s=It(t);Ot(()=>i.register(o),[o,i.register]);let l=n||!1,c=g.useMemo(()=>({...i.slot,disabled:l}),[i.slot,l]),d={ref:s,...i.props,id:o};return Pt()({ourProps:d,theirProps:a,slot:c,defaultTag:Fue,name:i.name||"Description"})}let Bue=Nt($ue),z9=Object.assign(Bue,{});var et=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(et||{});let Nh=g.createContext(null);Nh.displayName="LabelContext";function H9(){let e=g.useContext(Nh);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,H9),t}return e}function su(e){var t,r,n;let o=(r=(t=g.useContext(Nh))==null?void 0:t.value)!=null?r:void 0;return((n=e?.length)!=null?n:0)>0?[o,...e].filter(Boolean).join(" "):o}function Cj({inherit:e=!1}={}){let t=su(),[r,n]=g.useState([]),o=e?[t,...r].filter(Boolean):r;return[o.length>0?o.join(" "):void 0,g.useMemo(()=>function(a){let i=Se(l=>(n(c=>[...c,l]),()=>n(c=>{let d=c.slice(),f=d.indexOf(l);return f!==-1&&d.splice(f,1),d}))),s=g.useMemo(()=>({register:i,slot:a.slot,name:a.name,props:a.props,value:a.value}),[i,a.slot,a.name,a.props,a.value]);return y.createElement(Nh.Provider,{value:s},a.children)},[n])]}let zue="label";function Hue(e,t){var r;let n=g.useId(),o=H9(),a=Eh(),i=Cd(),{id:s=`headlessui-label-${n}`,htmlFor:l=a??((r=o.props)==null?void 0:r.htmlFor),passive:c=!1,...d}=e,f=It(t);Ot(()=>o.register(s),[s,o.register]);let m=Se(v=>{let x=v.currentTarget;if(x instanceof HTMLLabelElement&&v.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(v),x instanceof HTMLLabelElement){let k=document.getElementById(x.htmlFor);if(k){let S=k.getAttribute("disabled");if(S==="true"||S==="")return;let j=k.getAttribute("aria-disabled");if(j==="true"||j==="")return;(k instanceof HTMLInputElement&&(k.type==="radio"||k.type==="checkbox")||k.role==="radio"||k.role==="checkbox"||k.role==="switch")&&k.click(),k.focus({preventScroll:!0})}}}),p=i||!1,h=g.useMemo(()=>({...o.slot,disabled:p}),[o.slot,p]),b={ref:f,...o.props,id:s,htmlFor:l,onClick:m};return c&&("onClick"in b&&(delete b.htmlFor,delete b.onClick),"onClick"in d&&delete d.onClick),Pt()({ourProps:b,theirProps:d,slot:h,defaultTag:l?zue:"div",name:o.name||"Label"})}let que=Nt(Hue),Pj=Object.assign(que,{}),Wue=g.createContext(()=>{});function Aj({value:e,children:t}){return y.createElement(Wue.Provider,{value:e},t)}function Uue(e,t){return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&"id"in e&&"id"in t?e.id===t.id:e===t}function q9(e=Uue){return g.useCallback((t,r)=>{if(typeof e=="string"){let n=e;return t?.[n]===r?.[n]}return e(t,r)},[e])}function Kue(e){if(e===null)return{width:0,height:0};let{width:t,height:r}=e.getBoundingClientRect();return{width:t,height:r}}function dm(e,t=!1){let[r,n]=g.useReducer(()=>({}),{}),o=g.useMemo(()=>Kue(e),[e,r]);return Ot(()=>{if(!e)return;let a=new ResizeObserver(n);return a.observe(e),()=>{a.disconnect()}},[e]),t?{width:`${o.width}px`,height:`${o.height}px`}:o}let Vue=class extends Map{constructor(e){super(),this.factory=e}get(e){let t=super.get(e);return t===void 0&&(t=this.factory(e),this.set(e,t)),t}};function W9(e,t){let r=e(),n=new Set;return{getSnapshot(){return r},subscribe(o){return n.add(o),()=>n.delete(o)},dispatch(o,...a){let i=t[o].call(r,...a);i&&(r=i,n.forEach(s=>s()))}}}function U9(e){return g.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}let Gue=new Vue(()=>W9(()=>[],{ADD(e){return this.includes(e)?this:[...this,e]},REMOVE(e){let t=this.indexOf(e);if(t===-1)return this;let r=this.slice();return r.splice(t,1),r}}));function lu(e,t){let r=Gue.get(t),n=g.useId(),o=U9(r);if(Ot(()=>{if(e)return r.dispatch("ADD",n),()=>r.dispatch("REMOVE",n)},[r,e]),!e)return!1;let a=o.indexOf(n),i=o.length;return a===-1&&(a=i,i+=1),a===i-1}let pk=new Map,pc=new Map;function OP(e){var t;let r=(t=pc.get(e))!=null?t:0;return pc.set(e,r+1),r!==0?()=>CP(e):(pk.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>CP(e))}function CP(e){var t;let r=(t=pc.get(e))!=null?t:1;if(r===1?pc.delete(e):pc.set(e,r-1),r!==1)return;let n=pk.get(e);n&&(n["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",n["aria-hidden"]),e.inert=n.inert,pk.delete(e))}function Tj(e,{allowed:t,disallowed:r}={}){let n=lu(e,"inert-others");Ot(()=>{var o,a;if(!n)return;let i=to();for(let l of(o=r?.())!=null?o:[])l&&i.add(OP(l));let s=(a=t?.())!=null?a:[];for(let l of s){if(!l)continue;let c=zo(l);if(!c)continue;let d=l.parentElement;for(;d&&d!==c.body;){for(let f of d.children)s.some(m=>f.contains(m))||i.add(OP(f));d=d.parentElement}}return i.dispose},[n,t,r])}function Oh(e,t,r){let n=nn(o=>{let a=o.getBoundingClientRect();a.x===0&&a.y===0&&a.width===0&&a.height===0&&r()});g.useEffect(()=>{if(!e)return;let o=t===null?null:t instanceof HTMLElement?t:t.current;if(!o)return;let a=to();if(typeof ResizeObserver<"u"){let i=new ResizeObserver(()=>n.current(o));i.observe(o),a.add(()=>i.disconnect())}if(typeof IntersectionObserver<"u"){let i=new IntersectionObserver(()=>n.current(o));i.observe(o),a.add(()=>i.disconnect())}return()=>a.dispose()},[t,n,e])}let fm=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),Yue=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Kt=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(Kt||{}),wo=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(wo||{}),Xue=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Xue||{});function Pd(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(fm)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}function Zue(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Yue)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var Ch=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Ch||{});function Mj(e,t=0){var r;return e===((r=zo(e))==null?void 0:r.body)?!1:Mt(t,{0(){return e.matches(fm)},1(){let n=e;for(;n!==null;){if(n.matches(fm))return!0;n=n.parentElement}return!1}})}var Jue=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Jue||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function la(e){e?.focus({preventScroll:!0})}let Que=["textarea","input"].join(",");function ece(e){var t,r;return(r=(t=e?.matches)==null?void 0:t.call(e,Que))!=null?r:!1}function Xa(e,t=r=>r){return e.slice().sort((r,n)=>{let o=t(r),a=t(n);if(o===null||a===null)return 0;let i=o.compareDocumentPosition(a);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function tce(e,t){return Ar(Pd(),t,{relativeTo:e})}function Ar(e,t,{sorted:r=!0,relativeTo:n=null,skipElements:o=[]}={}){let a=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,i=Array.isArray(e)?r?Xa(e):e:t&64?Zue(e):Pd(e);o.length>0&&i.length>1&&(i=i.filter(p=>!o.some(h=>h!=null&&"current"in h?h?.current===p:h===p))),n=n??a.activeElement;let s=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,i.indexOf(n))-1;if(t&4)return Math.max(0,i.indexOf(n))+1;if(t&8)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=t&32?{preventScroll:!0}:{},d=0,f=i.length,m;do{if(d>=f||d+f<=0)return 0;let p=l+d;if(t&16)p=(p+f)%f;else{if(p<0)return 3;if(p>=f)return 1}m=i[p],m?.focus(c),d+=s}while(m!==a.activeElement);return t&6&&ece(m)&&m.select(),2}function K9(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function rce(){return/Android/gi.test(window.navigator.userAgent)}function V9(){return K9()||rce()}function zu(e,t,r,n){let o=nn(r);g.useEffect(()=>{if(!e)return;function a(i){o.current(i)}return document.addEventListener(t,a,n),()=>document.removeEventListener(t,a,n)},[e,t,n])}function G9(e,t,r,n){let o=nn(r);g.useEffect(()=>{if(!e)return;function a(i){o.current(i)}return window.addEventListener(t,a,n),()=>window.removeEventListener(t,a,n)},[e,t,n])}const PP=30;function Ph(e,t,r){let n=lu(e,"outside-click"),o=nn(r),a=g.useCallback(function(l,c){if(l.defaultPrevented)return;let d=c(l);if(d===null||!d.getRootNode().contains(d)||!d.isConnected)return;let f=function m(p){return typeof p=="function"?m(p()):Array.isArray(p)||p instanceof Set?p:[p]}(t);for(let m of f)if(m!==null&&(m.contains(d)||l.composed&&l.composedPath().includes(m)))return;return!Mj(d,Ch.Loose)&&d.tabIndex!==-1&&l.preventDefault(),o.current(l,d)},[o,t]),i=g.useRef(null);zu(n,"pointerdown",l=>{var c,d;i.current=((d=(c=l.composedPath)==null?void 0:c.call(l))==null?void 0:d[0])||l.target},!0),zu(n,"mousedown",l=>{var c,d;i.current=((d=(c=l.composedPath)==null?void 0:c.call(l))==null?void 0:d[0])||l.target},!0),zu(n,"click",l=>{V9()||i.current&&(a(l,()=>i.current),i.current=null)},!0);let s=g.useRef({x:0,y:0});zu(n,"touchstart",l=>{s.current.x=l.touches[0].clientX,s.current.y=l.touches[0].clientY},!0),zu(n,"touchend",l=>{let c={x:l.changedTouches[0].clientX,y:l.changedTouches[0].clientY};if(!(Math.abs(c.x-s.current.x)>=PP||Math.abs(c.y-s.current.y)>=PP))return a(l,()=>l.target instanceof HTMLElement?l.target:null)},!0),G9(n,"blur",l=>a(l,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function so(...e){return g.useMemo(()=>zo(...e),[...e])}function Ah(e,t,r,n){let o=nn(r);g.useEffect(()=>{e=e??window;function a(i){o.current(i)}return e.addEventListener(t,a,n),()=>e.removeEventListener(t,a,n)},[e,t,n])}function Y9(e){let t=g.useRef({value:"",selectionStart:null,selectionEnd:null});return Ah(e,"blur",r=>{let n=r.target;n instanceof HTMLInputElement&&(t.current={value:n.value,selectionStart:n.selectionStart,selectionEnd:n.selectionEnd})}),Se(()=>{if(document.activeElement!==e&&e instanceof HTMLInputElement&&e.isConnected){if(e.focus({preventScroll:!0}),e.value!==t.current.value)e.setSelectionRange(e.value.length,e.value.length);else{let{selectionStart:r,selectionEnd:n}=t.current;r!==null&&n!==null&&e.setSelectionRange(r,n)}t.current={value:"",selectionStart:null,selectionEnd:null}}})}function uu(e,t){return g.useMemo(()=>{var r;if(e.type)return e.type;let n=(r=e.as)!=null?r:"button";if(typeof n=="string"&&n.toLowerCase()==="button"||t?.tagName==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function nce(){let e;return{before({doc:t}){var r;let n=t.documentElement,o=(r=t.defaultView)!=null?r:window;e=Math.max(0,o.innerWidth-n.clientWidth)},after({doc:t,d:r}){let n=t.documentElement,o=Math.max(0,n.clientWidth-n.offsetWidth),a=Math.max(0,e-o);r.style(n,"paddingRight",`${a}px`)}}}function oce(){return K9()?{before({doc:e,d:t,meta:r}){function n(o){return r.containers.flatMap(a=>a()).some(a=>a.contains(o))}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let s=to();s.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>s.dispose()))}let a=(o=window.scrollY)!=null?o:window.pageYOffset,i=null;t.addEventListener(e,"click",s=>{if(s.target instanceof HTMLElement)try{let l=s.target.closest("a");if(!l)return;let{hash:c}=new URL(l.href),d=e.querySelector(c);d&&!n(d)&&(i=d)}catch{}},!0),t.addEventListener(e,"touchstart",s=>{if(s.target instanceof HTMLElement)if(n(s.target)){let l=s.target;for(;l.parentElement&&n(l.parentElement);)l=l.parentElement;t.style(l,"overscrollBehavior","contain")}else t.style(s.target,"touchAction","none")}),t.addEventListener(e,"touchmove",s=>{if(s.target instanceof HTMLElement){if(s.target.tagName==="INPUT")return;if(n(s.target)){let l=s.target;for(;l.parentElement&&l.dataset.headlessuiPortal!==""&&!(l.scrollHeight>l.clientHeight||l.scrollWidth>l.clientWidth);)l=l.parentElement;l.dataset.headlessuiPortal===""&&s.preventDefault()}else s.preventDefault()}},{passive:!1}),t.add(()=>{var s;let l=(s=window.scrollY)!=null?s:window.pageYOffset;a!==l&&window.scrollTo(0,a),i&&i.isConnected&&(i.scrollIntoView({block:"nearest"}),i=null)})})}}:{}}function ace(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function ice(e){let t={};for(let r of e)Object.assign(t,r(t));return t}let Zi=W9(()=>new Map,{PUSH(e,t){var r;let n=(r=this.get(e))!=null?r:{doc:e,count:0,d:to(),meta:new Set};return n.count++,n.meta.add(t),this.set(e,n),this},POP(e,t){let r=this.get(e);return r&&(r.count--,r.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:r}){let n={doc:e,d:t,meta:ice(r)},o=[oce(),nce(),ace()];o.forEach(({before:a})=>a?.(n)),o.forEach(({after:a})=>a?.(n))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Zi.subscribe(()=>{let e=Zi.getSnapshot(),t=new Map;for(let[r]of e)t.set(r,r.documentElement.style.overflow);for(let r of e.values()){let n=t.get(r.doc)==="hidden",o=r.count!==0;(o&&!n||!o&&n)&&Zi.dispatch(r.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",r),r.count===0&&Zi.dispatch("TEARDOWN",r)}});function sce(e,t,r=()=>({containers:[]})){let n=U9(Zi),o=t?n.get(t):void 0,a=o?o.count>0:!1;return Ot(()=>{if(!(!t||!e))return Zi.dispatch("PUSH",t,r),()=>Zi.dispatch("POP",t,r)},[e,t]),a}function Th(e,t,r=()=>[document.body]){let n=lu(e,"scroll-lock");sce(n,t,o=>{var a;return{containers:[...(a=o.containers)!=null?a:[],r]}})}function AP(e){return[e.screenX,e.screenY]}function X9(){let e=g.useRef([-1,-1]);return{wasMoved(t){let r=AP(t);return e.current[0]===r[0]&&e.current[1]===r[1]?!1:(e.current=r,!0)},update(t){e.current=AP(t)}}}function lce(e=0){let[t,r]=g.useState(e),n=g.useCallback(l=>r(l),[t]),o=g.useCallback(l=>r(c=>c|l),[t]),a=g.useCallback(l=>(t&l)===l,[t]),i=g.useCallback(l=>r(c=>c&~l),[r]),s=g.useCallback(l=>r(c=>c^l),[r]);return{flags:t,setFlag:n,addFlag:o,hasFlag:a,removeFlag:i,toggleFlag:s}}var TP,MP;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((TP=process==null?void 0:PA)==null?void 0:TP.NODE_ENV)==="test"&&typeof((MP=Element?.prototype)==null?void 0:MP.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
139
+ `)),[]});var uce=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(uce||{});function cu(e){let t={};for(let r in e)e[r]===!0&&(t[`data-${r}`]="");return t}function du(e,t,r,n){let[o,a]=g.useState(r),{hasFlag:i,addFlag:s,removeFlag:l}=lce(e&&o?3:0),c=g.useRef(!1),d=g.useRef(!1),f=Ho();return Ot(()=>{var m;if(e){if(r&&a(!0),!t){r&&s(3);return}return(m=n?.start)==null||m.call(n,r),cce(t,{inFlight:c,prepare(){d.current?d.current=!1:d.current=c.current,c.current=!0,!d.current&&(r?(s(3),l(4)):(s(4),l(2)))},run(){d.current?r?(l(3),s(4)):(l(4),s(3)):r?l(1):s(1)},done(){var p;d.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(c.current=!1,l(7),r||a(!1),(p=n?.end)==null||p.call(n,r))}})}},[e,r,t,f]),e?[o,{closed:i(1),enter:i(2),leave:i(4),transition:i(2)||i(4)}]:[r,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function cce(e,{prepare:t,run:r,done:n,inFlight:o}){let a=to();return fce(e,{prepare:t,inFlight:o}),a.nextFrame(()=>{r(),a.requestAnimationFrame(()=>{a.add(dce(e,n))})}),a.dispose}function dce(e,t){var r,n;let o=to();if(!e)return o.dispose;let a=!1;o.add(()=>{a=!0});let i=(n=(r=e.getAnimations)==null?void 0:r.call(e).filter(s=>s instanceof CSSTransition))!=null?n:[];return i.length===0?(t(),o.dispose):(Promise.allSettled(i.map(s=>s.finished)).then(()=>{a||t()}),o.dispose)}function fce(e,{inFlight:t,prepare:r}){if(t!=null&&t.current){r();return}let n=e.style.transition;e.style.transition="none",r(),e.offsetHeight,e.style.transition=n}function pce(e,{container:t,accept:r,walk:n}){let o=g.useRef(r),a=g.useRef(n);g.useEffect(()=>{o.current=r,a.current=n},[r,n]),Ot(()=>{if(!t||!e)return;let i=zo(t);if(!i)return;let s=o.current,l=a.current,c=Object.assign(f=>s(f),{acceptNode:s}),d=i.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,c,!1);for(;d.nextNode();)l(d.currentNode)},[t,e,o,a])}function od(e,t){let r=g.useRef([]),n=Se(e);g.useEffect(()=>{let o=[...r.current];for(let[a,i]of t.entries())if(r.current[a]!==i){let s=n(t,o);return r.current=t,s}},[n,...t])}function mce(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:r,version:n}=t;return r+"/"+n}).join(" "):navigator.userAgent}var Uf=typeof document<"u"?g.useLayoutEffect:g.useEffect;function pm(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!pm(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const a=o[n];if(!(a==="_owner"&&e.$$typeof)&&!pm(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function Z9(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function _P(e,t){const r=Z9(e);return Math.round(t*r)/r}function Zx(e){const t=g.useRef(e);return Uf(()=>{t.current=e}),t}function hce(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:a,floating:i}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[d,f]=g.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=g.useState(n);pm(m,n)||p(n);const[h,b]=g.useState(null),[v,x]=g.useState(null),k=g.useCallback(z=>{z!==C.current&&(C.current=z,b(z))},[]),S=g.useCallback(z=>{z!==N.current&&(N.current=z,x(z))},[]),j=a||h,O=i||v,C=g.useRef(null),N=g.useRef(null),T=g.useRef(d),M=l!=null,I=Zx(l),_=Zx(o),R=Zx(c),L=g.useCallback(()=>{if(!C.current||!N.current)return;const z={placement:t,strategy:r,middleware:m};_.current&&(z.platform=_.current),Wk(C.current,N.current,z).then(W=>{const K={...W,isPositioned:R.current!==!1};F.current&&!pm(T.current,K)&&(T.current=K,Ht.flushSync(()=>{f(K)}))})},[m,t,r,_,R]);Uf(()=>{c===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(z=>({...z,isPositioned:!1})))},[c]);const F=g.useRef(!1);Uf(()=>(F.current=!0,()=>{F.current=!1}),[]),Uf(()=>{if(j&&(C.current=j),O&&(N.current=O),j&&O){if(I.current)return I.current(j,O,L);L()}},[j,O,L,I,M]);const B=g.useMemo(()=>({reference:C,floating:N,setReference:k,setFloating:S}),[k,S]),U=g.useMemo(()=>({reference:j,floating:O}),[j,O]),$=g.useMemo(()=>{const z={position:r,left:0,top:0};if(!U.floating)return z;const W=_P(U.floating,d.x),K=_P(U.floating,d.y);return s?{...z,transform:"translate("+W+"px, "+K+"px)",...Z9(U.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:W,top:K}},[r,s,U.floating,d.x,d.y]);return g.useMemo(()=>({...d,update:L,refs:B,elements:U,floatingStyles:$}),[d,L,B,U,$])}const J9=(e,t)=>({...zk(e),options:[e,t]}),gce=(e,t)=>({...Hk(e),options:[e,t]}),bce=(e,t)=>({...qk(e),options:[e,t]}),vce=(e,t)=>({...jT(e),options:[e,t]}),Q9={...il},yce=Q9.useInsertionEffect,xce=yce||(e=>e());function e8(e){const t=g.useRef(()=>{});return xce(()=>{t.current=e}),g.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}var mk=typeof document<"u"?g.useLayoutEffect:g.useEffect;let IP=!1,wce=0;const DP=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+wce++;function kce(){const[e,t]=g.useState(()=>IP?DP():void 0);return mk(()=>{e==null&&t(DP())},[]),g.useEffect(()=>{IP=!0},[]),e}const jce=Q9.useId,Ece=jce||kce;function Sce(){const e=new Map;return{emit(t,r){var n;(n=e.get(t))==null||n.forEach(o=>o(r))},on(t,r){e.set(t,[...e.get(t)||[],r])},off(t,r){var n;e.set(t,((n=e.get(t))==null?void 0:n.filter(o=>o!==r))||[])}}}const Nce=g.createContext(null),Oce=g.createContext(null),Cce=()=>{var e;return((e=g.useContext(Nce))==null?void 0:e.id)||null},Pce=()=>g.useContext(Oce),Ace="data-floating-ui-focusable";function Tce(e){const{open:t=!1,onOpenChange:r,elements:n}=e,o=Ece(),a=g.useRef({}),[i]=g.useState(()=>Sce()),s=Cce()!=null,[l,c]=g.useState(n.reference),d=e8((p,h,b)=>{a.current.openEvent=p?h:void 0,i.emit("openchange",{open:p,event:h,reason:b,nested:s}),r?.(p,h,b)}),f=g.useMemo(()=>({setPositionReference:c}),[]),m=g.useMemo(()=>({reference:l||n.reference||null,floating:n.floating||null,domReference:n.reference}),[l,n.reference,n.floating]);return g.useMemo(()=>({dataRef:a,open:t,onOpenChange:d,elements:m,events:i,floatingId:o,refs:f}),[t,d,m,i,o,f])}function Mce(e){e===void 0&&(e={});const{nodeId:t}=e,r=Tce({...e,elements:{reference:null,floating:null,...e.elements}}),n=e.rootContext||r,o=n.elements,[a,i]=g.useState(null),[s,l]=g.useState(null),c=o?.domReference||a,d=g.useRef(null),f=Pce();mk(()=>{c&&(d.current=c)},[c]);const m=hce({...e,elements:{...o,...s&&{reference:s}}}),p=g.useCallback(k=>{const S=Tr(k)?{getBoundingClientRect:()=>k.getBoundingClientRect(),contextElement:k}:k;l(S),m.refs.setReference(S)},[m.refs]),h=g.useCallback(k=>{(Tr(k)||k===null)&&(d.current=k,i(k)),(Tr(m.refs.reference.current)||m.refs.reference.current===null||k!==null&&!Tr(k))&&m.refs.setReference(k)},[m.refs]),b=g.useMemo(()=>({...m.refs,setReference:h,setPositionReference:p,domReference:d}),[m.refs,h,p]),v=g.useMemo(()=>({...m.elements,domReference:c}),[m.elements,c]),x=g.useMemo(()=>({...m,...n,refs:b,elements:v,nodeId:t}),[m,b,v,t,n]);return mk(()=>{n.dataRef.current.floatingContext=x;const k=f?.nodesRef.current.find(S=>S.id===t);k&&(k.context=x)}),g.useMemo(()=>({...m,context:x,refs:b,elements:v}),[m,b,v,x])}const LP="active",RP="selected";function Jx(e,t,r){const n=new Map,o=r==="item";let a=e;if(o&&e){const{[LP]:i,[RP]:s,...l}=e;a=l}return{...r==="floating"&&{tabIndex:-1,[Ace]:""},...a,...t.map(i=>{const s=i?i[r]:null;return typeof s=="function"?e?s(e):null:s}).concat(e).reduce((i,s)=>(s&&Object.entries(s).forEach(l=>{let[c,d]=l;if(!(o&&[LP,RP].includes(c)))if(c.indexOf("on")===0){if(n.has(c)||n.set(c,[]),typeof d=="function"){var f;(f=n.get(c))==null||f.push(d),i[c]=function(){for(var m,p=arguments.length,h=new Array(p),b=0;b<p;b++)h[b]=arguments[b];return(m=n.get(c))==null?void 0:m.map(v=>v(...h)).find(v=>v!==void 0)}}}else i[c]=d}),i),{})}}function _ce(e){e===void 0&&(e=[]);const t=e.map(s=>s?.reference),r=e.map(s=>s?.floating),n=e.map(s=>s?.item),o=g.useCallback(s=>Jx(s,e,"reference"),t),a=g.useCallback(s=>Jx(s,e,"floating"),r),i=g.useCallback(s=>Jx(s,e,"item"),n);return g.useMemo(()=>({getReferenceProps:o,getFloatingProps:a,getItemProps:i}),[o,a,i])}function FP(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const Ice=e=>({name:"inner",options:e,async fn(t){const{listRef:r,overflowRef:n,onFallbackChange:o,offset:a=0,index:i=0,minItemsVisible:s=4,referenceOverflowThreshold:l=0,scrollRef:c,...d}=Qn(e,t),{rects:f,elements:{floating:m}}=t,p=r.current[i],h=c?.current||m,b=m.clientTop||h.clientTop,v=m.clientTop!==0,x=h.clientTop!==0,k=m===h;if(!p)return{};const S={...t,...await J9(-p.offsetTop-m.clientTop-f.reference.height/2-p.offsetHeight/2-a).fn(t)},j=await Js(FP(S,h.scrollHeight+b+m.clientTop),d),O=await Js(S,{...d,elementContext:"reference"}),C=Pr(0,j.top),N=S.y+C,T=(h.scrollHeight>h.clientHeight?M=>M:dl)(Pr(0,h.scrollHeight+(v&&k||x?b*2:0)-C-Pr(0,j.bottom)));if(h.style.maxHeight=T+"px",h.scrollTop=C,o){const M=h.offsetHeight<p.offsetHeight*Po(s,r.current.length)-1||O.top>=-l||O.bottom>=-l;Ht.flushSync(()=>o(M))}return n&&(n.current=await Js(FP({...S,y:N},h.offsetHeight+b+m.clientTop),d)),{y:N}}});function Dce(e,t){const{open:r,elements:n}=e,{enabled:o=!0,overflowRef:a,scrollRef:i,onChange:s}=t,l=e8(s),c=g.useRef(!1),d=g.useRef(null),f=g.useRef(null);g.useEffect(()=>{if(!o)return;function p(b){if(b.ctrlKey||!h||a.current==null)return;const v=b.deltaY,x=a.current.top>=-.5,k=a.current.bottom>=-.5,S=h.scrollHeight-h.clientHeight,j=v<0?-1:1,O=v<0?"max":"min";h.scrollHeight<=h.clientHeight||(!x&&v>0||!k&&v<0?(b.preventDefault(),Ht.flushSync(()=>{l(C=>C+Math[O](v,S*j))})):/firefox/i.test(mce())&&(h.scrollTop+=v))}const h=i?.current||n.floating;if(r&&h)return h.addEventListener("wheel",p),requestAnimationFrame(()=>{d.current=h.scrollTop,a.current!=null&&(f.current={...a.current})}),()=>{d.current=null,f.current=null,h.removeEventListener("wheel",p)}},[o,r,n.floating,a,i,l]);const m=g.useMemo(()=>({onKeyDown(){c.current=!0},onWheel(){c.current=!1},onPointerMove(){c.current=!1},onScroll(){const p=i?.current||n.floating;if(!(!a.current||!p||!c.current)){if(d.current!==null){const h=p.scrollTop-d.current;(a.current.bottom<-.5&&h<-1||a.current.top<-.5&&h>1)&&Ht.flushSync(()=>l(b=>b+h))}requestAnimationFrame(()=>{d.current=p.scrollTop})}}}),[n.floating,l,a,i]);return g.useMemo(()=>o?{floating:m}:{},[o,m])}let fu=g.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});fu.displayName="FloatingContext";let _j=g.createContext(null);_j.displayName="PlacementContext";function Ij(e){return g.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function Dj(){return g.useContext(fu).setReference}function Lce(){return g.useContext(fu).getReferenceProps}function Lj(){let{getFloatingProps:e,slot:t}=g.useContext(fu);return g.useCallback((...r)=>Object.assign({},e(...r),{"data-anchor":t.anchor}),[e,t])}function Rj(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=g.useContext(_j),r=g.useMemo(()=>e,[JSON.stringify(e,(o,a)=>{var i;return(i=a?.outerHTML)!=null?i:a})]);Ot(()=>{t?.(r??null)},[t,r]);let n=g.useContext(fu);return g.useMemo(()=>[n.setFloating,e?n.styles:{}],[n.setFloating,e,n.styles])}let $P=4;function Fj({children:e,enabled:t=!0}){let[r,n]=g.useState(null),[o,a]=g.useState(0),i=g.useRef(null),[s,l]=g.useState(null);Rce(s);let c=t&&r!==null&&s!==null,{to:d="bottom",gap:f=0,offset:m=0,padding:p=0,inner:h}=Fce(r,s),[b,v="center"]=d.split(" ");Ot(()=>{c&&a(0)},[c]);let{refs:x,floatingStyles:k,context:S}=Mce({open:c,placement:b==="selection"?v==="center"?"bottom":`bottom-${v}`:v==="center"?`${b}`:`${b}-${v}`,strategy:"absolute",transform:!1,middleware:[J9({mainAxis:b==="selection"?0:f,crossAxis:m}),gce({padding:p}),b!=="selection"&&bce({padding:p}),b==="selection"&&h?Ice({...h,padding:p,overflowRef:i,offset:o,minItemsVisible:$P,referenceOverflowThreshold:p,onFallbackChange(_){var R,L;if(!_)return;let F=S.elements.floating;if(!F)return;let B=parseFloat(getComputedStyle(F).scrollPaddingBottom)||0,U=Math.min($P,F.childElementCount),$=0,z=0;for(let W of(L=(R=S.elements.floating)==null?void 0:R.childNodes)!=null?L:[])if(W instanceof HTMLElement){let K=W.offsetTop,q=K+W.clientHeight+B,J=F.scrollTop,V=J+F.clientHeight;if(K>=J&&q<=V)U--;else{z=Math.max(0,Math.min(q,V)-Math.max(K,J)),$=W.clientHeight;break}}U>=1&&a(W=>{let K=$*U-z+B;return W>=K?W:K})}}):null,vce({padding:p,apply({availableWidth:_,availableHeight:R,elements:L}){Object.assign(L.floating.style,{overflow:"auto",maxWidth:`${_}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${R}px)`})}})].filter(Boolean),whileElementsMounted:Nm}),[j=b,O=v]=S.placement.split("-");b==="selection"&&(j="selection");let C=g.useMemo(()=>({anchor:[j,O].filter(Boolean).join(" ")}),[j,O]),N=Dce(S,{overflowRef:i,onChange:a}),{getReferenceProps:T,getFloatingProps:M}=_ce([N]),I=Se(_=>{l(_),x.setFloating(_)});return g.createElement(_j.Provider,{value:n},g.createElement(fu.Provider,{value:{setFloating:I,setReference:x.setReference,styles:k,getReferenceProps:T,getFloatingProps:M,slot:C}},e))}function Rce(e){Ot(()=>{if(!e)return;let t=new MutationObserver(()=>{let r=window.getComputedStyle(e).maxHeight,n=parseFloat(r);if(isNaN(n))return;let o=parseInt(r);isNaN(o)||n!==o&&(e.style.maxHeight=`${Math.ceil(n)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function Fce(e,t){var r,n,o;let a=Qx((r=e?.gap)!=null?r:"var(--anchor-gap, 0)",t),i=Qx((n=e?.offset)!=null?n:"var(--anchor-offset, 0)",t),s=Qx((o=e?.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:a,offset:i,padding:s}}function Qx(e,t,r=void 0){let n=Ho(),o=Se((l,c)=>{if(l==null)return[r,null];if(typeof l=="number")return[l,null];if(typeof l=="string"){if(!c)return[r,null];let d=BP(l,c);return[d,f=>{let m=t8(l);{let p=m.map(h=>window.getComputedStyle(c).getPropertyValue(h));n.requestAnimationFrame(function h(){n.nextFrame(h);let b=!1;for(let[x,k]of m.entries()){let S=window.getComputedStyle(c).getPropertyValue(k);if(p[x]!==S){p[x]=S,b=!0;break}}if(!b)return;let v=BP(l,c);d!==v&&(f(v),d=v)})}return n.dispose}]}return[r,null]}),a=g.useMemo(()=>o(e,t)[0],[e,t]),[i=a,s]=g.useState();return Ot(()=>{let[l,c]=o(e,t);if(s(l),!!c)return c(s)},[e,t]),i}function t8(e){let t=/var\((.*)\)/.exec(e);if(t){let r=t[1].indexOf(",");if(r===-1)return[t[1]];let n=t[1].slice(0,r).trim(),o=t[1].slice(r+1).trim();return o?[n,...t8(o)]:[n]}return[]}function BP(e,t){let r=document.createElement("div");t.appendChild(r),r.style.setProperty("margin-top","0px","important"),r.style.setProperty("margin-top",e,"important");let n=parseFloat(window.getComputedStyle(r).marginTop)||0;return t.removeChild(r),n}function $ce({children:e,freeze:t}){let r=mm(t,e);return y.createElement(y.Fragment,null,r)}function mm(e,t){let[r,n]=g.useState(t);return!e&&r!==t&&n(t),e?r:t}let Mh=g.createContext(null);Mh.displayName="OpenClosedContext";var Vt=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Vt||{});function Sa(){return g.useContext(Mh)}function Ad({value:e,children:t}){return y.createElement(Mh.Provider,{value:e},t)}function $j({children:e}){return y.createElement(Mh.Provider,{value:null},e)}function Bce(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let go=[];Bce(()=>{function e(t){if(!(t.target instanceof HTMLElement)||t.target===document.body||go[0]===t.target)return;let r=t.target;r=r.closest(fm),go.unshift(r??t.target),go=go.filter(n=>n!=null&&n.isConnected),go.splice(10)}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function zce(e){throw new Error("Unexpected object: "+e)}var Ct=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(Ct||{});function mc(e,t){let r=t.resolveItems();if(r.length<=0)return null;let n=t.resolveActiveIndex(),o=n??-1;switch(e.focus){case 0:{for(let a=0;a<r.length;++a)if(!t.resolveDisabled(r[a],a,r))return a;return n}case 1:{o===-1&&(o=r.length);for(let a=o-1;a>=0;--a)if(!t.resolveDisabled(r[a],a,r))return a;return n}case 2:{for(let a=o+1;a<r.length;++a)if(!t.resolveDisabled(r[a],a,r))return a;return n}case 3:{for(let a=r.length-1;a>=0;--a)if(!t.resolveDisabled(r[a],a,r))return a;return n}case 4:{for(let a=0;a<r.length;++a)if(t.resolveId(r[a],a,r)===e.id)return a;return n}case 5:return null;default:zce(e)}}var Bj=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(Bj||{});function r8(e){let t=Se(e),r=g.useRef(!1);g.useEffect(()=>(r.current=!1,()=>{r.current=!0,Od(()=>{r.current&&t()})}),[t])}function Hce(){let e=typeof document>"u";return"useSyncExternalStore"in il?(t=>t.useSyncExternalStore)(il)(()=>()=>{},()=>!1,()=>!e):!1}function Td(){let e=Hce(),[t,r]=g.useState(os.isHandoffComplete);return t&&os.isHandoffComplete===!1&&r(!1),g.useEffect(()=>{t!==!0&&r(!0)},[t]),g.useEffect(()=>os.handoff(),[]),e?!1:t}let n8=g.createContext(!1);function qce(){return g.useContext(n8)}function zP(e){return y.createElement(n8.Provider,{value:e.force},e.children)}function Wce(e){let t=qce(),r=g.useContext(a8),n=so(e),[o,a]=g.useState(()=>{var i;if(!t&&r!==null)return(i=r.current)!=null?i:null;if(os.isServer)return null;let s=n?.getElementById("headlessui-portal-root");if(s)return s;if(n===null)return null;let l=n.createElement("div");return l.setAttribute("id","headlessui-portal-root"),n.body.appendChild(l)});return g.useEffect(()=>{o!==null&&(n!=null&&n.body.contains(o)||n==null||n.body.appendChild(o))},[o,n]),g.useEffect(()=>{t||r!==null&&a(r.current)},[r,a,t]),o}let o8=g.Fragment,Uce=Nt(function(e,t){let r=e,n=g.useRef(null),o=It(Nj(f=>{n.current=f}),t),a=so(n),i=Wce(n),[s]=g.useState(()=>{var f;return os.isServer?null:(f=a?.createElement("div"))!=null?f:null}),l=g.useContext(hk),c=Td();Ot(()=>{!i||!s||i.contains(s)||(s.setAttribute("data-headlessui-portal",""),i.appendChild(s))},[i,s]),Ot(()=>{if(s&&l)return l.register(s)},[l,s]),r8(()=>{var f;!i||!s||(s instanceof Node&&i.contains(s)&&i.removeChild(s),i.childNodes.length<=0&&((f=i.parentElement)==null||f.removeChild(i)))});let d=Pt();return c?!i||!s?null:Ht.createPortal(d({ourProps:{ref:o},theirProps:r,slot:{},defaultTag:o8,name:"Portal"}),s):null});function Kce(e,t){let r=It(t),{enabled:n=!0,...o}=e,a=Pt();return n?y.createElement(Uce,{...o,ref:r}):a({ourProps:{ref:r},theirProps:o,slot:{},defaultTag:o8,name:"Portal"})}let Vce=g.Fragment,a8=g.createContext(null);function Gce(e,t){let{target:r,...n}=e,o={ref:It(t)},a=Pt();return y.createElement(a8.Provider,{value:r},a({ourProps:o,theirProps:n,defaultTag:Vce,name:"Popover.Group"}))}let hk=g.createContext(null);function i8(){let e=g.useContext(hk),t=g.useRef([]),r=Se(a=>(t.current.push(a),e&&e.register(a),()=>n(a))),n=Se(a=>{let i=t.current.indexOf(a);i!==-1&&t.current.splice(i,1),e&&e.unregister(a)}),o=g.useMemo(()=>({register:r,unregister:n,portals:t}),[r,n,t]);return[t,g.useMemo(()=>function({children:a}){return y.createElement(hk.Provider,{value:o},a)},[o])]}let Yce=Nt(Kce),s8=Nt(Gce),_h=Object.assign(Yce,{Group:s8});var Xce=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Xce||{}),Zce=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Zce||{}),Jce=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(Jce||{}),Qce=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.SetTyping=3]="SetTyping",e[e.RegisterOption=4]="RegisterOption",e[e.UnregisterOption=5]="UnregisterOption",e[e.SetActivationTrigger=6]="SetActivationTrigger",e[e.UpdateVirtualConfiguration=7]="UpdateVirtualConfiguration",e[e.SetInputElement=8]="SetInputElement",e[e.SetButtonElement=9]="SetButtonElement",e[e.SetOptionsElement=10]="SetOptionsElement",e))(Qce||{});function e0(e,t=r=>r){let r=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,n=t(e.options.slice()),o=n.length>0&&n[0].dataRef.current.order!==null?n.sort((i,s)=>i.dataRef.current.order-s.dataRef.current.order):Xa(n,i=>i.dataRef.current.domRef.current),a=r?o.indexOf(r):null;return a===-1&&(a=null),{options:o,activeOptionIndex:a}}let ede={1(e){var t;return(t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===1?e:{...e,activeOptionIndex:null,comboboxState:1,isTyping:!1,activationTrigger:2,__demoMode:!1}},0(e){var t,r;if((t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===0)return e;if((r=e.dataRef.current)!=null&&r.value){let n=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(n!==-1)return{...e,activeOptionIndex:n,comboboxState:0,__demoMode:!1}}return{...e,comboboxState:0,__demoMode:!1}},3(e,t){return e.isTyping===t.isTyping?e:{...e,isTyping:t.isTyping}},2(e,t){var r,n,o,a;if((r=e.dataRef.current)!=null&&r.disabled||e.optionsElement&&!((n=e.dataRef.current)!=null&&n.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let{options:c,disabled:d}=e.virtual,f=t.focus===Ct.Specific?t.idx:mc(t,{resolveItems:()=>c,resolveActiveIndex:()=>{var p,h;return(h=(p=e.activeOptionIndex)!=null?p:c.findIndex(b=>!d(b)))!=null?h:null},resolveDisabled:d,resolveId(){throw new Error("Function not implemented.")}}),m=(o=t.trigger)!=null?o:2;return e.activeOptionIndex===f&&e.activationTrigger===m?e:{...e,activeOptionIndex:f,activationTrigger:m,isTyping:!1,__demoMode:!1}}let i=e0(e);if(i.activeOptionIndex===null){let c=i.options.findIndex(d=>!d.dataRef.current.disabled);c!==-1&&(i.activeOptionIndex=c)}let s=t.focus===Ct.Specific?t.idx:mc(t,{resolveItems:()=>i.options,resolveActiveIndex:()=>i.activeOptionIndex,resolveId:c=>c.id,resolveDisabled:c=>c.dataRef.current.disabled}),l=(a=t.trigger)!=null?a:2;return e.activeOptionIndex===s&&e.activationTrigger===l?e:{...e,...i,isTyping:!1,activeOptionIndex:s,activationTrigger:l,__demoMode:!1}},4:(e,t)=>{var r,n,o;if((r=e.dataRef.current)!=null&&r.virtual)return{...e,options:[...e.options,t.payload]};let a=t.payload,i=e0(e,l=>(l.push(a),l));e.activeOptionIndex===null&&(n=e.dataRef.current)!=null&&n.isSelected(t.payload.dataRef.current.value)&&(i.activeOptionIndex=i.options.indexOf(a));let s={...e,...i,activationTrigger:2};return(o=e.dataRef.current)!=null&&o.__demoMode&&e.dataRef.current.value===void 0&&(s.activeOptionIndex=0),s},5:(e,t)=>{var r;if((r=e.dataRef.current)!=null&&r.virtual)return{...e,options:e.options.filter(o=>o.id!==t.id)};let n=e0(e,o=>{let a=o.findIndex(i=>i.id===t.id);return a!==-1&&o.splice(a,1),o});return{...e,...n,activationTrigger:2}},6:(e,t)=>e.activationTrigger===t.trigger?e:{...e,activationTrigger:t.trigger},7:(e,t)=>{var r,n;if(e.virtual===null)return{...e,virtual:{options:t.options,disabled:(r=t.disabled)!=null?r:()=>!1}};if(e.virtual.options===t.options&&e.virtual.disabled===t.disabled)return e;let o=e.activeOptionIndex;if(e.activeOptionIndex!==null){let a=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);a!==-1?o=a:o=null}return{...e,activeOptionIndex:o,virtual:{options:t.options,disabled:(n=t.disabled)!=null?n:()=>!1}}},8:(e,t)=>e.inputElement===t.element?e:{...e,inputElement:t.element},9:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},10:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element}},zj=g.createContext(null);zj.displayName="ComboboxActionsContext";function Md(e){let t=g.useContext(zj);if(t===null){let r=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Md),r}return t}let l8=g.createContext(null);function tde(e){let t=pu("VirtualProvider"),{options:r}=t.virtual,[n,o]=g.useMemo(()=>{let c=t.optionsElement;if(!c)return[0,0];let d=window.getComputedStyle(c);return[parseFloat(d.paddingBlockStart||d.paddingTop),parseFloat(d.paddingBlockEnd||d.paddingBottom)]},[t.optionsElement]),a=mL({enabled:r.length!==0,scrollPaddingStart:n,scrollPaddingEnd:o,count:r.length,estimateSize(){return 40},getScrollElement(){return t.optionsElement},overscan:12}),[i,s]=g.useState(0);Ot(()=>{s(c=>c+1)},[r]);let l=a.getVirtualItems();return l.length===0?null:y.createElement(l8.Provider,{value:a},y.createElement("div",{style:{position:"relative",width:"100%",height:`${a.getTotalSize()}px`},ref:c=>{c&&t.activationTrigger!==0&&t.activeOptionIndex!==null&&r.length>t.activeOptionIndex&&a.scrollToIndex(t.activeOptionIndex)}},l.map(c=>{var d;return y.createElement(g.Fragment,{key:c.key},y.cloneElement((d=e.children)==null?void 0:d.call(e,{...e.slot,option:r[c.index]}),{key:`${i}-${c.key}`,"data-index":c.index,"aria-setsize":r.length,"aria-posinset":c.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${c.start}px)`,overflowAnchor:"none"}}))})))}let ad=g.createContext(null);ad.displayName="ComboboxDataContext";function pu(e){let t=g.useContext(ad);if(t===null){let r=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,pu),r}return t}function rde(e,t){return Mt(t.type,ede,e,t)}let nde=g.Fragment;function ode(e,t){var r,n;let o=Cd(),{value:a,defaultValue:i,onChange:s,form:l,name:c,by:d,disabled:f=o||!1,onClose:m,__demoMode:p=!1,multiple:h=!1,immediate:b=!1,virtual:v=null,nullable:x,...k}=e,S=Ej(i),[j=h?[]:void 0,O]=jj(a,s,S),[C,N]=g.useReducer(rde,{dataRef:g.createRef(),comboboxState:p?0:1,isTyping:!1,options:[],virtual:v?{options:v.options,disabled:(r=v.disabled)!=null?r:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:p}),T=g.useRef(!1),M=g.useRef({static:!1,hold:!1}),I=q9(d),_=Se(le=>v?d===null?v.options.indexOf(le):v.options.findIndex(ge=>I(ge,le)):C.options.findIndex(ge=>I(ge.dataRef.current.value,le))),R=g.useCallback(le=>Mt(F.mode,{1:()=>j.some(ge=>I(ge,le)),0:()=>I(j,le)}),[j]),L=Se(le=>C.activeOptionIndex===_(le)),F=g.useMemo(()=>({...C,immediate:b,optionsPropsRef:M,value:j,defaultValue:S,disabled:f,mode:h?1:0,virtual:v?C.virtual:null,get activeOptionIndex(){if(T.current&&C.activeOptionIndex===null&&(v?v.options.length>0:C.options.length>0)){if(v){let ge=v.options.findIndex(Ce=>{var Me,Ye;return!((Ye=(Me=v.disabled)==null?void 0:Me.call(v,Ce))!=null&&Ye)});if(ge!==-1)return ge}let le=C.options.findIndex(ge=>!ge.dataRef.current.disabled);if(le!==-1)return le}return C.activeOptionIndex},calculateIndex:_,compare:I,isSelected:R,isActive:L}),[j,S,f,h,p,C,v]);Ot(()=>{var le;v&&N({type:7,options:v.options,disabled:(le=v.disabled)!=null?le:null})},[v,v?.options,v?.disabled]),Ot(()=>{C.dataRef.current=F},[F]);let B=F.comboboxState===0;Ph(B,[F.buttonElement,F.inputElement,F.optionsElement],()=>Oe.closeCombobox());let U=g.useMemo(()=>{var le,ge,Ce;return{open:F.comboboxState===0,disabled:f,activeIndex:F.activeOptionIndex,activeOption:F.activeOptionIndex===null?null:F.virtual?F.virtual.options[(le=F.activeOptionIndex)!=null?le:0]:(Ce=(ge=F.options[F.activeOptionIndex])==null?void 0:ge.dataRef.current.value)!=null?Ce:null,value:j}},[F,f,j]),$=Se(()=>{if(F.activeOptionIndex!==null){if(Oe.setIsTyping(!1),F.virtual)V(F.virtual.options[F.activeOptionIndex]);else{let{dataRef:le}=F.options[F.activeOptionIndex];V(le.current.value)}Oe.goToOption(Ct.Specific,F.activeOptionIndex)}}),z=Se(()=>{N({type:0}),T.current=!0}),W=Se(()=>{N({type:1}),T.current=!1,m?.()}),K=Se(le=>{N({type:3,isTyping:le})}),q=Se((le,ge,Ce)=>(T.current=!1,le===Ct.Specific?N({type:2,focus:Ct.Specific,idx:ge,trigger:Ce}):N({type:2,focus:le,trigger:Ce}))),J=Se((le,ge)=>(N({type:4,payload:{id:le,dataRef:ge}}),()=>{F.isActive(ge.current.value)&&(T.current=!0),N({type:5,id:le})})),V=Se(le=>Mt(F.mode,{0(){return O?.(le)},1(){let ge=F.value.slice(),Ce=ge.findIndex(Me=>I(Me,le));return Ce===-1?ge.push(le):ge.splice(Ce,1),O?.(ge)}})),me=Se(le=>{N({type:6,trigger:le})}),X=Se(le=>{N({type:8,element:le})}),ce=Se(le=>{N({type:9,element:le})}),oe=Se(le=>{N({type:10,element:le})}),Oe=g.useMemo(()=>({onChange:V,registerOption:J,goToOption:q,setIsTyping:K,closeCombobox:W,openCombobox:z,setActivationTrigger:me,selectActiveOption:$,setInputElement:X,setButtonElement:ce,setOptionsElement:oe}),[]),[te,Ne]=Cj(),ve=t===null?{}:{ref:t},G=g.useCallback(()=>{if(S!==void 0)return O?.(S)},[O,S]),ye=Pt();return y.createElement(Ne,{value:te,props:{htmlFor:(n=F.inputElement)==null?void 0:n.id},slot:{open:F.comboboxState===0,disabled:f}},y.createElement(Fj,null,y.createElement(zj.Provider,{value:Oe},y.createElement(ad.Provider,{value:F},y.createElement(Ad,{value:Mt(F.comboboxState,{0:Vt.Open,1:Vt.Closed})},c!=null&&y.createElement(Sj,{disabled:f,data:j!=null?{[c]:j}:{},form:l,onReset:G}),ye({ourProps:ve,theirProps:k,slot:U,defaultTag:nde,name:"Combobox"}))))))}let ade="input";function ide(e,t){var r,n,o,a,i;let s=pu("Combobox.Input"),l=Md("Combobox.Input"),c=g.useId(),d=Eh(),{id:f=d||`headlessui-combobox-input-${c}`,onChange:m,displayValue:p,disabled:h=s.disabled||!1,autoFocus:b=!1,type:v="text",...x}=e,k=g.useRef(null),S=It(k,t,Dj(),l.setInputElement),j=so(s.inputElement),O=Ho(),C=Se(()=>{l.onChange(null),s.optionsElement&&(s.optionsElement.scrollTop=0),l.goToOption(Ct.Nothing)}),N=g.useMemo(()=>{var V;return typeof p=="function"&&s.value!==void 0?(V=p(s.value))!=null?V:"":typeof s.value=="string"?s.value:""},[s.value,p]);od(([V,me],[X,ce])=>{if(s.isTyping)return;let oe=k.current;oe&&((ce===0&&me===1||V!==X)&&(oe.value=V),requestAnimationFrame(()=>{if(s.isTyping||!oe||j?.activeElement!==oe)return;let{selectionStart:Oe,selectionEnd:te}=oe;Math.abs((te??0)-(Oe??0))===0&&Oe===0&&oe.setSelectionRange(oe.value.length,oe.value.length)}))},[N,s.comboboxState,j,s.isTyping]),od(([V],[me])=>{if(V===0&&me===1){if(s.isTyping)return;let X=k.current;if(!X)return;let ce=X.value,{selectionStart:oe,selectionEnd:Oe,selectionDirection:te}=X;X.value="",X.value=ce,te!==null?X.setSelectionRange(oe,Oe,te):X.setSelectionRange(oe,Oe)}},[s.comboboxState]);let T=g.useRef(!1),M=Se(()=>{T.current=!0}),I=Se(()=>{O.nextFrame(()=>{T.current=!1})}),_=Se(V=>{switch(l.setIsTyping(!0),V.key){case et.Enter:if(s.comboboxState!==0||T.current)return;if(V.preventDefault(),V.stopPropagation(),s.activeOptionIndex===null){l.closeCombobox();return}l.selectActiveOption(),s.mode===0&&l.closeCombobox();break;case et.ArrowDown:return V.preventDefault(),V.stopPropagation(),Mt(s.comboboxState,{0:()=>l.goToOption(Ct.Next),1:()=>l.openCombobox()});case et.ArrowUp:return V.preventDefault(),V.stopPropagation(),Mt(s.comboboxState,{0:()=>l.goToOption(Ct.Previous),1:()=>{Ht.flushSync(()=>l.openCombobox()),s.value||l.goToOption(Ct.Last)}});case et.Home:if(V.shiftKey)break;return V.preventDefault(),V.stopPropagation(),l.goToOption(Ct.First);case et.PageUp:return V.preventDefault(),V.stopPropagation(),l.goToOption(Ct.First);case et.End:if(V.shiftKey)break;return V.preventDefault(),V.stopPropagation(),l.goToOption(Ct.Last);case et.PageDown:return V.preventDefault(),V.stopPropagation(),l.goToOption(Ct.Last);case et.Escape:return s.comboboxState!==0?void 0:(V.preventDefault(),s.optionsElement&&!s.optionsPropsRef.current.static&&V.stopPropagation(),s.mode===0&&s.value===null&&C(),l.closeCombobox());case et.Tab:if(s.comboboxState!==0)return;s.mode===0&&s.activationTrigger!==1&&l.selectActiveOption(),l.closeCombobox();break}}),R=Se(V=>{m?.(V),s.mode===0&&V.target.value===""&&C(),l.openCombobox()}),L=Se(V=>{var me,X,ce;let oe=(me=V.relatedTarget)!=null?me:go.find(Oe=>Oe!==V.currentTarget);if(!((X=s.optionsElement)!=null&&X.contains(oe))&&!((ce=s.buttonElement)!=null&&ce.contains(oe))&&s.comboboxState===0)return V.preventDefault(),s.mode===0&&s.value===null&&C(),l.closeCombobox()}),F=Se(V=>{var me,X,ce;let oe=(me=V.relatedTarget)!=null?me:go.find(Oe=>Oe!==V.currentTarget);(X=s.buttonElement)!=null&&X.contains(oe)||(ce=s.optionsElement)!=null&&ce.contains(oe)||s.disabled||s.immediate&&s.comboboxState!==0&&O.microTask(()=>{Ht.flushSync(()=>l.openCombobox()),l.setActivationTrigger(1)})}),B=su(),U=Oj(),{isFocused:$,focusProps:z}=no({autoFocus:b}),{isHovered:W,hoverProps:K}=Lo({isDisabled:h}),q=g.useMemo(()=>({open:s.comboboxState===0,disabled:h,hover:W,focus:$,autofocus:b}),[s,W,$,b,h]),J=io({ref:S,id:f,role:"combobox",type:v,"aria-controls":(r=s.optionsElement)==null?void 0:r.id,"aria-expanded":s.comboboxState===0,"aria-activedescendant":s.activeOptionIndex===null?void 0:s.virtual?(n=s.options.find(V=>!V.dataRef.current.disabled&&s.compare(V.dataRef.current.value,s.virtual.options[s.activeOptionIndex])))==null?void 0:n.id:(o=s.options[s.activeOptionIndex])==null?void 0:o.id,"aria-labelledby":B,"aria-describedby":U,"aria-autocomplete":"list",defaultValue:(i=(a=e.defaultValue)!=null?a:s.defaultValue!==void 0?p?.(s.defaultValue):null)!=null?i:s.defaultValue,disabled:h||void 0,autoFocus:b,onCompositionStart:M,onCompositionEnd:I,onKeyDown:_,onChange:R,onFocus:F,onBlur:L},z,K);return Pt()({ourProps:J,theirProps:x,slot:q,defaultTag:ade,name:"Combobox.Input"})}let sde="button";function lde(e,t){var r;let n=pu("Combobox.Button"),o=Md("Combobox.Button"),a=It(t,o.setButtonElement),i=g.useId(),{id:s=`headlessui-combobox-button-${i}`,disabled:l=n.disabled||!1,autoFocus:c=!1,...d}=e,f=Y9(n.inputElement),m=Se(N=>{switch(N.key){case et.Space:case et.Enter:N.preventDefault(),N.stopPropagation(),n.comboboxState===1&&Ht.flushSync(()=>o.openCombobox()),f();return;case et.ArrowDown:N.preventDefault(),N.stopPropagation(),n.comboboxState===1&&(Ht.flushSync(()=>o.openCombobox()),n.value||o.goToOption(Ct.First)),f();return;case et.ArrowUp:N.preventDefault(),N.stopPropagation(),n.comboboxState===1&&(Ht.flushSync(()=>o.openCombobox()),n.value||o.goToOption(Ct.Last)),f();return;case et.Escape:if(n.comboboxState!==0)return;N.preventDefault(),n.optionsElement&&!n.optionsPropsRef.current.static&&N.stopPropagation(),Ht.flushSync(()=>o.closeCombobox()),f();return;default:return}}),p=Se(N=>{N.preventDefault(),!iu(N.currentTarget)&&(N.button===Bj.Left&&(n.comboboxState===0?o.closeCombobox():o.openCombobox()),f())}),h=su([s]),{isFocusVisible:b,focusProps:v}=no({autoFocus:c}),{isHovered:x,hoverProps:k}=Lo({isDisabled:l}),{pressed:S,pressProps:j}=au({disabled:l}),O=g.useMemo(()=>({open:n.comboboxState===0,active:S||n.comboboxState===0,disabled:l,value:n.value,hover:x,focus:b}),[n,x,b,S,l]),C=io({ref:a,id:s,type:uu(e,n.buttonElement),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":(r=n.optionsElement)==null?void 0:r.id,"aria-expanded":n.comboboxState===0,"aria-labelledby":h,disabled:l||void 0,autoFocus:c,onMouseDown:p,onKeyDown:m},v,k,j);return Pt()({ourProps:C,theirProps:d,slot:O,defaultTag:sde,name:"Combobox.Button"})}let ude="div",cde=Vr.RenderStrategy|Vr.Static;function dde(e,t){var r,n,o;let a=g.useId(),{id:i=`headlessui-combobox-options-${a}`,hold:s=!1,anchor:l,portal:c=!1,modal:d=!0,transition:f=!1,...m}=e,p=pu("Combobox.Options"),h=Md("Combobox.Options"),b=Ij(l);b&&(c=!0);let[v,x]=Rj(b),[k,S]=g.useState(null),j=Lj(),O=It(t,b?v:null,h.setOptionsElement,S),C=so(p.optionsElement),N=Sa(),[T,M]=du(f,k,N!==null?(N&Vt.Open)===Vt.Open:p.comboboxState===0);Oh(T,p.inputElement,h.closeCombobox);let I=p.__demoMode?!1:d&&p.comboboxState===0;Th(I,C);let _=p.__demoMode?!1:d&&p.comboboxState===0;Tj(_,{allowed:g.useCallback(()=>[p.inputElement,p.buttonElement,p.optionsElement],[p.inputElement,p.buttonElement,p.optionsElement])}),Ot(()=>{var J;p.optionsPropsRef.current.static=(J=e.static)!=null?J:!1},[p.optionsPropsRef,e.static]),Ot(()=>{p.optionsPropsRef.current.hold=s},[p.optionsPropsRef,s]),pce(p.comboboxState===0,{container:p.optionsElement,accept(J){return J.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:J.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(J){J.setAttribute("role","none")}});let R=su([(r=p.buttonElement)==null?void 0:r.id]),L=g.useMemo(()=>({open:p.comboboxState===0,option:void 0}),[p.comboboxState]),F=Se(()=>{h.setActivationTrigger(0)}),B=Se(J=>{J.preventDefault(),h.setActivationTrigger(0)}),U=io(b?j():{},{"aria-labelledby":R,role:"listbox","aria-multiselectable":p.mode===1?!0:void 0,id:i,ref:O,style:{...m.style,...x,"--input-width":dm(p.inputElement,!0).width,"--button-width":dm(p.buttonElement,!0).width},onWheel:p.activationTrigger===0?void 0:F,onMouseDown:B,...cu(M)}),$=T&&p.comboboxState===1,z=mm($,(n=p.virtual)==null?void 0:n.options),W=mm($,p.value),K=Se(J=>p.compare(W,J));if(p.virtual){if(z===void 0)throw new Error("Missing `options` in virtual mode");Object.assign(m,{children:y.createElement(ad.Provider,{value:z!==p.virtual.options?{...p,virtual:{...p.virtual,options:z}}:p},y.createElement(tde,{slot:L},m.children))})}let q=Pt();return y.createElement(_h,{enabled:c?e.static||T:!1},y.createElement(ad.Provider,{value:p.mode===1?p:{...p,isSelected:K}},q({ourProps:U,theirProps:{...m,children:y.createElement($ce,{freeze:$},typeof m.children=="function"?(o=m.children)==null?void 0:o.call(m,L):m.children)},slot:L,defaultTag:ude,features:cde,visible:T,name:"Combobox.Options"})))}let fde="div";function pde(e,t){var r,n,o,a;let i=pu("Combobox.Option"),s=Md("Combobox.Option"),l=g.useId(),{id:c=`headlessui-combobox-option-${l}`,value:d,disabled:f=(o=(n=(r=i.virtual)==null?void 0:r.disabled)==null?void 0:n.call(r,d))!=null?o:!1,order:m=null,...p}=e,h=Y9(i.inputElement),b=i.virtual?i.activeOptionIndex===i.calculateIndex(d):i.activeOptionIndex===null?!1:((a=i.options[i.activeOptionIndex])==null?void 0:a.id)===c,v=i.isSelected(d),x=g.useRef(null),k=nn({disabled:f,value:d,domRef:x,order:m}),S=g.useContext(l8),j=It(t,x,S?S.measureElement:null),O=Se(()=>{s.setIsTyping(!1),s.onChange(d)});Ot(()=>s.registerOption(c,k),[k,c]);let C=g.useRef(!(i.virtual||i.__demoMode));Ot(()=>{if(!i.virtual&&!i.__demoMode)return to().requestAnimationFrame(()=>{C.current=!0})},[i.virtual,i.__demoMode]),Ot(()=>{if(C.current&&i.comboboxState===0&&b&&i.activationTrigger!==0)return to().requestAnimationFrame(()=>{var B,U;(U=(B=x.current)==null?void 0:B.scrollIntoView)==null||U.call(B,{block:"nearest"})})},[x,b,i.comboboxState,i.activationTrigger,i.activeOptionIndex]);let N=Se(B=>{B.preventDefault(),B.button===Bj.Left&&(f||(O(),V9()||requestAnimationFrame(()=>h()),i.mode===0&&s.closeCombobox()))}),T=Se(()=>{if(f)return s.goToOption(Ct.Nothing);let B=i.calculateIndex(d);s.goToOption(Ct.Specific,B)}),M=X9(),I=Se(B=>M.update(B)),_=Se(B=>{if(!M.wasMoved(B)||f||b)return;let U=i.calculateIndex(d);s.goToOption(Ct.Specific,U,0)}),R=Se(B=>{M.wasMoved(B)&&(f||b&&(i.optionsPropsRef.current.hold||s.goToOption(Ct.Nothing)))}),L=g.useMemo(()=>({active:b,focus:b,selected:v,disabled:f}),[b,v,f]),F={id:c,ref:j,role:"option",tabIndex:f===!0?void 0:-1,"aria-disabled":f===!0?!0:void 0,"aria-selected":v,disabled:void 0,onMouseDown:N,onFocus:T,onPointerEnter:I,onMouseEnter:I,onPointerMove:_,onMouseMove:_,onPointerLeave:R,onMouseLeave:R};return Pt()({ourProps:F,theirProps:p,slot:L,defaultTag:fde,name:"Combobox.Option"})}let mde=Nt(ode),u8=Nt(lde),c8=Nt(ide),hde=Pj,d8=Nt(dde),f8=Nt(pde),gde=Object.assign(mde,{Input:c8,Button:u8,Label:hde,Options:d8,Option:f8});function bde(e,t=typeof document<"u"?document.defaultView:null,r){let n=lu(e,"escape");Ah(t,"keydown",o=>{n&&(o.defaultPrevented||o.key===et.Escape&&r(o))})}function vde(){var e;let[t]=g.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[r,n]=g.useState((e=t?.matches)!=null?e:!1);return Ot(()=>{if(!t)return;function o(a){n(a.matches)}return t.addEventListener("change",o),()=>t.removeEventListener("change",o)},[t]),r}function p8({defaultContainers:e=[],portals:t,mainTreeNode:r}={}){let n=so(r),o=Se(()=>{var a,i;let s=[];for(let l of e)l!==null&&(l instanceof HTMLElement?s.push(l):"current"in l&&l.current instanceof HTMLElement&&s.push(l.current));if(t!=null&&t.current)for(let l of t.current)s.push(l);for(let l of(a=n?.querySelectorAll("html > *, body > *"))!=null?a:[])l!==document.body&&l!==document.head&&l instanceof HTMLElement&&l.id!=="headlessui-portal-root"&&(r&&(l.contains(r)||l.contains((i=r?.getRootNode())==null?void 0:i.host))||s.some(c=>l.contains(c))||s.push(l));return s});return{resolveContainers:o,contains:Se(a=>o().some(i=>i.contains(a)))}}let m8=g.createContext(null);function hm({children:e,node:t}){let[r,n]=g.useState(null),o=Hj(t??r);return y.createElement(m8.Provider,{value:o},e,o===null&&y.createElement(Do,{features:Io.Hidden,ref:a=>{var i,s;if(a){for(let l of(s=(i=zo(a))==null?void 0:i.querySelectorAll("html > *, body > *"))!=null?s:[])if(l!==document.body&&l!==document.head&&l instanceof HTMLElement&&l!=null&&l.contains(a)){n(l);break}}}}))}function Hj(e=null){var t;return(t=g.useContext(m8))!=null?t:e}function Ih(){let e=g.useRef(!1);return Ot(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var jn=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(jn||{});function qj(){let e=g.useRef(0);return G9(!0,"keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function h8(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let r of e.current)r.current instanceof HTMLElement&&t.add(r.current);return t}let yde="div";var Bi=(e=>(e[e.None=0]="None",e[e.InitialFocus=1]="InitialFocus",e[e.TabLock=2]="TabLock",e[e.FocusLock=4]="FocusLock",e[e.RestoreFocus=8]="RestoreFocus",e[e.AutoFocus=16]="AutoFocus",e))(Bi||{});function xde(e,t){let r=g.useRef(null),n=It(r,t),{initialFocus:o,initialFocusFallback:a,containers:i,features:s=15,...l}=e;Td()||(s=0);let c=so(r);Ede(s,{ownerDocument:c});let d=Sde(s,{ownerDocument:c,container:r,initialFocus:o,initialFocusFallback:a});Nde(s,{ownerDocument:c,container:r,containers:i,previousActiveElement:d});let f=qj(),m=Se(k=>{let S=r.current;S&&(j=>j())(()=>{Mt(f.current,{[jn.Forwards]:()=>{Ar(S,Kt.First,{skipElements:[k.relatedTarget,a]})},[jn.Backwards]:()=>{Ar(S,Kt.Last,{skipElements:[k.relatedTarget,a]})}})})}),p=lu(!!(s&2),"focus-trap#tab-lock"),h=Ho(),b=g.useRef(!1),v={ref:n,onKeyDown(k){k.key=="Tab"&&(b.current=!0,h.requestAnimationFrame(()=>{b.current=!1}))},onBlur(k){if(!(s&4))return;let S=h8(i);r.current instanceof HTMLElement&&S.add(r.current);let j=k.relatedTarget;j instanceof HTMLElement&&j.dataset.headlessuiFocusGuard!=="true"&&(g8(S,j)||(b.current?Ar(r.current,Mt(f.current,{[jn.Forwards]:()=>Kt.Next,[jn.Backwards]:()=>Kt.Previous})|Kt.WrapAround,{relativeTo:k.target}):k.target instanceof HTMLElement&&la(k.target)))}},x=Pt();return y.createElement(y.Fragment,null,p&&y.createElement(Do,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:m,features:Io.Focusable}),x({ourProps:v,theirProps:l,defaultTag:yde,name:"FocusTrap"}),p&&y.createElement(Do,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:m,features:Io.Focusable}))}let wde=Nt(xde),kde=Object.assign(wde,{features:Bi});function jde(e=!0){let t=g.useRef(go.slice());return od(([r],[n])=>{n===!0&&r===!1&&Od(()=>{t.current.splice(0)}),n===!1&&r===!0&&(t.current=go.slice())},[e,go,t]),Se(()=>{var r;return(r=t.current.find(n=>n!=null&&n.isConnected))!=null?r:null})}function Ede(e,{ownerDocument:t}){let r=!!(e&8),n=jde(r);od(()=>{r||t?.activeElement===t?.body&&la(n())},[r]),r8(()=>{r&&la(n())})}function Sde(e,{ownerDocument:t,container:r,initialFocus:n,initialFocusFallback:o}){let a=g.useRef(null),i=lu(!!(e&1),"focus-trap#initial-focus"),s=Ih();return od(()=>{if(e===0)return;if(!i){o!=null&&o.current&&la(o.current);return}let l=r.current;l&&Od(()=>{if(!s.current)return;let c=t?.activeElement;if(n!=null&&n.current){if(n?.current===c){a.current=c;return}}else if(l.contains(c)){a.current=c;return}if(n!=null&&n.current)la(n.current);else{if(e&16){if(Ar(l,Kt.First|Kt.AutoFocus)!==wo.Error)return}else if(Ar(l,Kt.First)!==wo.Error)return;if(o!=null&&o.current&&(la(o.current),t?.activeElement===o.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}a.current=t?.activeElement})},[o,i,e]),a}function Nde(e,{ownerDocument:t,container:r,containers:n,previousActiveElement:o}){let a=Ih(),i=!!(e&4);Ah(t?.defaultView,"focus",s=>{if(!i||!a.current)return;let l=h8(n);r.current instanceof HTMLElement&&l.add(r.current);let c=o.current;if(!c)return;let d=s.target;d&&d instanceof HTMLElement?g8(l,d)?(o.current=d,la(d)):(s.preventDefault(),s.stopPropagation(),la(c)):la(o.current)},!0)}function g8(e,t){for(let r of e)if(r.contains(t))return!0;return!1}function b8(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:y8)!==g.Fragment||y.Children.count(e.children)===1}let Dh=g.createContext(null);Dh.displayName="TransitionContext";var Ode=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Ode||{});function Cde(){let e=g.useContext(Dh);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Pde(){let e=g.useContext(Lh);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Lh=g.createContext(null);Lh.displayName="NestingContext";function Rh(e){return"children"in e?Rh(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function v8(e,t){let r=nn(e),n=g.useRef([]),o=Ih(),a=Ho(),i=Se((p,h=Ya.Hidden)=>{let b=n.current.findIndex(({el:v})=>v===p);b!==-1&&(Mt(h,{[Ya.Unmount](){n.current.splice(b,1)},[Ya.Hidden](){n.current[b].state="hidden"}}),a.microTask(()=>{var v;!Rh(n)&&o.current&&((v=r.current)==null||v.call(r))}))}),s=Se(p=>{let h=n.current.find(({el:b})=>b===p);return h?h.state!=="visible"&&(h.state="visible"):n.current.push({el:p,state:"visible"}),()=>i(p,Ya.Unmount)}),l=g.useRef([]),c=g.useRef(Promise.resolve()),d=g.useRef({enter:[],leave:[]}),f=Se((p,h,b)=>{l.current.splice(0),t&&(t.chains.current[h]=t.chains.current[h].filter(([v])=>v!==p)),t?.chains.current[h].push([p,new Promise(v=>{l.current.push(v)})]),t?.chains.current[h].push([p,new Promise(v=>{Promise.all(d.current[h].map(([x,k])=>k)).then(()=>v())})]),h==="enter"?c.current=c.current.then(()=>t?.wait.current).then(()=>b(h)):b(h)}),m=Se((p,h,b)=>{Promise.all(d.current[h].splice(0).map(([v,x])=>x)).then(()=>{var v;(v=l.current.shift())==null||v()}).then(()=>b(h))});return g.useMemo(()=>({children:n,register:s,unregister:i,onStart:f,onStop:m,wait:c,chains:d}),[s,i,n,f,m,d,c])}let y8=g.Fragment,x8=Vr.RenderStrategy;function Ade(e,t){var r,n;let{transition:o=!0,beforeEnter:a,afterEnter:i,beforeLeave:s,afterLeave:l,enter:c,enterFrom:d,enterTo:f,entered:m,leave:p,leaveFrom:h,leaveTo:b,...v}=e,[x,k]=g.useState(null),S=g.useRef(null),j=b8(e),O=It(...j?[S,t,k]:t===null?[]:[t]),C=(r=v.unmount)==null||r?Ya.Unmount:Ya.Hidden,{show:N,appear:T,initial:M}=Cde(),[I,_]=g.useState(N?"visible":"hidden"),R=Pde(),{register:L,unregister:F}=R;Ot(()=>L(S),[L,S]),Ot(()=>{if(C===Ya.Hidden&&S.current){if(N&&I!=="visible"){_("visible");return}return Mt(I,{hidden:()=>F(S),visible:()=>L(S)})}},[I,S,L,F,N,C]);let B=Td();Ot(()=>{if(j&&B&&I==="visible"&&S.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[S,I,B,j]);let U=M&&!T,$=T&&N&&M,z=g.useRef(!1),W=v8(()=>{z.current||(_("hidden"),F(S))},R),K=Se(oe=>{z.current=!0;let Oe=oe?"enter":"leave";W.onStart(S,Oe,te=>{te==="enter"?a?.():te==="leave"&&s?.()})}),q=Se(oe=>{let Oe=oe?"enter":"leave";z.current=!1,W.onStop(S,Oe,te=>{te==="enter"?i?.():te==="leave"&&l?.()}),Oe==="leave"&&!Rh(W)&&(_("hidden"),F(S))});g.useEffect(()=>{j&&o||(K(N),q(N))},[N,j,o]);let J=!(!o||!j||!B||U),[,V]=du(J,x,N,{start:K,end:q}),me=za({ref:O,className:((n=fk(v.className,$&&c,$&&d,V.enter&&c,V.enter&&V.closed&&d,V.enter&&!V.closed&&f,V.leave&&p,V.leave&&!V.closed&&h,V.leave&&V.closed&&b,!V.transition&&N&&m))==null?void 0:n.trim())||void 0,...cu(V)}),X=0;I==="visible"&&(X|=Vt.Open),I==="hidden"&&(X|=Vt.Closed),V.enter&&(X|=Vt.Opening),V.leave&&(X|=Vt.Closing);let ce=Pt();return y.createElement(Lh.Provider,{value:W},y.createElement(Ad,{value:X},ce({ourProps:me,theirProps:v,defaultTag:y8,features:x8,visible:I==="visible",name:"Transition.Child"})))}function Tde(e,t){let{show:r,appear:n=!1,unmount:o=!0,...a}=e,i=g.useRef(null),s=b8(e),l=It(...s?[i,t]:t===null?[]:[t]);Td();let c=Sa();if(r===void 0&&c!==null&&(r=(c&Vt.Open)===Vt.Open),r===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[d,f]=g.useState(r?"visible":"hidden"),m=v8(()=>{r||f("hidden")}),[p,h]=g.useState(!0),b=g.useRef([r]);Ot(()=>{p!==!1&&b.current[b.current.length-1]!==r&&(b.current.push(r),h(!1))},[b,r]);let v=g.useMemo(()=>({show:r,appear:n,initial:p}),[r,n,p]);Ot(()=>{r?f("visible"):!Rh(m)&&i.current!==null&&f("hidden")},[r,m]);let x={unmount:o},k=Se(()=>{var O;p&&h(!1),(O=e.beforeEnter)==null||O.call(e)}),S=Se(()=>{var O;p&&h(!1),(O=e.beforeLeave)==null||O.call(e)}),j=Pt();return y.createElement(Lh.Provider,{value:m},y.createElement(Dh.Provider,{value:v},j({ourProps:{...x,as:g.Fragment,children:y.createElement(w8,{ref:l,...x,...a,beforeEnter:k,beforeLeave:S})},theirProps:{},defaultTag:g.Fragment,features:x8,visible:d==="visible",name:"Transition"})))}function Mde(e,t){let r=g.useContext(Dh)!==null,n=Sa()!==null;return y.createElement(y.Fragment,null,!r&&n?y.createElement(gk,{ref:t,...e}):y.createElement(w8,{ref:t,...e}))}let gk=Nt(Tde),w8=Nt(Ade),Fh=Nt(Mde),di=Object.assign(gk,{Child:Fh,Root:gk});var _de=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(_de||{}),Ide=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(Ide||{});let Dde={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},Wj=g.createContext(null);Wj.displayName="DialogContext";function $h(e){let t=g.useContext(Wj);if(t===null){let r=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,$h),r}return t}function Lde(e,t){return Mt(t.type,Dde,e,t)}let HP=Nt(function(e,t){let r=g.useId(),{id:n=`headlessui-dialog-${r}`,open:o,onClose:a,initialFocus:i,role:s="dialog",autoFocus:l=!0,__demoMode:c=!1,unmount:d=!1,...f}=e,m=g.useRef(!1);s=function(){return s==="dialog"||s==="alertdialog"?s:(m.current||(m.current=!0,console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let p=Sa();o===void 0&&p!==null&&(o=(p&Vt.Open)===Vt.Open);let h=g.useRef(null),b=It(h,t),v=so(h),x=o?0:1,[k,S]=g.useReducer(Lde,{titleId:null,descriptionId:null,panelRef:g.createRef()}),j=Se(()=>a(!1)),O=Se(q=>S({type:0,id:q})),C=Td()?x===0:!1,[N,T]=i8(),M={get current(){var q;return(q=k.panelRef.current)!=null?q:h.current}},I=Hj(),{resolveContainers:_}=p8({mainTreeNode:I,portals:N,defaultContainers:[M]}),R=p!==null?(p&Vt.Closing)===Vt.Closing:!1;Tj(c||R?!1:C,{allowed:Se(()=>{var q,J;return[(J=(q=h.current)==null?void 0:q.closest("[data-headlessui-portal]"))!=null?J:null]}),disallowed:Se(()=>{var q;return[(q=I?.closest("body > *:not(#headlessui-portal-root)"))!=null?q:null]})}),Ph(C,_,q=>{q.preventDefault(),j()}),bde(C,v?.defaultView,q=>{q.preventDefault(),q.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),j()}),Th(c||R?!1:C,v,_),Oh(C,h,j);let[L,F]=B9(),B=g.useMemo(()=>[{dialogState:x,close:j,setTitleId:O,unmount:d},k],[x,k,j,O,d]),U=g.useMemo(()=>({open:x===0}),[x]),$={ref:b,id:n,role:s,tabIndex:-1,"aria-modal":c?void 0:x===0?!0:void 0,"aria-labelledby":k.titleId,"aria-describedby":L,unmount:d},z=!vde(),W=Bi.None;C&&!c&&(W|=Bi.RestoreFocus,W|=Bi.TabLock,l&&(W|=Bi.AutoFocus),z&&(W|=Bi.InitialFocus));let K=Pt();return y.createElement($j,null,y.createElement(zP,{force:!0},y.createElement(_h,null,y.createElement(Wj.Provider,{value:B},y.createElement(s8,{target:h},y.createElement(zP,{force:!1},y.createElement(F,{slot:U},y.createElement(T,null,y.createElement(kde,{initialFocus:i,initialFocusFallback:h,containers:_,features:W},y.createElement(Aj,{value:j},K({ourProps:$,theirProps:f,slot:U,defaultTag:Rde,features:Fde,visible:x===0,name:"Dialog"})))))))))))}),Rde="div",Fde=Vr.RenderStrategy|Vr.Static;function $de(e,t){let{transition:r=!1,open:n,...o}=e,a=Sa(),i=e.hasOwnProperty("open")||a!==null,s=e.hasOwnProperty("onClose");if(!i&&!s)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!i)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!s)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!a&&typeof e.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);if(typeof e.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);return(n!==void 0||r)&&!o.static?y.createElement(hm,null,y.createElement(di,{show:n,transition:r,unmount:o.unmount},y.createElement(HP,{ref:t,...o}))):y.createElement(hm,null,y.createElement(HP,{ref:t,open:n,...o}))}let Bde="div";function zde(e,t){let r=g.useId(),{id:n=`headlessui-dialog-panel-${r}`,transition:o=!1,...a}=e,[{dialogState:i,unmount:s},l]=$h("Dialog.Panel"),c=It(t,l.panelRef),d=g.useMemo(()=>({open:i===0}),[i]),f=Se(v=>{v.stopPropagation()}),m={ref:c,id:n,onClick:f},p=o?Fh:g.Fragment,h=o?{unmount:s}:{},b=Pt();return y.createElement(p,{...h},b({ourProps:m,theirProps:a,slot:d,defaultTag:Bde,name:"Dialog.Panel"}))}let Hde="div";function qde(e,t){let{transition:r=!1,...n}=e,[{dialogState:o,unmount:a}]=$h("Dialog.Backdrop"),i=g.useMemo(()=>({open:o===0}),[o]),s={ref:t,"aria-hidden":!0},l=r?Fh:g.Fragment,c=r?{unmount:a}:{},d=Pt();return y.createElement(l,{...c},d({ourProps:s,theirProps:n,slot:i,defaultTag:Hde,name:"Dialog.Backdrop"}))}let Wde="h2";function Ude(e,t){let r=g.useId(),{id:n=`headlessui-dialog-title-${r}`,...o}=e,[{dialogState:a,setTitleId:i}]=$h("Dialog.Title"),s=It(t);g.useEffect(()=>(i(n),()=>i(null)),[n,i]);let l=g.useMemo(()=>({open:a===0}),[a]),c={ref:s,id:n};return Pt()({ourProps:c,theirProps:o,slot:l,defaultTag:Wde,name:"Dialog.Title"})}let Kde=Nt($de),k8=Nt(zde),Vde=Nt(qde),Gde=Nt(Ude),Yde=Object.assign(Kde,{Panel:k8,Title:Gde,Description:z9});var qP;let Xde=(qP=y.startTransition)!=null?qP:function(e){e()};var Zde=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Zde||{}),Jde=(e=>(e[e.ToggleDisclosure=0]="ToggleDisclosure",e[e.CloseDisclosure=1]="CloseDisclosure",e[e.SetButtonId=2]="SetButtonId",e[e.SetPanelId=3]="SetPanelId",e[e.SetButtonElement=4]="SetButtonElement",e[e.SetPanelElement=5]="SetPanelElement",e))(Jde||{});let Qde={0:e=>({...e,disclosureState:Mt(e.disclosureState,{0:1,1:0})}),1:e=>e.disclosureState===1?e:{...e,disclosureState:1},2(e,t){return e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId}},3(e,t){return e.panelId===t.panelId?e:{...e,panelId:t.panelId}},4(e,t){return e.buttonElement===t.element?e:{...e,buttonElement:t.element}},5(e,t){return e.panelElement===t.element?e:{...e,panelElement:t.element}}},Uj=g.createContext(null);Uj.displayName="DisclosureContext";function Kj(e){let t=g.useContext(Uj);if(t===null){let r=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Kj),r}return t}let Vj=g.createContext(null);Vj.displayName="DisclosureAPIContext";function j8(e){let t=g.useContext(Vj);if(t===null){let r=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,j8),r}return t}let Gj=g.createContext(null);Gj.displayName="DisclosurePanelContext";function efe(){return g.useContext(Gj)}function tfe(e,t){return Mt(t.type,Qde,e,t)}let rfe=g.Fragment;function nfe(e,t){let{defaultOpen:r=!1,...n}=e,o=g.useRef(null),a=It(t,Nj(b=>{o.current=b},e.as===void 0||e.as===g.Fragment)),i=g.useReducer(tfe,{disclosureState:r?0:1,buttonElement:null,panelElement:null,buttonId:null,panelId:null}),[{disclosureState:s,buttonId:l},c]=i,d=Se(b=>{c({type:1});let v=zo(o);if(!v||!l)return;let x=b?b instanceof HTMLElement?b:b.current instanceof HTMLElement?b.current:v.getElementById(l):v.getElementById(l);x?.focus()}),f=g.useMemo(()=>({close:d}),[d]),m=g.useMemo(()=>({open:s===0,close:d}),[s,d]),p={ref:a},h=Pt();return y.createElement(Uj.Provider,{value:i},y.createElement(Vj.Provider,{value:f},y.createElement(Aj,{value:d},y.createElement(Ad,{value:Mt(s,{0:Vt.Open,1:Vt.Closed})},h({ourProps:p,theirProps:n,slot:m,defaultTag:rfe,name:"Disclosure"})))))}let ofe="button";function afe(e,t){let r=g.useId(),{id:n=`headlessui-disclosure-button-${r}`,disabled:o=!1,autoFocus:a=!1,...i}=e,[s,l]=Kj("Disclosure.Button"),c=efe(),d=c===null?!1:c===s.panelId,f=g.useRef(null),m=It(f,t,Se(M=>{if(!d)return l({type:4,element:M})}));g.useEffect(()=>{if(!d)return l({type:2,buttonId:n}),()=>{l({type:2,buttonId:null})}},[n,l,d]);let p=Se(M=>{var I;if(d){if(s.disclosureState===1)return;switch(M.key){case et.Space:case et.Enter:M.preventDefault(),M.stopPropagation(),l({type:0}),(I=s.buttonElement)==null||I.focus();break}}else switch(M.key){case et.Space:case et.Enter:M.preventDefault(),M.stopPropagation(),l({type:0});break}}),h=Se(M=>{switch(M.key){case et.Space:M.preventDefault();break}}),b=Se(M=>{var I;iu(M.currentTarget)||o||(d?(l({type:0}),(I=s.buttonElement)==null||I.focus()):l({type:0}))}),{isFocusVisible:v,focusProps:x}=no({autoFocus:a}),{isHovered:k,hoverProps:S}=Lo({isDisabled:o}),{pressed:j,pressProps:O}=au({disabled:o}),C=g.useMemo(()=>({open:s.disclosureState===0,hover:k,active:j,disabled:o,focus:v,autofocus:a}),[s,k,j,v,o,a]),N=uu(e,s.buttonElement),T=io(d?{ref:m,type:N,disabled:o||void 0,autoFocus:a,onKeyDown:p,onClick:b}:{ref:m,id:n,type:N,"aria-expanded":s.disclosureState===0,"aria-controls":s.panelElement?s.panelId:void 0,disabled:o||void 0,autoFocus:a,onKeyDown:p,onKeyUp:h,onClick:b},x,S,O);return Pt()({ourProps:T,theirProps:i,slot:C,defaultTag:ofe,name:"Disclosure.Button"})}let ife="div",sfe=Vr.RenderStrategy|Vr.Static;function lfe(e,t){let r=g.useId(),{id:n=`headlessui-disclosure-panel-${r}`,transition:o=!1,...a}=e,[i,s]=Kj("Disclosure.Panel"),{close:l}=j8("Disclosure.Panel"),[c,d]=g.useState(null),f=It(t,Se(k=>{Xde(()=>s({type:5,element:k}))}),d);g.useEffect(()=>(s({type:3,panelId:n}),()=>{s({type:3,panelId:null})}),[n,s]);let m=Sa(),[p,h]=du(o,c,m!==null?(m&Vt.Open)===Vt.Open:i.disclosureState===0),b=g.useMemo(()=>({open:i.disclosureState===0,close:l}),[i.disclosureState,l]),v={ref:f,id:n,...cu(h)},x=Pt();return y.createElement($j,null,y.createElement(Gj.Provider,{value:i.panelId},x({ourProps:v,theirProps:a,slot:b,defaultTag:ife,features:sfe,visible:p,name:"Disclosure.Panel"})))}let ufe=Nt(nfe),cfe=Nt(afe),dfe=Nt(lfe),Yj=Object.assign(ufe,{Button:cfe,Panel:dfe});function ffe(e,t){let r=g.useRef({left:0,top:0});if(Ot(()=>{if(!t)return;let o=t.getBoundingClientRect();o&&(r.current=o)},[e,t]),t==null||!e||t===document.activeElement)return!1;let n=t.getBoundingClientRect();return n.top!==r.current.top||n.left!==r.current.left}let WP=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function UP(e){var t,r;let n=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!(o instanceof HTMLElement))return n;let a=!1;for(let s of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))s.remove(),a=!0;let i=a?(r=o.innerText)!=null?r:"":n;return WP.test(i)&&(i=i.replace(WP,"")),i}function pfe(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let r=e.getAttribute("aria-labelledby");if(r){let n=r.split(" ").map(o=>{let a=document.getElementById(o);if(a){let i=a.getAttribute("aria-label");return typeof i=="string"?i.trim():UP(a).trim()}return null}).filter(Boolean);if(n.length>0)return n.join(", ")}return UP(e).trim()}function mfe(e){let t=g.useRef(""),r=g.useRef("");return Se(()=>{let n=e.current;if(!n)return"";let o=n.innerText;if(t.current===o)return r.current;let a=pfe(n).trim().toLowerCase();return t.current=o,r.current=a,a})}var hfe=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(hfe||{}),gfe=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(gfe||{}),bfe=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(bfe||{}),vfe=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterOption=5]="RegisterOption",e[e.UnregisterOption=6]="UnregisterOption",e[e.SetButtonElement=7]="SetButtonElement",e[e.SetOptionsElement=8]="SetOptionsElement",e))(vfe||{});function t0(e,t=r=>r){let r=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,n=Xa(t(e.options.slice()),a=>a.dataRef.current.domRef.current),o=r?n.indexOf(r):null;return o===-1&&(o=null),{options:n,activeOptionIndex:o}}let yfe={1(e){return e.dataRef.current.disabled||e.listboxState===1?e:{...e,activeOptionIndex:null,listboxState:1,__demoMode:!1}},0(e){if(e.dataRef.current.disabled||e.listboxState===0)return e;let t=e.activeOptionIndex,{isSelected:r}=e.dataRef.current,n=e.options.findIndex(o=>r(o.dataRef.current.value));return n!==-1&&(t=n),{...e,listboxState:0,activeOptionIndex:t,__demoMode:!1}},2(e,t){var r,n,o,a,i;if(e.dataRef.current.disabled||e.listboxState===1)return e;let s={...e,searchQuery:"",activationTrigger:(r=t.trigger)!=null?r:1,__demoMode:!1};if(t.focus===Ct.Nothing)return{...s,activeOptionIndex:null};if(t.focus===Ct.Specific)return{...s,activeOptionIndex:e.options.findIndex(d=>d.id===t.id)};if(t.focus===Ct.Previous){let d=e.activeOptionIndex;if(d!==null){let f=e.options[d].dataRef.current.domRef,m=mc(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});if(m!==null){let p=e.options[m].dataRef.current.domRef;if(((n=f.current)==null?void 0:n.previousElementSibling)===p.current||((o=p.current)==null?void 0:o.previousElementSibling)===null)return{...s,activeOptionIndex:m}}}}else if(t.focus===Ct.Next){let d=e.activeOptionIndex;if(d!==null){let f=e.options[d].dataRef.current.domRef,m=mc(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});if(m!==null){let p=e.options[m].dataRef.current.domRef;if(((a=f.current)==null?void 0:a.nextElementSibling)===p.current||((i=p.current)==null?void 0:i.nextElementSibling)===null)return{...s,activeOptionIndex:m}}}}let l=t0(e),c=mc(t,{resolveItems:()=>l.options,resolveActiveIndex:()=>l.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled});return{...s,...l,activeOptionIndex:c}},3:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let r=e.searchQuery!==""?0:1,n=e.searchQuery+t.value.toLowerCase(),o=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+r).concat(e.options.slice(0,e.activeOptionIndex+r)):e.options).find(i=>{var s;return!i.dataRef.current.disabled&&((s=i.dataRef.current.textValue)==null?void 0:s.startsWith(n))}),a=o?e.options.indexOf(o):-1;return a===-1||a===e.activeOptionIndex?{...e,searchQuery:n}:{...e,searchQuery:n,activeOptionIndex:a,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5:(e,t)=>{let r={id:t.id,dataRef:t.dataRef},n=t0(e,o=>[...o,r]);return e.activeOptionIndex===null&&e.dataRef.current.isSelected(t.dataRef.current.value)&&(n.activeOptionIndex=n.options.indexOf(r)),{...e,...n}},6:(e,t)=>{let r=t0(e,n=>{let o=n.findIndex(a=>a.id===t.id);return o!==-1&&n.splice(o,1),n});return{...e,...r,activationTrigger:1}},7:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},8:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element}},Xj=g.createContext(null);Xj.displayName="ListboxActionsContext";function Bh(e){let t=g.useContext(Xj);if(t===null){let r=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Bh),r}return t}let zh=g.createContext(null);zh.displayName="ListboxDataContext";function _d(e){let t=g.useContext(zh);if(t===null){let r=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,_d),r}return t}function xfe(e,t){return Mt(t.type,yfe,e,t)}let wfe=g.Fragment;function kfe(e,t){var r;let n=Cd(),{value:o,defaultValue:a,form:i,name:s,onChange:l,by:c,invalid:d=!1,disabled:f=n||!1,horizontal:m=!1,multiple:p=!1,__demoMode:h=!1,...b}=e;const v=m?"horizontal":"vertical";let x=It(t),k=Ej(a),[S=p?[]:void 0,j]=jj(o,l,k),[O,C]=g.useReducer(xfe,{dataRef:g.createRef(),listboxState:h?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,optionsVisible:!1,buttonElement:null,optionsElement:null,__demoMode:h}),N=g.useRef({static:!1,hold:!1}),T=g.useRef(new Map),M=q9(c),I=g.useCallback(G=>Mt(_.mode,{1:()=>S.some(ye=>M(ye,G)),0:()=>M(S,G)}),[S]),_=g.useMemo(()=>({...O,value:S,disabled:f,invalid:d,mode:p?1:0,orientation:v,compare:M,isSelected:I,optionsPropsRef:N,listRef:T}),[S,f,d,p,O,T]);Ot(()=>{O.dataRef.current=_},[_]);let R=_.listboxState===0;Ph(R,[_.buttonElement,_.optionsElement],(G,ye)=>{var le;C({type:1}),Mj(ye,Ch.Loose)||(G.preventDefault(),(le=_.buttonElement)==null||le.focus())});let L=g.useMemo(()=>({open:_.listboxState===0,disabled:f,invalid:d,value:S}),[_,f,S,d]),F=Se(G=>{let ye=_.options.find(le=>le.id===G);ye&&q(ye.dataRef.current.value)}),B=Se(()=>{if(_.activeOptionIndex!==null){let{dataRef:G,id:ye}=_.options[_.activeOptionIndex];q(G.current.value),C({type:2,focus:Ct.Specific,id:ye})}}),U=Se(()=>C({type:0})),$=Se(()=>C({type:1})),z=Ho(),W=Se((G,ye,le)=>{z.dispose(),z.microTask(()=>G===Ct.Specific?C({type:2,focus:Ct.Specific,id:ye,trigger:le}):C({type:2,focus:G,trigger:le}))}),K=Se((G,ye)=>(C({type:5,id:G,dataRef:ye}),()=>C({type:6,id:G}))),q=Se(G=>Mt(_.mode,{0(){return j?.(G)},1(){let ye=_.value.slice(),le=ye.findIndex(ge=>M(ge,G));return le===-1?ye.push(G):ye.splice(le,1),j?.(ye)}})),J=Se(G=>C({type:3,value:G})),V=Se(()=>C({type:4})),me=Se(G=>{C({type:7,element:G})}),X=Se(G=>{C({type:8,element:G})}),ce=g.useMemo(()=>({onChange:q,registerOption:K,goToOption:W,closeListbox:$,openListbox:U,selectActiveOption:B,selectOption:F,search:J,clearSearch:V,setButtonElement:me,setOptionsElement:X}),[]),[oe,Oe]=Cj({inherit:!0}),te={ref:x},Ne=g.useCallback(()=>{if(k!==void 0)return j?.(k)},[j,k]),ve=Pt();return y.createElement(Oe,{value:oe,props:{htmlFor:(r=_.buttonElement)==null?void 0:r.id},slot:{open:_.listboxState===0,disabled:f}},y.createElement(Fj,null,y.createElement(Xj.Provider,{value:ce},y.createElement(zh.Provider,{value:_},y.createElement(Ad,{value:Mt(_.listboxState,{0:Vt.Open,1:Vt.Closed})},s!=null&&S!=null&&y.createElement(Sj,{disabled:f,data:{[s]:S},form:i,onReset:Ne}),ve({ourProps:te,theirProps:b,slot:L,defaultTag:wfe,name:"Listbox"}))))))}let jfe="button";function Efe(e,t){var r;let n=_d("Listbox.Button"),o=Bh("Listbox.Button"),a=g.useId(),i=Eh(),{id:s=i||`headlessui-listbox-button-${a}`,disabled:l=n.disabled||!1,autoFocus:c=!1,...d}=e,f=It(t,Dj(),o.setButtonElement),m=Lce(),p=Se(_=>{switch(_.key){case et.Enter:R9(_.currentTarget);break;case et.Space:case et.ArrowDown:_.preventDefault(),Ht.flushSync(()=>o.openListbox()),n.value||o.goToOption(Ct.First);break;case et.ArrowUp:_.preventDefault(),Ht.flushSync(()=>o.openListbox()),n.value||o.goToOption(Ct.Last);break}}),h=Se(_=>{switch(_.key){case et.Space:_.preventDefault();break}}),b=Se(_=>{var R;if(iu(_.currentTarget))return _.preventDefault();n.listboxState===0?(Ht.flushSync(()=>o.closeListbox()),(R=n.buttonElement)==null||R.focus({preventScroll:!0})):(_.preventDefault(),o.openListbox())}),v=Se(_=>_.preventDefault()),x=su([s]),k=Oj(),{isFocusVisible:S,focusProps:j}=no({autoFocus:c}),{isHovered:O,hoverProps:C}=Lo({isDisabled:l}),{pressed:N,pressProps:T}=au({disabled:l}),M=g.useMemo(()=>({open:n.listboxState===0,active:N||n.listboxState===0,disabled:l,invalid:n.invalid,value:n.value,hover:O,focus:S,autofocus:c}),[n.listboxState,n.value,l,O,S,N,n.invalid,c]),I=io(m(),{ref:f,id:s,type:uu(e,n.buttonElement),"aria-haspopup":"listbox","aria-controls":(r=n.optionsElement)==null?void 0:r.id,"aria-expanded":n.listboxState===0,"aria-labelledby":x,"aria-describedby":k,disabled:l||void 0,autoFocus:c,onKeyDown:p,onKeyUp:h,onKeyPress:v,onClick:b},j,C,T);return Pt()({ourProps:I,theirProps:d,slot:M,defaultTag:jfe,name:"Listbox.Button"})}let E8=g.createContext(!1),Sfe="div",Nfe=Vr.RenderStrategy|Vr.Static;function Ofe(e,t){var r,n;let o=g.useId(),{id:a=`headlessui-listbox-options-${o}`,anchor:i,portal:s=!1,modal:l=!0,transition:c=!1,...d}=e,f=Ij(i),[m,p]=g.useState(null);f&&(s=!0);let h=_d("Listbox.Options"),b=Bh("Listbox.Options"),v=so(h.optionsElement),x=Sa(),[k,S]=du(c,m,x!==null?(x&Vt.Open)===Vt.Open:h.listboxState===0);Oh(k,h.buttonElement,b.closeListbox);let j=h.__demoMode?!1:l&&h.listboxState===0;Th(j,v);let O=h.__demoMode?!1:l&&h.listboxState===0;Tj(O,{allowed:g.useCallback(()=>[h.buttonElement,h.optionsElement],[h.buttonElement,h.optionsElement])});let C=h.listboxState!==0,N=ffe(C,h.buttonElement)?!1:k,T=k&&h.listboxState===1,M=mm(T,h.value),I=Se(V=>h.compare(M,V)),_=g.useMemo(()=>{var V;if(f==null||!((V=f?.to)!=null&&V.includes("selection")))return null;let me=h.options.findIndex(X=>I(X.dataRef.current.value));return me===-1&&(me=0),me},[f,h.options]),R=(()=>{if(f==null)return;if(_===null)return{...f,inner:void 0};let V=Array.from(h.listRef.current.values());return{...f,inner:{listRef:{current:V},index:_}}})(),[L,F]=Rj(R),B=Lj(),U=It(t,f?L:null,b.setOptionsElement,p),$=Ho();g.useEffect(()=>{var V;let me=h.optionsElement;me&&h.listboxState===0&&me!==((V=zo(me))==null?void 0:V.activeElement)&&me?.focus({preventScroll:!0})},[h.listboxState,h.optionsElement]);let z=Se(V=>{var me,X;switch($.dispose(),V.key){case et.Space:if(h.searchQuery!=="")return V.preventDefault(),V.stopPropagation(),b.search(V.key);case et.Enter:if(V.preventDefault(),V.stopPropagation(),h.activeOptionIndex!==null){let{dataRef:ce}=h.options[h.activeOptionIndex];b.onChange(ce.current.value)}h.mode===0&&(Ht.flushSync(()=>b.closeListbox()),(me=h.buttonElement)==null||me.focus({preventScroll:!0}));break;case Mt(h.orientation,{vertical:et.ArrowDown,horizontal:et.ArrowRight}):return V.preventDefault(),V.stopPropagation(),b.goToOption(Ct.Next);case Mt(h.orientation,{vertical:et.ArrowUp,horizontal:et.ArrowLeft}):return V.preventDefault(),V.stopPropagation(),b.goToOption(Ct.Previous);case et.Home:case et.PageUp:return V.preventDefault(),V.stopPropagation(),b.goToOption(Ct.First);case et.End:case et.PageDown:return V.preventDefault(),V.stopPropagation(),b.goToOption(Ct.Last);case et.Escape:V.preventDefault(),V.stopPropagation(),Ht.flushSync(()=>b.closeListbox()),(X=h.buttonElement)==null||X.focus({preventScroll:!0});return;case et.Tab:V.preventDefault(),V.stopPropagation(),Ht.flushSync(()=>b.closeListbox()),tce(h.buttonElement,V.shiftKey?Kt.Previous:Kt.Next);break;default:V.key.length===1&&(b.search(V.key),$.setTimeout(()=>b.clearSearch(),350));break}}),W=(r=h.buttonElement)==null?void 0:r.id,K=g.useMemo(()=>({open:h.listboxState===0}),[h.listboxState]),q=io(f?B():{},{id:a,ref:U,"aria-activedescendant":h.activeOptionIndex===null||(n=h.options[h.activeOptionIndex])==null?void 0:n.id,"aria-multiselectable":h.mode===1?!0:void 0,"aria-labelledby":W,"aria-orientation":h.orientation,onKeyDown:z,role:"listbox",tabIndex:h.listboxState===0?0:void 0,style:{...d.style,...F,"--button-width":dm(h.buttonElement,!0).width},...cu(S)}),J=Pt();return y.createElement(_h,{enabled:s?e.static||k:!1},y.createElement(zh.Provider,{value:h.mode===1?h:{...h,isSelected:I}},J({ourProps:q,theirProps:d,slot:K,defaultTag:Sfe,features:Nfe,visible:N,name:"Listbox.Options"})))}let Cfe="div";function Pfe(e,t){let r=g.useId(),{id:n=`headlessui-listbox-option-${r}`,disabled:o=!1,value:a,...i}=e,s=g.useContext(E8)===!0,l=_d("Listbox.Option"),c=Bh("Listbox.Option"),d=l.activeOptionIndex!==null?l.options[l.activeOptionIndex].id===n:!1,f=l.isSelected(a),m=g.useRef(null),p=mfe(m),h=nn({disabled:o,value:a,domRef:m,get textValue(){return p()}}),b=It(t,m,M=>{M?l.listRef.current.set(n,M):l.listRef.current.delete(n)});Ot(()=>{if(!l.__demoMode&&l.listboxState===0&&d&&l.activationTrigger!==0)return to().requestAnimationFrame(()=>{var M,I;(I=(M=m.current)==null?void 0:M.scrollIntoView)==null||I.call(M,{block:"nearest"})})},[m,d,l.__demoMode,l.listboxState,l.activationTrigger,l.activeOptionIndex]),Ot(()=>{if(!s)return c.registerOption(n,h)},[h,n,s]);let v=Se(M=>{var I;if(o)return M.preventDefault();c.onChange(a),l.mode===0&&(Ht.flushSync(()=>c.closeListbox()),(I=l.buttonElement)==null||I.focus({preventScroll:!0}))}),x=Se(()=>{if(o)return c.goToOption(Ct.Nothing);c.goToOption(Ct.Specific,n)}),k=X9(),S=Se(M=>{k.update(M),!o&&(d||c.goToOption(Ct.Specific,n,0))}),j=Se(M=>{k.wasMoved(M)&&(o||d||c.goToOption(Ct.Specific,n,0))}),O=Se(M=>{k.wasMoved(M)&&(o||d&&c.goToOption(Ct.Nothing))}),C=g.useMemo(()=>({active:d,focus:d,selected:f,disabled:o,selectedOption:f&&s}),[d,f,o,s]),N=s?{}:{id:n,ref:b,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":f,disabled:void 0,onClick:v,onFocus:x,onPointerEnter:S,onMouseEnter:S,onPointerMove:j,onMouseMove:j,onPointerLeave:O,onMouseLeave:O},T=Pt();return!f&&s?null:T({ourProps:N,theirProps:i,slot:C,defaultTag:Cfe,name:"Listbox.Option"})}let Afe=g.Fragment;function Tfe(e,t){let{options:r,placeholder:n,...o}=e,a={ref:It(t)},i=_d("ListboxSelectedOption"),s=g.useMemo(()=>({}),[]),l=i.value===void 0||i.value===null||i.mode===1&&Array.isArray(i.value)&&i.value.length===0,c=Pt();return y.createElement(E8.Provider,{value:!0},c({ourProps:a,theirProps:{...o,children:y.createElement(y.Fragment,null,n&&l?n:r)},slot:s,defaultTag:Afe,name:"ListboxSelectedOption"}))}let Mfe=Nt(kfe),Hh=Nt(Efe),_fe=Pj,qh=Nt(Ofe),Zj=Nt(Pfe),Ife=Nt(Tfe),Jj=Object.assign(Mfe,{Button:Hh,Label:_fe,Options:qh,Option:Zj,SelectedOption:Ife});var Dfe=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Dfe||{}),Lfe=(e=>(e[e.TogglePopover=0]="TogglePopover",e[e.ClosePopover=1]="ClosePopover",e[e.SetButton=2]="SetButton",e[e.SetButtonId=3]="SetButtonId",e[e.SetPanel=4]="SetPanel",e[e.SetPanelId=5]="SetPanelId",e))(Lfe||{});let Rfe={0:e=>({...e,popoverState:Mt(e.popoverState,{0:1,1:0}),__demoMode:!1}),1(e){return e.popoverState===1?e:{...e,popoverState:1,__demoMode:!1}},2(e,t){return e.button===t.button?e:{...e,button:t.button}},3(e,t){return e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId}},4(e,t){return e.panel===t.panel?e:{...e,panel:t.panel}},5(e,t){return e.panelId===t.panelId?e:{...e,panelId:t.panelId}}},Qj=g.createContext(null);Qj.displayName="PopoverContext";function Wh(e){let t=g.useContext(Qj);if(t===null){let r=new Error(`<${e} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Wh),r}return t}let Uh=g.createContext(null);Uh.displayName="PopoverAPIContext";function eE(e){let t=g.useContext(Uh);if(t===null){let r=new Error(`<${e} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,eE),r}return t}let tE=g.createContext(null);tE.displayName="PopoverGroupContext";function S8(){return g.useContext(tE)}let Kh=g.createContext(null);Kh.displayName="PopoverPanelContext";function Ffe(){return g.useContext(Kh)}function $fe(e,t){return Mt(t.type,Rfe,e,t)}let Bfe="div";function zfe(e,t){var r;let{__demoMode:n=!1,...o}=e,a=g.useRef(null),i=It(t,Nj(W=>{a.current=W})),s=g.useRef([]),l=g.useReducer($fe,{__demoMode:n,popoverState:n?0:1,buttons:s,button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:g.createRef(),afterPanelSentinel:g.createRef(),afterButtonSentinel:g.createRef()}),[{popoverState:c,button:d,buttonId:f,panel:m,panelId:p,beforePanelSentinel:h,afterPanelSentinel:b,afterButtonSentinel:v},x]=l,k=so((r=a.current)!=null?r:d),S=g.useMemo(()=>{if(!d||!m)return!1;for(let X of document.querySelectorAll("body > *"))if(Number(X?.contains(d))^Number(X?.contains(m)))return!0;let W=Pd(),K=W.indexOf(d),q=(K+W.length-1)%W.length,J=(K+1)%W.length,V=W[q],me=W[J];return!m.contains(V)&&!m.contains(me)},[d,m]),j=nn(f),O=nn(p),C=g.useMemo(()=>({buttonId:j,panelId:O,close:()=>x({type:1})}),[j,O,x]),N=S8(),T=N?.registerPopover,M=Se(()=>{var W;return(W=N?.isFocusWithinPopoverGroup())!=null?W:k?.activeElement&&(d?.contains(k.activeElement)||m?.contains(k.activeElement))});g.useEffect(()=>T?.(C),[T,C]);let[I,_]=i8(),R=Hj(d),L=p8({mainTreeNode:R,portals:I,defaultContainers:[d,m]});Ah(k?.defaultView,"focus",W=>{var K,q,J,V,me,X;W.target!==window&&W.target instanceof HTMLElement&&c===0&&(M()||d&&m&&(L.contains(W.target)||(q=(K=h.current)==null?void 0:K.contains)!=null&&q.call(K,W.target)||(V=(J=b.current)==null?void 0:J.contains)!=null&&V.call(J,W.target)||(X=(me=v.current)==null?void 0:me.contains)!=null&&X.call(me,W.target)||x({type:1})))},!0),Ph(c===0,L.resolveContainers,(W,K)=>{x({type:1}),Mj(K,Ch.Loose)||(W.preventDefault(),d?.focus())});let F=Se(W=>{x({type:1});let K=W?W instanceof HTMLElement?W:"current"in W&&W.current instanceof HTMLElement?W.current:d:d;K?.focus()}),B=g.useMemo(()=>({close:F,isPortalled:S}),[F,S]),U=g.useMemo(()=>({open:c===0,close:F}),[c,F]),$={ref:i},z=Pt();return y.createElement(hm,{node:R},y.createElement(Fj,null,y.createElement(Kh.Provider,{value:null},y.createElement(Qj.Provider,{value:l},y.createElement(Uh.Provider,{value:B},y.createElement(Aj,{value:F},y.createElement(Ad,{value:Mt(c,{0:Vt.Open,1:Vt.Closed})},y.createElement(_,null,z({ourProps:$,theirProps:o,slot:U,defaultTag:Bfe,name:"Popover"})))))))))}let Hfe="button";function qfe(e,t){let r=g.useId(),{id:n=`headlessui-popover-button-${r}`,disabled:o=!1,autoFocus:a=!1,...i}=e,[s,l]=Wh("Popover.Button"),{isPortalled:c}=eE("Popover.Button"),d=g.useRef(null),f=`headlessui-focus-sentinel-${g.useId()}`,m=S8(),p=m?.closeOthers,h=Ffe()!==null;g.useEffect(()=>{if(!h)return l({type:3,buttonId:n}),()=>{l({type:3,buttonId:null})}},[h,n,l]);let[b]=g.useState(()=>Symbol()),v=It(d,t,Dj(),Se(K=>{if(!h){if(K)s.buttons.current.push(b);else{let q=s.buttons.current.indexOf(b);q!==-1&&s.buttons.current.splice(q,1)}s.buttons.current.length>1&&console.warn("You are already using a <Popover.Button /> but only 1 <Popover.Button /> is supported."),K&&l({type:2,button:K})}})),x=It(d,t),k=so(d),S=Se(K=>{var q,J,V;if(h){if(s.popoverState===1)return;switch(K.key){case et.Space:case et.Enter:K.preventDefault(),(J=(q=K.target).click)==null||J.call(q),l({type:1}),(V=s.button)==null||V.focus();break}}else switch(K.key){case et.Space:case et.Enter:K.preventDefault(),K.stopPropagation(),s.popoverState===1&&p?.(s.buttonId),l({type:0});break;case et.Escape:if(s.popoverState!==0)return p?.(s.buttonId);if(!d.current||k!=null&&k.activeElement&&!d.current.contains(k.activeElement))return;K.preventDefault(),K.stopPropagation(),l({type:1});break}}),j=Se(K=>{h||K.key===et.Space&&K.preventDefault()}),O=Se(K=>{var q,J;iu(K.currentTarget)||o||(h?(l({type:1}),(q=s.button)==null||q.focus()):(K.preventDefault(),K.stopPropagation(),s.popoverState===1&&p?.(s.buttonId),l({type:0}),(J=s.button)==null||J.focus()))}),C=Se(K=>{K.preventDefault(),K.stopPropagation()}),{isFocusVisible:N,focusProps:T}=no({autoFocus:a}),{isHovered:M,hoverProps:I}=Lo({isDisabled:o}),{pressed:_,pressProps:R}=au({disabled:o}),L=s.popoverState===0,F=g.useMemo(()=>({open:L,active:_||L,disabled:o,hover:M,focus:N,autofocus:a}),[L,M,N,_,o,a]),B=uu(e,s.button),U=io(h?{ref:x,type:B,onKeyDown:S,onClick:O,disabled:o||void 0,autoFocus:a}:{ref:v,id:s.buttonId,type:B,"aria-expanded":s.popoverState===0,"aria-controls":s.panel?s.panelId:void 0,disabled:o||void 0,autoFocus:a,onKeyDown:S,onKeyUp:j,onClick:O,onMouseDown:C},T,I,R),$=qj(),z=Se(()=>{let K=s.panel;if(!K)return;function q(){Mt($.current,{[jn.Forwards]:()=>Ar(K,Kt.First),[jn.Backwards]:()=>Ar(K,Kt.Last)})===wo.Error&&Ar(Pd().filter(J=>J.dataset.headlessuiFocusGuard!=="true"),Mt($.current,{[jn.Forwards]:Kt.Next,[jn.Backwards]:Kt.Previous}),{relativeTo:s.button})}q()}),W=Pt();return y.createElement(y.Fragment,null,W({ourProps:U,theirProps:i,slot:F,defaultTag:Hfe,name:"Popover.Button"}),L&&!h&&c&&y.createElement(Do,{id:f,ref:s.afterButtonSentinel,features:Io.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:z}))}let Wfe="div",Ufe=Vr.RenderStrategy|Vr.Static;function N8(e,t){let r=g.useId(),{id:n=`headlessui-popover-backdrop-${r}`,transition:o=!1,...a}=e,[{popoverState:i},s]=Wh("Popover.Backdrop"),[l,c]=g.useState(null),d=It(t,c),f=Sa(),[m,p]=du(o,l,f!==null?(f&Vt.Open)===Vt.Open:i===0),h=Se(x=>{if(iu(x.currentTarget))return x.preventDefault();s({type:1})}),b=g.useMemo(()=>({open:i===0}),[i]),v={ref:d,id:n,"aria-hidden":!0,onClick:h,...cu(p)};return Pt()({ourProps:v,theirProps:a,slot:b,defaultTag:Wfe,features:Ufe,visible:m,name:"Popover.Backdrop"})}let Kfe="div",Vfe=Vr.RenderStrategy|Vr.Static;function Gfe(e,t){let r=g.useId(),{id:n=`headlessui-popover-panel-${r}`,focus:o=!1,anchor:a,portal:i=!1,modal:s=!1,transition:l=!1,...c}=e,[d,f]=Wh("Popover.Panel"),{close:m,isPortalled:p}=eE("Popover.Panel"),h=`headlessui-focus-sentinel-before-${r}`,b=`headlessui-focus-sentinel-after-${r}`,v=g.useRef(null),x=Ij(a),[k,S]=Rj(x),j=Lj();x&&(i=!0);let[O,C]=g.useState(null),N=It(v,t,x?k:null,Se(K=>f({type:4,panel:K})),C),T=so(v);Ot(()=>(f({type:5,panelId:n}),()=>{f({type:5,panelId:null})}),[n,f]);let M=Sa(),[I,_]=du(l,O,M!==null?(M&Vt.Open)===Vt.Open:d.popoverState===0);Oh(I,d.button,()=>{f({type:1})});let R=d.__demoMode?!1:s&&I;Th(R,T);let L=Se(K=>{var q;switch(K.key){case et.Escape:if(d.popoverState!==0||!v.current||T!=null&&T.activeElement&&!v.current.contains(T.activeElement))return;K.preventDefault(),K.stopPropagation(),f({type:1}),(q=d.button)==null||q.focus();break}});g.useEffect(()=>{var K;e.static||d.popoverState===1&&((K=e.unmount)==null||K)&&f({type:4,panel:null})},[d.popoverState,e.unmount,e.static,f]),g.useEffect(()=>{if(d.__demoMode||!o||d.popoverState!==0||!v.current)return;let K=T?.activeElement;v.current.contains(K)||Ar(v.current,Kt.First)},[d.__demoMode,o,v.current,d.popoverState]);let F=g.useMemo(()=>({open:d.popoverState===0,close:m}),[d.popoverState,m]),B=io(x?j():{},{ref:N,id:n,onKeyDown:L,onBlur:o&&d.popoverState===0?K=>{var q,J,V,me,X;let ce=K.relatedTarget;ce&&v.current&&((q=v.current)!=null&&q.contains(ce)||(f({type:1}),((V=(J=d.beforePanelSentinel.current)==null?void 0:J.contains)!=null&&V.call(J,ce)||(X=(me=d.afterPanelSentinel.current)==null?void 0:me.contains)!=null&&X.call(me,ce))&&ce.focus({preventScroll:!0})))}:void 0,tabIndex:-1,style:{...c.style,...S,"--button-width":dm(d.button,!0).width},...cu(_)}),U=qj(),$=Se(()=>{let K=v.current;if(!K)return;function q(){Mt(U.current,{[jn.Forwards]:()=>{var J;Ar(K,Kt.First)===wo.Error&&((J=d.afterPanelSentinel.current)==null||J.focus())},[jn.Backwards]:()=>{var J;(J=d.button)==null||J.focus({preventScroll:!0})}})}q()}),z=Se(()=>{let K=v.current;if(!K)return;function q(){Mt(U.current,{[jn.Forwards]:()=>{if(!d.button)return;let J=Pd(),V=J.indexOf(d.button),me=J.slice(0,V+1),X=[...J.slice(V+1),...me];for(let ce of X.slice())if(ce.dataset.headlessuiFocusGuard==="true"||O!=null&&O.contains(ce)){let oe=X.indexOf(ce);oe!==-1&&X.splice(oe,1)}Ar(X,Kt.First,{sorted:!1})},[jn.Backwards]:()=>{var J;Ar(K,Kt.Previous)===wo.Error&&((J=d.button)==null||J.focus())}})}q()}),W=Pt();return y.createElement($j,null,y.createElement(Kh.Provider,{value:n},y.createElement(Uh.Provider,{value:{close:m,isPortalled:p}},y.createElement(_h,{enabled:i?e.static||I:!1},I&&p&&y.createElement(Do,{id:h,ref:d.beforePanelSentinel,features:Io.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:$}),W({ourProps:B,theirProps:c,slot:F,defaultTag:Kfe,features:Vfe,visible:I,name:"Popover.Panel"}),I&&p&&y.createElement(Do,{id:b,ref:d.afterPanelSentinel,features:Io.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:z})))))}let Yfe="div";function Xfe(e,t){let r=g.useRef(null),n=It(r,t),[o,a]=g.useState([]),i=Se(b=>{a(v=>{let x=v.indexOf(b);if(x!==-1){let k=v.slice();return k.splice(x,1),k}return v})}),s=Se(b=>(a(v=>[...v,b]),()=>i(b))),l=Se(()=>{var b;let v=zo(r);if(!v)return!1;let x=v.activeElement;return(b=r.current)!=null&&b.contains(x)?!0:o.some(k=>{var S,j;return((S=v.getElementById(k.buttonId.current))==null?void 0:S.contains(x))||((j=v.getElementById(k.panelId.current))==null?void 0:j.contains(x))})}),c=Se(b=>{for(let v of o)v.buttonId.current!==b&&v.close()}),d=g.useMemo(()=>({registerPopover:s,unregisterPopover:i,isFocusWithinPopoverGroup:l,closeOthers:c}),[s,i,l,c]),f=g.useMemo(()=>({}),[]),m=e,p={ref:n},h=Pt();return y.createElement(hm,null,y.createElement(tE.Provider,{value:d},h({ourProps:p,theirProps:m,slot:f,defaultTag:Yfe,name:"Popover.Group"})))}let Zfe=Nt(zfe),rE=Nt(qfe),Jfe=Nt(N8),Qfe=Nt(N8),nE=Nt(Gfe),epe=Nt(Xfe),O8=Object.assign(Zfe,{Button:rE,Backdrop:Qfe,Overlay:Jfe,Panel:nE,Group:epe}),oE=g.createContext(null);oE.displayName="GroupContext";let tpe=g.Fragment;function rpe(e){var t;let[r,n]=g.useState(null),[o,a]=Cj(),[i,s]=B9(),l=g.useMemo(()=>({switch:r,setSwitch:n}),[r,n]),c={},d=e,f=Pt();return y.createElement(s,{name:"Switch.Description",value:i},y.createElement(a,{name:"Switch.Label",value:o,props:{htmlFor:(t=l.switch)==null?void 0:t.id,onClick(m){r&&(m.currentTarget instanceof HTMLLabelElement&&m.preventDefault(),r.click(),r.focus({preventScroll:!0}))}}},y.createElement(oE.Provider,{value:l},f({ourProps:c,theirProps:d,slot:{},defaultTag:tpe,name:"Switch.Group"}))))}let npe="button";function ope(e,t){var r;let n=g.useId(),o=Eh(),a=Cd(),{id:i=o||`headlessui-switch-${n}`,disabled:s=a||!1,checked:l,defaultChecked:c,onChange:d,name:f,value:m,form:p,autoFocus:h=!1,...b}=e,v=g.useContext(oE),[x,k]=g.useState(null),S=g.useRef(null),j=It(S,t,v===null?null:v.setSwitch,k),O=Ej(c),[C,N]=jj(l,d,O??!1),T=Ho(),[M,I]=g.useState(!1),_=Se(()=>{I(!0),N?.(!C),T.nextFrame(()=>{I(!1)})}),R=Se(oe=>{if(iu(oe.currentTarget))return oe.preventDefault();oe.preventDefault(),_()}),L=Se(oe=>{oe.key===et.Space?(oe.preventDefault(),_()):oe.key===et.Enter&&R9(oe.currentTarget)}),F=Se(oe=>oe.preventDefault()),B=su(),U=Oj(),{isFocusVisible:$,focusProps:z}=no({autoFocus:h}),{isHovered:W,hoverProps:K}=Lo({isDisabled:s}),{pressed:q,pressProps:J}=au({disabled:s}),V=g.useMemo(()=>({checked:C,disabled:s,hover:W,focus:$,active:q,autofocus:h,changing:M}),[C,W,$,q,s,M,h]),me=io({id:i,ref:j,role:"switch",type:uu(e,x),tabIndex:e.tabIndex===-1?0:(r=e.tabIndex)!=null?r:0,"aria-checked":C,"aria-labelledby":B,"aria-describedby":U,disabled:s||void 0,autoFocus:h,onClick:R,onKeyUp:L,onKeyPress:F},z,K,J),X=g.useCallback(()=>{if(O!==void 0)return N?.(O)},[N,O]),ce=Pt();return y.createElement(y.Fragment,null,f!=null&&y.createElement(Sj,{disabled:s,data:{[f]:m||"on"},overrides:{type:"checkbox",checked:C},form:p,onReset:X}),ce({ourProps:me,theirProps:b,slot:V,defaultTag:npe,name:"Switch"}))}let ape=Nt(ope),ipe=rpe,spe=Pj,lpe=z9,upe=Object.assign(ape,{Group:ipe,Label:spe,Description:lpe});function cpe({onFocus:e}){let[t,r]=g.useState(!0),n=Ih();return t?y.createElement(Do,{as:"button",type:"button",features:Io.Focusable,onFocus:o=>{o.preventDefault();let a,i=50;function s(){if(i--<=0){a&&cancelAnimationFrame(a);return}if(e()){if(cancelAnimationFrame(a),!n.current)return;r(!1);return}a=requestAnimationFrame(s)}a=requestAnimationFrame(s)}}):null}const C8=g.createContext(null);function dpe(){return{groups:new Map,get(e,t){var r;let n=this.groups.get(e);n||(n=new Map,this.groups.set(e,n));let o=(r=n.get(t))!=null?r:0;n.set(t,o+1);let a=Array.from(n.keys()).indexOf(t);function i(){let s=n.get(t);s>1?n.set(t,s-1):n.delete(t)}return[a,i]}}}function fpe({children:e}){let t=g.useRef(dpe());return g.createElement(C8.Provider,{value:t},e)}function P8(e){let t=g.useContext(C8);if(!t)throw new Error("You must wrap your component in a <StableCollection>");let r=g.useId(),[n,o]=t.current.get(e,r);return g.useEffect(()=>o,[]),n}var ppe=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(ppe||{}),mpe=(e=>(e[e.Less=-1]="Less",e[e.Equal=0]="Equal",e[e.Greater=1]="Greater",e))(mpe||{}),hpe=(e=>(e[e.SetSelectedIndex=0]="SetSelectedIndex",e[e.RegisterTab=1]="RegisterTab",e[e.UnregisterTab=2]="UnregisterTab",e[e.RegisterPanel=3]="RegisterPanel",e[e.UnregisterPanel=4]="UnregisterPanel",e))(hpe||{});let gpe={0(e,t){var r;let n=Xa(e.tabs,d=>d.current),o=Xa(e.panels,d=>d.current),a=n.filter(d=>{var f;return!((f=d.current)!=null&&f.hasAttribute("disabled"))}),i={...e,tabs:n,panels:o};if(t.index<0||t.index>n.length-1){let d=Mt(Math.sign(t.index-e.selectedIndex),{[-1]:()=>1,0:()=>Mt(Math.sign(t.index),{[-1]:()=>0,0:()=>0,1:()=>1}),1:()=>0});if(a.length===0)return i;let f=Mt(d,{0:()=>n.indexOf(a[0]),1:()=>n.indexOf(a[a.length-1])});return{...i,selectedIndex:f===-1?e.selectedIndex:f}}let s=n.slice(0,t.index),l=[...n.slice(t.index),...s].find(d=>a.includes(d));if(!l)return i;let c=(r=n.indexOf(l))!=null?r:e.selectedIndex;return c===-1&&(c=e.selectedIndex),{...i,selectedIndex:c}},1(e,t){if(e.tabs.includes(t.tab))return e;let r=e.tabs[e.selectedIndex],n=Xa([...e.tabs,t.tab],a=>a.current),o=e.selectedIndex;return e.info.current.isControlled||(o=n.indexOf(r),o===-1&&(o=e.selectedIndex)),{...e,tabs:n,selectedIndex:o}},2(e,t){return{...e,tabs:e.tabs.filter(r=>r!==t.tab)}},3(e,t){return e.panels.includes(t.panel)?e:{...e,panels:Xa([...e.panels,t.panel],r=>r.current)}},4(e,t){return{...e,panels:e.panels.filter(r=>r!==t.panel)}}},aE=g.createContext(null);aE.displayName="TabsDataContext";function Wl(e){let t=g.useContext(aE);if(t===null){let r=new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Wl),r}return t}let iE=g.createContext(null);iE.displayName="TabsActionsContext";function sE(e){let t=g.useContext(iE);if(t===null){let r=new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,sE),r}return t}function bpe(e,t){return Mt(t.type,gpe,e,t)}let vpe="div";function ype(e,t){let{defaultIndex:r=0,vertical:n=!1,manual:o=!1,onChange:a,selectedIndex:i=null,...s}=e;const l=n?"vertical":"horizontal",c=o?"manual":"auto";let d=i!==null,f=nn({isControlled:d}),m=It(t),[p,h]=g.useReducer(bpe,{info:f,selectedIndex:i??r,tabs:[],panels:[]}),b=g.useMemo(()=>({selectedIndex:p.selectedIndex}),[p.selectedIndex]),v=nn(a||(()=>{})),x=nn(p.tabs),k=g.useMemo(()=>({orientation:l,activation:c,...p}),[l,c,p]),S=Se(I=>(h({type:1,tab:I}),()=>h({type:2,tab:I}))),j=Se(I=>(h({type:3,panel:I}),()=>h({type:4,panel:I}))),O=Se(I=>{C.current!==I&&v.current(I),d||h({type:0,index:I})}),C=nn(d?e.selectedIndex:p.selectedIndex),N=g.useMemo(()=>({registerTab:S,registerPanel:j,change:O}),[]);Ot(()=>{h({type:0,index:i??r})},[i]),Ot(()=>{if(C.current===void 0||p.tabs.length<=0)return;let I=Xa(p.tabs,_=>_.current);I.some((_,R)=>p.tabs[R]!==_)&&O(I.indexOf(p.tabs[C.current]))});let T={ref:m},M=Pt();return y.createElement(fpe,null,y.createElement(iE.Provider,{value:N},y.createElement(aE.Provider,{value:k},k.tabs.length<=0&&y.createElement(cpe,{onFocus:()=>{var I,_;for(let R of x.current)if(((I=R.current)==null?void 0:I.tabIndex)===0)return(_=R.current)==null||_.focus(),!0;return!1}}),M({ourProps:T,theirProps:s,slot:b,defaultTag:vpe,name:"Tabs"}))))}let xpe="div";function wpe(e,t){let{orientation:r,selectedIndex:n}=Wl("Tab.List"),o=It(t),a=g.useMemo(()=>({selectedIndex:n}),[n]),i=e,s={ref:o,role:"tablist","aria-orientation":r};return Pt()({ourProps:s,theirProps:i,slot:a,defaultTag:xpe,name:"Tabs.List"})}let kpe="button";function jpe(e,t){var r,n;let o=g.useId(),{id:a=`headlessui-tabs-tab-${o}`,disabled:i=!1,autoFocus:s=!1,...l}=e,{orientation:c,activation:d,selectedIndex:f,tabs:m,panels:p}=Wl("Tab"),h=sE("Tab"),b=Wl("Tab"),[v,x]=g.useState(null),k=g.useRef(null),S=It(k,t,x);Ot(()=>h.registerTab(k),[h,k]);let j=P8("tabs"),O=m.indexOf(k);O===-1&&(O=j);let C=O===f,N=Se(K=>{var q;let J=K();if(J===wo.Success&&d==="auto"){let V=(q=zo(k))==null?void 0:q.activeElement,me=b.tabs.findIndex(X=>X.current===V);me!==-1&&h.change(me)}return J}),T=Se(K=>{let q=m.map(J=>J.current).filter(Boolean);if(K.key===et.Space||K.key===et.Enter){K.preventDefault(),K.stopPropagation(),h.change(O);return}switch(K.key){case et.Home:case et.PageUp:return K.preventDefault(),K.stopPropagation(),N(()=>Ar(q,Kt.First));case et.End:case et.PageDown:return K.preventDefault(),K.stopPropagation(),N(()=>Ar(q,Kt.Last))}if(N(()=>Mt(c,{vertical(){return K.key===et.ArrowUp?Ar(q,Kt.Previous|Kt.WrapAround):K.key===et.ArrowDown?Ar(q,Kt.Next|Kt.WrapAround):wo.Error},horizontal(){return K.key===et.ArrowLeft?Ar(q,Kt.Previous|Kt.WrapAround):K.key===et.ArrowRight?Ar(q,Kt.Next|Kt.WrapAround):wo.Error}}))===wo.Success)return K.preventDefault()}),M=g.useRef(!1),I=Se(()=>{var K;M.current||(M.current=!0,(K=k.current)==null||K.focus({preventScroll:!0}),h.change(O),Od(()=>{M.current=!1}))}),_=Se(K=>{K.preventDefault()}),{isFocusVisible:R,focusProps:L}=no({autoFocus:s}),{isHovered:F,hoverProps:B}=Lo({isDisabled:i}),{pressed:U,pressProps:$}=au({disabled:i}),z=g.useMemo(()=>({selected:C,hover:F,active:U,focus:R,autofocus:s,disabled:i}),[C,F,R,U,s,i]),W=io({ref:S,onKeyDown:T,onMouseDown:_,onClick:I,id:a,role:"tab",type:uu(e,v),"aria-controls":(n=(r=p[O])==null?void 0:r.current)==null?void 0:n.id,"aria-selected":C,tabIndex:C?0:-1,disabled:i||void 0,autoFocus:s},L,B,$);return Pt()({ourProps:W,theirProps:l,slot:z,defaultTag:kpe,name:"Tabs.Tab"})}let Epe="div";function Spe(e,t){let{selectedIndex:r}=Wl("Tab.Panels"),n=It(t),o=g.useMemo(()=>({selectedIndex:r}),[r]),a=e,i={ref:n};return Pt()({ourProps:i,theirProps:a,slot:o,defaultTag:Epe,name:"Tabs.Panels"})}let Npe="div",Ope=Vr.RenderStrategy|Vr.Static;function Cpe(e,t){var r,n,o,a;let i=g.useId(),{id:s=`headlessui-tabs-panel-${i}`,tabIndex:l=0,...c}=e,{selectedIndex:d,tabs:f,panels:m}=Wl("Tab.Panel"),p=sE("Tab.Panel"),h=g.useRef(null),b=It(h,t);Ot(()=>p.registerPanel(h),[p,h]);let v=P8("panels"),x=m.indexOf(h);x===-1&&(x=v);let k=x===d,{isFocusVisible:S,focusProps:j}=no(),O=g.useMemo(()=>({selected:k,focus:S}),[k,S]),C=io({ref:b,id:s,role:"tabpanel","aria-labelledby":(n=(r=f[x])==null?void 0:r.current)==null?void 0:n.id,tabIndex:k?l:-1},j),N=Pt();return!k&&((o=c.unmount)==null||o)&&!((a=c.static)!=null&&a)?y.createElement(Do,{"aria-hidden":"true",...C}):N({ourProps:C,theirProps:c,slot:O,defaultTag:Npe,features:Ope,visible:k,name:"Tabs.Panel"})}let Ppe=Nt(jpe),Ape=Nt(ype),Tpe=Nt(wpe),Mpe=Nt(Spe),_pe=Nt(Cpe),Vh=Object.assign(Ppe,{Group:Ape,List:Tpe,Panels:Mpe,Panel:_pe});const A8=e=>{var t=Te(e,[]);return y.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"}),y.createElement("path",{fillRule:"evenodd",d:"M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z",clipRule:"evenodd"}))},Id=e=>{var t=Te(e,[]);return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),y.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 10.5858L9.17157 7.75736L7.75736 9.17157L10.5858 12L7.75736 14.8284L9.17157 16.2426L12 13.4142L14.8284 16.2426L16.2426 14.8284L13.4142 12L16.2426 9.17157L14.8284 7.75736L12 10.5858Z"}))};var ct=function(){return ct=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},ct.apply(this,arguments)};function Ipe(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function T8(e,t,r){for(var n=0,o=t.length,a;n<o;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}function Dd(e){return e.mode==="multiple"}function Ld(e){return e.mode==="range"}function Gh(e){return e.mode==="single"}var Dpe={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function Lpe(e,t){return un(e,"LLLL y",t)}function Rpe(e,t){return un(e,"d",t)}function Fpe(e,t){return un(e,"LLLL",t)}function $pe(e){return"".concat(e)}function Bpe(e,t){return un(e,"cccccc",t)}function zpe(e,t){return un(e,"yyyy",t)}var Hpe=Object.freeze({__proto__:null,formatCaption:Lpe,formatDay:Rpe,formatMonthCaption:Fpe,formatWeekNumber:$pe,formatWeekdayName:Bpe,formatYearCaption:zpe}),qpe=function(e,t,r){return un(e,"do MMMM (EEEE)",r)},Wpe=function(){return"Month: "},Upe=function(){return"Go to next month"},Kpe=function(){return"Go to previous month"},Vpe=function(e,t){return un(e,"cccc",t)},Gpe=function(e){return"Week n. ".concat(e)},Ype=function(){return"Year: "},Xpe=Object.freeze({__proto__:null,labelDay:qpe,labelMonthDropdown:Wpe,labelNext:Upe,labelPrevious:Kpe,labelWeekNumber:Gpe,labelWeekday:Vpe,labelYearDropdown:Ype});function Zpe(){var e="buttons",t=Dpe,r=jh,n={},o={},a=1,i={},s=new Date;return{captionLayout:e,classNames:t,formatters:Hpe,labels:Xpe,locale:r,modifiersClassNames:n,modifiers:o,numberOfMonths:a,styles:i,today:s,mode:"default"}}function Jpe(e){var t=e.fromYear,r=e.toYear,n=e.fromMonth,o=e.toMonth,a=e.fromDate,i=e.toDate;return n?a=zr(n):t&&(a=new Date(t,0,1)),o?i=yj(o):r&&(i=new Date(r,11,31)),{fromDate:a?_o(a):void 0,toDate:i?_o(i):void 0}}var M8=g.createContext(void 0);function Qpe(e){var t,r=e.initialProps,n=Zpe(),o=Jpe(r),a=o.fromDate,i=o.toDate,s=(t=r.captionLayout)!==null&&t!==void 0?t:n.captionLayout;s!=="buttons"&&(!a||!i)&&(s="buttons");var l;(Gh(r)||Dd(r)||Ld(r))&&(l=r.onSelect);var c=ct(ct(ct({},n),r),{captionLayout:s,classNames:ct(ct({},n.classNames),r.classNames),components:ct({},r.components),formatters:ct(ct({},n.formatters),r.formatters),fromDate:a,labels:ct(ct({},n.labels),r.labels),mode:r.mode||n.mode,modifiers:ct(ct({},n.modifiers),r.modifiers),modifiersClassNames:ct(ct({},n.modifiersClassNames),r.modifiersClassNames),onSelect:l,styles:ct(ct({},n.styles),r.styles),toDate:i});return u.jsx(M8.Provider,{value:c,children:e.children})}function ir(){var e=g.useContext(M8);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function _8(e){var t=ir(),r=t.locale,n=t.classNames,o=t.styles,a=t.formatters.formatCaption;return u.jsx("div",{className:n.caption_label,style:o.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:a(e.displayMonth,{locale:r})})}function eme(e){return u.jsx("svg",ct({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:u.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function I8(e){var t,r,n=e.onChange,o=e.value,a=e.children,i=e.caption,s=e.className,l=e.style,c=ir(),d=(r=(t=c.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&r!==void 0?r:eme;return u.jsxs("div",{className:s,style:l,children:[u.jsx("span",{className:c.classNames.vhidden,children:e["aria-label"]}),u.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:o,onChange:n,children:a}),u.jsxs("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[i,u.jsx(d,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function tme(e){var t,r=ir(),n=r.fromDate,o=r.toDate,a=r.styles,i=r.locale,s=r.formatters.formatMonthCaption,l=r.classNames,c=r.components,d=r.labels.labelMonthDropdown;if(!n)return u.jsx(u.Fragment,{});if(!o)return u.jsx(u.Fragment,{});var f=[];if(yue(n,o))for(var m=zr(n),p=n.getMonth();p<=o.getMonth();p++)f.push(Gx(m,p));else for(var m=zr(new Date),p=0;p<=11;p++)f.push(Gx(m,p));var h=function(v){var x=Number(v.target.value),k=Gx(zr(e.displayMonth),x);e.onChange(k)},b=(t=c?.Dropdown)!==null&&t!==void 0?t:I8;return u.jsx(b,{name:"months","aria-label":d(),className:l.dropdown_month,style:a.dropdown_month,onChange:h,value:e.displayMonth.getMonth(),caption:s(e.displayMonth,{locale:i}),children:f.map(function(v){return u.jsx("option",{value:v.getMonth(),children:s(v,{locale:i})},v.getMonth())})})}function rme(e){var t,r=e.displayMonth,n=ir(),o=n.fromDate,a=n.toDate,i=n.locale,s=n.styles,l=n.classNames,c=n.components,d=n.formatters.formatYearCaption,f=n.labels.labelYearDropdown,m=[];if(!o)return u.jsx(u.Fragment,{});if(!a)return u.jsx(u.Fragment,{});for(var p=o.getFullYear(),h=a.getFullYear(),b=p;b<=h;b++)m.push(SP(xj(new Date),b));var v=function(k){var S=SP(zr(r),Number(k.target.value));e.onChange(S)},x=(t=c?.Dropdown)!==null&&t!==void 0?t:I8;return u.jsx(x,{name:"years","aria-label":f(),className:l.dropdown_year,style:s.dropdown_year,onChange:v,value:r.getFullYear(),caption:d(r,{locale:i}),children:m.map(function(k){return u.jsx("option",{value:k.getFullYear(),children:d(k,{locale:i})},k.getFullYear())})})}function nme(e,t){var r=g.useState(e),n=r[0],o=r[1],a=t===void 0?n:t;return[a,o]}function ome(e){var t=e.month,r=e.defaultMonth,n=e.today,o=t||r||n||new Date,a=e.toDate,i=e.fromDate,s=e.numberOfMonths,l=s===void 0?1:s;if(a&&nd(a,o)<0){var c=-1*(l-1);o=$n(a,c)}return i&&nd(o,i)<0&&(o=i),zr(o)}function ame(){var e=ir(),t=ome(e),r=nme(t,e.month),n=r[0],o=r[1],a=function(i){var s;if(!e.disableNavigation){var l=zr(i);o(l),(s=e.onMonthChange)===null||s===void 0||s.call(e,l)}};return[n,a]}function ime(e,t){for(var r=t.reverseMonths,n=t.numberOfMonths,o=zr(e),a=zr($n(o,n)),i=nd(a,o),s=[],l=0;l<i;l++){var c=$n(o,l);s.push(c)}return r&&(s=s.reverse()),s}function sme(e,t){if(!t.disableNavigation){var r=t.toDate,n=t.pagedNavigation,o=t.numberOfMonths,a=o===void 0?1:o,i=n?a:1,s=zr(e);if(!r)return $n(s,i);var l=nd(r,e);if(!(l<a))return $n(s,i)}}function lme(e,t){if(!t.disableNavigation){var r=t.fromDate,n=t.pagedNavigation,o=t.numberOfMonths,a=o===void 0?1:o,i=n?a:1,s=zr(e);if(!r)return $n(s,-i);var l=nd(s,r);if(!(l<=0))return $n(s,-i)}}var D8=g.createContext(void 0);function ume(e){var t=ir(),r=ame(),n=r[0],o=r[1],a=ime(n,t),i=sme(n,t),s=lme(n,t),l=function(f){return a.some(function(m){return kj(f,m)})},c=function(f,m){l(f)||(m&&M9(f,m)?o($n(f,1+t.numberOfMonths*-1)):o(f))},d={currentMonth:n,displayMonths:a,goToMonth:o,goToDate:c,previousMonth:s,nextMonth:i,isDateDisplayed:l};return u.jsx(D8.Provider,{value:d,children:e.children})}function mu(){var e=g.useContext(D8);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function KP(e){var t,r=ir(),n=r.classNames,o=r.styles,a=r.components,i=mu().goToMonth,s=function(d){i($n(d,e.displayIndex?-e.displayIndex:0))},l=(t=a?.CaptionLabel)!==null&&t!==void 0?t:_8,c=u.jsx(l,{id:e.id,displayMonth:e.displayMonth});return u.jsxs("div",{className:n.caption_dropdowns,style:o.caption_dropdowns,children:[u.jsx("div",{className:n.vhidden,children:c}),u.jsx(tme,{onChange:s,displayMonth:e.displayMonth}),u.jsx(rme,{onChange:s,displayMonth:e.displayMonth})]})}function cme(e){return u.jsx("svg",ct({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:u.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function dme(e){return u.jsx("svg",ct({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:u.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var gm=g.forwardRef(function(e,t){var r=ir(),n=r.classNames,o=r.styles,a=[n.button_reset,n.button];e.className&&a.push(e.className);var i=a.join(" "),s=ct(ct({},o.button_reset),o.button);return e.style&&Object.assign(s,e.style),u.jsx("button",ct({},e,{ref:t,type:"button",className:i,style:s}))});function fme(e){var t,r,n=ir(),o=n.dir,a=n.locale,i=n.classNames,s=n.styles,l=n.labels,c=l.labelPrevious,d=l.labelNext,f=n.components;if(!e.nextMonth&&!e.previousMonth)return u.jsx(u.Fragment,{});var m=c(e.previousMonth,{locale:a}),p=[i.nav_button,i.nav_button_previous].join(" "),h=d(e.nextMonth,{locale:a}),b=[i.nav_button,i.nav_button_next].join(" "),v=(t=f?.IconRight)!==null&&t!==void 0?t:dme,x=(r=f?.IconLeft)!==null&&r!==void 0?r:cme;return u.jsxs("div",{className:i.nav,style:s.nav,children:[!e.hidePrevious&&u.jsx(gm,{name:"previous-month","aria-label":m,className:p,style:s.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:o==="rtl"?u.jsx(v,{className:i.nav_icon,style:s.nav_icon}):u.jsx(x,{className:i.nav_icon,style:s.nav_icon})}),!e.hideNext&&u.jsx(gm,{name:"next-month","aria-label":h,className:b,style:s.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:o==="rtl"?u.jsx(x,{className:i.nav_icon,style:s.nav_icon}):u.jsx(v,{className:i.nav_icon,style:s.nav_icon})})]})}function VP(e){var t=ir().numberOfMonths,r=mu(),n=r.previousMonth,o=r.nextMonth,a=r.goToMonth,i=r.displayMonths,s=i.findIndex(function(h){return kj(e.displayMonth,h)}),l=s===0,c=s===i.length-1,d=t>1&&(l||!c),f=t>1&&(c||!l),m=function(){n&&a(n)},p=function(){o&&a(o)};return u.jsx(fme,{displayMonth:e.displayMonth,hideNext:d,hidePrevious:f,nextMonth:o,previousMonth:n,onPreviousClick:m,onNextClick:p})}function pme(e){var t,r=ir(),n=r.classNames,o=r.disableNavigation,a=r.styles,i=r.captionLayout,s=r.components,l=(t=s?.CaptionLabel)!==null&&t!==void 0?t:_8,c;return o?c=u.jsx(l,{id:e.id,displayMonth:e.displayMonth}):i==="dropdown"?c=u.jsx(KP,{displayMonth:e.displayMonth,id:e.id}):i==="dropdown-buttons"?c=u.jsxs(u.Fragment,{children:[u.jsx(KP,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),u.jsx(VP,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):c=u.jsxs(u.Fragment,{children:[u.jsx(l,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),u.jsx(VP,{displayMonth:e.displayMonth,id:e.id})]}),u.jsx("div",{className:n.caption,style:a.caption,children:c})}function mme(e){var t=ir(),r=t.footer,n=t.styles,o=t.classNames.tfoot;return r?u.jsx("tfoot",{className:o,style:n.tfoot,children:u.jsx("tr",{children:u.jsx("td",{colSpan:8,children:r})})}):u.jsx(u.Fragment,{})}function hme(e,t,r){for(var n=r?hs(new Date):Mo(new Date,{locale:e,weekStartsOn:t}),o=[],a=0;a<7;a++){var i=Jr(n,a);o.push(i)}return o}function gme(){var e=ir(),t=e.classNames,r=e.styles,n=e.showWeekNumber,o=e.locale,a=e.weekStartsOn,i=e.ISOWeek,s=e.formatters.formatWeekdayName,l=e.labels.labelWeekday,c=hme(o,a,i);return u.jsxs("tr",{style:r.head_row,className:t.head_row,children:[n&&u.jsx("td",{style:r.head_cell,className:t.head_cell}),c.map(function(d,f){return u.jsx("th",{scope:"col",className:t.head_cell,style:r.head_cell,"aria-label":l(d,{locale:o}),children:s(d,{locale:o})},f)})]})}function bme(){var e,t=ir(),r=t.classNames,n=t.styles,o=t.components,a=(e=o?.HeadRow)!==null&&e!==void 0?e:gme;return u.jsx("thead",{style:n.head,className:r.head,children:u.jsx(a,{})})}function vme(e){var t=ir(),r=t.locale,n=t.formatters.formatDay;return u.jsx(u.Fragment,{children:n(e.date,{locale:r})})}var lE=g.createContext(void 0);function yme(e){if(!Dd(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return u.jsx(lE.Provider,{value:t,children:e.children})}return u.jsx(xme,{initialProps:e.initialProps,children:e.children})}function xme(e){var t=e.initialProps,r=e.children,n=t.selected,o=t.min,a=t.max,i=function(c,d,f){var m,p;(m=t.onDayClick)===null||m===void 0||m.call(t,c,d,f);var h=!!(d.selected&&o&&n?.length===o);if(!h){var b=!!(!d.selected&&a&&n?.length===a);if(!b){var v=n?T8([],n):[];if(d.selected){var x=v.findIndex(function(k){return fn(c,k)});v.splice(x,1)}else v.push(c);(p=t.onSelect)===null||p===void 0||p.call(t,v,c,d,f)}}},s={disabled:[]};n&&s.disabled.push(function(c){var d=a&&n.length>a-1,f=n.some(function(m){return fn(m,c)});return!!(d&&!f)});var l={selected:n,onDayClick:i,modifiers:s};return u.jsx(lE.Provider,{value:l,children:r})}function uE(){var e=g.useContext(lE);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function wme(e,t){var r=t||{},n=r.from,o=r.to;return n&&o?fn(o,e)&&fn(n,e)?void 0:fn(o,e)?{from:o,to:void 0}:fn(n,e)?void 0:dk(n,e)?{from:e,to:o}:{from:n,to:e}:o?dk(e,o)?{from:o,to:e}:{from:e,to:o}:n?M9(e,n)?{from:e,to:n}:{from:n,to:e}:{from:e,to:void 0}}var cE=g.createContext(void 0);function kme(e){if(!Ld(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return u.jsx(cE.Provider,{value:t,children:e.children})}return u.jsx(jme,{initialProps:e.initialProps,children:e.children})}function jme(e){var t=e.initialProps,r=e.children,n=t.selected,o=n||{},a=o.from,i=o.to,s=t.min,l=t.max,c=function(p,h,b){var v,x;(v=t.onDayClick)===null||v===void 0||v.call(t,p,h,b);var k=wme(p,n);(x=t.onSelect)===null||x===void 0||x.call(t,k,p,h,b)},d={range_start:[],range_end:[],range_middle:[],disabled:[]};if(a?(d.range_start=[a],i?(d.range_end=[i],fn(a,i)||(d.range_middle=[{after:a,before:i}])):d.range_end=[a]):i&&(d.range_start=[i],d.range_end=[i]),s&&(a&&!i&&d.disabled.push({after:Wf(a,s-1),before:Jr(a,s-1)}),a&&i&&d.disabled.push({after:a,before:Jr(a,s-1)}),!a&&i&&d.disabled.push({after:Wf(i,s-1),before:Jr(i,s-1)})),l){if(a&&!i&&(d.disabled.push({before:Jr(a,-l+1)}),d.disabled.push({after:Jr(a,l-1)})),a&&i){var f=xo(i,a)+1,m=l-f;d.disabled.push({before:Wf(a,m)}),d.disabled.push({after:Jr(i,m)})}!a&&i&&(d.disabled.push({before:Jr(i,-l+1)}),d.disabled.push({after:Jr(i,l-1)}))}return u.jsx(cE.Provider,{value:{selected:n,onDayClick:c,modifiers:d},children:r})}function dE(){var e=g.useContext(cE);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function Kf(e){return Array.isArray(e)?T8([],e):e!==void 0?[e]:[]}function Eme(e){var t={};return Object.entries(e).forEach(function(r){var n=r[0],o=r[1];t[n]=Kf(o)}),t}var ro;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(ro||(ro={}));var Sme=ro.Selected,Xo=ro.Disabled,Nme=ro.Hidden,Ome=ro.Today,r0=ro.RangeEnd,n0=ro.RangeMiddle,o0=ro.RangeStart,Cme=ro.Outside;function Pme(e,t,r){var n,o=(n={},n[Sme]=Kf(e.selected),n[Xo]=Kf(e.disabled),n[Nme]=Kf(e.hidden),n[Ome]=[e.today],n[r0]=[],n[n0]=[],n[o0]=[],n[Cme]=[],n);return e.fromDate&&o[Xo].push({before:e.fromDate}),e.toDate&&o[Xo].push({after:e.toDate}),Dd(e)?o[Xo]=o[Xo].concat(t.modifiers[Xo]):Ld(e)&&(o[Xo]=o[Xo].concat(r.modifiers[Xo]),o[o0]=r.modifiers[o0],o[n0]=r.modifiers[n0],o[r0]=r.modifiers[r0]),o}var L8=g.createContext(void 0);function Ame(e){var t=ir(),r=uE(),n=dE(),o=Pme(t,r,n),a=Eme(t.modifiers),i=ct(ct({},o),a);return u.jsx(L8.Provider,{value:i,children:e.children})}function R8(){var e=g.useContext(L8);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function Tme(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Mme(e){return!!(e&&typeof e=="object"&&"from"in e)}function _me(e){return!!(e&&typeof e=="object"&&"after"in e)}function Ime(e){return!!(e&&typeof e=="object"&&"before"in e)}function Dme(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Lme(e,t){var r,n=t.from,o=t.to;if(n&&o){var a=xo(o,n)<0;a&&(r=[o,n],n=r[0],o=r[1]);var i=xo(e,n)>=0&&xo(o,e)>=0;return i}return o?fn(o,e):n?fn(n,e):!1}function Rme(e){return vj(e)}function Fme(e){return Array.isArray(e)&&e.every(vj)}function $me(e,t){return t.some(function(r){if(typeof r=="boolean")return r;if(Rme(r))return fn(e,r);if(Fme(r))return r.includes(e);if(Mme(r))return Lme(e,r);if(Dme(r))return r.dayOfWeek.includes(e.getDay());if(Tme(r)){var n=xo(r.before,e),o=xo(r.after,e),a=n>0,i=o<0,s=dk(r.before,r.after);return s?i&&a:a||i}return _me(r)?xo(e,r.after)>0:Ime(r)?xo(r.before,e)>0:typeof r=="function"?r(e):!1})}function fE(e,t,r){var n=Object.keys(t).reduce(function(a,i){var s=t[i];return $me(e,s)&&a.push(i),a},[]),o={};return n.forEach(function(a){return o[a]=!0}),r&&!kj(e,r)&&(o.outside=!0),o}function Bme(e,t){for(var r=zr(e[0]),n=yj(e[e.length-1]),o,a,i=r;i<=n;){var s=fE(i,t),l=!s.disabled&&!s.hidden;if(!l){i=Jr(i,1);continue}if(s.selected)return i;s.today&&!a&&(a=i),o||(o=i),i=Jr(i,1)}return a||o}var zme=365;function F8(e,t){var r=t.moveBy,n=t.direction,o=t.context,a=t.modifiers,i=t.retry,s=i===void 0?{count:0,lastFocused:e}:i,l=o.weekStartsOn,c=o.fromDate,d=o.toDate,f=o.locale,m={day:Jr,week:uk,month:$n,year:ck,startOfWeek:function(v){return o.ISOWeek?hs(v):Mo(v,{locale:f,weekStartsOn:l})},endOfWeek:function(v){return o.ISOWeek?O9(v):wj(v,{locale:f,weekStartsOn:l})}},p=m[r](e,n==="after"?1:-1);n==="before"&&c?p=S9([c,p]):n==="after"&&d&&(p=N9([d,p]));var h=!0;if(a){var b=fE(p,a);h=!b.disabled&&!b.hidden}return h?p:s.count>zme?s.lastFocused:F8(p,{moveBy:r,direction:n,context:o,modifiers:a,retry:ct(ct({},s),{count:s.count+1})})}var $8=g.createContext(void 0);function Hme(e){var t=mu(),r=R8(),n=g.useState(),o=n[0],a=n[1],i=g.useState(),s=i[0],l=i[1],c=Bme(t.displayMonths,r),d=o??(s&&t.isDateDisplayed(s))?s:c,f=function(){l(o),a(void 0)},m=function(v){a(v)},p=ir(),h=function(v,x){if(o){var k=F8(o,{moveBy:v,direction:x,context:p,modifiers:r});fn(o,k)||(t.goToDate(k,o),m(k))}},b={focusedDay:o,focusTarget:d,blur:f,focus:m,focusDayAfter:function(){return h("day","after")},focusDayBefore:function(){return h("day","before")},focusWeekAfter:function(){return h("week","after")},focusWeekBefore:function(){return h("week","before")},focusMonthBefore:function(){return h("month","before")},focusMonthAfter:function(){return h("month","after")},focusYearBefore:function(){return h("year","before")},focusYearAfter:function(){return h("year","after")},focusStartOfWeek:function(){return h("startOfWeek","before")},focusEndOfWeek:function(){return h("endOfWeek","after")}};return u.jsx($8.Provider,{value:b,children:e.children})}function pE(){var e=g.useContext($8);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function qme(e,t){var r=R8(),n=fE(e,r,t);return n}var mE=g.createContext(void 0);function Wme(e){if(!Gh(e.initialProps)){var t={selected:void 0};return u.jsx(mE.Provider,{value:t,children:e.children})}return u.jsx(Ume,{initialProps:e.initialProps,children:e.children})}function Ume(e){var t=e.initialProps,r=e.children,n=function(a,i,s){var l,c,d;if((l=t.onDayClick)===null||l===void 0||l.call(t,a,i,s),i.selected&&!t.required){(c=t.onSelect)===null||c===void 0||c.call(t,void 0,a,i,s);return}(d=t.onSelect)===null||d===void 0||d.call(t,a,a,i,s)},o={selected:t.selected,onDayClick:n};return u.jsx(mE.Provider,{value:o,children:r})}function B8(){var e=g.useContext(mE);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function Kme(e,t){var r=ir(),n=B8(),o=uE(),a=dE(),i=pE(),s=i.focusDayAfter,l=i.focusDayBefore,c=i.focusWeekAfter,d=i.focusWeekBefore,f=i.blur,m=i.focus,p=i.focusMonthBefore,h=i.focusMonthAfter,b=i.focusYearBefore,v=i.focusYearAfter,x=i.focusStartOfWeek,k=i.focusEndOfWeek,S=function($){var z,W,K,q;Gh(r)?(z=n.onDayClick)===null||z===void 0||z.call(n,e,t,$):Dd(r)?(W=o.onDayClick)===null||W===void 0||W.call(o,e,t,$):Ld(r)?(K=a.onDayClick)===null||K===void 0||K.call(a,e,t,$):(q=r.onDayClick)===null||q===void 0||q.call(r,e,t,$)},j=function($){var z;m(e),(z=r.onDayFocus)===null||z===void 0||z.call(r,e,t,$)},O=function($){var z;f(),(z=r.onDayBlur)===null||z===void 0||z.call(r,e,t,$)},C=function($){var z;(z=r.onDayMouseEnter)===null||z===void 0||z.call(r,e,t,$)},N=function($){var z;(z=r.onDayMouseLeave)===null||z===void 0||z.call(r,e,t,$)},T=function($){var z;(z=r.onDayPointerEnter)===null||z===void 0||z.call(r,e,t,$)},M=function($){var z;(z=r.onDayPointerLeave)===null||z===void 0||z.call(r,e,t,$)},I=function($){var z;(z=r.onDayTouchCancel)===null||z===void 0||z.call(r,e,t,$)},_=function($){var z;(z=r.onDayTouchEnd)===null||z===void 0||z.call(r,e,t,$)},R=function($){var z;(z=r.onDayTouchMove)===null||z===void 0||z.call(r,e,t,$)},L=function($){var z;(z=r.onDayTouchStart)===null||z===void 0||z.call(r,e,t,$)},F=function($){var z;(z=r.onDayKeyUp)===null||z===void 0||z.call(r,e,t,$)},B=function($){var z;switch($.key){case"ArrowLeft":$.preventDefault(),$.stopPropagation(),r.dir==="rtl"?s():l();break;case"ArrowRight":$.preventDefault(),$.stopPropagation(),r.dir==="rtl"?l():s();break;case"ArrowDown":$.preventDefault(),$.stopPropagation(),c();break;case"ArrowUp":$.preventDefault(),$.stopPropagation(),d();break;case"PageUp":$.preventDefault(),$.stopPropagation(),$.shiftKey?b():p();break;case"PageDown":$.preventDefault(),$.stopPropagation(),$.shiftKey?v():h();break;case"Home":$.preventDefault(),$.stopPropagation(),x();break;case"End":$.preventDefault(),$.stopPropagation(),k();break}(z=r.onDayKeyDown)===null||z===void 0||z.call(r,e,t,$)},U={onClick:S,onFocus:j,onBlur:O,onKeyDown:B,onKeyUp:F,onMouseEnter:C,onMouseLeave:N,onPointerEnter:T,onPointerLeave:M,onTouchCancel:I,onTouchEnd:_,onTouchMove:R,onTouchStart:L};return U}function Vme(){var e=ir(),t=B8(),r=uE(),n=dE(),o=Gh(e)?t.selected:Dd(e)?r.selected:Ld(e)?n.selected:void 0;return o}function Gme(e){return Object.values(ro).includes(e)}function Yme(e,t){var r=[e.classNames.day];return Object.keys(t).forEach(function(n){var o=e.modifiersClassNames[n];if(o)r.push(o);else if(Gme(n)){var a=e.classNames["day_".concat(n)];a&&r.push(a)}}),r}function Xme(e,t){var r=ct({},e.styles.day);return Object.keys(t).forEach(function(n){var o;r=ct(ct({},r),(o=e.modifiersStyles)===null||o===void 0?void 0:o[n])}),r}function Zme(e,t,r){var n,o,a,i=ir(),s=pE(),l=qme(e,t),c=Kme(e,l),d=Vme(),f=!!(i.onDayClick||i.mode!=="default");g.useEffect(function(){var C;l.outside||s.focusedDay&&f&&fn(s.focusedDay,e)&&((C=r.current)===null||C===void 0||C.focus())},[s.focusedDay,e,r,f,l.outside]);var m=Yme(i,l).join(" "),p=Xme(i,l),h=!!(l.outside&&!i.showOutsideDays||l.hidden),b=(a=(o=i.components)===null||o===void 0?void 0:o.DayContent)!==null&&a!==void 0?a:vme,v=u.jsx(b,{date:e,displayMonth:t,activeModifiers:l}),x={style:p,className:m,children:v,role:"gridcell"},k=s.focusTarget&&fn(s.focusTarget,e)&&!l.outside,S=s.focusedDay&&fn(s.focusedDay,e),j=ct(ct(ct({},x),(n={disabled:l.disabled,role:"gridcell"},n["aria-selected"]=l.selected,n.tabIndex=S||k?0:-1,n)),c),O={isButton:f,isHidden:h,activeModifiers:l,selectedDays:d,buttonProps:j,divProps:x};return O}function Jme(e){var t=g.useRef(null),r=Zme(e.date,e.displayMonth,t);return r.isHidden?u.jsx("div",{role:"gridcell"}):r.isButton?u.jsx(gm,ct({name:"day",ref:t},r.buttonProps)):u.jsx("div",ct({},r.divProps))}function Qme(e){var t=e.number,r=e.dates,n=ir(),o=n.onWeekNumberClick,a=n.styles,i=n.classNames,s=n.locale,l=n.labels.labelWeekNumber,c=n.formatters.formatWeekNumber,d=c(Number(t),{locale:s});if(!o)return u.jsx("span",{className:i.weeknumber,style:a.weeknumber,children:d});var f=l(Number(t),{locale:s}),m=function(p){o(t,r,p)};return u.jsx(gm,{name:"week-number","aria-label":f,className:i.weeknumber,style:a.weeknumber,onClick:m,children:d})}function ehe(e){var t,r,n=ir(),o=n.styles,a=n.classNames,i=n.showWeekNumber,s=n.components,l=(t=s?.Day)!==null&&t!==void 0?t:Jme,c=(r=s?.WeekNumber)!==null&&r!==void 0?r:Qme,d;return i&&(d=u.jsx("td",{className:a.cell,style:o.cell,children:u.jsx(c,{number:e.weekNumber,dates:e.dates})})),u.jsxs("tr",{className:a.row,style:o.row,children:[d,e.dates.map(function(f){return u.jsx("td",{className:a.cell,style:o.cell,role:"presentation",children:u.jsx(l,{displayMonth:e.displayMonth,date:f})},hue(f))})]})}function GP(e,t,r){for(var n=r!=null&&r.ISOWeek?O9(t):wj(t,r),o=r!=null&&r.ISOWeek?hs(e):Mo(e,r),a=xo(n,o),i=[],s=0;s<=a;s++)i.push(Jr(o,s));var l=i.reduce(function(c,d){var f=r!=null&&r.ISOWeek?C9(d):A9(d,r),m=c.find(function(p){return p.weekNumber===f});return m?(m.dates.push(d),c):(c.push({weekNumber:f,dates:[d]}),c)},[]);return l}function the(e,t){var r=GP(zr(e),yj(e),t);if(t!=null&&t.useFixedWeeks){var n=bue(e,t);if(n<6){var o=r[r.length-1],a=o.dates[o.dates.length-1],i=uk(a,6-n),s=GP(uk(a,1),i,t);r.push.apply(r,s)}}return r}function rhe(e){var t,r,n,o=ir(),a=o.locale,i=o.classNames,s=o.styles,l=o.hideHead,c=o.fixedWeeks,d=o.components,f=o.weekStartsOn,m=o.firstWeekContainsDate,p=o.ISOWeek,h=the(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:p,locale:a,weekStartsOn:f,firstWeekContainsDate:m}),b=(t=d?.Head)!==null&&t!==void 0?t:bme,v=(r=d?.Row)!==null&&r!==void 0?r:ehe,x=(n=d?.Footer)!==null&&n!==void 0?n:mme;return u.jsxs("table",{id:e.id,className:i.table,style:s.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&u.jsx(b,{}),u.jsx("tbody",{className:i.tbody,style:s.tbody,children:h.map(function(k){return u.jsx(v,{displayMonth:e.displayMonth,dates:k.dates,weekNumber:k.weekNumber},k.weekNumber)})}),u.jsx(x,{displayMonth:e.displayMonth})]})}function nhe(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var ohe=nhe()?g.useLayoutEffect:g.useEffect,a0=!1,ahe=0;function YP(){return"react-day-picker-".concat(++ahe)}function ihe(e){var t,r=e??(a0?YP():null),n=g.useState(r),o=n[0],a=n[1];return ohe(function(){o===null&&a(YP())},[]),g.useEffect(function(){a0===!1&&(a0=!0)},[]),(t=e??o)!==null&&t!==void 0?t:void 0}function she(e){var t,r,n=ir(),o=n.dir,a=n.classNames,i=n.styles,s=n.components,l=mu().displayMonths,c=ihe(n.id?"".concat(n.id,"-").concat(e.displayIndex):void 0),d=n.id?"".concat(n.id,"-grid-").concat(e.displayIndex):void 0,f=[a.month],m=i.month,p=e.displayIndex===0,h=e.displayIndex===l.length-1,b=!p&&!h;o==="rtl"&&(t=[p,h],h=t[0],p=t[1]),p&&(f.push(a.caption_start),m=ct(ct({},m),i.caption_start)),h&&(f.push(a.caption_end),m=ct(ct({},m),i.caption_end)),b&&(f.push(a.caption_between),m=ct(ct({},m),i.caption_between));var v=(r=s?.Caption)!==null&&r!==void 0?r:pme;return u.jsxs("div",{className:f.join(" "),style:m,children:[u.jsx(v,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),u.jsx(rhe,{id:d,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function lhe(e){var t=ir(),r=t.classNames,n=t.styles;return u.jsx("div",{className:r.months,style:n.months,children:e.children})}function uhe(e){var t,r,n=e.initialProps,o=ir(),a=pE(),i=mu(),s=g.useState(!1),l=s[0],c=s[1];g.useEffect(function(){o.initialFocus&&a.focusTarget&&(l||(a.focus(a.focusTarget),c(!0)))},[o.initialFocus,l,a.focus,a.focusTarget,a]);var d=[o.classNames.root,o.className];o.numberOfMonths>1&&d.push(o.classNames.multiple_months),o.showWeekNumber&&d.push(o.classNames.with_weeknumber);var f=ct(ct({},o.styles.root),o.style),m=Object.keys(n).filter(function(h){return h.startsWith("data-")}).reduce(function(h,b){var v;return ct(ct({},h),(v={},v[b]=n[b],v))},{}),p=(r=(t=n.components)===null||t===void 0?void 0:t.Months)!==null&&r!==void 0?r:lhe;return u.jsx("div",ct({className:d.join(" "),style:f,dir:o.dir,id:o.id,nonce:n.nonce,title:n.title,lang:n.lang},m,{children:u.jsx(p,{children:i.displayMonths.map(function(h,b){return u.jsx(she,{displayIndex:b,displayMonth:h},b)})})}))}function che(e){var t=e.children,r=Ipe(e,["children"]);return u.jsx(Qpe,{initialProps:r,children:u.jsx(ume,{children:u.jsx(Wme,{initialProps:r,children:u.jsx(yme,{initialProps:r,children:u.jsx(kme,{initialProps:r,children:u.jsx(Ame,{children:u.jsx(Hme,{children:t})})})})})})})}function dhe(e){return u.jsx(che,ct({},e,{children:u.jsx(uhe,{initialProps:e})}))}const XP=e=>{var t=Te(e,[]);return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),y.createElement("path",{d:"M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z"}))},ZP=e=>{var t=Te(e,[]);return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),y.createElement("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"}))},fhe=e=>{var t=Te(e,[]);return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),y.createElement("path",{d:"M4.83582 12L11.0429 18.2071L12.4571 16.7929L7.66424 12L12.4571 7.20712L11.0429 5.79291L4.83582 12ZM10.4857 12L16.6928 18.2071L18.107 16.7929L13.3141 12L18.107 7.20712L16.6928 5.79291L10.4857 12Z"}))},phe=e=>{var t=Te(e,[]);return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),y.createElement("path",{d:"M19.1642 12L12.9571 5.79291L11.5429 7.20712L16.3358 12L11.5429 16.7929L12.9571 18.2071L19.1642 12ZM13.5143 12L7.30722 5.79291L5.89301 7.20712L10.6859 12L5.89301 16.7929L7.30722 18.2071L13.5143 12Z"}))},zt=y.forwardRef((e,t)=>{const{color:r,className:n,children:o}=e;return y.createElement("p",{ref:t,className:Y("text-tremor-default",r?_e(r,Le.text).textColor:Y("text-tremor-content","dark:text-dark-tremor-content"),n)},o)});zt.displayName="Text";const Af=e=>{var{onClick:t,icon:r}=e,n=Te(e,["onClick","icon"]);const o=r;return y.createElement("button",Object.assign({type:"button",className:Y("flex items-center justify-center p-1 h-7 w-7 outline-none focus:ring-2 transition duration-100 border border-tremor-border dark:border-dark-tremor-border hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted rounded-tremor-small focus:border-tremor-brand-subtle select-none dark:focus:border-dark-tremor-brand-subtle focus:ring-tremor-brand-muted dark:focus:ring-dark-tremor-brand-muted text-tremor-content-subtle dark:text-dark-tremor-content-subtle hover:text-tremor-content dark:hover:text-dark-tremor-content")},n),y.createElement(w9,{onClick:t,icon:o,variant:"simple",color:"slate",size:"sm"}))};function hE(e){var{mode:t,defaultMonth:r,selected:n,onSelect:o,locale:a,disabled:i,enableYearNavigation:s,classNames:l,weekStartsOn:c=0}=e,d=Te(e,["mode","defaultMonth","selected","onSelect","locale","disabled","enableYearNavigation","classNames","weekStartsOn"]);return y.createElement(dhe,Object.assign({showOutsideDays:!0,mode:t,defaultMonth:r,selected:n,onSelect:o,locale:a,disabled:i,weekStartsOn:c,classNames:Object.assign({months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-2 relative items-center",caption_label:"text-tremor-default text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis font-medium",nav:"space-x-1 flex items-center",nav_button:"flex items-center justify-center p-1 h-7 w-7 outline-none focus:ring-2 transition duration-100 border border-tremor-border dark:border-dark-tremor-border hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted rounded-tremor-small focus:border-tremor-brand-subtle dark:focus:border-dark-tremor-brand-subtle focus:ring-tremor-brand-muted dark:focus:ring-dark-tremor-brand-muted text-tremor-content-subtle dark:text-dark-tremor-content-subtle hover:text-tremor-content dark:hover:text-dark-tremor-content",nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"w-9 font-normal text-center text-tremor-content-subtle dark:text-dark-tremor-content-subtle",row:"flex w-full mt-0.5",cell:"text-center p-0 relative focus-within:relative text-tremor-default text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",day:"h-9 w-9 p-0 hover:bg-tremor-background-subtle dark:hover:bg-dark-tremor-background-subtle outline-tremor-brand dark:outline-dark-tremor-brand rounded-tremor-default",day_today:"font-bold",day_selected:"aria-selected:bg-tremor-background-emphasis aria-selected:text-tremor-content-inverted dark:aria-selected:bg-dark-tremor-background-emphasis dark:aria-selected:text-dark-tremor-content-inverted ",day_disabled:"text-tremor-content-subtle dark:text-dark-tremor-content-subtle disabled:hover:bg-transparent",day_outside:"text-tremor-content-subtle dark:text-dark-tremor-content-subtle"},l),components:{IconLeft:f=>{var m=Te(f,[]);return y.createElement(XP,Object.assign({className:"h-4 w-4"},m))},IconRight:f=>{var m=Te(f,[]);return y.createElement(ZP,Object.assign({className:"h-4 w-4"},m))},Caption:f=>{var m=Te(f,[]);const{goToMonth:p,nextMonth:h,previousMonth:b,currentMonth:v}=mu();return y.createElement("div",{className:"flex justify-between items-center"},y.createElement("div",{className:"flex items-center space-x-1"},s&&y.createElement(Af,{onClick:()=>v&&p(ck(v,-1)),icon:fhe}),y.createElement(Af,{onClick:()=>b&&p(b),icon:XP})),y.createElement(zt,{className:"text-tremor-default tabular-nums capitalize text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis font-medium"},un(m.displayMonth,"LLLL yyy",{locale:a})),y.createElement("div",{className:"flex items-center space-x-1"},y.createElement(Af,{onClick:()=>h&&p(h),icon:ZP}),s&&y.createElement(Af,{onClick:()=>v&&p(ck(v,1)),icon:phe})))}}},d))}hE.displayName="DateRangePicker";const mhe=at("DatePicker"),fi=(e,t)=>{const r=t!==void 0,[n,o]=g.useState(e);return[r?t:n,a=>{r||o(a)}]},JP=at("DateRangePicker"),hhe=(e,t,r,n)=>{var o;if(r&&(e=(o=n.get(r))===null||o===void 0?void 0:o.from),e)return _o(e&&!t?e:S9([e,t]))},ghe=(e,t,r,n)=>{var o,a;if(r&&(e=_o((a=(o=n.get(r))===null||o===void 0?void 0:o.to)!==null&&a!==void 0?a:qa())),e)return _o(e&&!t?e:N9([e,t]))},i0=[{value:"tdy",text:"Today",from:qa()},{value:"w",text:"Last 7 days",from:NP(qa(),{days:7})},{value:"t",text:"Last 30 days",from:NP(qa(),{days:30})},{value:"m",text:"Month to Date",from:zr(qa())},{value:"y",text:"Year to Date",from:xj(qa())}],z8=(e,t,r,n)=>{const o=r?.code||"en-US";if(!e&&!t)return"";if(e&&!t){if(n)return un(e,n);const a={year:"numeric",month:"short",day:"numeric"};return e.toLocaleDateString(o,a)}if(e&&t){if(vue(e,t)){if(n)return un(e,n);const a={year:"numeric",month:"short",day:"numeric"};return e.toLocaleDateString(o,a)}if(e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()){if(n)return`${un(e,n)} - ${un(t,n)}`;const a={month:"short",day:"numeric"};return`${e.toLocaleDateString(o,a)} -
140
+ ${t.getDate()}, ${t.getFullYear()}`}{if(n)return`${un(e,n)} - ${un(t,n)}`;const a={year:"numeric",month:"short",day:"numeric"};return`${e.toLocaleDateString(o,a)} -
141
+ ${t.toLocaleDateString(o,a)}`}}return""},id=e=>["string","number"].includes(typeof e)?e:e instanceof Array?e.map(id).join(""):typeof e=="object"&&e?id(e.props.children):void 0;function gE(e){const t=new Map;return y.Children.map(e,r=>{var n;t.set(r.props.value,(n=id(r))!==null&&n!==void 0?n:r.props.value)}),t}function bk(e,t){return y.Children.map(t,r=>{var n;if(((n=id(r))!==null&&n!==void 0?n:r.props.value).toLowerCase().includes(e.toLowerCase()))return r})}const pi=(e,t,r=!1)=>Y(t?"bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle":"bg-tremor-background dark:bg-dark-tremor-background",!t&&"hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted",e?"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis":"text-tremor-content dark:text-dark-tremor-content",t&&"text-tremor-content-subtle dark:text-dark-tremor-content-subtle",r&&"text-red-500 placeholder:text-red-500 dark:text-red-500 dark:placeholder:text-red-500",r?"border-red-500 dark:border-red-500":"border-tremor-border dark:border-dark-tremor-border");function gs(e){return e!=null&&e!==""}const bhe=qa(),vhe=y.forwardRef((e,t)=>{var r;const{value:n,defaultValue:o,onValueChange:a,minDate:i,maxDate:s,placeholder:l="Select date",disabled:c=!1,locale:d=jh,enableClear:f=!0,displayFormat:m,className:p,enableYearNavigation:h=!1,weekStartsOn:b=0,disabledDates:v}=e,x=Te(e,["value","defaultValue","onValueChange","minDate","maxDate","placeholder","disabled","locale","enableClear","displayFormat","className","enableYearNavigation","weekStartsOn","disabledDates"]),[k,S]=fi(o,n),j=g.useMemo(()=>{const T=[];return i&&T.push({before:i}),s&&T.push({after:s}),[...T,...v??[]]},[i,s,v]),O=k?z8(k,void 0,d,m):l,C=zr((r=k??s)!==null&&r!==void 0?r:bhe),N=f&&!c;return y.createElement(O8,Object.assign({ref:t,as:"div",className:Y("relative w-full min-w-[10rem] text-tremor-default","focus:ring-2 focus:ring-tremor-brand-muted dark:focus:ring-dark-tremor-brand-muted",p)},x),y.createElement(rE,{disabled:c,className:Y("w-full outline-none text-left whitespace-nowrap truncate focus:ring-2 transition duration-100 rounded-tremor-default flex flex-nowrap border pl-3 py-2","border-tremor-border shadow-tremor-input text-tremor-content-emphasis focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:text-dark-tremor-content-emphasis dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",N?"pr-8":"pr-4",pi(gs(k),c))},y.createElement(A8,{className:Y(mhe("calendarIcon"),"flex-none shrink-0 h-5 w-5 mr-2 -ml-0.5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle"),"aria-hidden":"true"}),y.createElement("p",{className:"truncate"},O)),N&&k?y.createElement("button",{type:"button",className:Y("absolute outline-none inset-y-0 right-0 flex items-center transition duration-100 mr-4"),onClick:T=>{T.preventDefault(),a?.(void 0),S(void 0)}},y.createElement(Id,{className:Y("flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,y.createElement(di,{enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},y.createElement(nE,{anchor:"bottom start",className:Y("z-10 min-w-min divide-y overflow-y-auto outline-none rounded-tremor-default p-3 border [--anchor-gap:4px]","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},({close:T})=>y.createElement(hE,{showOutsideDays:!0,mode:"single",defaultMonth:C,selected:k,weekStartsOn:b,onSelect:M=>{a?.(M),S(M),T()},locale:d,disabled:j,enableYearNavigation:h}))))});vhe.displayName="DatePicker";const bE=e=>{var t=Te(e,[]);return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),y.createElement("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"}))},s0=at("Select"),H8=y.forwardRef((e,t)=>{const{defaultValue:r="",value:n,onValueChange:o,placeholder:a="Select...",disabled:i=!1,icon:s,enableClear:l=!1,required:c,children:d,name:f,error:m=!1,errorMessage:p,className:h,id:b}=e,v=Te(e,["defaultValue","value","onValueChange","placeholder","disabled","icon","enableClear","required","children","name","error","errorMessage","className","id"]),x=g.useRef(null),k=g.Children.toArray(d),[S,j]=fi(r,n),O=s,C=g.useMemo(()=>{const N=y.Children.toArray(d).filter(g.isValidElement);return gE(N)},[d]);return y.createElement("div",{className:Y("w-full min-w-[10rem] text-tremor-default",h)},y.createElement("div",{className:"relative"},y.createElement("select",{title:"select-hidden",required:c,className:Y("h-full w-full absolute left-0 top-0 -z-10 opacity-0"),value:S,onChange:N=>{N.preventDefault()},name:f,disabled:i,id:b,onFocus:()=>{const N=x.current;N&&N.focus()}},y.createElement("option",{className:"hidden",value:"",disabled:!0,hidden:!0},a),k.map(N=>{const T=N.props.value,M=N.props.children;return y.createElement("option",{className:"hidden",key:T,value:T},M)})),y.createElement(Jj,Object.assign({as:"div",ref:t,defaultValue:S,value:S,onChange:N=>{o?.(N),j(N)},disabled:i,id:b},v),({value:N})=>{var T;return y.createElement(y.Fragment,null,y.createElement(Hh,{ref:x,className:Y("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-2","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",O?"pl-10":"pl-3",pi(gs(N),i,m))},O&&y.createElement("span",{className:Y("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},y.createElement(O,{className:Y(s0("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),y.createElement("span",{className:"w-[90%] block truncate"},N&&(T=C.get(N))!==null&&T!==void 0?T:a),y.createElement("span",{className:Y("absolute inset-y-0 right-0 flex items-center mr-3")},y.createElement(bE,{className:Y(s0("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),l&&S?y.createElement("button",{type:"button",className:Y("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:M=>{M.preventDefault(),j(""),o?.("")}},y.createElement(Id,{className:Y(s0("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,y.createElement(di,{enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},y.createElement(qh,{anchor:"bottom start",className:Y("z-10 w-[var(--button-width)] divide-y overflow-y-auto outline-none rounded-tremor-default max-h-[228px] border [--anchor-gap:4px]","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},d)))})),m&&p?y.createElement("p",{className:Y("errorMessage","text-sm text-rose-500 mt-1")},p):null)});H8.displayName="Select";const QP=at("SelectItem"),Ji=y.forwardRef((e,t)=>{const{value:r,icon:n,className:o,children:a}=e,i=Te(e,["value","icon","className","children"]),s=n;return y.createElement(Zj,Object.assign({className:Y(QP("root"),"flex justify-start items-center cursor-default text-tremor-default px-2.5 py-2.5","data-[focus]:bg-tremor-background-muted data-[focus]:text-tremor-content-strong data-[selected]:text-tremor-content-strong data-[selected]:bg-tremor-background-muted text-tremor-content-emphasis","dark:data-[focus]:bg-dark-tremor-background-muted dark:data-[focus]:text-dark-tremor-content-strong dark:data-[selected]:text-dark-tremor-content-strong dark:data-[selected]:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",o),ref:t,key:r,value:r},i),s&&y.createElement(s,{className:Y(QP("icon"),"flex-none w-5 h-5 mr-1.5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}),y.createElement("span",{className:"whitespace-nowrap truncate"},a??r))});Ji.displayName="SelectItem";const l0=qa(),yhe=y.forwardRef((e,t)=>{var r,n;const{value:o,defaultValue:a,onValueChange:i,enableSelect:s=!0,minDate:l,maxDate:c,placeholder:d="Select range",selectPlaceholder:f="Select range",disabled:m=!1,locale:p=jh,enableClear:h=!0,displayFormat:b,children:v,className:x,enableYearNavigation:k=!1,weekStartsOn:S=0,disabledDates:j}=e,O=Te(e,["value","defaultValue","onValueChange","enableSelect","minDate","maxDate","placeholder","selectPlaceholder","disabled","locale","enableClear","displayFormat","children","className","enableYearNavigation","weekStartsOn","disabledDates"]),[C,N]=fi(a,o),[T,M]=g.useState(!1),[I,_]=g.useState(!1),R=g.useMemo(()=>{const q=[];return l&&q.push({before:l}),c&&q.push({after:c}),[...q,...j??[]]},[l,c,j]),L=g.useMemo(()=>{const q=new Map;return v?y.Children.forEach(v,J=>{var V;q.set(J.props.value,{text:(V=id(J))!==null&&V!==void 0?V:J.props.value,from:J.props.from,to:J.props.to})}):i0.forEach(J=>{q.set(J.value,{text:J.text,from:J.from,to:l0})}),q},[v]),F=g.useMemo(()=>{if(v)return gE(v);const q=new Map;return i0.forEach(J=>q.set(J.value,J.text)),q},[v]),B=C?.selectValue||"",U=hhe(C?.from,l,B,L),$=ghe(C?.to,c,B,L),z=U||$?z8(U,$,p,b):d,W=zr((n=(r=$??U)!==null&&r!==void 0?r:c)!==null&&n!==void 0?n:l0),K=h&&!m;return y.createElement("div",Object.assign({ref:t,className:Y("w-full min-w-[10rem] relative flex justify-between text-tremor-default max-w-sm shadow-tremor-input dark:shadow-dark-tremor-input rounded-tremor-default",x)},O),y.createElement(O8,{as:"div",className:Y("w-full",s?"rounded-l-tremor-default":"rounded-tremor-default",T&&"ring-2 ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted z-10")},y.createElement("div",{className:"relative w-full"},y.createElement(rE,{onFocus:()=>M(!0),onBlur:()=>M(!1),disabled:m,className:Y("w-full outline-none text-left whitespace-nowrap truncate focus:ring-2 transition duration-100 rounded-l-tremor-default flex flex-nowrap border pl-3 py-2","rounded-l-tremor-default border-tremor-border text-tremor-content-emphasis focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:text-dark-tremor-content-emphasis dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",s?"rounded-l-tremor-default":"rounded-tremor-default",K?"pr-8":"pr-4",pi(gs(U||$),m))},y.createElement(A8,{className:Y(JP("calendarIcon"),"flex-none shrink-0 h-5 w-5 -ml-0.5 mr-2","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle"),"aria-hidden":"true"}),y.createElement("p",{className:"truncate"},z)),K&&U?y.createElement("button",{type:"button",className:Y("absolute outline-none inset-y-0 right-0 flex items-center transition duration-100 mr-4"),onClick:q=>{q.preventDefault(),i?.({}),N({})}},y.createElement(Id,{className:Y(JP("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null),y.createElement(di,{enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},y.createElement(nE,{anchor:"bottom start",focus:!0,className:Y("min-w-min divide-y overflow-y-auto outline-none rounded-tremor-default p-3 border [--anchor-gap:4px]","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},y.createElement(hE,Object.assign({mode:"range",showOutsideDays:!0,defaultMonth:W,selected:{from:U,to:$},onSelect:q=>{i?.({from:q?.from,to:q?.to}),N({from:q?.from,to:q?.to})},locale:p,disabled:R,enableYearNavigation:k,classNames:{day_range_middle:Y("!rounded-none aria-selected:!bg-tremor-background-subtle aria-selected:dark:!bg-dark-tremor-background-subtle aria-selected:!text-tremor-content aria-selected:dark:!bg-dark-tremor-background-subtle"),day_range_start:"rounded-r-none rounded-l-tremor-small aria-selected:text-tremor-brand-inverted dark:aria-selected:text-dark-tremor-brand-inverted",day_range_end:"rounded-l-none rounded-r-tremor-small aria-selected:text-tremor-brand-inverted dark:aria-selected:text-dark-tremor-brand-inverted"},weekStartsOn:S},e))))),s&&y.createElement(Jj,{as:"div",className:Y("w-48 -ml-px rounded-r-tremor-default",I&&"ring-2 ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted z-10"),value:B,onChange:q=>{const{from:J,to:V}=L.get(q),me=V??l0;i?.({from:J,to:me,selectValue:q}),N({from:J,to:me,selectValue:q})},disabled:m},({value:q})=>{var J;return y.createElement(y.Fragment,null,y.createElement(Hh,{onFocus:()=>_(!0),onBlur:()=>_(!1),className:Y("w-full outline-none text-left whitespace-nowrap truncate rounded-r-tremor-default transition duration-100 border px-4 py-2","border-tremor-border text-tremor-content-emphasis focus:border-tremor-brand-subtle","dark:border-dark-tremor-border dark:text-dark-tremor-content-emphasis dark:focus:border-dark-tremor-brand-subtle",pi(gs(q),m))},q&&(J=F.get(q))!==null&&J!==void 0?J:f),y.createElement(di,{enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},y.createElement(qh,{anchor:"bottom end",className:Y("[--anchor-gap:4px] divide-y overflow-y-auto outline-none border min-w-44","shadow-tremor-dropdown bg-tremor-background border-tremor-border divide-tremor-border rounded-tremor-default","dark:shadow-dark-tremor-dropdown dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border")},v??i0.map(V=>y.createElement(Ji,{key:V.value,value:V.value},V.text)))))}))});yhe.displayName="DateRangePicker";const xhe=y.forwardRef((e,t)=>{const{value:r,className:n,children:o}=e,a=Te(e,["value","className","children"]);return y.createElement(Ji,Object.assign({ref:t,className:n,value:r},a),o??r)});xhe.displayName="DateRangePickerItem";const q8=g.createContext(qe.Blue),W8=g.createContext(0),hc=g.createContext(void 0),Yh=g.createContext({selectedValue:void 0,handleValueChange:void 0}),whe=e=>{var t=Te(e,[]);return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),y.createElement("path",{d:"M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"}))},khe=e=>{var t=Te(e,[]);return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},t),y.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),y.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))},Tf=at("MultiSelect"),jhe=y.forwardRef((e,t)=>{const{defaultValue:r=[],value:n,onValueChange:o,placeholder:a="Select...",placeholderSearch:i="Search",disabled:s=!1,icon:l,children:c,className:d,required:f,name:m,error:p=!1,errorMessage:h,id:b}=e,v=Te(e,["defaultValue","value","onValueChange","placeholder","placeholderSearch","disabled","icon","children","className","required","name","error","errorMessage","id"]),x=g.useRef(null),k=l,[S,j]=fi(r,n),{reactElementChildren:O,optionsAvailable:C}=g.useMemo(()=>{const R=y.Children.toArray(c).filter(g.isValidElement);return{reactElementChildren:R,optionsAvailable:bk("",R)}},[c]),[N,T]=g.useState(""),M=(S??[]).length>0,I=g.useMemo(()=>N?bk(N,O):C,[N,O,C]),_=()=>{T("")};return y.createElement("div",{className:Y("w-full min-w-[10rem] text-tremor-default",d)},y.createElement("div",{className:"relative"},y.createElement("select",{title:"multi-select-hidden",required:f,className:Y("h-full w-full absolute left-0 top-0 -z-10 opacity-0"),value:S,onChange:R=>{R.preventDefault()},name:m,disabled:s,multiple:!0,id:b,onFocus:()=>{const R=x.current;R&&R.focus()}},y.createElement("option",{className:"hidden",value:"",disabled:!0,hidden:!0},a),I.map(R=>{const L=R.props.value,F=R.props.children;return y.createElement("option",{className:"hidden",key:L,value:L},F)})),y.createElement(Jj,Object.assign({as:"div",ref:t,defaultValue:S,value:S,onChange:R=>{o?.(R),j(R)},disabled:s,id:b,multiple:!0},v),({value:R})=>y.createElement(y.Fragment,null,y.createElement(Hh,{className:Y("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-1.5","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",k?"pl-11 -ml-0.5":"pl-3",pi(R.length>0,s,p)),ref:x},k&&y.createElement("span",{className:Y("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},y.createElement(k,{className:Y(Tf("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),y.createElement("div",{className:"h-6 flex items-center"},R.length>0?y.createElement("div",{className:"flex flex-nowrap overflow-x-scroll [&::-webkit-scrollbar]:hidden [scrollbar-width:none] gap-x-1 mr-5 -ml-1.5 relative"},C.filter(L=>R.includes(L.props.value)).map((L,F)=>{var B;return y.createElement("div",{key:F,className:Y("max-w-[100px] lg:max-w-[200px] flex justify-center items-center pl-2 pr-1.5 py-1 font-medium","rounded-tremor-small","bg-tremor-background-muted dark:bg-dark-tremor-background-muted","bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle","text-tremor-content-default dark:text-dark-tremor-content-default","text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis")},y.createElement("div",{className:"text-xs truncate "},(B=L.props.children)!==null&&B!==void 0?B:L.props.value),y.createElement("div",{onClick:U=>{U.preventDefault();const $=R.filter(z=>z!==L.props.value);o?.($),j($)}},y.createElement(khe,{className:Y(Tf("clearIconItem"),"cursor-pointer rounded-tremor-full w-3.5 h-3.5 ml-2","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle dark:hover:text-tremor-content")})))})):y.createElement("span",null,a)),y.createElement("span",{className:Y("absolute inset-y-0 right-0 flex items-center mr-2.5")},y.createElement(bE,{className:Y(Tf("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),M&&!s?y.createElement("button",{type:"button",className:Y("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:L=>{L.preventDefault(),j([]),o?.([])}},y.createElement(Id,{className:Y(Tf("clearIconAllItems"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,y.createElement(di,{enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},y.createElement(qh,{anchor:"bottom start",className:Y("z-10 divide-y w-[var(--button-width)] overflow-y-auto outline-none rounded-tremor-default max-h-[228px] border [--anchor-gap:4px]","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},y.createElement("div",{className:Y("flex items-center w-full px-2.5","bg-tremor-background-muted","dark:bg-dark-tremor-background-muted")},y.createElement("span",null,y.createElement(whe,{className:Y("flex-none w-4 h-4 mr-2","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),y.createElement("input",{name:"search",type:"input",autoComplete:"off",placeholder:i,className:Y("w-full focus:outline-none focus:ring-none bg-transparent text-tremor-default py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-subtle"),onKeyDown:L=>{L.code==="Space"&&L.target.value!==""&&L.stopPropagation()},onChange:L=>T(L.target.value),value:N})),y.createElement(Yh.Provider,Object.assign({},{onBlur:{handleResetSearch:_}},{value:{selectedValue:R}}),I)))))),p&&h?y.createElement("p",{className:Y("errorMessage","text-sm text-rose-500 mt-1")},h):null)});jhe.displayName="MultiSelect";const eA=at("MultiSelectItem"),Ehe=y.forwardRef((e,t)=>{const{value:r,className:n,children:o}=e,a=Te(e,["value","className","children"]),{selectedValue:i}=g.useContext(Yh),s=cse(r,i);return y.createElement(Zj,Object.assign({className:Y(eA("root"),"flex justify-start items-center cursor-default text-tremor-default p-2.5","data-[focus]:bg-tremor-background-muted data-[focus]:text-tremor-content-strong data-[select]ed:text-tremor-content-strong text-tremor-content-emphasis","dark:data-[focus]:bg-dark-tremor-background-muted dark:data-[focus]:text-dark-tremor-content-strong dark:data-[select]ed:text-dark-tremor-content-strong dark:data-[select]ed:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",n),ref:t,key:r,value:r},a),y.createElement("input",{type:"checkbox",className:Y(eA("checkbox"),"flex-none focus:ring-none focus:outline-none cursor-pointer mr-2.5","accent-tremor-brand","dark:accent-dark-tremor-brand"),checked:s,readOnly:!0}),y.createElement("span",{className:"whitespace-nowrap truncate"},o??r))});Ehe.displayName="MultiSelectItem";const She=e=>{var t=Te(e,[]);return y.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),y.createElement("path",{d:"M12 4v16m8-8H4"}))},Nhe=e=>{var t=Te(e,[]);return y.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),y.createElement("path",{d:"M20 12H4"}))},Ohe=e=>{var t=Te(e,[]);return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),y.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM11 15V17H13V15H11ZM11 7V13H13V7H11Z"}))},Che=e=>{var t=Te(e,[]);return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),y.createElement("path",{d:"M1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12ZM12.0003 17C14.7617 17 17.0003 14.7614 17.0003 12C17.0003 9.23858 14.7617 7 12.0003 7C9.23884 7 7.00026 9.23858 7.00026 12C7.00026 14.7614 9.23884 17 12.0003 17ZM12.0003 15C10.3434 15 9.00026 13.6569 9.00026 12C9.00026 10.3431 10.3434 9 12.0003 9C13.6571 9 15.0003 10.3431 15.0003 12C15.0003 13.6569 13.6571 15 12.0003 15Z"}))},Phe=e=>{var t=Te(e,[]);return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),y.createElement("path",{d:"M4.52047 5.93457L1.39366 2.80777L2.80788 1.39355L22.6069 21.1925L21.1927 22.6068L17.8827 19.2968C16.1814 20.3755 14.1638 21.0002 12.0003 21.0002C6.60812 21.0002 2.12215 17.1204 1.18164 12.0002C1.61832 9.62282 2.81932 7.5129 4.52047 5.93457ZM14.7577 16.1718L13.2937 14.7078C12.902 14.8952 12.4634 15.0002 12.0003 15.0002C10.3434 15.0002 9.00026 13.657 9.00026 12.0002C9.00026 11.537 9.10522 11.0984 9.29263 10.7067L7.82866 9.24277C7.30514 10.0332 7.00026 10.9811 7.00026 12.0002C7.00026 14.7616 9.23884 17.0002 12.0003 17.0002C13.0193 17.0002 13.9672 16.6953 14.7577 16.1718ZM7.97446 3.76015C9.22127 3.26959 10.5793 3.00016 12.0003 3.00016C17.3924 3.00016 21.8784 6.87992 22.8189 12.0002C22.5067 13.6998 21.8038 15.2628 20.8068 16.5925L16.947 12.7327C16.9821 12.4936 17.0003 12.249 17.0003 12.0002C17.0003 9.23873 14.7617 7.00016 12.0003 7.00016C11.7514 7.00016 11.5068 7.01833 11.2677 7.05343L7.97446 3.76015Z"}))},vE=y.forwardRef((e,t)=>{const{value:r,defaultValue:n,type:o,placeholder:a="Type...",icon:i,error:s=!1,errorMessage:l,disabled:c=!1,stepper:d,makeInputClassName:f,className:m,onChange:p,onValueChange:h,autoFocus:b,pattern:v}=e,x=Te(e,["value","defaultValue","type","placeholder","icon","error","errorMessage","disabled","stepper","makeInputClassName","className","onChange","onValueChange","autoFocus","pattern"]),[k,S]=g.useState(b||!1),[j,O]=g.useState(!1),C=g.useCallback(()=>O(!j),[j,O]),N=i,T=g.useRef(null),M=gs(r||n);return y.useEffect(()=>{const I=()=>S(!0),_=()=>S(!1),R=T.current;return R&&(R.addEventListener("focus",I),R.addEventListener("blur",_),b&&R.focus()),()=>{R&&(R.removeEventListener("focus",I),R.removeEventListener("blur",_))}},[b]),y.createElement(y.Fragment,null,y.createElement("div",{className:Y(f("root"),"relative w-full flex items-center min-w-[10rem] outline-none rounded-tremor-default transition duration-100 border","shadow-tremor-input","dark:shadow-dark-tremor-input",pi(M,c,s),k&&Y("ring-2","border-tremor-brand-subtle ring-tremor-brand-muted","dark:border-dark-tremor-brand-subtle dark:ring-dark-tremor-brand-muted"),m)},N?y.createElement(N,{className:Y(f("icon"),"shrink-0 h-5 w-5 mx-2.5 absolute left-0 flex items-center","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}):null,y.createElement("input",Object.assign({ref:ja([T,t]),defaultValue:n,value:r,type:j?"text":o,className:Y(f("input"),"w-full bg-transparent focus:outline-none focus:ring-0 border-none text-tremor-default rounded-tremor-default transition duration-100 py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",o==="password"?s?"pr-16":"pr-12":s?"pr-8":"pr-3",N?"pl-10":"pl-3",c?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content"),placeholder:a,disabled:c,"data-testid":"base-input",onChange:I=>{p?.(I),h?.(I.target.value)},pattern:v},x)),o!=="password"||c?null:y.createElement("button",{className:Y(f("toggleButton"),"absolute inset-y-0 right-0 flex items-center px-2.5 rounded-lg"),type:"button",onClick:()=>C(),"aria-label":j?"Hide password":"Show Password"},j?y.createElement(Phe,{className:Y("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0}):y.createElement(Che,{className:Y("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0})),s?y.createElement(Ohe,{className:Y(f("errorIcon"),"text-red-500 shrink-0 h-5 w-5 absolute right-0 flex items-center",o==="password"?"mr-10":o==="number"?d?"mr-20":"mr-3":"mx-2.5")}):null,d??null),s&&l?y.createElement("p",{className:Y(f("errorMessage"),"text-sm text-red-500 mt-1")},l):null)});vE.displayName="BaseInput";const tA="flex mx-auto text-tremor-content-subtle dark:text-dark-tremor-content-subtle",rA="cursor-pointer hover:text-tremor-content dark:hover:text-dark-tremor-content",Ahe=y.forwardRef((e,t)=>{const{onSubmit:r,enableStepper:n=!0,disabled:o,onValueChange:a,onChange:i}=e,s=Te(e,["onSubmit","enableStepper","disabled","onValueChange","onChange"]),l=g.useRef(null),[c,d]=y.useState(!1),f=y.useCallback(()=>{d(!0)},[]),m=y.useCallback(()=>{d(!1)},[]),[p,h]=y.useState(!1),b=y.useCallback(()=>{h(!0)},[]),v=y.useCallback(()=>{h(!1)},[]);return y.createElement(vE,Object.assign({type:"number",ref:ja([l,t]),disabled:o,makeInputClassName:at("NumberInput"),onKeyDown:x=>{var k;if(x.key==="Enter"&&!x.ctrlKey&&!x.altKey&&!x.shiftKey){const S=(k=l.current)===null||k===void 0?void 0:k.value;r?.(parseFloat(S??""))}x.key==="ArrowDown"&&f(),x.key==="ArrowUp"&&b()},onKeyUp:x=>{x.key==="ArrowDown"&&m(),x.key==="ArrowUp"&&v()},onChange:x=>{o||(a?.(parseFloat(x.target.value)),i?.(x))},stepper:n?y.createElement("div",{className:Y("flex justify-center align-middle")},y.createElement("div",{tabIndex:-1,onClick:x=>x.preventDefault(),onMouseDown:x=>x.preventDefault(),onTouchStart:x=>{x.cancelable&&x.preventDefault()},onMouseUp:()=>{var x,k;o||((x=l.current)===null||x===void 0||x.stepDown(),(k=l.current)===null||k===void 0||k.dispatchEvent(new Event("input",{bubbles:!0})))},className:Y(!o&&rA,tA,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},y.createElement(Nhe,{"data-testid":"step-down",className:(c?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"})),y.createElement("div",{tabIndex:-1,onClick:x=>x.preventDefault(),onMouseDown:x=>x.preventDefault(),onTouchStart:x=>{x.cancelable&&x.preventDefault()},onMouseUp:()=>{var x,k;o||((x=l.current)===null||x===void 0||x.stepUp(),(k=l.current)===null||k===void 0||k.dispatchEvent(new Event("input",{bubbles:!0})))},className:Y(!o&&rA,tA,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},y.createElement(She,{"data-testid":"step-up",className:(p?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"}))):null},s))});Ahe.displayName="NumberInput";const nA=at("SearchSelect"),The=at("SearchSelect"),Mhe=y.forwardRef((e,t)=>{const{defaultValue:r="",searchValue:n,onSearchValueChange:o,value:a,onValueChange:i,placeholder:s="Select...",disabled:l=!1,icon:c,enableClear:d=!0,name:f,required:m,error:p=!1,errorMessage:h,children:b,className:v,id:x,autoComplete:k="off"}=e,S=Te(e,["defaultValue","searchValue","onSearchValueChange","value","onValueChange","placeholder","disabled","icon","enableClear","name","required","error","errorMessage","children","className","id","autoComplete"]),j=g.useRef(null),[O,C]=fi("",n),[N,T]=fi(r,a),M=c,{reactElementChildren:I,valueToNameMapping:_}=g.useMemo(()=>{const L=y.Children.toArray(b).filter(g.isValidElement);return{reactElementChildren:L,valueToNameMapping:gE(L)}},[b]),R=g.useMemo(()=>bk(O??"",I),[O,I]);return y.createElement("div",{className:Y("w-full min-w-[10rem] text-tremor-default",v)},y.createElement("div",{className:"relative"},y.createElement("select",{title:"search-select-hidden",required:m,className:Y("h-full w-full absolute left-0 top-0 -z-10 opacity-0"),value:N,onChange:L=>{L.preventDefault()},name:f,disabled:l,id:x,onFocus:()=>{const L=j.current;L&&L.focus()}},y.createElement("option",{className:"hidden",value:"",disabled:!0,hidden:!0},s),R.map(L=>{const F=L.props.value,B=L.props.children;return y.createElement("option",{className:"hidden",key:F,value:F},B)})),y.createElement(gde,Object.assign({as:"div",ref:t,defaultValue:N,value:N,onChange:L=>{i?.(L),T(L)},disabled:l,id:x},S),({value:L})=>y.createElement(y.Fragment,null,y.createElement(u8,{className:"w-full"},M&&y.createElement("span",{className:Y("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},y.createElement(M,{className:Y(nA("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),y.createElement(c8,{ref:j,className:Y("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 text-tremor-default pr-14 border py-2","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",M?"pl-10":"pl-3",l?"placeholder:text-tremor-content-subtle dark:placeholder:text-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-tremor-content",pi(gs(L),l,p)),placeholder:s,onChange:F=>{o?.(F.target.value),C(F.target.value)},displayValue:F=>{var B;return(B=_.get(F))!==null&&B!==void 0?B:""},autoComplete:k}),y.createElement("div",{className:Y("absolute inset-y-0 right-0 flex items-center pr-2.5")},y.createElement(bE,{className:Y(nA("arrowDownIcon"),"flex-none h-5 w-5","!text-tremor-content-subtle","!dark:text-dark-tremor-content-subtle")}))),d&&N?y.createElement("button",{type:"button",className:Y("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:F=>{F.preventDefault(),T(""),C(""),i?.(""),o?.("")}},y.createElement(Id,{className:Y(The("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,R.length>0&&y.createElement(di,{enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},y.createElement(d8,{anchor:"bottom start",className:Y("z-10 divide-y w-[var(--button-width)] overflow-y-auto outline-none rounded-tremor-default text-tremor-default max-h-[228px] border [--anchor-gap:4px]","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},R))))),p&&h?y.createElement("p",{className:Y("errorMessage","text-sm text-rose-500 mt-1")},h):null)});Mhe.displayName="SearchSelect";const oA=at("SearchSelectItem"),_he=y.forwardRef((e,t)=>{const{value:r,icon:n,className:o,children:a}=e,i=Te(e,["value","icon","className","children"]),s=n;return y.createElement(f8,Object.assign({className:Y(oA("root"),"flex justify-start items-center cursor-default text-tremor-default p-2.5","data-[focus]:bg-tremor-background-muted data-[focus]:text-tremor-content-strong data-[selected]:text-tremor-content-strong data-[selected]:bg-tremor-background-muted text-tremor-content-emphasis","dark:data-[focus]:bg-dark-tremor-background-muted dark:data-[focus]:text-dark-tremor-content-strong dark:data-[selected]:text-dark-tremor-content-strong dark:data-[selected]:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",o),ref:t,key:r,value:r},i),s&&y.createElement(s,{className:Y(oA("icon"),"flex-none h-5 w-5 mr-3","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}),y.createElement("span",{className:"whitespace-nowrap truncate"},a??r))});_he.displayName="SearchSelectItem";const Mi=at("Switch"),Ihe=y.forwardRef((e,t)=>{const{checked:r,defaultChecked:n=!1,onChange:o,color:a,name:i,error:s,errorMessage:l,disabled:c,required:d,tooltip:f,id:m}=e,p=Te(e,["checked","defaultChecked","onChange","color","name","error","errorMessage","disabled","required","tooltip","id"]),h=(O=>({bgColor:O?_e(O,Le.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",ringColor:O?_e(O,Le.ring).ringColor:"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}))(a),[b,v]=fi(n,r),[x,k]=g.useState(!1),{tooltipProps:S,getReferenceProps:j}=Fn(300);return y.createElement("div",{className:"flex flex-row items-center justify-start"},y.createElement(On,Object.assign({text:f},S)),y.createElement("div",Object.assign({ref:ja([t,S.refs.setReference]),className:Y(Mi("root"),"flex flex-row relative h-5")},p,j),y.createElement("input",{type:"checkbox",className:Y(Mi("input"),"absolute w-5 h-5 cursor-pointer left-0 top-0 opacity-0"),name:i,required:d,checked:b,onChange:O=>{O.preventDefault()}}),y.createElement(upe,{checked:b,onChange:O=>{v(O),o?.(O)},disabled:c,className:Y(Mi("switch"),"w-10 h-5 group relative inline-flex shrink-0 cursor-pointer items-center justify-center rounded-tremor-full","focus:outline-none",c?"cursor-not-allowed":""),onFocus:()=>k(!0),onBlur:()=>k(!1),id:m},y.createElement("span",{className:Y(Mi("sr-only"),"sr-only")},"Switch ",b?"on":"off"),y.createElement("span",{"aria-hidden":"true",className:Y(Mi("background"),b?h.bgColor:"bg-tremor-border dark:bg-dark-tremor-border","pointer-events-none absolute mx-auto h-3 w-9 rounded-tremor-full transition-colors duration-100 ease-in-out")}),y.createElement("span",{"aria-hidden":"true",className:Y(Mi("round"),b?Y(h.bgColor,"translate-x-5 border-tremor-background dark:border-dark-tremor-background"):"translate-x-0 bg-tremor-border dark:bg-dark-tremor-border border-tremor-background dark:border-dark-tremor-background","pointer-events-none absolute left-0 inline-block h-5 w-5 transform rounded-tremor-full border-2 shadow-tremor-input duration-100 ease-in-out transition",x?Y("ring-2",h.ringColor):"")}))),s&&l?y.createElement("p",{className:Y(Mi("errorMessage"),"text-sm text-red-500 mt-1 ")},l):null)});Ihe.displayName="Switch";const Dhe=at("TabList"),U8=g.createContext("line"),Lhe={line:Y("flex border-b space-x-4","border-tremor-border","dark:border-dark-tremor-border"),solid:Y("inline-flex p-0.5 rounded-tremor-default space-x-1.5","bg-tremor-background-subtle","dark:bg-dark-tremor-background-subtle")},yE=y.forwardRef((e,t)=>{const{color:r,variant:n="line",children:o,className:a}=e,i=Te(e,["color","variant","children","className"]);return y.createElement(Vh.List,Object.assign({ref:t,className:Y(Dhe("root"),"justify-start overflow-x-clip",Lhe[n],a)},i),y.createElement(U8.Provider,{value:n},y.createElement(q8.Provider,{value:r},o)))});yE.displayName="TabList";const aA=at("Tab");function Rhe(e,t){switch(e){case"line":return Y("data-[selected]:border-b-2 hover:border-b-2 border-transparent transition duration-100 -mb-px px-2 py-2","hover:border-tremor-content hover:text-tremor-content-emphasis text-tremor-content","[&:not([data-selected])]:dark:hover:border-dark-tremor-content-emphasis [&:not([data-selected])]:dark:hover:text-dark-tremor-content-emphasis [&:not([data-selected])]:dark:text-dark-tremor-content",t?_e(t,Le.border).selectBorderColor:["data-[selected]:border-tremor-brand data-[selected]:text-tremor-brand","data-[selected]:dark:border-dark-tremor-brand data-[selected]:dark:text-dark-tremor-brand"]);case"solid":return Y("border-transparent border rounded-tremor-small px-2.5 py-1","data-[selected]:border-tremor-border data-[selected]:bg-tremor-background data-[selected]:shadow-tremor-input [&:not([data-selected])]:hover:text-tremor-content-emphasis data-[selected]:text-tremor-brand [&:not([data-selected])]:text-tremor-content","dark:data-[selected]:border-dark-tremor-border dark:data-[selected]:bg-dark-tremor-background dark:data-[selected]:shadow-dark-tremor-input dark:[&:not([data-selected])]:hover:text-dark-tremor-content-emphasis dark:data-[selected]:text-dark-tremor-brand dark:[&:not([data-selected])]:text-dark-tremor-content",t?_e(t,Le.text).selectTextColor:"text-tremor-content dark:text-dark-tremor-content")}}const Qi=y.forwardRef((e,t)=>{const{icon:r,className:n,children:o}=e,a=Te(e,["icon","className","children"]),i=g.useContext(U8),s=g.useContext(q8),l=r;return y.createElement(Vh,Object.assign({ref:t,className:Y(aA("root"),"flex whitespace-nowrap truncate max-w-xs outline-none data-focus-visible:ring text-tremor-default transition duration-100",Rhe(i,s),n,s&&_e(s,Le.text).selectTextColor)},a),l?y.createElement(l,{className:Y(aA("icon"),"flex-none h-5 w-5",o?"mr-2":"")}):null,o?y.createElement("span",null,o):null)});Qi.displayName="Tab";const Fhe=at("TabGroup"),xE=y.forwardRef((e,t)=>{const{defaultIndex:r,index:n,onIndexChange:o,children:a,className:i}=e,s=Te(e,["defaultIndex","index","onIndexChange","children","className"]);return y.createElement(Vh.Group,Object.assign({as:"div",ref:t,defaultIndex:r,selectedIndex:n,onChange:o,className:Y(Fhe("root"),"w-full",i)},s),a)});xE.displayName="TabGroup";const $he=at("TabPanel"),es=y.forwardRef((e,t)=>{const{children:r,className:n}=e,o=Te(e,["children","className"]),{selectedValue:a}=g.useContext(Yh),i=a===g.useContext(W8);return y.createElement("div",Object.assign({ref:t,className:Y($he("root"),"w-full mt-2",i?"":"hidden",n),"aria-selected":i?"true":"false"},o),r)});es.displayName="TabPanel";const Bhe=at("TabPanels"),wE=y.forwardRef((e,t)=>{const{children:r,className:n}=e,o=Te(e,["children","className"]);return y.createElement(Vh.Panels,Object.assign({as:"div",ref:t,className:Y(Bhe("root"),"w-full",n)},o),({selectedIndex:a})=>y.createElement(Yh.Provider,{value:{selectedValue:a}},y.Children.map(r,(i,s)=>y.createElement(W8.Provider,{value:s},i))))});wE.displayName="TabPanels";const iA=at("Textarea"),zhe=y.forwardRef((e,t)=>{const{value:r,defaultValue:n="",placeholder:o="Type...",error:a=!1,errorMessage:i,disabled:s=!1,className:l,onChange:c,onValueChange:d,autoHeight:f=!1}=e,m=Te(e,["value","defaultValue","placeholder","error","errorMessage","disabled","className","onChange","onValueChange","autoHeight"]),[p,h]=fi(n,r),b=g.useRef(null),v=gs(p);return g.useEffect(()=>{const x=b.current;if(f&&x){x.style.height="60px";const k=x.scrollHeight;x.style.height=k+"px"}},[f,b,p]),y.createElement(y.Fragment,null,y.createElement("textarea",Object.assign({ref:ja([b,t]),value:p,placeholder:o,disabled:s,className:Y(iA("Textarea"),"w-full flex items-center outline-none rounded-tremor-default px-3 py-2 text-tremor-default focus:ring-2 transition duration-100 border","shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:shadow-dark-tremor-input focus:dark:border-dark-tremor-brand-subtle focus:dark:ring-dark-tremor-brand-muted",pi(v,s,a),s?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content",l),"data-testid":"text-area",onChange:x=>{c?.(x),h(x.target.value),d?.(x.target.value)}},m)),a&&i?y.createElement("p",{className:Y(iA("errorMessage"),"text-sm text-red-500 mt-1")},i):null)});zhe.displayName="Textarea";const Hhe=at("TextInput"),K8=y.forwardRef((e,t)=>{const{type:r="text"}=e,n=Te(e,["type"]);return y.createElement(vE,Object.assign({ref:t,type:r,makeInputClassName:Hhe},n))});K8.displayName="TextInput";const qhe=at("Accordion"),V8=g.createContext({isOpen:!1}),Whe=y.forwardRef((e,t)=>{var r;const{defaultOpen:n=!1,children:o,className:a}=e,i=Te(e,["defaultOpen","children","className"]),s=(r=g.useContext(hc))!==null&&r!==void 0?r:Y("rounded-tremor-default border");return y.createElement(Yj,Object.assign({as:"div",ref:t,className:Y(qhe("root"),"overflow-hidden","bg-tremor-background border-tremor-border","dark:bg-dark-tremor-background dark:border-dark-tremor-border",s,a),defaultOpen:n},i),({open:l})=>y.createElement(V8.Provider,{value:{isOpen:l}},o))});Whe.displayName="Accordion";const Uhe=at("AccordionBody"),Khe=y.forwardRef((e,t)=>{const{children:r,className:n}=e,o=Te(e,["children","className"]);return y.createElement(Yj.Panel,Object.assign({ref:t,className:Y(Uhe("root"),"w-full text-tremor-default px-4 pb-3","text-tremor-content","dark:text-dark-tremor-content",n)},o),r)});Khe.displayName="AccordionBody";const Vhe=e=>{var t=Te(e,[]);return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),y.createElement("path",{d:"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"}))},u0=at("AccordionHeader"),Ghe=y.forwardRef((e,t)=>{const{children:r,className:n}=e,o=Te(e,["children","className"]),{isOpen:a}=g.useContext(V8);return y.createElement(Yj.Button,Object.assign({ref:t,className:Y(u0("root"),"w-full flex items-center justify-between px-4 py-3","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis",n)},o),y.createElement("div",{className:Y(u0("children"),"flex flex-1 text-inherit mr-4")},r),y.createElement("div",null,y.createElement(Vhe,{className:Y(u0("arrowIcon"),"h-5 w-5 -mr-1","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle",a?"transition-all":"transition-all -rotate-180")})))});Ghe.displayName="AccordionHeader";const Yhe=at("AccordionList"),Xhe=y.forwardRef((e,t)=>{const{children:r,className:n}=e,o=Te(e,["children","className"]),a=y.Children.count(r);return y.createElement("div",Object.assign({ref:t,className:Y(Yhe("root"),"rounded-tremor-default","shadow-tremor-card","dark:shadow-dark-tremor-card",n)},o),y.Children.map(r,(i,s)=>s===0?y.createElement(hc.Provider,{value:Y("rounded-t-tremor-default border")},y.cloneElement(i)):s===a-1?y.createElement(hc.Provider,{value:Y("rounded-b-tremor-default border-l border-r border-b")},y.cloneElement(i)):y.createElement(hc.Provider,{value:Y("border-l border-r border-b")},y.cloneElement(i))))});Xhe.displayName="AccordionList";const Zhe=at("Card"),Jhe=e=>{if(!e)return"";switch(e){case rl.Left:return"border-l-4";case tP.Top:return"border-t-4";case rl.Right:return"border-r-4";case tP.Bottom:return"border-b-4";default:return""}},fr=y.forwardRef((e,t)=>{const{decoration:r="",decorationColor:n,children:o,className:a}=e,i=Te(e,["decoration","decorationColor","children","className"]);return y.createElement("div",Object.assign({ref:t,className:Y(Zhe("root"),"relative w-full text-left ring-1 rounded-tremor-default p-6","bg-tremor-background ring-tremor-ring shadow-tremor-card","dark:bg-dark-tremor-background dark:ring-dark-tremor-ring dark:shadow-dark-tremor-card",n?_e(n,Le.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand",Jhe(r),a)},i),o)});fr.displayName="Card";const Qhe=at("Divider"),ji=y.forwardRef((e,t)=>{const{className:r,children:n}=e,o=Te(e,["className","children"]);return y.createElement("div",Object.assign({ref:t,className:Y(Qhe("root"),"w-full mx-auto my-6 flex justify-between gap-3 items-center text-tremor-default","text-tremor-content","dark:text-dark-tremor-content",r)},o),n?y.createElement(y.Fragment,null,y.createElement("div",{className:Y("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}),y.createElement("div",{className:Y("text-inherit whitespace-nowrap")},n),y.createElement("div",{className:Y("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")})):y.createElement("div",{className:Y("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}))});ji.displayName="Divider";const ege=at("Flex"),tge={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},rge={start:"items-start",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"},nge={row:"flex-row",col:"flex-col","row-reverse":"flex-row-reverse","col-reverse":"flex-col-reverse"},G8=y.forwardRef((e,t)=>{const{flexDirection:r="row",justifyContent:n="between",alignItems:o="center",children:a,className:i}=e,s=Te(e,["flexDirection","justifyContent","alignItems","children","className"]);return y.createElement("div",Object.assign({ref:t,className:Y(ege("root"),"flex w-full",nge[r],tge[n],rge[o],i)},s),a)});G8.displayName="Flex";const oge={0:"grid-cols-none",1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},age={0:"sm:grid-cols-none",1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",5:"sm:grid-cols-5",6:"sm:grid-cols-6",7:"sm:grid-cols-7",8:"sm:grid-cols-8",9:"sm:grid-cols-9",10:"sm:grid-cols-10",11:"sm:grid-cols-11",12:"sm:grid-cols-12"},ige={0:"md:grid-cols-none",1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12"},sge={0:"lg:grid-cols-none",1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12"},lge={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12",13:"col-span-13"},uge={1:"sm:col-span-1",2:"sm:col-span-2",3:"sm:col-span-3",4:"sm:col-span-4",5:"sm:col-span-5",6:"sm:col-span-6",7:"sm:col-span-7",8:"sm:col-span-8",9:"sm:col-span-9",10:"sm:col-span-10",11:"sm:col-span-11",12:"sm:col-span-12",13:"sm:col-span-13"},cge={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12",13:"md:col-span-13"},dge={1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12",13:"lg:col-span-13"},fge=at("Col"),pge=y.forwardRef((e,t)=>{const{numColSpan:r=1,numColSpanSm:n,numColSpanMd:o,numColSpanLg:a,children:i,className:s}=e,l=Te(e,["numColSpan","numColSpanSm","numColSpanMd","numColSpanLg","children","className"]),c=(d,f)=>d&&Object.keys(f).includes(String(d))?f[d]:"";return y.createElement("div",Object.assign({ref:t,className:Y(fge("root"),(()=>{const d=c(r,lge),f=c(n,uge),m=c(o,cge),p=c(a,dge);return Y(d,f,m,p)})(),s)},l),i)});pge.displayName="Col";const mge=at("Grid"),Mf=(e,t)=>e&&Object.keys(t).includes(String(e))?t[e]:"",Xh=y.forwardRef((e,t)=>{const{numItems:r=1,numItemsSm:n,numItemsMd:o,numItemsLg:a,children:i,className:s}=e,l=Te(e,["numItems","numItemsSm","numItemsMd","numItemsLg","children","className"]),c=Mf(r,oge),d=Mf(n,age),f=Mf(o,ige),m=Mf(a,sge),p=Y(c,d,f,m);return y.createElement("div",Object.assign({ref:t,className:Y(mge("root"),"grid",p,s)},l),i)});Xh.displayName="Grid";const hge=at("dialog"),gge=y.forwardRef((e,t)=>{const{children:r,className:n}=e,o=Te(e,["children","className"]);return y.createElement(di,{appear:!0,show:e.open},y.createElement(Yde,Object.assign({ref:t},o,{className:Y(hge("root"),"relative z-50",n)}),y.createElement(Vde,{transition:!0,className:"fixed bg-slate-950/30 dark:bg-slate-950/50 inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),y.createElement("div",{className:"fixed inset-0 overflow-y-auto w-screen"},y.createElement("div",{className:"flex min-h-full items-center justify-center p-4"},r))))});gge.displayName="Dialog";const bge=at("dialog"),vge=y.forwardRef((e,t)=>{var r;const{children:n,className:o}=e,a=Te(e,["children","className"]),i=(r=y.useContext(hc))!==null&&r!==void 0?r:Y("rounded-tremor-default p-6");return y.createElement(Fh,{enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95"},y.createElement(k8,Object.assign({ref:t,className:Y(bge("panel"),"w-full max-w-lg overflow-visible text-left ring-1 shadow-tremor transition-all transform","bg-tremor-background text-tremor-content ring-tremor-ring","dark:bg-dark-tremor-background dark:text-dark-tremor-content dark:ring-dark-tremor-ring",i,o)},a),n))});vge.displayName="DialogPanel";const yge=at("List"),Rd=y.forwardRef((e,t)=>{const{children:r,className:n}=e,o=Te(e,["children","className"]);return y.createElement("ul",Object.assign({ref:t,className:Y(yge("root"),"w-full divide-y","divide-tremor-border text-tremor-content","dark:divide-dark-tremor-border dark:text-dark-tremor-content",n)},o),r)});Rd.displayName="List";const xge=at("ListItem"),Er=y.forwardRef((e,t)=>{const{children:r,className:n}=e,o=Te(e,["children","className"]);return y.createElement(y.Fragment,null,y.createElement("li",Object.assign({ref:t,className:Y(xge("root"),"w-full flex justify-between items-center text-tremor-default py-2",n)},o),r))});Er.displayName="ListItem";const sA=at("Table"),Y8=y.forwardRef((e,t)=>{const{children:r,className:n}=e,o=Te(e,["children","className"]);return y.createElement("div",{className:Y(sA("root"),"overflow-auto",n)},y.createElement("table",Object.assign({ref:t,className:Y(sA("table"),"w-full text-tremor-default","text-tremor-content","dark:text-dark-tremor-content")},o),r))});Y8.displayName="Table";const wge=at("TableBody"),X8=y.forwardRef((e,t)=>{const{children:r,className:n}=e,o=Te(e,["children","className"]);return y.createElement(y.Fragment,null,y.createElement("tbody",Object.assign({ref:t,className:Y(wge("root"),"align-top divide-y","divide-tremor-border","dark:divide-dark-tremor-border",n)},o),r))});X8.displayName="TableBody";const kge=at("TableCell"),Ri=y.forwardRef((e,t)=>{const{children:r,className:n}=e,o=Te(e,["children","className"]);return y.createElement(y.Fragment,null,y.createElement("td",Object.assign({ref:t,className:Y(kge("root"),"align-middle whitespace-nowrap text-left p-4",n)},o),r))});Ri.displayName="TableCell";const jge=at("TableFoot"),Ege=y.forwardRef((e,t)=>{const{children:r,className:n}=e,o=Te(e,["children","className"]);return y.createElement("tfoot",Object.assign({ref:t,className:Y(jge("root"),"text-left font-medium border-t-[1px] ","text-tremor-content border-tremor-border","dark:text-dark-tremor-content dark:border-dark-tremor-border",n)},o),r)});Ege.displayName="TableFoot";const Sge=at("TableFooterCell"),Nge=y.forwardRef((e,t)=>{const{children:r,className:n}=e,o=Te(e,["children","className"]);return y.createElement(y.Fragment,null,y.createElement("th",Object.assign({ref:t,className:Y(Sge("root"),"top-0 px-4 py-3.5","text-tremor-content font-medium","dark:text-dark-tremor-content",n)},o),r))});Nge.displayName="TableFooterCell";const Oge=at("TableHead"),Z8=y.forwardRef((e,t)=>{const{children:r,className:n}=e,o=Te(e,["children","className"]);return y.createElement(y.Fragment,null,y.createElement("thead",Object.assign({ref:t,className:Y(Oge("root"),"text-left","text-tremor-content","dark:text-dark-tremor-content",n)},o),r))});Z8.displayName="TableHead";const Cge=at("TableHeaderCell"),Fi=y.forwardRef((e,t)=>{const{children:r,className:n}=e,o=Te(e,["children","className"]);return y.createElement(y.Fragment,null,y.createElement("th",Object.assign({ref:t,className:Y(Cge("root"),"whitespace-nowrap text-left font-semibold top-0 px-4 py-3.5","text-tremor-content-strong","dark:text-dark-tremor-content-strong",n)},o),r))});Fi.displayName="TableHeaderCell";const Pge=at("TableRow"),vk=y.forwardRef((e,t)=>{const{children:r,className:n}=e,o=Te(e,["children","className"]);return y.createElement(y.Fragment,null,y.createElement("tr",Object.assign({ref:t,className:Y(Pge("row"),n)},o),r))});vk.displayName="TableRow";const Age=y.forwardRef((e,t)=>{const{data:r=[],categories:n=[],index:o,colors:a=Bo,stack:i=!1,relative:s=!1,animationDuration:l=900,showAnimation:c=!1,noDataText:d,autoMinValue:f=!1,minValue:m,maxValue:p,className:h}=e,b=Te(e,["data","categories","index","colors","stack","relative","animationDuration","showAnimation","noDataText","autoMinValue","minValue","maxValue","className"]),v=ks(n,a),x=ci(f,m,p);return y.createElement("div",Object.assign({ref:t,className:Y("w-28 h-12",h)},b),y.createElement(vi,{className:"h-full w-full"},r!=null&&r.length?y.createElement(a9,{data:r,stackOffset:s?"expand":"none",margin:{top:0,left:-1.5,right:-1.5,bottom:0}},y.createElement(mn,{hide:!0,domain:x}),y.createElement(pn,{hide:!0,dataKey:o}),n.map(k=>{var S;return y.createElement(ki,{className:Y(_e((S=v.get(k))!==null&&S!==void 0?S:qe.Gray,Le.background).fillColor),key:k,name:k,type:"linear",stackId:i||s?"a":void 0,dataKey:k,fill:"",isAnimationActive:c,animationDuration:l})})):y.createElement(Ea,{noDataText:d})))});Age.displayName="SparkBarChart";const Tge=y.forwardRef((e,t)=>{const{data:r=[],categories:n=[],index:o,colors:a=Bo,animationDuration:i=900,showAnimation:s=!1,curveType:l="linear",connectNulls:c=!1,noDataText:d,autoMinValue:f=!1,minValue:m,maxValue:p,className:h}=e,b=Te(e,["data","categories","index","colors","animationDuration","showAnimation","curveType","connectNulls","noDataText","autoMinValue","minValue","maxValue","className"]),v=ks(n,a),x=ci(f,m,p);return y.createElement("div",Object.assign({ref:t,className:Y("w-28 h-12",h)},b),y.createElement(vi,{className:"h-full w-full"},r!=null&&r.length?y.createElement(o9,{data:r,margin:{top:1,left:1,right:1,bottom:1}},y.createElement(mn,{hide:!0,domain:x}),y.createElement(pn,{hide:!0,dataKey:o}),n.map(k=>{var S;return y.createElement(ui,{className:Y(_e((S=v.get(k))!==null&&S!==void 0?S:qe.Gray,Le.text).strokeColor),strokeOpacity:1,dot:!1,key:k,name:k,type:l,dataKey:k,stroke:"",strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:s,animationDuration:i,connectNulls:c})})):y.createElement(Ea,{noDataText:d})))});Tge.displayName="SparkLineChart";const Mge=y.forwardRef((e,t)=>{const{data:r=[],categories:n=[],index:o,stack:a=!1,colors:i=Bo,showAnimation:s=!1,animationDuration:l=900,showGradient:c=!0,curveType:d="linear",connectNulls:f=!1,noDataText:m,autoMinValue:p=!1,minValue:h,maxValue:b,className:v}=e,x=Te(e,["data","categories","index","stack","colors","showAnimation","animationDuration","showGradient","curveType","connectNulls","noDataText","autoMinValue","minValue","maxValue","className"]),k=ks(n,i),S=ci(p,h,b);return y.createElement("div",Object.assign({ref:t,className:Y("w-28 h-12",v)},x),y.createElement(vi,{className:"h-full w-full"},r!=null&&r.length?y.createElement(i9,{data:r,margin:{top:1,left:1,right:1,bottom:1}},y.createElement(mn,{hide:!0,domain:S}),y.createElement(pn,{hide:!0,dataKey:o}),n.map(j=>{var O,C;return y.createElement("defs",{key:j},c?y.createElement("linearGradient",{className:_e((O=k.get(j))!==null&&O!==void 0?O:qe.Gray,Le.text).textColor,id:k.get(j),x1:"0",y1:"0",x2:"0",y2:"1"},y.createElement("stop",{offset:"5%",stopColor:"currentColor",stopOpacity:.4}),y.createElement("stop",{offset:"95%",stopColor:"currentColor",stopOpacity:0})):y.createElement("linearGradient",{className:_e((C=k.get(j))!==null&&C!==void 0?C:qe.Gray,Le.text).textColor,id:k.get(j),x1:"0",y1:"0",x2:"0",y2:"1"},y.createElement("stop",{stopColor:"currentColor",stopOpacity:.3})))}),n.map(j=>{var O;return y.createElement(ka,{className:_e((O=k.get(j))!==null&&O!==void 0?O:qe.Gray,Le.text).strokeColor,strokeOpacity:1,dot:!1,key:j,name:j,type:d,dataKey:j,stroke:"",fill:`url(#${k.get(j)})`,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:s,animationDuration:l,stackId:a?"a":void 0,connectNulls:f})})):y.createElement(Ea,{noDataText:m})))});Mge.displayName="AreaChart";const _ge=y.forwardRef((e,t)=>{const{children:r,className:n}=e,o=Te(e,["children","className"]);return y.createElement("b",Object.assign({ref:t,className:Y("text-inherit font-bold",n)},o),r)});_ge.displayName="Bold";const Hu=at("Callout"),Ige=y.forwardRef((e,t)=>{const{title:r,icon:n,color:o,className:a,children:i}=e,s=Te(e,["title","icon","color","className","children"]),l=n;return y.createElement("div",Object.assign({ref:t,className:Y(Hu("root"),"flex flex-col overflow-hidden rounded-tremor-default text-tremor-default border-l-4 py-3 pr-3 pl-4",o?Y(_e(o,Le.background).bgColor,_e(o,Le.darkBorder).borderColor,_e(o,Le.darkText).textColor,"dark:bg-opacity-10 bg-opacity-10"):Y("bg-tremor-brand-faint border-tremor-brand-emphasis text-tremor-brand-emphasis","dark:bg-dark-tremor-brand-muted/70 dark:border-dark-tremor-brand-emphasis dark:text-dark-tremor-brand-emphasis"),a)},s),y.createElement("div",{className:Y(Hu("header"),"flex items-start")},l?y.createElement(l,{className:Y(Hu("icon"),"flex-none h-5 w-5 mr-1.5")}):null,y.createElement("h4",{className:Y(Hu("title"),"font-semibold")},r)),y.createElement("p",{className:Y(Hu("body"),"overflow-y-auto",i?"mt-2":"")},i))});Ige.displayName="Callout";const Dge=y.forwardRef((e,t)=>{const{children:r,className:n}=e,o=Te(e,["children","className"]);return y.createElement("i",Object.assign({ref:t,className:Y("italic text-inherit",n)},o),r)});Dge.displayName="Italic";const ua=y.forwardRef((e,t)=>{const{color:r,children:n,className:o}=e,a=Te(e,["color","children","className"]);return y.createElement("p",Object.assign({ref:t,className:Y("font-semibold text-tremor-metric",r?_e(r,Le.darkText).textColor:"text-tremor-content-strong dark:text-dark-tremor-content-strong",o)},a),n)});ua.displayName="Metric";const Lge=y.forwardRef((e,t)=>{const{color:r,children:n,className:o}=e,a=Te(e,["color","children","className"]);return y.createElement("p",Object.assign({ref:t,className:Y(r?_e(r,Le.lightText).textColor:"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",o)},a),n)});Lge.displayName="Subtitle";const Gn=y.forwardRef((e,t)=>{const{color:r,children:n,className:o}=e,a=Te(e,["color","children","className"]);return y.createElement("p",Object.assign({ref:t,className:Y("font-medium text-tremor-title",r?_e(r,Le.darkText).textColor:"text-tremor-content-strong dark:text-dark-tremor-content-strong",o)},a),n)});Gn.displayName="Title";const Zo=at("BarList");function J8(e,t){const{data:r=[],color:n,valueFormatter:o=No,showAnimation:a=!1,onValueChange:i,sortOrder:s="descending",className:l}=e,c=Te(e,["data","color","valueFormatter","showAnimation","onValueChange","sortOrder","className"]),d=i?"button":"div",f=y.useMemo(()=>s==="none"?r:[...r].sort((p,h)=>s==="ascending"?p.value-h.value:h.value-p.value),[r,s]),m=y.useMemo(()=>{const p=Math.max(...f.map(h=>h.value),0);return f.map(h=>h.value===0?0:Math.max(h.value/p*100,2))},[f]);return y.createElement("div",Object.assign({ref:t,className:Y(Zo("root"),"flex justify-between space-x-6",l),"aria-sort":s},c),y.createElement("div",{className:Y(Zo("bars"),"relative w-full space-y-1.5")},f.map((p,h)=>{var b,v,x;const k=p.icon;return y.createElement(d,{key:(b=p.key)!==null&&b!==void 0?b:h,onClick:()=>{i?.(p)},className:Y(Zo("bar"),"group w-full flex items-center rounded-tremor-small",i?["cursor-pointer","hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-subtle/40"]:"")},y.createElement("div",{className:Y("flex items-center rounded transition-all bg-opacity-40","h-8",p.color||n?[_e((v=p.color)!==null&&v!==void 0?v:n,Le.background).bgColor,i?"group-hover:bg-opacity-30":""]:"bg-tremor-brand-subtle dark:bg-dark-tremor-brand-subtle/60",!i||p.color||n?"":"group-hover:bg-tremor-brand-subtle/30 group-hover:dark:bg-dark-tremor-brand-subtle/70",h===f.length-1?"mb-0":"",a?"duration-500":""),style:{width:`${m[h]}%`,transition:a?"all 1s":""}},y.createElement("div",{className:Y("absolute left-2 pr-4 flex max-w-full")},k?y.createElement(k,{className:Y(Zo("barIcon"),"flex-none h-5 w-5 mr-2","text-tremor-content","dark:text-dark-tremor-content")}):null,p.href?y.createElement("a",{href:p.href,target:(x=p.target)!==null&&x!==void 0?x:"_blank",rel:"noreferrer",className:Y(Zo("barLink"),"whitespace-nowrap hover:underline truncate text-tremor-default",i?"cursor-pointer":"","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis"),onClick:S=>S.stopPropagation()},p.name):y.createElement("p",{className:Y(Zo("barText"),"whitespace-nowrap truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},p.name))))})),y.createElement("div",{className:Zo("labels")},f.map((p,h)=>{var b;return y.createElement("div",{key:(b=p.key)!==null&&b!==void 0?b:h,className:Y(Zo("labelWrapper"),"flex justify-end items-center","h-8",h===f.length-1?"mb-0":"mb-1.5")},y.createElement("p",{className:Y(Zo("labelText"),"whitespace-nowrap leading-none truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},o(p.value)))})))}J8.displayName="BarList";const Qu=y.forwardRef(J8),zs=at("CategoryBar"),Q8=(e,t)=>e?e/t*100:0,Rge=({values:e})=>{const t=g.useMemo(()=>cj(e),[e]);let r=0,n=0;return y.createElement("div",{className:Y(zs("labels"),"relative flex w-full text-tremor-default h-5 mb-2","text-tremor-content","dark:text-dark-tremor-content")},e.slice(0,e.length).map((o,a)=>{r+=o;const i=(o>=.1*t||n>=.09*t)&&t-r>=.15*t&&r>=.1*t;n=i?0:n+=o;const s=Q8(o,t);return y.createElement("div",{key:`item-${a}`,className:"flex items-center justify-end",style:{width:`${s}%`}},y.createElement("span",{className:Y(i?"block":"hidden","left-1/2 translate-x-1/2")},r))}),y.createElement("div",{className:Y("absolute bottom-0 flex items-center left-0")},"0"),y.createElement("div",{className:Y("absolute bottom-0 flex items-center right-0")},t))},Fge=y.forwardRef((e,t)=>{const{values:r=[],colors:n=Bo,markerValue:o,showLabels:a=!0,tooltip:i,showAnimation:s=!1,className:l}=e,c=Te(e,["values","colors","markerValue","showLabels","tooltip","showAnimation","className"]),d=g.useMemo(()=>((b,v,x)=>{if(b===void 0)return"";let k=0;for(let S=0;S<v.length;S++){const j=v[S],O=_e(x[S],Le.background).bgColor;if(k+=j,k>=b)return O}return""})(o,r,n),[o,r,n]),{tooltipProps:f,getReferenceProps:m}=Fn(),p=g.useMemo(()=>cj(r),[r]),h=g.useMemo(()=>Q8(o,p),[o,p]);return y.createElement(y.Fragment,null,y.createElement(On,Object.assign({text:i},f)),y.createElement("div",Object.assign({ref:t,className:Y(zs("root"),l)},c),a?y.createElement(Rge,{values:r}):null,y.createElement("div",{className:Y(zs("barWrapper"),"relative w-full flex items-center h-2")},y.createElement("div",{className:Y("flex-1 flex items-center h-full overflow-hidden rounded-tremor-full")},r.map((b,v)=>{var x;const k=(x=n[v])!==null&&x!==void 0?x:"gray",S=b/p*100;return y.createElement("div",{key:`item-${v}`,className:Y(zs("categoryBar"),"h-full",_e(k,Le.background).bgColor),style:{width:`${S}%`}})})),o!==void 0?y.createElement("div",Object.assign({ref:f.refs.setReference,className:Y(zs("markerWrapper"),"absolute right-1/2 -translate-x-1/2 w-5"),style:{left:`${h}%`,transition:s?"all 1s":""}},m),y.createElement("div",{className:Y(zs("marker"),"ring-2 mx-auto rounded-tremor-full h-4 w-1","ring-tremor-brand-inverted","dark:ring-dark-tremor-brand-inverted",d)})):null)))});Fge.displayName="CategoryBar";const lA={[tr.Increase]:{bgColor:_e(qe.Emerald,Le.background).bgColor},[tr.ModerateIncrease]:{bgColor:_e(qe.Emerald,Le.background).bgColor},[tr.Decrease]:{bgColor:_e(qe.Rose,Le.background).bgColor},[tr.ModerateDecrease]:{bgColor:_e(qe.Rose,Le.background).bgColor},[tr.Unchanged]:{bgColor:_e(qe.Orange,Le.background).bgColor}},qu=at("DeltaBar"),$ge=y.forwardRef((e,t)=>{const{value:r,isIncreasePositive:n=!0,showAnimation:o=!1,className:a,tooltip:i}=e,s=Te(e,["value","isIncreasePositive","showAnimation","className","tooltip"]),l=f9((f=>f>=0?tr.Increase:tr.Decrease)(r),n),{tooltipProps:c,getReferenceProps:d}=Fn();return y.createElement(y.Fragment,null,y.createElement(On,Object.assign({text:i},c)),y.createElement("div",Object.assign({ref:t,className:Y(qu("root"),"relative flex items-center w-full rounded-tremor-full h-2","bg-tremor-background-subtle","dark:bg-dark-tremor-background-subtle",a)},s),y.createElement("div",{className:"flex justify-end h-full w-1/2"},r<0?y.createElement("div",Object.assign({ref:c.refs.setReference,className:Y(qu("negativeDeltaBar"),"rounded-l-tremor-full",lA[l].bgColor),style:{width:`${Math.abs(r)}%`,transition:o?"all duration-300":""}},d)):null),y.createElement("div",{className:Y(qu("separator"),"ring-2 z-10 rounded-tremor-full h-4 w-1","ring-tremor-brand-inverted bg-tremor-background-emphasis","dark:ring-dark-tremor-brand-inverted dark:bg-dark-tremor-background-emphasis")}),y.createElement("div",{className:Y(qu("positiveDeltaBarWrapper"),"flex justify-start h-full w-1/2")},r>=0?y.createElement("div",Object.assign({ref:c.refs.setReference,className:Y(qu("positiveDeltaBar"),"rounded-r-tremor-full",lA[l].bgColor),style:{width:`${Math.abs(r)}%`,transition:o?"all 1s":""}},d)):null)))});$ge.displayName="DeltaBar";const _f=at("MarkerBar"),Bge=y.forwardRef((e,t)=>{const{value:r,minValue:n,maxValue:o,markerTooltip:a,rangeTooltip:i,showAnimation:s=!1,color:l,className:c}=e,d=Te(e,["value","minValue","maxValue","markerTooltip","rangeTooltip","showAnimation","color","className"]),{tooltipProps:f,getReferenceProps:m}=Fn(),{tooltipProps:p,getReferenceProps:h}=Fn();return y.createElement("div",Object.assign({ref:t,className:Y(_f("root"),"relative flex items-center w-full rounded-tremor-full h-2","bg-tremor-background-subtle","dark:bg-dark-tremor-background-subtle",c)},d),n!==void 0&&o!==void 0?y.createElement(y.Fragment,null,y.createElement(On,Object.assign({text:i},p)),y.createElement("div",Object.assign({ref:p.refs.setReference,className:Y(_f("rangeBar"),"absolute h-full rounded-tremor-full","bg-tremor-content-subtle","dark:bg-dark-tremor-content-subtle"),style:{left:`${n}%`,width:o-n+"%",transition:s?"all duration-300":""}},h))):null,y.createElement(On,Object.assign({text:a},f)),y.createElement("div",Object.assign({ref:f.refs.setReference,className:Y(_f("markerWrapper"),"absolute right-1/2 -translate-x-1/2 w-5"),style:{left:`${r}%`,transition:s?"all 1s":""}},m),y.createElement("div",{className:Y(_f("marker"),"ring-2 mx-auto rounded-tremor-full h-4 w-1","ring-tremor-brand-inverted","dark:ring-dark-tremor-brand-inverted",l?_e(l,Le.background).bgColor:"dark:bg-dark-tremor-brand bg-tremor-brand")})))});Bge.displayName="MarkerBar";const Wu=at("ProgressBar"),yk=y.forwardRef((e,t)=>{const{value:r,label:n,color:o,tooltip:a,showAnimation:i=!1,className:s}=e,l=Te(e,["value","label","color","tooltip","showAnimation","className"]),{tooltipProps:c,getReferenceProps:d}=Fn();return y.createElement(y.Fragment,null,y.createElement(On,Object.assign({text:a},c)),y.createElement("div",Object.assign({ref:t,className:Y(Wu("root"),"flex items-center w-full",s)},l),y.createElement("div",Object.assign({ref:c.refs.setReference,className:Y(Wu("progressBarWrapper"),"relative flex items-center w-full rounded-tremor-full bg-opacity-20 h-2",o?_e(o,Le.background).bgColor:"bg-tremor-brand-muted/50 dark:bg-dark-tremor-brand-muted")},d),y.createElement("div",{className:Y(Wu("progressBar"),"flex-col h-full rounded-tremor-full",o?_e(o,Le.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",i?"transition-all duration-300 ease-in-out":""),style:{width:`${r}%`}})),n?y.createElement("div",{className:Y(Wu("labelWrapper"),"w-16 truncate text-right ml-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},y.createElement("p",{className:Y(Wu("label"),"shrink-0 whitespace-nowrap truncate text-tremor-default")},n)):null))});yk.displayName="ProgressBar";const zge=at("ProgressBar"),uA={xs:{radius:15,strokeWidth:3},sm:{radius:19,strokeWidth:4},md:{radius:32,strokeWidth:6},lg:{radius:52,strokeWidth:8},xl:{radius:80,strokeWidth:10}},Hge=y.forwardRef((e,t)=>{const{value:r,size:n="md",className:o,showAnimation:a=!0,color:i,tooltip:s,radius:l,strokeWidth:c,children:d}=e,f=Te(e,["value","size","className","showAnimation","color","tooltip","radius","strokeWidth","children"]),m=(p=r)===void 0?0:p>100?100:p;var p;const h=l??uA[n].radius,b=c??uA[n].strokeWidth,v=h-b/2,x=2*v*Math.PI,k=x-m/100*x,{tooltipProps:S,getReferenceProps:j}=Fn();return y.createElement(y.Fragment,null,y.createElement(On,Object.assign({text:s},S)),y.createElement("div",Object.assign({ref:t,className:Y(zge("root"),"flex flex-col items-center justify-center",o)},f),y.createElement("svg",Object.assign({ref:S.refs.setReference,width:2*h,height:2*h,viewBox:`0 0 ${2*h} ${2*h}`,className:"transform -rotate-90"},j),y.createElement("circle",{r:v,cx:h,cy:h,strokeWidth:b,fill:"transparent",stroke:"",strokeLinecap:"round",className:Y("transition-colors ease-linear",i?`${_e(i,Le.background).strokeColor} opacity-20 dark:opacity-25`:"stroke-tremor-brand-muted/50 dark:stroke-dark-tremor-brand-muted")}),m>=0?y.createElement("circle",{r:v,cx:h,cy:h,strokeWidth:b,strokeDasharray:x+" "+x,strokeDashoffset:k,fill:"transparent",stroke:"",strokeLinecap:"round",className:Y("transition-colors ease-linear",i?_e(i,Le.background).strokeColor:"stroke-tremor-brand dark:stroke-dark-tremor-brand",a?"transition-all duration-300 ease-in-out":"")}):null),y.createElement("div",{className:Y("absolute flex")},d)))});Hge.displayName="ProgressCircle";const eI=at("Tracker"),tI=y.forwardRef((e,t)=>{const{color:r,tooltip:n}=e,o=Te(e,["color","tooltip"]),{tooltipProps:a,getReferenceProps:i}=Fn();return y.createElement("div",Object.assign({ref:ja([t,a.refs.setReference]),className:Y(eI("trackingBlock"),"w-full h-full rounded-[1px] first:rounded-l-[4px] last:rounded-r-[4px]",_e(r??"gray",Le.background).bgColor)},o,i),y.createElement(On,Object.assign({text:n},a)))});tI.displayName="TrackerBlock";const qge=y.forwardRef((e,t)=>{const{data:r=[],className:n}=e,o=Te(e,["data","className"]);return y.createElement("div",Object.assign({ref:t,className:Y(eI("root"),"h-10 flex items-center space-x-0.5",n)},o),r.map((a,i)=>{var s;return y.createElement(tI,{key:(s=a.key)!==null&&s!==void 0?s:i,color:a.color,tooltip:a.tooltip})}))});qge.displayName="Tracker";function Bn(e,t=!1,r=!0){const[n,o]=Cr(`feature_preview_${e}`,t?"true":void 0);return g.useEffect(()=>{r&&n==="false"&&o(void 0)},[r,n,o]),[n==="true",a=>{o(a?"true":r?void 0:"false")}]}function rI(e){const t=e&&e.reason||"",r=e&&e.status;switch(t){case"invalid_request":return'Invalid request. Submit as {"license_key": "..."}.';case"invalid_format":return"Invalid format. Did you paste JSON or a file? Paste only the license key string.";case"ingress_unreachable":return"Activation service unreachable. Check network/ingress connectivity and try again.";case"activation_error":return`Activation failed. ${e?.details||"Please try again or contact support."}`;case"invalid_key":return"Invalid license key. Is this the exact key? Check for typos or request a new key.";case"revoked":return"License revoked. Contact support to resolve or obtain a new license.";case"expired":return"License expired. Renew your license or enter a valid key.";case"storage_error":return"Failed to store the license locally. Ensure write permissions and retry.";case"internal_error":return"Server error during activation. Please try again shortly.";default:return r===401?"Unauthorized: Invalid license key.":r===403?"Forbidden: License revoked.":r===410?"Expired license. Please renew or use a new key.":e?.message||"Failed to update license"}}function Wge({open:e,onClose:t,onSubmit:r}){const[n,o]=g.useState(""),[a,i]=g.useState(""),[s,l]=g.useState(!1),c="license-file-input";if(g.useEffect(()=>{e&&(o(""),i(""),l(!1))},[e]),!e)return null;const d=async()=>{i("");const m=(n||"").trim();if(!m){i("Please paste a license key.");return}try{l(!0),await r(m),t()}catch(p){const h=rI(p);i(h),l(!1)}},f=async m=>{const p=m.target.files&&m.target.files[0];if(p)try{const h=await p.text();o(h.trim()),i("")}catch{i("Failed to read license file.")}finally{m.target.value=""}};return u.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[u.jsx("div",{className:"absolute inset-0 bg-black opacity-50",onClick:t}),u.jsxs("div",{className:"relative bg-white dark:bg-gray-950 rounded-lg shadow-xl max-w-2xl w-full mx-4 p-6 z-10",children:[u.jsxs("div",{className:"flex items-center justify-between mb-4",children:[u.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-50",children:"Update License"}),u.jsx("button",{onClick:t,className:"text-gray-600 dark:text-gray-300 hover:text-gray-800 dark:hover:text-gray-100","aria-label":"Close",disabled:s,children:"×"})]}),u.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 mb-3",children:"Paste your license key below or upload a key file."}),u.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[u.jsx("input",{id:c,type:"file",accept:".txt,.key,.license,application/octet-stream,text/plain,application/json",onChange:f,className:"hidden",disabled:s}),u.jsx("button",{type:"button",onClick:()=>{var m;return(m=document.getElementById(c))==null?void 0:m.click()},className:"px-3 py-1.5 text-sm rounded bg-gray-200 dark:bg-gray-800 text-gray-800 dark:text-gray-200 hover:bg-gray-300 dark:hover:bg-gray-700",disabled:s,children:"Upload Key File"}),u.jsx("span",{className:"text-xs text-gray-500",children:"Accepted: .txt, .key, .license"})]}),u.jsx("textarea",{className:`w-full h-48 p-3 rounded border text-sm font-mono ${a?"border-red-500 focus:border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-800 focus:border-blue-500 focus:ring-blue-500"}`,placeholder:"Paste your license key here",value:n,onChange:m=>{o(m.target.value),a&&i("")},disabled:s}),a&&u.jsx("p",{className:"mt-2 text-sm text-red-600",children:a}),u.jsxs("div",{className:"mt-4 flex justify-end gap-3",children:[u.jsx("button",{onClick:t,className:"px-4 py-2 bg-gray-200 dark:bg-gray-800 text-gray-800 dark:text-gray-200 rounded hover:bg-gray-300 dark:hover:bg-gray-700",disabled:s,children:"Cancel"}),u.jsx("button",{onClick:d,className:`px-4 py-2 text-white rounded ${s?"bg-gray-400 cursor-not-allowed":"bg-blue-600 hover:bg-blue-700"}`,disabled:s,children:s?"Updating…":"Update License"})]})]})]})}function Uge({open:e,onClose:t,license:r,onRefresh:n}){var o,a;const[i,s]=g.useState(""),[l,c]=g.useState(!1),[d,f]=g.useState("");if(g.useEffect(()=>{e&&(s(""),c(!1),f(""))},[e]),!e)return null;const m=((o=r?.license)==null?void 0:o.plan)||"unknown",p=r?.license||{},h=r?.features||{},b=((a=r?.usage)==null?void 0:a.features)||{},v=p?.expires_at||null,x=p?.starts_at||null,k=p?.updated_at||null,S=p?.grace_until||null,j=p?.in_grace===!0,O=p?.issuer||null,C=p?.subject||null,N=Object.entries(h||{}),T=K=>{if(!K)return null;const q=new Date(K);return isNaN(q)?K:q.toISOString().slice(0,19).replace("T"," ")},M=async()=>{f("");const K=(i||"").trim();if(!K){f("Please enter a license key.");return}try{c(!0),await n(K),s("")}catch(q){f(rI(q))}finally{c(!1)}},I=new Date,_=v?new Date(v):null,R=S?new Date(S):null,L=_?I>_:!1,F=L&&R?I>R:!1,B=j||L&&R&&I<=R,U=_?I<=_:!1;let $="Unknown",z="",W="bg-gray-400";return F?($="Expired",z=R?`(grace ended ${T(S)})`:"(grace ended)",W="bg-red-600"):B?($="In Grace",z=R?`(until ${T(S)})`:"",W="bg-yellow-500"):U&&($="Active",z=_?`(until ${T(v)})`:"",W="bg-green-600"),u.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[u.jsx("div",{className:"absolute inset-0 bg-black opacity-50",onClick:t}),u.jsxs("div",{className:"relative bg-white dark:bg-gray-950 rounded-lg shadow-xl max-w-3xl w-full mx-4 p-6 z-10",children:[u.jsxs("div",{className:"flex items-center justify-between mb-4",children:[u.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-50",children:"License Overview"}),u.jsx("button",{onClick:t,className:"text-gray-600 dark:text-gray-300 hover:text-gray-800 dark:hover:text-gray-100","aria-label":"Close",disabled:l,children:"×"})]}),u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[u.jsxs("div",{className:"rounded border border-gray-200 dark:border-gray-800 p-3",children:[u.jsx("p",{className:"text-xs uppercase text-gray-500",children:"Status"}),u.jsxs("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-50 flex items-center",children:[u.jsx("span",{className:`inline-block w-2 h-2 rounded-full mr-2 ${W}`}),$,z&&u.jsx("span",{className:"ml-2 text-xs font-normal text-gray-500",children:z})]})]}),u.jsxs("div",{className:"rounded border border-gray-200 dark:border-gray-800 p-3",children:[u.jsx("p",{className:"text-xs uppercase text-gray-500",children:"Plan"}),u.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-50",children:m})]}),u.jsxs("div",{className:"rounded border border-gray-200 dark:border-gray-800 p-3",children:[u.jsx("p",{className:"text-xs uppercase text-gray-500",children:"Issued By"}),u.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-50",children:O||"—"})]}),u.jsxs("div",{className:"rounded border border-gray-200 dark:border-gray-800 p-3",children:[u.jsx("p",{className:"text-xs uppercase text-gray-500",children:"License Key"}),u.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-50",children:C||"—"})]}),u.jsxs("div",{className:"rounded border border-gray-200 dark:border-gray-800 p-3",children:[u.jsx("p",{className:"text-xs uppercase text-gray-500",children:"Last Updated"}),u.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-50",children:T(k)||"—"})]}),u.jsxs("div",{className:"rounded border border-gray-200 dark:border-gray-800 p-3",children:[u.jsx("p",{className:"text-xs uppercase text-gray-500",children:"Starts"}),u.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-50",children:T(x)||"—"})]}),u.jsxs("div",{className:"rounded border border-gray-200 dark:border-gray-800 p-3",children:[u.jsx("p",{className:"text-xs uppercase text-gray-500",children:"Expires"}),u.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-50",children:T(v)||"—"})]}),S&&u.jsxs("div",{className:"rounded border border-gray-200 dark:border-gray-800 p-3",children:[u.jsx("p",{className:"text-xs uppercase text-gray-500",children:"Grace Until"}),u.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-50",children:T(S)})]})]}),u.jsxs("div",{className:"mb-4",children:[u.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-50 mb-2",children:"Features"}),N.length===0&&u.jsx("p",{className:"text-sm text-gray-500",children:"No features available."}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:N.map(([K,q])=>{const J=K.toUpperCase(),V=b?.[K]||{};return u.jsxs("div",{className:"rounded border border-gray-200 dark:border-gray-800 p-3",children:[u.jsx("p",{className:"text-xs uppercase text-gray-500 mb-1",children:J}),u.jsxs("div",{className:"text-xs text-gray-700 dark:text-gray-300 space-y-1",children:["effective_enabled"in q&&u.jsxs("p",{children:["Effective enabled: ",String(q.effective_enabled)]}),"effective_limit"in q&&u.jsxs("p",{children:["Effective limit: ",q.effective_limit??"—"]}),"licensed_enabled"in q&&u.jsxs("p",{children:["Licensed enabled: ",String(q.licensed_enabled)]}),"licensed_limit"in q&&u.jsxs("p",{children:["Licensed limit: ",q.licensed_limit??"—"]}),"default_limit"in q&&u.jsxs("p",{children:["Default limit: ",q.default_limit??"—"]}),"unlimited"in q&&u.jsxs("p",{children:["Unlimited: ",String(q.unlimited)]}),("used"in V||"used"in q)&&u.jsxs("p",{children:["Used: ",V.used??q.used??0]}),("remaining"in V||"remaining"in q)&&u.jsxs("p",{children:["Remaining: ",V.remaining??q.remaining??0]}),("window"in V||"window"in q)&&u.jsxs("p",{children:["Window: ",V.window??q.window??"—"]}),("period_start"in V||"period_start"in q)&&u.jsxs("p",{children:["Period start: ",T(V.period_start??q.period_start)]})]})]},K)})})]}),u.jsxs("div",{className:"mt-2 rounded border border-gray-200 dark:border-gray-800 p-3",children:[u.jsx("p",{className:"text-sm font-semibold text-gray-900 dark:text-gray-50",children:"Refresh License"}),u.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Enter a license key to update the license details."}),u.jsxs("div",{className:"mt-2 flex gap-2",children:[u.jsx("input",{type:"text",value:i,onChange:K=>s(K.target.value),placeholder:"INSPECTR-...",className:"flex-1 rounded border border-gray-300 dark:border-gray-800 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",disabled:l}),u.jsx("button",{type:"button",onClick:M,className:`px-4 py-2 text-white rounded ${l?"bg-gray-400 cursor-not-allowed":"bg-blue-600 hover:bg-blue-700"}`,disabled:l,children:l?"Refreshing…":"Refresh License"})]}),d&&u.jsx("p",{className:"mt-2 text-sm text-red-600",children:d})]})]})]})}const Kge=()=>{var e,t,r,n,o,a,i,s,l,c,d,f,m,p;const{client:h,setToast:b}=mr(),[v]=Bn("feat_export_mcp_server"),[x]=Bn("feat_rules_ui",!1),[k,S]=g.useState(null),[j,O]=g.useState(null),[C,N]=g.useState(!0),[T,M]=g.useState(!1),[I,_]=g.useState(""),[R,L]=g.useState(!1),[F,B]=g.useState(!1),[U,$]=g.useState(!1),z=y.useCallback(async(Je=!1)=>{var dt;try{Je?N(!0):M(!0);let Gt=null,Rr=null;(dt=h?.service)!=null&&dt.getLicense?[Gt,Rr]=await Promise.all([h.service.getMetrics(),h.service.getLicense().catch(()=>null)]):Gt=await h.service.getMetrics(),S(Gt),Rr&&O(Rr),_("")}catch(Gt){console.error("Error fetching metrics:",Gt),_(Gt.message||"Failed to load metrics")}finally{Je?N(!1):M(!1)}},[h]);g.useEffect(()=>{z(!0)},[z]);const W=async Je=>{await h.service.putLicense(Je),b?.({message:"License updated",subMessage:"License applied successfully."}),await z(!1)},K=async Je=>{await h.service.putLicense(Je),b?.({message:"License refreshed",subMessage:"License updated successfully."}),await z(!1)},q=k?.operations||{},J=((t=(e=k?.generic)==null?void 0:e.totals)==null?void 0:t.sse)||{},V=((n=(r=k?.generic)==null?void 0:r.totals)==null?void 0:n.mcp)||{},me=((a=(o=k?.generic)==null?void 0:o.totals)==null?void 0:a.features)||{},X=k?.features||{},ce=k?.mcp||{},oe=(()=>{var Je;const dt=(Je=j?.features)==null?void 0:Je.mcp;if(dt)return dt.unlimited===!0?!0:typeof dt.effective_limit=="number"?!1:dt.effective_enabled===!0&&typeof dt.default_limit!="number"})(),Oe=(()=>{var Je;const dt=(Je=j?.features)==null?void 0:Je.mcp;return!dt||dt.unlimited===!0?null:typeof dt.effective_limit=="number"?dt.effective_limit:typeof dt.default_limit=="number"?dt.default_limit:null})(),te=(i=j?.features)==null?void 0:i.mcp,Ne=(l=(s=j?.usage)==null?void 0:s.features)==null?void 0:l.mcp,ve=(()=>{const Je=Ne?.window||te?.window;return Je?Je.charAt(0).toUpperCase()+Je.slice(1):null})(),G=(()=>{const Je=Ne?.period_start||te?.period_start;if(!Je)return null;const dt=new Date(Je);return isNaN(dt)?null:dt.toISOString().slice(0,10)})(),ye=(()=>{const Je=Ne?.period_end||te?.period_end;if(!Je)return null;const dt=new Date(Je);return isNaN(dt)?null:dt.toISOString().slice(0,10)})(),le=typeof Ne?.used=="number"?Ne.used:typeof V.requests=="number"?V.requests:0,ge=Oe?Math.min(100,le/Oe*100):0,Ce=(c=j?.features)==null?void 0:c.rules,Me=(f=(d=j?.usage)==null?void 0:d.features)==null?void 0:f.rules,Ye=(()=>{const Je=Ce;return!Je||Je.unlimited===!0?null:typeof Je.effective_limit=="number"?Je.effective_limit:typeof Je.default_limit=="number"?Je.default_limit:null})();(()=>{const Je=Me?.window||Ce?.window;return Je?Je.charAt(0).toUpperCase()+Je.slice(1):null})(),(()=>{const Je=Me?.period_start||Ce?.period_start;if(!Je)return null;const dt=new Date(Je);return isNaN(dt)?null:dt.toISOString().slice(0,10)})(),(()=>{const Je=Me?.period_end||Ce?.period_end;if(!Je)return null;const dt=new Date(Je);return isNaN(dt)?null:dt.toISOString().slice(0,10)})();const Ve=((p=(m=k?.generic)==null?void 0:m.totals)==null?void 0:p.rules)||{},$e=k?.rules||{},Ze=typeof Ve.definitions=="number"?Ve.definitions:typeof $e.definitions_total=="number"?$e.definitions_total:0,rt=Ye?Math.min(100,Ze/Ye*100):0,nt=(()=>{var Je;const dt=(((Je=j?.license)==null?void 0:Je.plan)||"").toString().toLowerCase(),Gt=(ce?.plan||"").toString().toLowerCase(),Rr=dt||Gt;return Rr==="pro"||Rr==="professional"||Rr==="paid"?"pro":["open_source","open-source","opensource","oss","open source"].includes(Rr)?"open_source":oe?"pro":"open_source"})(),ht=nt==="pro"?"Pro":"Open Source",ft=nt==="pro"?"bg-brand-primary text-gray-900 ":"bg-white dark:bg-gray-800/10 border border-brand-primary text-brand-primary",vt=(()=>{var Je;const dt=(Je=k?.meta)==null?void 0:Je.installed_at;if(!dt)return null;const Gt=new Date(dt);return isNaN(Gt)?null:Gt.toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"})})(),Qt=nt==="open_source"||typeof Oe=="number"&&ge>=90;return g.useEffect(()=>{k&&L(Qt)},[Qt,k]),C?u.jsxs(fr,{className:"p-6",children:[u.jsx(Gn,{children:"Usage Overview"}),u.jsx(zt,{className:"mt-2",children:"Loading usage…"})]}):I?u.jsxs(fr,{className:"p-6",children:[u.jsx(Gn,{children:"Usage Overview"}),u.jsxs(zt,{className:"mt-2 text-red-600 dark:text-red-400",children:["Error loading metrics: ",I]})]}):u.jsxs("div",{className:"grid grid-cols-1 gap-4",children:[u.jsx("header",{children:u.jsxs("div",{className:"sm:flex sm:items-center sm:justify-between",children:[u.jsx("h3",{className:"text-tremor-title font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Usage Overview"}),u.jsx("div",{className:"mt-2 sm:mt-0",children:u.jsxs("div",{className:"flex gap-2",children:[u.jsx(al,{onClick:()=>$(!0),children:"License Details"}),u.jsx(al,{onClick:()=>B(!0),children:"Update License"}),u.jsx(al,{onClick:()=>z(!1),children:T?"Loading":"Refresh"})]})})]})}),u.jsxs("div",{className:"rounded-lg bg-gray-200 p-6 ring-1 ring-inset ring-gray-200 dark:bg-gray-400/10 dark:ring-gray-800",children:[u.jsxs("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-50",children:["This workspace is currently on"," ",u.jsx("span",{className:`inline-flex items-center rounded-full px-3 py-1 text-xs font-medium ${ft}`,children:ht})]}),u.jsxs("p",{className:"mt-1 max-w-2xl text-sm leading-6 text-gray-500",children:[nt==="pro"?"You're on Pro — enjoy premium features and priority support.":"Boost your analytics and unlock advanced features with our premium plans.",u.jsxs("a",{href:"https://inspectr.dev/pricing",target:"_blank",rel:"noreferrer noopener",className:"inline-flex items-center gap-1 text-indigo-600 dark:text-indigo-500",children:[nt==="pro"?"Explore features":"Compare plans",u.jsx("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor","aria-hidden":"true",className:"remixicon size-4 shrink-0",children:u.jsx("path",{d:"M16.0037 9.41421L7.39712 18.0208L5.98291 16.6066L14.5895 8H7.00373V6H18.0037V17H16.0037V9.41421Z"})})]})]})]}),vt&&u.jsxs(zt,{className:"-mt-2 text-sm text-gray-500",children:["Usage metrics since ",vt]}),u.jsx(Wge,{open:F,onClose:()=>B(!1),onSubmit:W}),u.jsx(Uge,{open:U,onClose:()=>$(!1),license:j,onRefresh:K}),u.jsxs(fr,{className:"p-6",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("img",{src:XS,width:24,height:24,alt:"","aria-hidden":"true",className:"inline-block"}),u.jsx(Gn,{className:"!mb-0",children:"Operations"})]}),u.jsx(zt,{className:"mt-1 text-gray-500",children:"Metrics on requests, responses, and events handled by Inspectr."}),u.jsxs("div",{className:"mt-4 grid grid-cols-3 gap-4",children:[u.jsxs("div",{children:[u.jsx(zt,{children:"Total requests"}),u.jsx(ua,{children:q.total_requests??(q.requests_local??0)+(q.requests_ingress??0)}),u.jsx("div",{className:"mt-3",children:u.jsx(Qu,{data:[{name:"proxy",value:q.requests_local??0,color:"cyan"},{name:"ingress",value:q.requests_ingress??0,color:"yellow"}]})})]}),u.jsxs("div",{children:[u.jsx(zt,{children:"Total responses"}),u.jsx(ua,{children:q.total_responses??(q.responses_local??0)+(q.responses_ingress??0)}),u.jsx("div",{className:"mt-3",children:u.jsx(Qu,{data:[{name:"proxy",value:q.responses_local??0,color:"cyan"},{name:"ingress",value:q.responses_ingress??0,color:"yellow"}]})})]}),u.jsxs("div",{children:[u.jsx(zt,{children:"Event frames"}),u.jsx(ua,{children:q.total_event_frames??(q.event_frames_local??0)+(q.event_frames_ingress??0)}),u.jsx("div",{className:"mt-3",children:u.jsx(Qu,{data:[{name:"proxy",value:q.event_frames_local??0,color:"cyan"},{name:"ingress",value:q.event_frames_ingress??0,color:"yellow"}]})})]})]})]}),u.jsxs(fr,{className:"p-6",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("img",{src:XS,width:24,height:24,alt:"","aria-hidden":"true",className:"inline-block"}),u.jsx(Gn,{className:"!mb-0",children:"Features"})]}),u.jsx(zt,{className:"mt-1 text-gray-500",children:"Usage metrics for core Inspectr features."}),u.jsxs("div",{className:"mt-4 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Registrations"}),u.jsx("p",{className:"font-semibold text-tremor-metric text-tremor-content-strong dark:text-dark-tremor-content-strong",children:me.registrations??X.registration_requests??0})]}),u.jsxs("div",{children:[u.jsx("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Token refresh"}),u.jsx("p",{className:"font-semibold text-tremor-metric text-tremor-content-strong dark:text-dark-tremor-content-strong",children:me.token_refresh??X.token_refresh_requests??0})]}),u.jsxs("div",{children:[u.jsx("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Launches"}),u.jsx("p",{className:"font-semibold text-tremor-metric text-tremor-content-strong dark:text-dark-tremor-content-strong",children:me.launches??0})]}),u.jsxs("div",{children:[u.jsx("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Ingress registrations"}),u.jsx("p",{className:"font-semibold text-tremor-metric text-tremor-content-strong dark:text-dark-tremor-content-strong",children:me.ingress_registrations??0})]})]})]}),u.jsxs(fr,{className:"p-6",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("img",{src:bH,width:24,height:24,alt:"","aria-hidden":"true",className:"inline-block"}),u.jsx(Gn,{className:"!mb-0",children:"Inspectr Connections"})]}),u.jsx(zt,{className:"mt-1 text-gray-500",children:"Overview of metrics related to the Inspectr App SSE connections to Inspectr."}),u.jsxs("div",{className:"mt-4 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Active connections"}),u.jsx("p",{className:"font-semibold text-tremor-metric text-tremor-content-strong dark:text-dark-tremor-content-strong",children:J.active??0})]}),u.jsxs("div",{children:[u.jsx("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Reconnect attempts"}),u.jsx("p",{className:"font-semibold text-tremor-metric text-tremor-content-strong dark:text-dark-tremor-content-strong",children:J.reconnect_attempts??0})]}),u.jsxs("div",{children:[u.jsx("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Total connections"}),u.jsx("p",{className:"font-semibold text-tremor-metric text-tremor-content-strong dark:text-dark-tremor-content-strong",children:J.total_connections??0})]}),u.jsxs("div",{children:[u.jsx("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Total disconnections"}),u.jsx("p",{className:"font-semibold text-tremor-metric text-tremor-content-strong dark:text-dark-tremor-content-strong",children:J.total_disconnections??0})]})]})]}),x&&u.jsxs(fr,{className:"p-6",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("img",{src:ZS,width:24,height:24,alt:"","aria-hidden":"true",className:"inline-block"}),u.jsx(Gn,{className:"!mb-0",children:"Rules"})]}),u.jsx(zt,{className:"mt-1 text-gray-500",children:"Overview of Rules definitions and actions usage."}),Ye!==null&&u.jsxs("div",{className:"mt-6",children:[u.jsx(zt,{className:"mb-2",children:"Definitions usage"}),u.jsx(yk,{value:rt,color:"indigo"}),u.jsxs(zt,{className:"mt-2",children:[Ze," of ",Ye," rules defined"]}),u.jsx(zt,{className:"mt-1 text-gray-500",children:"Limit is the maximum number of rule definitions. No monthly reset."})]}),u.jsxs("div",{className:"mt-6 grid grid-cols-1 md:grid-cols-2 gap-6",children:[u.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Rules executed"}),u.jsx("p",{className:"font-semibold text-tremor-metric text-tremor-content-strong dark:text-dark-tremor-content-strong",children:Ve.actions_executed??$e.actions_executed??0})]}),u.jsxs("div",{children:[u.jsx("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Actions triggered"}),u.jsx("p",{className:"font-semibold text-tremor-metric text-tremor-content-strong dark:text-dark-tremor-content-strong",children:Ve.actions_triggered??0})]}),u.jsxs("div",{children:[u.jsx("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Historically operations processed"}),u.jsx("p",{className:"font-semibold text-tremor-metric text-tremor-content-strong dark:text-dark-tremor-content-strong",children:Ve.apply_processed??0})]}),u.jsxs("div",{children:[u.jsx("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Historically operations updated"}),u.jsx("p",{className:"font-semibold text-tremor-metric text-tremor-content-strong dark:text-dark-tremor-content-strong",children:Ve.apply_updated??0})]})]}),u.jsxs("div",{children:[u.jsx("h4",{className:"text-tremor-title font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong mb-2",children:"Actions by type"}),u.jsx(Qu,{data:Object.entries($e.actions_by_type||{}).map(([Je,dt])=>({name:Je,value:dt}))})]})]})]}),v&&u.jsxs(fr,{className:"p-6",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("img",{src:vH,width:24,height:24,alt:"","aria-hidden":"true",className:"inline-block"}),u.jsx(Gn,{className:"!mb-0",children:"Inspectr MCP Server"})]}),u.jsx(zt,{className:"mt-1 text-gray-500",children:"Overview of Model Context Protocol (MCP) activity on the Inspectr MCP server, including usage across tools, resources, and prompts."}),R&&Qt&&u.jsxs("div",{className:"mt-4 rounded-md bg-gray-50 p-6 ring-1 ring-inset ring-gray-200 dark:bg-gray-900 dark:ring-gray-800",children:[u.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-50",children:"Want to upgrade?"}),u.jsx("p",{className:"mt-2 text-sm/6 text-gray-500 dark:text-gray-500",children:"Elevate your workspace and boost productivity with premium features. See our pro plans and upgrade today."}),u.jsxs("div",{className:"mt-6 flex items-center space-x-2",children:[u.jsx("a",{href:"https://inspectr.dev/pricing",target:"_blank",rel:"noreferrer noopener",className:"relative inline-flex items-center justify-center whitespace-nowrap rounded-md border px-3 py-2 text-center text-sm font-medium shadow-sm transition-all duration-100 ease-in-out disabled:pointer-events-none disabled:shadow-none outline outline-offset-2 outline-0 focus-visible:outline-2 outline-blue-500 dark:outline-blue-500 border-transparent text-white dark:text-white bg-blue-500 dark:bg-blue-500 hover:bg-blue-600 dark:hover:bg-blue-600 disabled:bg-blue-300 disabled:text-white disabled:dark:bg-blue-800 disabled:dark:text-blue-400",children:"Plans"}),u.jsx("button",{type:"button",className:"relative inline-flex items-center justify-center whitespace-nowrap rounded-md border px-3 py-2 text-center text-sm font-medium shadow-sm transition-all duration-100 ease-in-out disabled:pointer-events-none disabled:shadow-none outline outline-offset-2 outline-0 focus-visible:outline-2 outline-blue-500 dark:outline-blue-500 border-gray-300 dark:border-gray-800 text-gray-900 dark:text-gray-50 bg-white dark:bg-gray-950 hover:bg-gray-50 dark:hover:bg-gray-900/60 disabled:text-gray-400 disabled:dark:text-gray-600",onClick:()=>L(!1),children:"Dismiss"})]})]}),Oe&&u.jsxs("div",{className:"mt-6",children:[u.jsx(zt,{className:"mb-2",children:"Remaining usage"}),u.jsx(yk,{value:ge,color:"blue"}),u.jsxs(zt,{className:"mt-2",children:[le," of ",Oe," uses"]}),(ve||G||ye)&&u.jsxs(zt,{className:"mt-1 text-gray-500",children:[ve?`${ve} window`:"Usage window",G?` since ${G}`:"",ye?` — resets on ${ye}`:""]})]}),u.jsxs("div",{className:"mt-6 grid grid-cols-1 md:grid-cols-2 gap-6",children:[u.jsxs("div",{className:"grid grid-cols-1 gap-4",children:[u.jsx("h4",{className:"text-tremor-title font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Usage"}),u.jsxs("div",{children:[u.jsxs("p",{className:"flex items-center text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:[u.jsx("img",{src:ZS,width:16,height:16,alt:"","aria-hidden":"true",className:"w-4 h-4 mr-2"}),"Total tools"]}),u.jsx("p",{className:"font-semibold text-tremor-metric text-tremor-content-strong dark:text-dark-tremor-content-strong",children:V.tools??0})]}),u.jsxs("div",{children:[u.jsxs("p",{className:"flex items-center text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:[u.jsx("img",{src:yH,width:16,height:16,alt:"","aria-hidden":"true",className:"w-4 h-4 mr-2"}),"Total resources"]}),u.jsx("p",{className:"font-semibold text-tremor-metric text-tremor-content-strong dark:text-dark-tremor-content-strong",children:V.resources??0})]}),u.jsxs("div",{children:[u.jsxs("p",{className:"flex items-center text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:[u.jsx("img",{src:xH,width:16,height:16,alt:"","aria-hidden":"true",className:"w-4 h-4 mr-2"}),"Total prompts"]}),u.jsx("p",{className:"font-semibold text-tremor-metric text-tremor-content-strong dark:text-dark-tremor-content-strong",children:V.prompts??0})]})]}),u.jsxs("div",{className:"grid grid-cols-1 gap-4",children:[u.jsx("h4",{className:"text-tremor-title font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Traffic"}),u.jsxs("div",{children:[u.jsx("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Total requests"}),u.jsx("p",{className:"font-semibold text-tremor-metric text-tremor-content-strong dark:text-dark-tremor-content-strong",children:V.requests??0})]}),u.jsxs("div",{children:[u.jsx("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Total responses"}),u.jsx("p",{className:"font-semibold text-tremor-metric text-tremor-content-strong dark:text-dark-tremor-content-strong",children:V.responses??0})]})]})]})]})]})};function Vge(...e){return e.filter(Boolean).join(" ")}function Gge({overall:e}){if(!e)return u.jsx("div",{children:"Loading KPI..."});const t=[{name:"Total Requests",stat:e.total_requests,change:"",changeType:"neutral"},{name:"Average Response Time",stat:`${e.average_response_time} ms`,change:"",changeType:"neutral"},{name:"Success Rate",stat:`${(e.success_rate*100).toFixed(1)}%`,change:"",changeType:"neutral"},{name:"Error Rate",stat:`${(e.error_rate*100).toFixed(1)}%`,change:"",changeType:"neutral"}],r=t.length;return u.jsx("dl",{className:`grid grid-cols-1 gap-${r} sm:grid-cols-2 lg:grid-cols-${r}`,children:t.map(n=>u.jsxs(fr,{children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("dt",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:n.name}),n.change&&u.jsx("span",{className:Vge(n.changeType==="positive"?"bg-emerald-100 text-emerald-800 ring-emerald-600/10 dark:bg-emerald-400/10 dark:text-emerald-500 dark:ring-emerald-400/20":"bg-red-100 text-red-800 ring-red-600/10 dark:bg-red-400/10 dark:text-red-500 dark:ring-red-400/20","inline-flex items-center rounded-tremor-small px-2 py-1 text-tremor-label font-medium ring-1 ring-inset"),children:n.change})]}),u.jsx("dd",{className:"text-tremor-metric font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:n.stat})]},n.name))})}function Yge(...e){return e.filter(Boolean).join(" ")}function Xge({title:e="Traffic Volume",data:t,valueFormatter:r}){const n=Array.isArray(t)?t:[],o=n.reduce((s,l)=>(s["2xx"]+=l["2xx"]||0,s["3xx"]+=l["3xx"]||0,s["4xx"]+=l["4xx"]||0,s["5xx"]+=l["5xx"]||0,s),{"2xx":0,"3xx":0,"4xx":0,"5xx":0}),a=r||(s=>Intl.NumberFormat("en-US",{maximumFractionDigits:0,notation:"compact",compactDisplay:"short"}).format(s)),i=[{name:"2xx",value:o["2xx"],color:"bg-blue-500"},{name:"3xx",value:o["3xx"],color:"bg-orange-500"},{name:"4xx",value:o["4xx"],color:"bg-cyan-500"},{name:"5xx",value:o["5xx"],color:"bg-red-500"}];return u.jsxs(fr,{className:"mt-4 h-120 rounded-tremor-small p-2",children:[u.jsx("h3",{className:"font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:e}),u.jsx("ul",{role:"list",className:"mt-6 grid gap-3 sm:grid-cols-4 md:grid-cols-4",children:i.map(s=>u.jsxs("li",{className:"rounded-tremor-small border border-tremor-border px-3 py-2 text-left dark:border-dark-tremor-border",children:[u.jsxs("div",{className:"flex items-center space-x-1.5",children:[u.jsx("span",{className:Yge(s.color,"size-2.5 rounded-sm"),"aria-hidden":"true"}),u.jsx("p",{className:"text-tremor-label text-tremor-content dark:text-dark-tremor-content",children:s.name})]}),u.jsx("p",{className:"mt-0.5 font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:a(s.value)})]},s.name))}),u.jsx(ak,{data:n,index:"date",categories:["2xx","3xx","4xx","5xx"],colors:["blue","orange","cyan","red"],showLegend:!1,valueFormatter:a,yAxisWidth:50,stack:!0,className:"mt-6 hidden h-80 w-full sm:block"}),u.jsx(ak,{data:n,index:"date",categories:["2xx","3xx","4xx","5xx"],colors:["blue","orange","cyan","red"],showLegend:!1,valueFormatter:a,showYAxis:!1,stack:!0,className:"mt-6 h-48 w-full sm:hidden"})]})}function Zge(e,t){return t==="ms"?`${Math.round(e)}`:new Intl.NumberFormat("en-US",{maximumFractionDigits:0,notation:"compact",compactDisplay:"short"}).format(e)}function c0({title:e="Response Times",data:t,metricKey:r=[],metricUnit:n="",highlightValue:o="",highlightLabel:a=""}){const i=Array.isArray(r)?r:[r],s=l=>Zge(l,n);return u.jsxs(fr,{className:"mt-4 h-120 rounded-tremor-small p-2",children:[u.jsx("h3",{className:"font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:e}),u.jsxs("div",{className:"p-6",children:[u.jsx("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:a}),u.jsxs("p",{className:"text-2xl font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:[o,n?` ${n}`:""]}),u.jsx(td,{data:t,index:"date",categories:i,showGradient:!1,valueFormatter:s,className:"mt-8 hidden h-80 w-full sm:block"}),u.jsx(td,{data:t,index:"date",categories:i,showGradient:!1,valueFormatter:s,className:"mt-8 h-48 w-full sm:hidden"})]})]})}function Jge(...e){return e.filter(Boolean).join(" ")}function nI({className:e=""}){return u.jsx("div",{className:Jge("flex items-center justify-center w-full h-full border border-dashed rounded-tremor-default border-tremor-border dark:border-dark-tremor-border",e),children:u.jsx("p",{className:"text-tremor-content text-tremor-default dark:text-dark-tremor-content",children:"No data"})})}const Qge=e=>`${Intl.NumberFormat("us").format(e).toString()}`;function Ra({title:e,data:t,toggleable:r=!0}){const[n,o]=g.useState(!0),a=r?n:!0,i=t?t.map(l=>({name:l.p95_response_time!=null?`${l.path} (P95: ${l.p95_response_time} ms)`:l.path,value:l.count})):[],s=i.length>0;return u.jsxs(fr,{className:"mt-4 rounded-tremor-small p-2",children:[u.jsxs("div",{className:"flex items-center justify-between border-b border-tremor-border p-3 dark:border-dark-tremor-border",children:[u.jsx("p",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:e}),u.jsx("p",{className:"text-tremor-label font-medium uppercase text-tremor-content dark:text-dark-tremor-content",children:"Totals"})]}),u.jsx("div",{className:`overflow-hidden p-6 ${a?"":"max-h-[260px]"}`,children:s?u.jsx(Qu,{data:i,valueFormatter:Qge}):u.jsx(nI,{className:"min-h-[150px]"})}),r&&s&&u.jsx("div",{className:`flex justify-center ${n?"px-6 pb-6":"absolute inset-x-0 bottom-0 rounded-b-tremor-default bg-gradient-to-t from-tremor-background to-transparent py-7 dark:from-dark-tremor-background"}`,children:u.jsx("button",{className:"flex items-center justify-center rounded-tremor-small border border-tremor-border bg-tremor-background px-2.5 py-2 text-tremor-default font-medium text-tremor-content-strong shadow-tremor-input hover:bg-tremor-background-muted dark:border-dark-tremor-border dark:bg-dark-tremor-background dark:text-dark-tremor-content-strong dark:shadow-dark-tremor-input hover:dark:bg-dark-tremor-background-muted",onClick:()=>o(!n),children:n?"Show less":"Show more"})})]})}function ebe(...e){return e.filter(Boolean).join(" ")}function If({title:e="Donut Chart",description:t="",data:r,valueFormatter:n,colors:o}){const a=["bg-blue-500","bg-violet-500","bg-fuchsia-500","bg-emerald-500","bg-sky-500"],i=o||["blue","violet","fuchsia","emerald","sky"],s=n||(c=>`${c}`);let l=[];if(Array.isArray(r))l=r;else if(r&&typeof r=="object"){const c=Object.entries(r),d=c.reduce((f,[,m])=>f+m,0);l=c.map(([f,m],p)=>({name:f,amount:m,share:d>0?`${(m/d*100).toFixed(1)}%`:"0%",borderColor:a[p%a.length]}))}return u.jsxs(fr,{className:"mt-4 h-120 rounded-tremor-small p-2",children:[u.jsx("h3",{className:"text-tremor-default font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:e}),t&&u.jsx("p",{className:"mt-1 text-tremor-default leading-6 text-tremor-content dark:text-dark-tremor-content",children:t}),u.jsxs("div",{className:"mt-6 grid grid-cols-1 gap-0 sm:grid-cols-2 sm:gap-8",children:[u.jsx(m9,{data:l,category:"amount",index:"name",valueFormatter:s,showTooltip:!0,className:"h-40 w-full",colors:i}),u.jsx("div",{className:"mt-6 flex items-center sm:mt-0",children:u.jsx("ul",{role:"list",className:"space-y-3",children:l.map(c=>u.jsxs("li",{className:"flex space-x-3",children:[u.jsx("span",{className:ebe(c.borderColor,"w-1 shrink-0 rounded")}),u.jsxs("div",{children:[u.jsxs("p",{className:"text-tremor-default font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:[s(c.amount)," ",u.jsxs("span",{className:"font-normal",children:["(",c.share,")"]})]}),u.jsx("p",{className:"mt-0.5 whitespace-nowrap text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:c.name})]})]},c.name))})})]})]})}const tbe=({open:e,onClose:t,onConfirm:r,title:n="Clear All",message:o="Are you sure you want to clear all? This action cannot be undone.",confirmButtonText:a="Clear All"})=>e?u.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[u.jsx("div",{className:"absolute inset-0 bg-black opacity-50",onClick:t}),u.jsxs("div",{className:"relative bg-white rounded-lg shadow-xl max-w-md w-full mx-4 p-6 z-10",children:[u.jsxs("div",{className:"flex items-center",children:[u.jsx("div",{className:"flex-shrink-0 bg-red-100 rounded-full p-2",children:u.jsx("svg",{className:"size-6 text-red-600",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})})}),u.jsxs("div",{className:"ml-4",children:[u.jsx("h3",{className:"text-lg font-medium text-gray-900",children:n}),u.jsx("p",{className:"mt-2 text-sm text-gray-500",children:o})]})]}),u.jsxs("div",{className:"mt-6 flex justify-end space-x-3",children:[u.jsx("button",{onClick:t,className:"px-4 py-2 bg-gray-200 rounded hover:bg-gray-300 text-sm",children:"Cancel"}),u.jsx("button",{onClick:()=>{r(),t()},className:"px-4 py-2 bg-red-600 text-white rounded hover:bg-red-700 text-sm",children:a})]})]})]}):null;function cA(e){return e==null||Number.isNaN(e)?"":`${Math.round(e)}`}function rbe({active:e,label:t,onClick:r}){return u.jsx("button",{type:"button",onClick:r,className:["px-2 py-1 text-xs rounded border",e?"bg-tremor-brand text-tremor-brand-inverted dark:bg-dark-tremor-brand dark:text-dark-tremor-brand-inverted border-transparent":"bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-200 border-gray-300 dark:border-gray-600 hover:bg-gray-200 dark:hover:bg-gray-600"].join(" "),children:t})}function nbe({title:e="HTTP Request duration: p50, p90, p95, p99",data:t=[]}){const r=["p50","p90","p95","p99"],n=g.useMemo(()=>{if(!Array.isArray(t))return[];const f=new Set;for(const m of t)for(const p of r)m&&typeof m[p]=="number"&&f.add(p);return r.filter(m=>f.has(m))},[t]),[o,a]=g.useState(new Set(r));g.useEffect(()=>{a(f=>{const m=new Set([...f].filter(p=>n.includes(p)));return m.size===0?new Set(n):(n.forEach(p=>m.add(p)),m)})},[n]);const i=f=>{a(m=>{const p=new Set(m);return p.has(f)?p.delete(f):p.add(f),p})},s={p50:"blue",p90:"violet",p95:"cyan",p99:"rose"},l=g.useMemo(()=>n.filter(f=>o.has(f)),[n,o]),c=g.useMemo(()=>l.map(f=>s[f]),[l]),d=Array.isArray(t)&&t.length>0&&n.length>0;return u.jsxs(fr,{className:"mt-4 rounded-tremor-small p-2",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("h3",{className:"font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:e}),u.jsx("div",{className:"flex gap-2",children:r.map(f=>u.jsx(rbe,{label:f.toUpperCase(),active:o.has(f),onClick:()=>i(f)},f))})]}),u.jsxs("div",{className:"p-6",children:[d?l.length===0?u.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"No percentile selected. Toggle one or more options above."}):u.jsxs(u.Fragment,{children:[u.jsx(td,{data:t,index:"date",categories:l,colors:c,showGradient:!1,valueFormatter:cA,className:"mt-4 hidden h-80 w-full sm:block"}),u.jsx(td,{data:t,index:"date",categories:l,colors:c,showGradient:!1,valueFormatter:cA,className:"mt-4 h-48 w-full sm:hidden"})]}):u.jsx(nI,{className:"h-40"}),d?u.jsx("p",{className:"mt-3 text-xs text-gray-500 dark:text-gray-400",children:"Values in milliseconds"}):null]})]})}function Uu(...e){return e.filter(Boolean).join(" ")}function Vf({tags:e=[],selectedTag:t,onSelect:r,disabled:n=!1,loading:o=!1,error:a,fullWidth:i=!1}){const[s,l]=g.useState(!1),c=g.useRef(null),d=g.useRef(null),f=!!t;g.useEffect(()=>{if(!s)return;const v=k=>{!d.current||!c.current||d.current.contains(k.target)||c.current.contains(k.target)||l(!1)},x=k=>{var S;k.key==="Escape"&&(l(!1),(S=c.current)==null||S.focus())};return document.addEventListener("mousedown",v),document.addEventListener("touchstart",v),document.addEventListener("keydown",x),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("touchstart",v),document.removeEventListener("keydown",x)}},[s]);const m=()=>{n||l(v=>!v)},p=()=>l(!1),h=v=>{n||(r?.(v),p())},b="tag-filter-dropdown-label";return u.jsxs("div",{className:Uu("relative inline-block text-left",i?"w-full":""),children:[u.jsxs("button",{type:"button",ref:c,onClick:m,onKeyDown:v=>{v.key==="ArrowDown"&&!s&&(v.preventDefault(),l(!0))},disabled:n,"aria-haspopup":"menu","aria-expanded":s,"aria-labelledby":b,className:Uu("inline-flex items-center gap-2 rounded-tremor-small border border-tremor-border bg-tremor-background px-3 py-2 text-sm font-medium text-tremor-content-strong shadow-tremor-input transition focus:z-10 focus:outline-none focus-visible:ring-2 focus-visible:ring-tremor-brand/60 min-h-[42px]",i?"w-full justify-start":"","hover:bg-tremor-background-subtle disabled:cursor-not-allowed disabled:opacity-70","dark:border-dark-tremor-border dark:bg-gray-950 dark:text-dark-tremor-content-strong dark:shadow-dark-tremor-input dark:hover:bg-gray-950/60"),children:[u.jsx("span",{id:b,className:"sr-only",children:"Filter statistics by tag"}),u.jsx(VI,{className:"h-4 w-4","aria-hidden":!0}),f?u.jsx(cs,{tag:t}):u.jsx("span",{className:"text-xs uppercase tracking-wide",children:"All tags"})]}),s?u.jsxs("div",{ref:d,role:"menu","aria-orientation":"vertical","aria-labelledby":b,className:Uu("absolute z-50 mt-2 w-64 rounded-md border border-tremor-border bg-tremor-background p-2 shadow-xl shadow-black/[2.5%] focus:outline-none dark:border-dark-tremor-border dark:bg-gray-950",i?"left-0 right-auto origin-top-left":"right-0 origin-top-right"),children:[u.jsx("div",{className:"px-2 pb-2 text-xs font-semibold uppercase tracking-wide text-tremor-content dark:text-dark-tremor-content",children:"Select a tag"}),u.jsxs("div",{className:"max-h-60 overflow-y-auto",children:[u.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":!f,onClick:()=>h(null),className:Uu("flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm transition","text-gray-500 hover:bg-tremor-background-subtle focus:outline-none focus-visible:bg-tremor-background-subtle dark:text-gray-400 dark:hover:bg-dark-tremor-background dark:focus-visible:bg-dark-tremor-background",f?"":"font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong"),children:[u.jsx("span",{className:"text-xs font-medium uppercase tracking-wide",children:"All tags"}),f?null:u.jsx(YE,{className:"ml-auto h-4 w-4 text-tremor-brand dark:text-dark-tremor-brand","aria-hidden":!0})]}),u.jsx("div",{className:"my-2 h-px bg-tremor-border dark:bg-dark-tremor-border"}),o?u.jsx("div",{className:"px-2 py-4 text-center text-xs text-gray-500 dark:text-gray-400",children:"Loading tags…"}):e.length===0?u.jsx("div",{className:"px-2 py-4 text-center text-xs text-gray-500 dark:text-gray-400",children:a||"No tags available"}):e.map(v=>{const x=t===v;return u.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":x,onClick:()=>h(v),className:Uu("flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm transition","text-tremor-content-strong hover:bg-tremor-background-subtle focus:outline-none focus-visible:bg-tremor-background-subtle dark:text-dark-tremor-content-strong dark:hover:bg-dark-tremor-background dark:focus-visible:bg-dark-tremor-background",x?"font-semibold":""),children:[u.jsx(cs,{tag:v}),x?u.jsx(YE,{className:"ml-auto h-4 w-4 text-tremor-brand dark:text-dark-tremor-brand","aria-hidden":!0}):null]},v)})]})]}):null]})}const oI=(e,t=0,r=0,n=0,o=0)=>new Date(e.getFullYear(),e.getMonth(),e.getDate(),t,r,n,o),kE=e=>!(e instanceof Date)||Number.isNaN(e.getTime())?new Date(0).toISOString():oI(e).toISOString(),jE=e=>!(e instanceof Date)||Number.isNaN(e.getTime())?new Date(0).toISOString():oI(e,23,59,59,999).toISOString(),Ku=(e,t,r)=>{const n=kE(t),o=jE(r);return{label:e,start:n,end:o,tooltip:`${n} – ${o}`}},aI=(e=new Date)=>{const t=e instanceof Date?new Date(e):new Date,r=t;return new Date(r.getTime()-60*60*1e3),[Ku("Today",t,t),Ku("7D",new Date(t.getTime()-7*24*60*60*1e3),t),Ku("30D",new Date(t.getTime()-30*24*60*60*1e3),t),Ku("3M",new Date(t.getUTCFullYear(),t.getUTCMonth()-3,t.getUTCDate()),t),Ku("6M",new Date(t.getUTCFullYear(),t.getUTCMonth()-6,t.getUTCDate()),t)]},obe=(e,t=new Date)=>aI(t).find(r=>r.label===e)||null,dA=(...e)=>e.filter(Boolean).join(" ");function iI({selectedRange:e,onSelect:t,onCustomClick:r,referenceDate:n}){const o=g.useMemo(()=>aI(n),[n]);return u.jsxs("div",{className:"inline-flex items-center rounded shadow",children:[o.map((a,i)=>u.jsx("button",{onClick:()=>t?.(a),title:a.tooltip,type:"button",className:dA(i===0?"rounded-l":i===o.length-1?"-ml-px rounded-r":"-ml-px","border px-3 py-1 text-sm focus:outline-none focus-visible:ring-2 focus-visible:ring-tremor-brand/60",e===a.label?"bg-tremor-brand text-tremor-brand-inverted dark:bg-dark-tremor-brand dark:text-dark-tremor-brand-inverted":"bg-gray-100 text-gray-600 hover:bg-gray-200 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600"),children:a.label},a.label)),u.jsx("button",{onClick:r,title:"Set custom date range",type:"button",className:dA("-ml-px rounded-r","border px-3 py-1 text-sm focus:outline-none focus-visible:ring-2 focus-visible:ring-tremor-brand/60",e==="Custom"?"bg-tremor-brand text-tremor-brand-inverted dark:bg-dark-tremor-brand dark:text-dark-tremor-brand-inverted":"bg-gray-100 text-gray-600 hover:bg-gray-200 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600"),children:"Custom"})]})}function fA(e){return new Date(e).toLocaleString("en-GB",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1})}function abe(e){return new Date(e).toLocaleString("en-GB",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1})}function d0(e){return Array.isArray(e)?e.map(t=>{const r={...t,date:abe(t.date)};return t.median_response_time!=null&&(r.p50=t.median_response_time),t.p90_response_time!=null&&(r.p90=t.p90_response_time),t.p95_response_time!=null&&(r.p95=t.p95_response_time),t.p99_response_time!=null&&(r.p99=t.p99_response_time),r}):[]}function ibe({tag:e}){return e?u.jsx(cs,{tag:e}):u.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400",children:"All operations"})}function sI(e,t,{includeTopMargin:r=!0,layout:n="overview"}={}){var o,a,i,s,l,c,d,f,m,p,h,b,v,x,k;const S=n==="compare",j="mt-6 grid grid-cols-1 gap-4";return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:r?"mt-6":"",children:u.jsx(Gge,{overall:e?.overall})}),u.jsxs("div",{className:S?j:"mt-6 grid grid-cols-2 gap-4 md:grid-cols-2 lg:grid-cols-2",children:[u.jsx(Xge,{title:"Traffic Volume",data:t}),u.jsx(c0,{title:"Average Response Times",data:t,metricKey:["min_response_time","average_response_time","max_response_time"],metricUnit:"ms",highlightValue:(o=e?.overall)==null?void 0:o.average_response_time,highlightLabel:"Average Response Time"})]}),u.jsx("div",{className:"mt-6 grid grid-cols-1",children:u.jsx(nbe,{title:"HTTP Request duration: p50, p90, p95, p99",data:t})}),S?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:j,children:[u.jsx(c0,{title:"Success / Error Rate",data:t,metricKey:["success","errors"],metricUnit:"",highlightValue:(a=e?.overall)==null?void 0:a.average_errors,highlightLabel:"Average Errors"}),u.jsx(Ra,{title:"Top Endpoints",data:(i=e?.top_endpoints)==null?void 0:i.all,toggleable:!1})]}),u.jsxs("div",{className:j,children:[u.jsx(If,{title:"Method Ratio",description:"Distribution of HTTP methods",data:(s=e?.totals)==null?void 0:s.method}),u.jsx(If,{title:"Status Ratio",description:"Distribution of HTTP status codes",data:(l=e?.totals)==null?void 0:l.status}),u.jsx(Ra,{title:"Top Failed Endpoints",data:(c=e?.top_endpoints)==null?void 0:c.error,toggleable:!1})]}),u.jsxs("div",{className:j,children:[u.jsx(Ra,{title:"Top Fastest Endpoints (P95)",data:(d=e?.top_endpoints)==null?void 0:d.fastest,toggleable:!1}),u.jsx(Ra,{title:"Top Slowest Endpoints (P95)",data:(f=e?.top_endpoints)==null?void 0:f.slowest,toggleable:!1})]})]}):u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"mt-6 grid grid-cols-3 gap-4 items-stretch",children:[u.jsx("div",{className:"col-span-2",children:u.jsx(c0,{title:"Success / Error Rate",data:t,metricKey:["success","errors"],metricUnit:"",highlightValue:(m=e?.overall)==null?void 0:m.average_errors,highlightLabel:"Average Errors"})}),u.jsx("div",{className:"col-span-1",children:u.jsx(Ra,{title:"Top Endpoints",data:(p=e?.top_endpoints)==null?void 0:p.all,toggleable:!1})})]}),u.jsxs("div",{className:"mt-6 grid grid-cols-3 gap-4 md:grid-cols-3 lg:grid-cols-3",children:[u.jsx(If,{title:"Method Ratio",description:"Distribution of HTTP methods",data:(h=e?.totals)==null?void 0:h.method}),u.jsx(If,{title:"Status Ratio",description:"Distribution of HTTP status codes",data:(b=e?.totals)==null?void 0:b.status}),u.jsx(Ra,{title:"Top Failed Endpoints",data:(v=e?.top_endpoints)==null?void 0:v.error,toggleable:!1})]}),u.jsxs("div",{className:"mt-6 grid grid-cols-2 gap-4 md:grid-cols-2 lg:grid-cols-2",children:[u.jsx(Ra,{title:"Top Fastest Endpoints (P95)",data:(x=e?.top_endpoints)==null?void 0:x.fastest,toggleable:!1}),u.jsx(Ra,{title:"Top Slowest Endpoints (P95)",data:(k=e?.top_endpoints)==null?void 0:k.slowest,toggleable:!1})]})]})]})}function pA({label:e,tag:t,stats:r,intervalData:n,loading:o}){const a=!!r;return u.jsxs("div",{className:"rounded-tremor-small border border-tremor-border bg-tremor-background p-4 shadow-sm dark:border-dark-tremor-border dark:bg-gray-950",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-sm font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:e}),u.jsx("div",{className:"mt-1",children:u.jsx(ibe,{tag:t})})]}),o?u.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Loading…"}):null]}),a?u.jsx("div",{className:"mt-4",children:sI(r,n,{includeTopMargin:!1,layout:"compare"})}):u.jsx("p",{className:"mt-4 text-sm text-gray-500 dark:text-gray-400",children:o?"Loading statistics…":"No data available for this selection."})]})}function sbe(){const{client:e}=mr(),[t]=Bn("feat_statistics_compare",!1),[r,n]=g.useState(null),[o,a]=g.useState(!1),[i,s]=g.useState(null),[l,c]=g.useState("hour"),[d,f]=g.useState([]),[m,p]=g.useState(!1),[h,b]=g.useState(""),[v,x]=g.useState(null),[k,S]=g.useState("overview"),[j,O]=g.useState(null),[C,N]=g.useState(void 0),[T,M]=g.useState(null),[I,_]=g.useState(null),[R,L]=g.useState(!1),[F,B]=g.useState(null),U=new Date,$=kE(U),z=jE(U),[W,K]=g.useState("Today"),[q,J]=g.useState($),[V,me]=g.useState(z),[X,ce]=g.useState(!1),[oe,Oe]=g.useState(new Date(U.getTime()-7*24*60*60*1e3).toISOString().split("T")[0]),[te,Ne]=g.useState("00:00"),[ve,G]=g.useState(U.toISOString().split("T")[0]),[ye,le]=g.useState("23:59"),[ge,Ce]=g.useState(!1),Me=ut=>e.stats.getOperations({group:l,start:q,end:V,tag:ut||void 0}),Ye=async()=>{var ut;if((ut=e?.stats)!=null&&ut.getOperations){a(!0),s(null);try{const Wt=await Me(v);n(Wt)}catch(Wt){console.error(Wt),s(Wt?.message||"Failed to load statistics")}finally{a(!1)}}},Ve=async()=>{var ut;if((ut=e?.stats)!=null&&ut.getOperations&&C!==void 0){L(!0),B(null);try{const[Wt,Fr]=await Promise.all([Me(j),Me(C)]);M(Wt),_(Fr)}catch(Wt){console.error(Wt),B(Wt?.message||"Failed to load comparison data")}finally{L(!1)}}},$e=()=>k==="compare"?Ve():Ye(),Ze=async()=>{try{await e.stats.deleteOperations(),await Ye(),k==="compare"&&await Ve()}catch(ut){console.error("Error clearing all operation stats:",ut)}};g.useEffect(()=>{Ye()},[e,l,q,V,v]),g.useEffect(()=>{k==="compare"&&Ve()},[e,k,l,q,V,j,C]),g.useEffect(()=>{var ut;if(!((ut=e?.operations)!=null&&ut.listTags))return;let Wt=!1;return(async()=>{try{p(!0),b("");const Fr=await e.operations.listTags();if(Wt)return;const wr=Array.isArray(Fr?.tags)?[...Fr.tags]:[];wr.sort((ze,sr)=>ze.localeCompare(sr)),f(wr)}catch(Fr){if(Wt)return;console.error("Failed to load tags",Fr),f([]),b(Fr?.message||"Failed to load tags")}finally{Wt||p(!1)}})(),()=>{Wt=!0}},[e]),g.useEffect(()=>{v&&(d.includes(v)||x(null))},[d,v]),g.useEffect(()=>{j&&(d.includes(j)||O(null))},[d,j]),g.useEffect(()=>{if(C!=null&&!d.includes(C)){const ut=d.find(Wt=>Wt!==j)??null;N(ut)}},[d,j,C]),g.useEffect(()=>{if(C!==void 0)return;if(d.length===0){N(null);return}const ut=d.find(Wt=>Wt!==j)??d[0];N(ut??null)},[d,j,C]);const rt=g.useMemo(()=>d0(r?.by_interval),[r?.by_interval]),nt=g.useMemo(()=>d0(T?.by_interval),[T?.by_interval]),ht=g.useMemo(()=>d0(I?.by_interval),[I?.by_interval]),ft=k==="compare"?1:0,vt=k==="compare"?R:o,Qt=C===void 0?null:C,Je=ut=>{S(ut===1?"compare":"overview")},dt=ut=>{K(ut.label),J(ut.start),me(ut.end),ce(!1)},Gt=()=>{ce(!X),X||K("Custom")},Rr=()=>{const ut=new Date(`${oe}T${te}:00`),Wt=new Date(`${ve}T${ye}:00`);J(ut.toISOString()),me(Wt.toISOString()),K("Custom"),ce(!1)};return u.jsxs(u.Fragment,{children:[u.jsx("header",{children:u.jsxs("div",{className:"sm:flex sm:items-center sm:justify-between",children:[u.jsx("h3",{className:"text-tremor-title font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Inspectr Statistics"}),u.jsxs("div",{className:"mt-2 text-sm text-gray-600 dark:text-gray-400 sm:mt-0",children:[u.jsx("span",{className:"font-medium",children:"Range:"})," ",fA(q)," -"," ",fA(V)]})]})}),u.jsxs(xE,{index:ft,onIndexChange:Je,children:[u.jsxs("div",{className:"relative mt-4",children:[u.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-start md:justify-between",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsxs(yE,{className:"w-auto",children:[u.jsx(Qi,{children:"Overview"}),t&&u.jsx(Qi,{children:"Compare"})]}),k==="overview"?t&&u.jsx(Vf,{tags:d,selectedTag:v,onSelect:x,disabled:vt,loading:m,error:h}):u.jsx("div",{className:"flex flex-wrap items-end gap-3",children:u.jsxs("div",{className:"flex flex-row gap-1 items-center",children:[u.jsx(Vf,{tags:d,selectedTag:j,onSelect:O,disabled:vt,loading:m,error:h}),u.jsx(Vf,{tags:d,selectedTag:Qt,onSelect:N,disabled:vt,loading:m,error:h})]})})]}),u.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[u.jsx(iI,{selectedRange:W,onSelect:dt,onCustomClick:Gt}),u.jsxs(H8,{className:"w-full sm:w-fit [&>button]:rounded-tremor-small",enableClear:!1,value:l,onValueChange:ut=>c(ut),children:[u.jsx(Ji,{value:"hour",children:"Hourly"}),u.jsx(Ji,{value:"day",children:"Daily"}),u.jsx(Ji,{value:"week",children:"Weekly"}),u.jsx(Ji,{value:"month",children:"Monthly"})]}),u.jsx(al,{onClick:$e,disabled:vt,children:vt?"Loading":"Refresh"}),u.jsxs("button",{type:"button",className:"rounded bg-red-500 px-2 py-2 text-xs text-white",onClick:()=>Ce(!0),children:[u.jsx("span",{className:"sr-only",children:"Clear all operation stats"}),u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"h-4 w-4","aria-hidden":!0,children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"})})]})]})]}),h&&!m?u.jsxs("p",{className:"mt-2 text-xs text-red-600 dark:text-red-400",children:["Tag filter unavailable: ",h]}):null,X&&u.jsxs("div",{className:"absolute top-full right-0 z-10 mt-2 flex flex-wrap items-center gap-2 rounded bg-gray-50 p-3 shadow dark:bg-gray-800",children:[u.jsxs("div",{className:"flex flex-col",children:[u.jsx("label",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Start Date"}),u.jsx("input",{type:"date",value:oe,onChange:ut=>Oe(ut.target.value),className:"rounded border px-2 py-1 focus:outline-none focus:ring-2 focus:ring-tremor-brand dark:border-gray-600 dark:bg-gray-700"})]}),u.jsxs("div",{className:"flex flex-col",children:[u.jsx("label",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Start Time"}),u.jsx("input",{type:"time",value:te,onChange:ut=>Ne(ut.target.value),className:"rounded border px-2 py-1 focus:outline-none focus:ring-2 focus:ring-tremor-brand dark:border-gray-600 dark:bg-gray-700"})]}),u.jsxs("div",{className:"flex flex-col",children:[u.jsx("label",{className:"text-xs text-gray-500 dark:text-gray-400",children:"End Date"}),u.jsx("input",{type:"date",value:ve,onChange:ut=>G(ut.target.value),className:"rounded border px-2 py-1 focus:outline-none focus:ring-2 focus:ring-tremor-brand dark:border-gray-600 dark:bg-gray-700"})]}),u.jsxs("div",{className:"flex flex-col",children:[u.jsx("label",{className:"text-xs text-gray-500 dark:text-gray-400",children:"End Time"}),u.jsx("input",{type:"time",value:ye,onChange:ut=>le(ut.target.value),className:"rounded border px-2 py-1 focus:outline-none focus:ring-2 focus:ring-tremor-brand dark:border-gray-600 dark:bg-gray-700"})]}),u.jsx("div",{className:"flex items-end",children:u.jsx(al,{onClick:Rr,className:"ml-2",children:"Apply"})})]})]}),u.jsxs(wE,{children:[u.jsxs(es,{children:[i?u.jsxs("p",{className:"mt-4 text-red-600 dark:text-red-400",children:["Error: ",i]}):null,u.jsx("main",{className:"mt-6",children:sI(r,rt)})]}),u.jsxs(es,{children:[F?u.jsxs("p",{className:"mt-4 text-red-600 dark:text-red-400",children:["Comparison error: ",F]}):null,u.jsx("main",{className:"mt-6",children:u.jsxs("div",{className:"grid grid-cols-1 gap-6 xl:grid-cols-2",children:[u.jsx(pA,{label:"Input A",tag:j,stats:T,intervalData:nt,loading:R}),u.jsx(pA,{label:"Input B",tag:Qt,stats:I,intervalData:ht,loading:R})]})})]})]})]}),u.jsx(tbe,{open:ge,onClose:()=>Ce(!1),title:"Clear All Operation Stats?",message:"Are you sure you want to clear all operation stats? This action cannot be undone.",onConfirm:Ze})]})}const lbe=[{value:"string",label:"String"},{value:"number",label:"Number"},{value:"boolean",label:"Boolean"}],ube=e=>{if(!Array.isArray(e)||e.length===0)return[];const t=new Set;return e.map(r=>{if(!r||typeof r!="object")return null;const n=r.operator||r.value||r.op;if(!n||typeof n!="string")return null;const o=n.trim();if(!o||t.has(o))return null;t.add(o);const a=Array.isArray(r.aliases)?r.aliases.filter(i=>typeof i=="string"&&i.trim()):[];return{operator:o,label:r.label||r.name||o,description:r.description||"",aliases:a,valueRequired:!!(r.value_required??r.valueRequired??r.requiresValue),multiValue:!!(r.multi_value??r.multiValue)}}).filter(Boolean)},cbe=(e=[])=>e.map(t=>({value:t.operator,label:t.label||t.operator,description:t.description||"",valueRequired:t.valueRequired!==!1,multiValue:t.multiValue===!0})),dbe=(e=[])=>e.reduce((t,r)=>{const n=r.label||r.operator;return t[r.operator]=n,(r.aliases||[]).forEach(o=>{t[o]=n}),t},{}),fbe=(e=[])=>e.reduce((t,r)=>(t[r.operator]=r,(r.aliases||[]).forEach(n=>{t[n]=r}),t),{}),lI=(e=[])=>{var t;return((t=e[0])==null?void 0:t.operator)||""},pbe=[{value:"and",label:"All conditions match"},{value:"or",label:"Any condition matches"}],mbe={and:"All conditions must match before actions run.",or:"Any condition may match before actions run."},mA={tag:"Apply static tags",tag_dynamic:"Apply dynamic tags"},xk=e=>typeof e=="boolean"?e:typeof e=="string"?e==="true"||e==="1":!!e,wk=e=>{if(e?.input==="single_select"&&Array.isArray(e?.choices)&&e.choices.length){if(e.default!=null)return e.default;const t=e.choices[0];return t?.value??""}return typeof e?.type=="string"&&e.type.startsWith("array")?"":e?.type==="object"?{}:e?.type==="boolean"?xk(e.default??!0):e?.default!=null?e.default:""},Gf=()=>Math.random().toString(36).slice(2,10),kk=(e=lI())=>({path:"",operator:e,value:"",valueType:"string"}),ec=e=>({id:Gf(),type:e?.type||"",params:(e?.params||[]).reduce((t,r)=>(t[r.name]=wk(r),t),{})}),tc=e=>Array.isArray(e)?e:typeof e=="string"?e.split(",").map(t=>t.trim()).filter(Boolean):[],bm=e=>e?Array.isArray(e)?e.flatMap(bm):e.left&&e.op?[e]:e.args?e.args.flatMap(bm):[]:[],hbe=e=>typeof e=="number"?"number":typeof e=="boolean"?"boolean":"string",gbe=e=>e==null||e===""?"empty":Array.isArray(e)?e.join(", "):typeof e=="object"?JSON.stringify(e):typeof e=="string"?`"${e}"`:typeof e=="boolean"?e?"true":"false":String(e),bbe=e=>mA[e]?mA[e]:e.toString().replace(/[-_]/g," ").replace(/\b\w/g,t=>t.toUpperCase()),vbe=(e={})=>{const t=Object.entries(e);return t.length===0?"No parameters configured":t.map(([r,n])=>Array.isArray(n)?`${r}: ${n.join(", ")}`:typeof n=="object"&&n!==null?`${r}: ${JSON.stringify(n)}`:typeof n=="boolean"?`${r}: ${n?"true":"false"}`:`${r}: ${n}`).join(" · ")},ybe=e=>{if(!e)return null;const t=new Date(e);if(Number.isNaN(t.getTime()))return null;const r=Date.now()-t.getTime();if(r<0)return t.toLocaleString();const n=Math.round(r/6e4);if(n<1)return"Just now";if(n<60)return`${n}m ago`;const o=Math.round(n/60);if(o<24)return`${o}h ago`;const a=Math.round(o/24);return a<30?`${a}d ago`:t.toLocaleDateString()},hA=(e,t,r)=>{if(!Array.isArray(e))return e;const n=e.length;if(n===0)return e;const o=(t%n+n)%n,a=(r%n+n)%n;if(o===a)return e;const i=[...e],[s]=i.splice(o,1);return i.splice(a,0,s),i},xbe=({variant:e})=>e==="event"?u.jsx("span",{className:"relative flex aspect-square h-9 items-center justify-center rounded-lg bg-orange-600 dark:bg-orange-500","aria-hidden":"true",children:u.jsxs("svg",{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",className:"size-5 shrink-0 text-white","aria-hidden":"true",children:[u.jsx("path",{d:"M12 2v14"}),u.jsx("path",{d:"m19 9-7 7-7-7"}),u.jsx("circle",{cx:"12",cy:"21",r:"1"})]})}):e==="condition"?u.jsx("span",{className:"relative flex aspect-square h-9 items-center justify-center rounded-lg bg-sky-500 dark:bg-sky-500","aria-hidden":"true",children:u.jsxs("svg",{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",className:"size-5 shrink-0 text-white","aria-hidden":"true",children:[u.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),u.jsx("path",{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3"}),u.jsx("path",{d:"M9 11.2h5.7"})]})}):u.jsx("span",{className:"relative flex aspect-square h-9 items-center justify-center rounded-lg bg-emerald-500 dark:bg-emerald-500","aria-hidden":"true",children:u.jsxs("svg",{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",className:"size-5 shrink-0 text-white","aria-hidden":"true",children:[u.jsx("path",{d:"M22 12A10 10 0 1 1 12 2"}),u.jsx("path",{d:"M22 2 12 12"}),u.jsx("path",{d:"M16 2h6v6"})]})}),wbe=(e,t,r)=>{var n;const o=String(((n=e.expression)==null?void 0:n.op)||"and").toLowerCase(),a=mbe[o],i=t[e.event]||{},s=i.name||e.event,l=[e.description,i.description,a].filter(Boolean),c=[{variant:"event",title:s,description:l.join(" · ")}];return bm(e.expression).forEach((d,f)=>{var m,p;const h=r?.[d.op]||d.op,b=gbe(d.right),v=[];(m=d.left)!=null&&m.path&&v.push(d.left.path),(p=d.right)!=null&&p.path&&v.push(`Compare to ${d.right.path}`),c.push({variant:"condition",title:`Condition ${f+1}: ${h} ${b}`,description:v.join(" · ")})}),(e.actions||[]).forEach((d,f)=>{c.push({variant:"action",title:`Action ${f+1}: ${bbe(d.type)}`,description:vbe(d.params)})}),c},kbe=e=>{if(!e||typeof e!="object")return null;const{id:t,updated_at:r,created_at:n,...o}=e,a=`Copy of ${e.name||"Untitled rule"}`;return{...o,name:a,active:!1}},jbe=({rules:e,events:t,loading:r,error:n,isRefreshing:o,openRuleId:a,onToggleRule:i,onRefresh:s,onEditRule:l,onDeleteRule:c,onCreateRule:d,onStartFromTemplate:f,onApplyHistory:m,actionsDisabled:p=!1,onDuplicateRule:h,onPauseRule:b,onExportRule:v,onImportRule:x,meta:k,onPageChange:S,paginationAlwaysShow:j=!1,operatorLabelMap:O={}})=>{const C=g.useMemo(()=>t.reduce((N,T)=>(N[T.type]=T,N),{}),[t]);return u.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white shadow-sm dark:border-gray-800 dark:bg-gray-900",children:[u.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4 border-b border-gray-200 px-4 py-4 dark:border-gray-800",children:[u.jsxs("div",{children:[u.jsx("h2",{className:"text-base font-semibold text-gray-900 dark:text-gray-50",children:"Rules"}),u.jsx("p",{className:"mt-1 text-sm text-gray-600 dark:text-gray-400",children:"Overview of automation rules currently available on your workspace."})]}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx("button",{type:"button",onClick:x,className:"inline-flex items-center rounded-md border border-gray-300 px-3 py-1.5 text-sm font-medium text-gray-700 shadow-sm transition hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-70 dark:border-gray-700 dark:text-gray-200 dark:hover:bg-gray-900",children:"Import rule"}),u.jsx("button",{type:"button",onClick:f,className:"inline-flex items-center rounded-md border border-gray-300 px-3 py-1.5 text-sm font-medium text-gray-700 shadow-sm transition hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-70 dark:border-gray-700 dark:text-gray-200 dark:hover:bg-gray-900",children:"Start from template"}),u.jsx("button",{type:"button",onClick:d,className:"inline-flex items-center rounded-md border border-transparent bg-blue-500 px-3 py-1.5 text-sm font-medium text-white shadow-sm transition hover:bg-blue-600 disabled:cursor-not-allowed disabled:opacity-70 dark:bg-blue-600 dark:hover:bg-blue-500",children:"Add rule"}),u.jsx("button",{type:"button",onClick:()=>s&&s(),title:"Refresh rules",disabled:o||r,className:"inline-flex items-center rounded-md border border-gray-300 px-3 py-1.5 text-sm font-medium text-gray-700 shadow-sm transition hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-70 dark:border-gray-700 dark:text-gray-200 dark:hover:bg-gray-900",children:o?"Refreshing…":"Refresh"})]})]}),u.jsxs("div",{className:"px-4 py-4",children:[r?u.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Loading rules…"}):n?u.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:n}):e.length===0?u.jsxs("div",{className:"mt-8 flex h-96 min-h-full flex-1 flex-col justify-center rounded-lg border border-gray-200 bg-gray-50 px-6 py-10 text-center dark:border-gray-700 dark:bg-gray-800",children:[u.jsx("h2",{className:"text-2xl font-semibold text-gray-900 dark:text-gray-50",children:"Get started with rules"}),u.jsx("p",{className:"mt-3 mx-auto max-w-xl text-sm text-gray-500 dark:text-gray-400 sm:text-base",children:"Automate how Inspectr responds to captured operations. Add your first rule or choose a template to jump-start your automation flow."}),u.jsxs("div",{className:"mt-8 flex flex-col items-center justify-center gap-3 sm:flex-row",children:[u.jsx("button",{type:"button",onClick:d,disabled:p||r,className:"inline-flex w-full items-center justify-center rounded-md border border-transparent bg-blue-500 px-3 py-2 text-sm font-medium text-white shadow-sm transition hover:bg-blue-600 disabled:cursor-not-allowed disabled:opacity-70 dark:bg-blue-600 dark:hover:bg-blue-500 sm:w-auto",children:"Add rule"}),u.jsx("button",{type:"button",onClick:f,disabled:p||r,className:"inline-flex w-full items-center justify-center gap-1 rounded-md border border-gray-300 px-3 py-2 text-sm font-medium text-gray-900 shadow-sm transition hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-70 dark:border-gray-800 dark:bg-gray-900 dark:text-gray-50 dark:hover:bg-gray-800/60 sm:w-auto",children:"Start from template"})]})]}):u.jsx("div",{className:"space-y-3",children:e.map(N=>{const T=a===N.id,M=wbe(N,C,O),I=ybe(N.updated_at||N.created_at);return u.jsxs("div",{className:"overflow-hidden rounded-md border border-gray-200 dark:border-gray-800",children:[u.jsx("button",{type:"button",onClick:()=>i(T?null:N.id),className:"flex w-full items-center justify-between gap-4 px-4 py-3 text-left text-sm font-medium text-gray-900 transition hover:bg-gray-50 dark:text-gray-100 dark:hover:bg-gray-900/40",children:u.jsxs("div",{className:"flex w-full items-center justify-between gap-4",children:[u.jsxs("div",{className:"truncate",children:[u.jsx("p",{className:"truncate text-sm font-medium text-gray-900 dark:text-gray-50",children:N.name}),u.jsx("p",{className:"mt-0.5 truncate text-xs text-gray-600 dark:text-gray-400",children:N.description||"No description provided"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full px-2.5 py-1 text-xs font-medium ${N.active?"bg-emerald-100 text-emerald-700 dark:bg-emerald-500/10 dark:text-emerald-300":"bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-400"}`,children:[u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-3.5","aria-hidden":"true",children:N.active?u.jsxs(u.Fragment,{children:[u.jsx("path",{d:"m9 11 3 3L22 4"}),u.jsx("path",{d:"M21.801 10A10 10 0 1 1 17 3.335"})]}):u.jsx("circle",{cx:"12",cy:"12",r:"10"})}),N.active?"Live":"Inactive"]}),u.jsx("svg",{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",className:`size-5 shrink-0 transition-transform duration-150 text-gray-400 dark:text-gray-600 ${T?"rotate-180":""}`,"aria-hidden":"true",children:u.jsx("path",{d:"m6 9 6 6 6-6"})})]})]})}),T&&u.jsx("div",{className:"border-t border-gray-200 bg-gray-50 px-4 py-5 text-sm dark:border-gray-800 dark:bg-gray-900/40",children:u.jsxs("div",{className:"overflow-hidden pb-4 text-sm text-gray-700 dark:text-gray-200",children:[u.jsx("div",{className:"mx-auto flex w-full items-center justify-between gap-3 text-sm text-gray-500 dark:text-gray-500",children:u.jsx("div",{className:"h-[1px] w-full bg-gray-200 dark:bg-gray-800"})}),u.jsx("ul",{role:"list",className:"mt-6 space-y-6","aria-label":"Rule steps",children:M.map((_,R)=>{const L=R===M.length-1;return u.jsxs("li",{className:"relative flex gap-x-4",children:[!L&&u.jsx("div",{className:"-bottom-6 absolute left-0 top-0 flex w-9 justify-center",children:u.jsx("div",{className:"w-px bg-gray-200 dark:bg-gray-800"})}),u.jsx(xbe,{variant:_.variant}),u.jsxs("div",{children:[u.jsxs("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-50",children:[R+1,". ",_.title]}),_.description&&u.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:_.description})]})]},`${N.id}-step-${R}`)})}),u.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-between gap-3",children:[u.jsx("time",{className:"flex-none text-xs leading-5 text-gray-500 dark:text-gray-500",children:I?`Updated ${I}`:"Updated recently"}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("button",{type:"button",onClick:()=>m&&m(N),className:"relative inline-flex items-center justify-center whitespace-nowrap rounded-md border border-blue-500 px-3 py-1.5 text-sm font-medium text-blue-600 shadow-sm transition hover:bg-blue-50 dark:border-blue-400 dark:text-blue-400 dark:hover:bg-blue-900/20",children:[u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"h-4 w-4 -ml-0.5 mr-1.5","aria-hidden":"true",children:u.jsx("path",{d:"M19.3788 15.1057C20.9258 11.4421 19.5373 7.11431 16.0042 5.0745C13.4511 3.60046 10.4232 3.69365 8.03452 5.0556L7.04216 3.31879C10.028 1.61639 13.8128 1.4999 17.0042 3.34245C21.4949 5.93513 23.2139 11.4848 21.1217 16.112L22.4635 16.8867L18.2984 19.1008L18.1334 14.3867L19.3788 15.1057ZM4.62961 8.89968C3.08263 12.5633 4.47116 16.8911 8.00421 18.9309C10.5573 20.4049 13.5851 20.3118 15.9737 18.9499L16.9661 20.6867C13.9803 22.389 10.1956 22.5055 7.00421 20.663C2.51357 18.0703 0.794565 12.5206 2.88672 7.89342L1.54492 7.11873L5.70999 4.90463L5.87505 9.61873L4.62961 8.89968ZM13.4184 14.8311L10.59 12.0027L7.76157 14.8311L6.34736 13.4169L10.59 9.17428L13.4184 12.0027L16.2469 9.17428L17.6611 10.5885L13.4184 14.8311Z"})}),"Apply to history"]}),u.jsxs("button",{type:"button",onClick:()=>l(N),className:"relative inline-flex items-center justify-center whitespace-nowrap rounded-md border border-gray-300 px-3 py-1.5 text-sm font-medium text-gray-900 shadow-sm transition hover:bg-gray-50 dark:border-gray-800 dark:bg-gray-900 dark:text-gray-50 dark:hover:bg-gray-800/30",children:[u.jsxs("svg",{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",className:"lucide lucide-settings -ml-0.5 mr-1.5 size-4 shrink-0","aria-hidden":"true",children:[u.jsx("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),u.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),"Edit"]}),u.jsxs("button",{type:"button",onClick:()=>{const _=kbe(N);_&&(h?h(_):d&&d(_))},className:"relative inline-flex items-center justify-center whitespace-nowrap rounded-md border border-gray-300 px-3 py-1.5 text-sm font-medium text-gray-900 shadow-sm transition hover:bg-gray-50 dark:border-gray-800 dark:bg-gray-900 dark:text-gray-50 dark:hover:bg-gray-800/30",title:"Duplicate rule","aria-label":"Duplicate rule",children:[u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"h-4 w-4 -ml-0.5 mr-1.5",children:[u.jsx("path",{d:"M9 7a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V7z"}),u.jsx("path",{d:"M5 9a2 2 0 0 1 2-2h1v7a4 4 0 0 0 4 4h7v1a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V9z"})]}),"Duplicate"]}),u.jsxs("button",{type:"button",onClick:()=>v&&v(N),className:"relative inline-flex items-center justify-center whitespace-nowrap rounded-md border border-gray-300 px-3 py-1.5 text-sm font-medium text-gray-900 shadow-sm transition hover:bg-gray-50 dark:border-gray-800 dark:bg-gray-900 dark:text-gray-50 dark:hover:bg-gray-800/30",title:"Export rule","aria-label":"Export rule",children:[u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"-ml-0.5 mr-1.5 size-4",children:[u.jsx("path",{d:"M5 7v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7"}),u.jsx("path",{d:"M12 3v12"}),u.jsx("path",{d:"m8 11 4 4 4-4"})]}),"Export"]}),u.jsxs("button",{type:"button",onClick:()=>c(N),className:"inline-flex items-center gap-1 rounded-md border border-grey-300 px-2.5 py-1.5 text-xs font-medium text-red-700 transition hover:bg-red-50 dark:border-red-900/40 dark:text-red-300 dark:hover:bg-red-950",children:[u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"-ms-0.5",children:[u.jsx("path",{d:"M3 6h18"}),u.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}),u.jsx("path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),u.jsx("line",{x1:"10",x2:"10",y1:"11",y2:"17"}),u.jsx("line",{x1:"14",x2:"14",y1:"11",y2:"17"})]}),"Delete"]}),u.jsxs("button",{type:"button",onClick:()=>b&&b(N),disabled:p||r,className:"relative inline-flex items-center justify-center whitespace-nowrap rounded-md border border-gray-300 px-3 py-1.5 text-sm font-medium text-gray-900 shadow-sm transition hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-70 dark:border-gray-800 dark:bg-gray-900 dark:text-gray-50 dark:hover:bg-gray-800/30",title:N.active?"Pause rule":"Activate rule",children:[N.active?u.jsxs("svg",{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",className:"lucide lucide-circle-pause -ml-0.5 mr-1.5 size-4 shrink-0","aria-hidden":"true",children:[u.jsx("circle",{cx:"12",cy:"12",r:"10"}),u.jsx("line",{x1:"10",x2:"10",y1:"15",y2:"9"}),u.jsx("line",{x1:"14",x2:"14",y1:"15",y2:"9"})]}):u.jsxs("svg",{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",className:"lucide lucide-circle-play -ml-0.5 mr-1.5 size-4 shrink-0","aria-hidden":"true",children:[u.jsx("circle",{cx:"12",cy:"12",r:"10"}),u.jsx("polygon",{points:"10 8 16 12 10 16"})]}),N.active?"Pause":"Play"]})]})]})]})})]},N.id||N.name)})}),k&&u.jsx(MA,{meta:k,onPageChange:S,alwaysShow:j})]})]})};function Ebe({id:e,descriptor:t,value:r,onChange:n,readOnly:o}){if(!t||t.hidden)return null;const a=t.label||t.name,i=o??!!t.readonly,s=t.help||(t.description?"":t.description);return u.jsxs("div",{className:"space-y-1",children:[u.jsxs("label",{htmlFor:e,className:"text-xs font-medium text-gray-500 dark:text-gray-400",children:[a,t.required&&u.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("input",{id:e,type:"checkbox",disabled:i,checked:!!r,onChange:l=>n(l.target.checked),className:"size-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500 disabled:cursor-not-allowed disabled:opacity-60 dark:border-gray-700 dark:bg-gray-900"}),t.description&&u.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:t.description})]}),s&&u.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:s})]})}function Sbe({id:e,descriptor:t,value:r,onChange:n,provider:o,readOnly:a}){if(!t||t.hidden)return null;const i=t.label||t.name,s=a??!!t.readonly,l=t.help||t.description,c="block w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm transition focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 disabled:cursor-not-allowed disabled:opacity-60 dark:border-gray-700 dark:bg-gray-950 dark:text-gray-50 dark:focus:border-blue-700 dark:focus:ring-blue-700/30",d=(t.choices||[]).filter(f=>!f.group||!o||f.group===o);return u.jsxs("div",{className:"space-y-1",children:[u.jsxs("label",{htmlFor:e,className:"text-xs font-medium text-gray-500 dark:text-gray-400",children:[i,t.required&&u.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),u.jsx("select",{id:e,disabled:s,value:typeof r=="string"?r:r??"",onChange:f=>n(f.target.value),className:c,children:d.map(f=>u.jsx("option",{value:f.value,title:f.description||"",children:f.label||f.value},f.value))}),l&&u.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:l})]})}function Nbe({id:e,descriptor:t,value:r,onChange:n,provider:o,readOnly:a}){if(!t||t.hidden)return null;const i=t.label||t.name,s=a??!!t.readonly,l=t.help||t.description,c="block w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm transition focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 disabled:cursor-not-allowed disabled:opacity-60 dark:border-gray-700 dark:bg-gray-950 dark:text-gray-50 dark:focus:border-blue-700 dark:focus:ring-blue-700/30",d=r&&typeof r=="object"&&r!==null?r:{},f=(h,b)=>{const v={...d};b?h in v||(v[h]=""):delete v[h],n(v)},m=(h,b)=>{const v={...d};v[h]=b,n(v)},p=(t.choices||[]).filter(h=>!h.group||!o||h.group===o);return u.jsxs("div",{className:"space-y-1",children:[u.jsxs("label",{className:"text-xs font-medium text-gray-500 dark:text-gray-400",children:[i,t.required&&u.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),u.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:p.map(h=>{var b,v;const x=((b=h.meta)==null?void 0:b.key)||h.value,k=Object.prototype.hasOwnProperty.call(d,x),S=((v=h.meta)==null?void 0:v.type)||"string",j=(()=>{const O=d[x];if(S==="object"&&typeof O=="object"&&O!==null)try{return JSON.stringify(O)}catch{return String(O)}return O??""})();return u.jsxs("div",{className:"rounded-md border border-gray-200 p-2 dark:border-gray-800",children:[u.jsxs("label",{className:"flex items-start gap-2 text-sm",children:[u.jsx("input",{type:"checkbox",disabled:s,checked:k,onChange:O=>f(x,O.target.checked),className:"mt-1 size-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500 disabled:cursor-not-allowed disabled:opacity-60 dark:border-gray-700 dark:bg-gray-900"}),u.jsxs("span",{className:"flex-1",children:[u.jsx("span",{className:"font-medium text-gray-800 dark:text-gray-200",children:h.label||h.value}),h.description&&u.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-500",children:h.description})]})]}),k&&u.jsx("div",{className:"mt-2",children:S==="object"?u.jsx("textarea",{rows:3,disabled:s,value:j,onChange:O=>m(x,O.target.value),placeholder:h.label,className:c}):u.jsx("input",{type:S==="integer"||S==="number"?"number":"text",disabled:s,value:j,onChange:O=>m(x,O.target.value),placeholder:h.label,className:c})})]},h.value)})}),l&&u.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:l})]})}function Obe({id:e,descriptor:t,value:r,onChange:n,readOnly:o}){if(!t||t.hidden)return null;const a=t.label||t.name,i=o??!!t.readonly,s=t.placeholder||"",l=t.help||t.description;return u.jsxs("div",{className:"space-y-1",children:[u.jsxs("label",{htmlFor:e,className:"text-xs font-medium text-gray-500 dark:text-gray-400",children:[a,t.required&&u.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),u.jsx("input",{id:e,type:"number",step:t.type==="integer"?1:"any",disabled:i,value:r??"",onChange:c=>n(c.target.value),placeholder:s,className:"block w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm transition focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 disabled:cursor-not-allowed disabled:opacity-60 dark:border-gray-700 dark:bg-gray-950 dark:text-gray-50 dark:focus:border-blue-700 dark:focus:ring-blue-700/30"}),l&&u.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:l})]})}function Cbe({id:e,descriptor:t,value:r,onChange:n,readOnly:o}){if(!t||t.hidden)return null;const a=t.label||t.name,i=o??!!t.readonly,s=t.placeholder||"",l=t.help||t.description;return u.jsxs("div",{className:"space-y-1",children:[u.jsxs("label",{htmlFor:e,className:"text-xs font-medium text-gray-500 dark:text-gray-400",children:[a,t.required&&u.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),u.jsx("input",{id:e,type:"text",disabled:i,value:Array.isArray(r)?r.join(", "):r??"",onChange:c=>n(c.target.value),placeholder:s,className:"block w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm transition focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 disabled:cursor-not-allowed disabled:opacity-60 dark:border-gray-700 dark:bg-gray-950 dark:text-gray-50 dark:focus:border-blue-700 dark:focus:ring-blue-700/30"}),l&&u.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:l})]})}function Pbe({id:e,descriptor:t,value:r,onChange:n,readOnly:o}){if(!t||t.hidden)return null;const a=t.label||t.name,i=o??!!t.readonly,s=t.placeholder||"",l=t.help||t.description,c="block w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm transition focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 disabled:cursor-not-allowed disabled:opacity-60 dark:border-gray-700 dark:bg-gray-950 dark:text-gray-50 dark:focus:border-blue-700 dark:focus:ring-blue-700/30",d=typeof r=="string"?r:r?JSON.stringify(r,null,2):"";return u.jsxs("div",{className:"space-y-1",children:[u.jsxs("label",{htmlFor:e,className:"text-xs font-medium text-gray-500 dark:text-gray-400",children:[a,t.required&&u.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),u.jsx("textarea",{id:e,rows:4,disabled:i,value:d,onChange:f=>n(f.target.value),placeholder:s,className:c}),l&&u.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:l})]})}function Abe({id:e,descriptor:t,value:r,onChange:n,readOnly:o}){if(!t||t.hidden)return null;const a=t.label||t.name,i=o??!!t.readonly,s=t.placeholder||"",l=t.help||t.description;return u.jsxs("div",{className:"space-y-1",children:[u.jsxs("label",{htmlFor:e,className:"text-xs font-medium text-gray-500 dark:text-gray-400",children:[a,t.required&&u.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),u.jsx("input",{id:e,type:"text",disabled:i,value:typeof r=="string"?r:r??"",onChange:c=>n(c.target.value),placeholder:s,className:"block w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm transition focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 disabled:cursor-not-allowed disabled:opacity-60 dark:border-gray-700 dark:bg-gray-950 dark:text-gray-50 dark:focus:border-blue-700 dark:focus:ring-blue-700/30"}),l&&u.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:l})]})}function Tbe({id:e,descriptor:t,value:r,onChange:n,readOnly:o}){if(!t||t.hidden)return null;const a=t.label||t.name,i=o??!!t.readonly,s=t.placeholder||"",l=t.help||t.description;return u.jsxs("div",{className:"space-y-1",children:[u.jsxs("label",{htmlFor:e,className:"text-xs font-medium text-gray-500 dark:text-gray-400",children:[a,t.required&&u.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),u.jsx("input",{id:e,type:"password",disabled:i,value:typeof r=="string"?r:r??"",onChange:c=>n(c.target.value),placeholder:s,className:"block w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm transition focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 disabled:cursor-not-allowed disabled:opacity-60 dark:border-gray-700 dark:bg-gray-950 dark:text-gray-50 dark:focus:border-blue-700 dark:focus:ring-blue-700/30"}),l&&u.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:l})]})}class Mbe{add(t,r,n){if(typeof arguments[0]!="string")for(let o in arguments[0])this.add(o,arguments[0][o],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(o){this[o]=this[o]||[],r&&this[o][n?"unshift":"push"](r)},this)}run(t,r){this[t]=this[t]||[],this[t].forEach(function(n){n.call(r&&r.context?r.context:r,r)})}}class _be{constructor(t){this.jsep=t,this.registered={}}register(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];r.forEach(o=>{if(typeof o!="object"||!o.name||!o.init)throw new Error("Invalid JSEP plugin format");this.registered[o.name]||(o.init(this.jsep),this.registered[o.name]=o)})}}class we{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+we.version}static addUnaryOp(t){return we.max_unop_len=Math.max(t.length,we.max_unop_len),we.unary_ops[t]=1,we}static addBinaryOp(t,r,n){return we.max_binop_len=Math.max(t.length,we.max_binop_len),we.binary_ops[t]=r,n?we.right_associative.add(t):we.right_associative.delete(t),we}static addIdentifierChar(t){return we.additional_identifier_chars.add(t),we}static addLiteral(t,r){return we.literals[t]=r,we}static removeUnaryOp(t){return delete we.unary_ops[t],t.length===we.max_unop_len&&(we.max_unop_len=we.getMaxKeyLen(we.unary_ops)),we}static removeAllUnaryOps(){return we.unary_ops={},we.max_unop_len=0,we}static removeIdentifierChar(t){return we.additional_identifier_chars.delete(t),we}static removeBinaryOp(t){return delete we.binary_ops[t],t.length===we.max_binop_len&&(we.max_binop_len=we.getMaxKeyLen(we.binary_ops)),we.right_associative.delete(t),we}static removeAllBinaryOps(){return we.binary_ops={},we.max_binop_len=0,we}static removeLiteral(t){return delete we.literals[t],we}static removeAllLiterals(){return we.literals={},we}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new we(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(r=>r.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return we.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!we.binary_ops[String.fromCharCode(t)]||we.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return we.isIdentifierStart(t)||we.isDecimalDigit(t)}throwError(t){const r=new Error(t+" at character "+this.index);throw r.index=this.index,r.description=t,r}runHook(t,r){if(we.hooks[t]){const n={context:this,node:r};return we.hooks.run(t,n),n.node}return r}searchHook(t){if(we.hooks[t]){const r={context:this};return we.hooks[t].find(function(n){return n.call(r.context,r),r.node}),r.node}}gobbleSpaces(){let t=this.code;for(;t===we.SPACE_CODE||t===we.TAB_CODE||t===we.LF_CODE||t===we.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");const t=this.gobbleExpressions(),r=t.length===1?t[0]:{type:we.COMPOUND,body:t};return this.runHook("after-all",r)}gobbleExpressions(t){let r=[],n,o;for(;this.index<this.expr.length;)if(n=this.code,n===we.SEMCOL_CODE||n===we.COMMA_CODE)this.index++;else if(o=this.gobbleExpression())r.push(o);else if(this.index<this.expr.length){if(n===t)break;this.throwError('Unexpected "'+this.char+'"')}return r}gobbleExpression(){const t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,we.max_binop_len),r=t.length;for(;r>0;){if(we.binary_ops.hasOwnProperty(t)&&(!we.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!we.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=r,t;t=t.substr(0,--r)}return!1}gobbleBinaryExpression(){let t,r,n,o,a,i,s,l,c;if(i=this.gobbleToken(),!i||(r=this.gobbleBinaryOp(),!r))return i;for(a={value:r,prec:we.binaryPrecedence(r),right_a:we.right_associative.has(r)},s=this.gobbleToken(),s||this.throwError("Expected expression after "+r),o=[i,a,s];r=this.gobbleBinaryOp();){if(n=we.binaryPrecedence(r),n===0){this.index-=r.length;break}a={value:r,prec:n,right_a:we.right_associative.has(r)},c=r;const d=f=>a.right_a&&f.right_a?n>f.prec:n<=f.prec;for(;o.length>2&&d(o[o.length-2]);)s=o.pop(),r=o.pop().value,i=o.pop(),t={type:we.BINARY_EXP,operator:r,left:i,right:s},o.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+c),o.push(a,t)}for(l=o.length-1,t=o[l];l>1;)t={type:we.BINARY_EXP,operator:o[l-1].value,left:o[l-2],right:t},l-=2;return t}gobbleToken(){let t,r,n,o;if(this.gobbleSpaces(),o=this.searchHook("gobble-token"),o)return this.runHook("after-token",o);if(t=this.code,we.isDecimalDigit(t)||t===we.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===we.SQUOTE_CODE||t===we.DQUOTE_CODE)o=this.gobbleStringLiteral();else if(t===we.OBRACK_CODE)o=this.gobbleArray();else{for(r=this.expr.substr(this.index,we.max_unop_len),n=r.length;n>0;){if(we.unary_ops.hasOwnProperty(r)&&(!we.isIdentifierStart(this.code)||this.index+r.length<this.expr.length&&!we.isIdentifierPart(this.expr.charCodeAt(this.index+r.length)))){this.index+=n;const a=this.gobbleToken();return a||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:we.UNARY_EXP,operator:r,argument:a,prefix:!0})}r=r.substr(0,--n)}we.isIdentifierStart(t)?(o=this.gobbleIdentifier(),we.literals.hasOwnProperty(o.name)?o={type:we.LITERAL,value:we.literals[o.name],raw:o.name}:o.name===we.this_str&&(o={type:we.THIS_EXP})):t===we.OPAREN_CODE&&(o=this.gobbleGroup())}return o?(o=this.gobbleTokenProperty(o),this.runHook("after-token",o)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let r=this.code;for(;r===we.PERIOD_CODE||r===we.OBRACK_CODE||r===we.OPAREN_CODE||r===we.QUMARK_CODE;){let n;if(r===we.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==we.PERIOD_CODE)break;n=!0,this.index+=2,this.gobbleSpaces(),r=this.code}this.index++,r===we.OBRACK_CODE?(t={type:we.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),r=this.code,r!==we.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):r===we.OPAREN_CODE?t={type:we.CALL_EXP,arguments:this.gobbleArguments(we.CPAREN_CODE),callee:t}:(r===we.PERIOD_CODE||n)&&(n&&this.index--,this.gobbleSpaces(),t={type:we.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),n&&(t.optional=!0),this.gobbleSpaces(),r=this.code}return t}gobbleNumericLiteral(){let t="",r,n;for(;we.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===we.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);we.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(r=this.char,r==="e"||r==="E"){for(t+=this.expr.charAt(this.index++),r=this.char,(r==="+"||r==="-")&&(t+=this.expr.charAt(this.index++));we.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);we.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return n=this.code,we.isIdentifierStart(n)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(n===we.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===we.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:we.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="";const r=this.index,n=this.expr.charAt(this.index++);let o=!1;for(;this.index<this.expr.length;){let a=this.expr.charAt(this.index++);if(a===n){o=!0;break}else if(a==="\\")switch(a=this.expr.charAt(this.index++),a){case"n":t+=`
142
+ `;break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=a}else t+=a}return o||this.throwError('Unclosed quote after "'+t+'"'),{type:we.LITERAL,value:t,raw:this.expr.substring(r,this.index)}}gobbleIdentifier(){let t=this.code,r=this.index;for(we.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,we.isIdentifierPart(t));)this.index++;return{type:we.IDENTIFIER,name:this.expr.slice(r,this.index)}}gobbleArguments(t){const r=[];let n=!1,o=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let a=this.code;if(a===t){n=!0,this.index++,t===we.CPAREN_CODE&&o&&o>=r.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(a===we.COMMA_CODE){if(this.index++,o++,o!==r.length){if(t===we.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===we.CBRACK_CODE)for(let i=r.length;i<o;i++)r.push(null)}}else if(r.length!==o&&o!==0)this.throwError("Expected comma");else{const i=this.gobbleExpression();(!i||i.type===we.COMPOUND)&&this.throwError("Expected comma"),r.push(i)}}return n||this.throwError("Expected "+String.fromCharCode(t)),r}gobbleGroup(){this.index++;let t=this.gobbleExpressions(we.CPAREN_CODE);if(this.code===we.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:we.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:we.ARRAY_EXP,elements:this.gobbleArguments(we.CBRACK_CODE)}}}const Ibe=new Mbe;Object.assign(we,{hooks:Ibe,plugins:new _be(we),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});we.max_unop_len=we.getMaxKeyLen(we.unary_ops);we.max_binop_len=we.getMaxKeyLen(we.binary_ops);const ha=e=>new we(e).parse(),Dbe=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(we).filter(e=>!Dbe.includes(e)&&ha[e]===void 0).forEach(e=>{ha[e]=we[e]});ha.Jsep=we;const Lbe="ConditionalExpression";var Rbe={name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;const r=t.node,n=this.gobbleExpression();if(n||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;const o=this.gobbleExpression();if(o||this.throwError("Expected expression"),t.node={type:Lbe,test:r,consequent:n,alternate:o},r.operator&&e.binary_ops[r.operator]<=.9){let a=r;for(;a.right.operator&&e.binary_ops[a.right.operator]<=.9;)a=a.right;t.node.test=a.right,a.right=t.node,t.node=r}}else this.throwError("Expected :")}})}};ha.plugins.register(Rbe);const gA=47,Fbe=92;var $be={name:"regex",init(e){e.hooks.add("gobble-token",function(t){if(this.code===gA){const r=++this.index;let n=!1;for(;this.index<this.expr.length;){if(this.code===gA&&!n){const o=this.expr.slice(r,this.index);let a="";for(;++this.index<this.expr.length;){const s=this.code;if(s>=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57)a+=this.char;else break}let i;try{i=new RegExp(o,a)}catch(s){this.throwError(s.message)}return t.node={type:e.LITERAL,value:i,raw:this.expr.slice(r-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===e.OBRACK_CODE?n=!0:n&&this.code===e.CBRACK_CODE&&(n=!1),this.index+=this.code===Fbe?2:1}this.throwError("Unclosed Regex")}})}};const f0=43,Bbe=45,Hs={name:"assignment",assignmentOperators:new Set(["=","*=","**=","/=","%=","+=","-=","<<=",">>=",">>>=","&=","^=","|=","||=","&&=","??="]),updateOperators:[f0,Bbe],assignmentPrecedence:.9,init(e){const t=[e.IDENTIFIER,e.MEMBER_EXP];Hs.assignmentOperators.forEach(n=>e.addBinaryOp(n,Hs.assignmentPrecedence,!0)),e.hooks.add("gobble-token",function(n){const o=this.code;Hs.updateOperators.some(a=>a===o&&a===this.expr.charCodeAt(this.index+1))&&(this.index+=2,n.node={type:"UpdateExpression",operator:o===f0?"++":"--",argument:this.gobbleTokenProperty(this.gobbleIdentifier()),prefix:!0},(!n.node.argument||!t.includes(n.node.argument.type))&&this.throwError(`Unexpected ${n.node.operator}`))}),e.hooks.add("after-token",function(n){if(n.node){const o=this.code;Hs.updateOperators.some(a=>a===o&&a===this.expr.charCodeAt(this.index+1))&&(t.includes(n.node.type)||this.throwError(`Unexpected ${n.node.operator}`),this.index+=2,n.node={type:"UpdateExpression",operator:o===f0?"++":"--",argument:n.node,prefix:!1})}}),e.hooks.add("after-expression",function(n){n.node&&r(n.node)});function r(n){Hs.assignmentOperators.has(n.operator)?(n.type="AssignmentExpression",r(n.left),r(n.right)):n.operator||Object.values(n).forEach(o=>{o&&typeof o=="object"&&r(o)})}}};ha.plugins.register($be,Hs);ha.addUnaryOp("typeof");ha.addLiteral("null",null);ha.addLiteral("undefined",void 0);const zbe=new Set(["constructor","__proto__","__defineGetter__","__defineSetter__"]),Xt={evalAst(e,t){switch(e.type){case"BinaryExpression":case"LogicalExpression":return Xt.evalBinaryExpression(e,t);case"Compound":return Xt.evalCompound(e,t);case"ConditionalExpression":return Xt.evalConditionalExpression(e,t);case"Identifier":return Xt.evalIdentifier(e,t);case"Literal":return Xt.evalLiteral(e,t);case"MemberExpression":return Xt.evalMemberExpression(e,t);case"UnaryExpression":return Xt.evalUnaryExpression(e,t);case"ArrayExpression":return Xt.evalArrayExpression(e,t);case"CallExpression":return Xt.evalCallExpression(e,t);case"AssignmentExpression":return Xt.evalAssignmentExpression(e,t);default:throw SyntaxError("Unexpected expression",e)}},evalBinaryExpression(e,t){return{"||":(r,n)=>r||n(),"&&":(r,n)=>r&&n(),"|":(r,n)=>r|n(),"^":(r,n)=>r^n(),"&":(r,n)=>r&n(),"==":(r,n)=>r==n(),"!=":(r,n)=>r!=n(),"===":(r,n)=>r===n(),"!==":(r,n)=>r!==n(),"<":(r,n)=>r<n(),">":(r,n)=>r>n(),"<=":(r,n)=>r<=n(),">=":(r,n)=>r>=n(),"<<":(r,n)=>r<<n(),">>":(r,n)=>r>>n(),">>>":(r,n)=>r>>>n(),"+":(r,n)=>r+n(),"-":(r,n)=>r-n(),"*":(r,n)=>r*n(),"/":(r,n)=>r/n(),"%":(r,n)=>r%n()}[e.operator](Xt.evalAst(e.left,t),()=>Xt.evalAst(e.right,t))},evalCompound(e,t){let r;for(let n=0;n<e.body.length;n++){e.body[n].type==="Identifier"&&["var","let","const"].includes(e.body[n].name)&&e.body[n+1]&&e.body[n+1].type==="AssignmentExpression"&&(n+=1);const o=e.body[n];r=Xt.evalAst(o,t)}return r},evalConditionalExpression(e,t){return Xt.evalAst(e.test,t)?Xt.evalAst(e.consequent,t):Xt.evalAst(e.alternate,t)},evalIdentifier(e,t){if(Object.hasOwn(t,e.name))return t[e.name];throw ReferenceError(`${e.name} is not defined`)},evalLiteral(e){return e.value},evalMemberExpression(e,t){const r=String(e.computed?Xt.evalAst(e.property):e.property.name),n=Xt.evalAst(e.object,t);if(n==null)throw TypeError(`Cannot read properties of ${n} (reading '${r}')`);if(!Object.hasOwn(n,r)&&zbe.has(r))throw TypeError(`Cannot read properties of ${n} (reading '${r}')`);const o=n[r];return typeof o=="function"?o.bind(n):o},evalUnaryExpression(e,t){return{"-":r=>-Xt.evalAst(r,t),"!":r=>!Xt.evalAst(r,t),"~":r=>~Xt.evalAst(r,t),"+":r=>+Xt.evalAst(r,t),typeof:r=>typeof Xt.evalAst(r,t)}[e.operator](e.argument)},evalArrayExpression(e,t){return e.elements.map(r=>Xt.evalAst(r,t))},evalCallExpression(e,t){const r=e.arguments.map(n=>Xt.evalAst(n,t));return Xt.evalAst(e.callee,t)(...r)},evalAssignmentExpression(e,t){if(e.left.type!=="Identifier")throw SyntaxError("Invalid left-hand side in assignment");const r=e.left.name,n=Xt.evalAst(e.right,t);return t[r]=n,t[r]}};class Hbe{constructor(t){this.code=t,this.ast=ha(this.code)}runInNewContext(t){const r=Object.assign(Object.create(null),t);return Xt.evalAst(this.ast,r)}}function Fa(e,t){return e=e.slice(),e.push(t),e}function jk(e,t){return t=t.slice(),t.unshift(e),t}class qbe extends Error{constructor(t){super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),this.avoidNew=!0,this.value=t,this.name="NewError"}}function Lt(e,t,r,n,o){if(!(this instanceof Lt))try{return new Lt(e,t,r,n,o)}catch(i){if(!i.avoidNew)throw i;return i.value}typeof e=="string"&&(o=n,n=r,r=t,t=e,e=null);const a=e&&typeof e=="object";if(e=e||{},this.json=e.json||r,this.path=e.path||t,this.resultType=e.resultType||"value",this.flatten=e.flatten||!1,this.wrap=Object.hasOwn(e,"wrap")?e.wrap:!0,this.sandbox=e.sandbox||{},this.eval=e.eval===void 0?"safe":e.eval,this.ignoreEvalErrors=typeof e.ignoreEvalErrors>"u"?!1:e.ignoreEvalErrors,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||n||null,this.otherTypeCallback=e.otherTypeCallback||o||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},e.autostart!==!1){const i={path:a?e.path:t};a?"json"in e&&(i.json=e.json):i.json=r;const s=this.evaluate(i);if(!s||typeof s!="object")throw new qbe(s);return s}}Lt.prototype.evaluate=function(e,t,r,n){let o=this.parent,a=this.parentProperty,{flatten:i,wrap:s}=this;if(this.currResultType=this.resultType,this.currEval=this.eval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,t=t||this.json,e=e||this.path,e&&typeof e=="object"&&!Array.isArray(e)){if(!e.path&&e.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!Object.hasOwn(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');({json:t}=e),i=Object.hasOwn(e,"flatten")?e.flatten:i,this.currResultType=Object.hasOwn(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=Object.hasOwn(e,"sandbox")?e.sandbox:this.currSandbox,s=Object.hasOwn(e,"wrap")?e.wrap:s,this.currEval=Object.hasOwn(e,"eval")?e.eval:this.currEval,r=Object.hasOwn(e,"callback")?e.callback:r,this.currOtherTypeCallback=Object.hasOwn(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,o=Object.hasOwn(e,"parent")?e.parent:o,a=Object.hasOwn(e,"parentProperty")?e.parentProperty:a,e=e.path}if(o=o||null,a=a||null,Array.isArray(e)&&(e=Lt.toPathString(e)),!e&&e!==""||!t)return;const l=Lt.toPathArray(e);l[0]==="$"&&l.length>1&&l.shift(),this._hasParentSelector=null;const c=this._trace(l,t,["$"],o,a,r).filter(function(d){return d&&!d.isParentSelector});return c.length?!s&&c.length===1&&!c[0].hasArrExpr?this._getPreferredOutput(c[0]):c.reduce((d,f)=>{const m=this._getPreferredOutput(f);return i&&Array.isArray(m)?d=d.concat(m):d.push(m),d},[]):s?[]:void 0};Lt.prototype._getPreferredOutput=function(e){const t=this.currResultType;switch(t){case"all":{const r=Array.isArray(e.path)?e.path:Lt.toPathArray(e.path);return e.pointer=Lt.toPointer(r),e.path=typeof e.path=="string"?e.path:Lt.toPathString(e.path),e}case"value":case"parent":case"parentProperty":return e[t];case"path":return Lt.toPathString(e[t]);case"pointer":return Lt.toPointer(e.path);default:throw new TypeError("Unknown result type")}};Lt.prototype._handleCallback=function(e,t,r){if(t){const n=this._getPreferredOutput(e);e.path=typeof e.path=="string"?e.path:Lt.toPathString(e.path),t(n,r,e)}};Lt.prototype._trace=function(e,t,r,n,o,a,i,s){let l;if(!e.length)return l={path:r,value:t,parent:n,parentProperty:o,hasArrExpr:i},this._handleCallback(l,a,"value"),l;const c=e[0],d=e.slice(1),f=[];function m(p){Array.isArray(p)?p.forEach(h=>{f.push(h)}):f.push(p)}if((typeof c!="string"||s)&&t&&Object.hasOwn(t,c))m(this._trace(d,t[c],Fa(r,c),t,c,a,i));else if(c==="*")this._walk(t,p=>{m(this._trace(d,t[p],Fa(r,p),t,p,a,!0,!0))});else if(c==="..")m(this._trace(d,t,r,n,o,a,i)),this._walk(t,p=>{typeof t[p]=="object"&&m(this._trace(e.slice(),t[p],Fa(r,p),t,p,a,!0))});else{if(c==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:d,isParentSelector:!0};if(c==="~")return l={path:Fa(r,c),value:o,parent:n,parentProperty:null},this._handleCallback(l,a,"property"),l;if(c==="$")m(this._trace(d,t,r,null,null,a,i));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(c))m(this._slice(c,d,t,r,n,o,a));else if(c.indexOf("?(")===0){if(this.currEval===!1)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");const p=c.replace(/^\?\((.*?)\)$/u,"$1"),h=/@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(p);h?this._walk(t,b=>{const v=[h[2]],x=h[1]?t[b][h[1]]:t[b];this._trace(v,x,r,n,o,a,!0).length>0&&m(this._trace(d,t[b],Fa(r,b),t,b,a,!0))}):this._walk(t,b=>{this._eval(p,t[b],b,r,n,o)&&m(this._trace(d,t[b],Fa(r,b),t,b,a,!0))})}else if(c[0]==="("){if(this.currEval===!1)throw new Error("Eval [(expr)] prevented in JSONPath expression.");m(this._trace(jk(this._eval(c,t,r.at(-1),r.slice(0,-1),n,o),d),t,r,n,o,a,i))}else if(c[0]==="@"){let p=!1;const h=c.slice(1,-2);switch(h){case"scalar":(!t||!["object","function"].includes(typeof t))&&(p=!0);break;case"boolean":case"string":case"undefined":case"function":typeof t===h&&(p=!0);break;case"integer":Number.isFinite(t)&&!(t%1)&&(p=!0);break;case"number":Number.isFinite(t)&&(p=!0);break;case"nonFinite":typeof t=="number"&&!Number.isFinite(t)&&(p=!0);break;case"object":t&&typeof t===h&&(p=!0);break;case"array":Array.isArray(t)&&(p=!0);break;case"other":p=this.currOtherTypeCallback(t,r,n,o);break;case"null":t===null&&(p=!0);break;default:throw new TypeError("Unknown value type "+h)}if(p)return l={path:r,value:t,parent:n,parentProperty:o},this._handleCallback(l,a,"value"),l}else if(c[0]==="`"&&t&&Object.hasOwn(t,c.slice(1))){const p=c.slice(1);m(this._trace(d,t[p],Fa(r,p),t,p,a,i,!0))}else if(c.includes(",")){const p=c.split(",");for(const h of p)m(this._trace(jk(h,d),t,r,n,o,a,!0))}else!s&&t&&Object.hasOwn(t,c)&&m(this._trace(d,t[c],Fa(r,c),t,c,a,i,!0))}if(this._hasParentSelector)for(let p=0;p<f.length;p++){const h=f[p];if(h&&h.isParentSelector){const b=this._trace(h.expr,t,h.path,n,o,a,i);if(Array.isArray(b)){f[p]=b[0];const v=b.length;for(let x=1;x<v;x++)p++,f.splice(p,0,b[x])}else f[p]=b}}return f};Lt.prototype._walk=function(e,t){if(Array.isArray(e)){const r=e.length;for(let n=0;n<r;n++)t(n)}else e&&typeof e=="object"&&Object.keys(e).forEach(r=>{t(r)})};Lt.prototype._slice=function(e,t,r,n,o,a,i){if(!Array.isArray(r))return;const s=r.length,l=e.split(":"),c=l[2]&&Number.parseInt(l[2])||1;let d=l[0]&&Number.parseInt(l[0])||0,f=l[1]&&Number.parseInt(l[1])||s;d=d<0?Math.max(0,d+s):Math.min(s,d),f=f<0?Math.max(0,f+s):Math.min(s,f);const m=[];for(let p=d;p<f;p+=c)this._trace(jk(p,t),r,n,o,a,i,!0).forEach(h=>{m.push(h)});return m};Lt.prototype._eval=function(e,t,r,n,o,a){this.currSandbox._$_parentProperty=a,this.currSandbox._$_parent=o,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=t;const i=e.includes("@path");i&&(this.currSandbox._$_path=Lt.toPathString(n.concat([r])));const s=this.currEval+"Script:"+e;if(!Lt.cache[s]){let l=e.replaceAll("@parentProperty","_$_parentProperty").replaceAll("@parent","_$_parent").replaceAll("@property","_$_property").replaceAll("@root","_$_root").replaceAll(/@([.\s)[])/gu,"_$_v$1");if(i&&(l=l.replaceAll("@path","_$_path")),this.currEval==="safe"||this.currEval===!0||this.currEval===void 0)Lt.cache[s]=new this.safeVm.Script(l);else if(this.currEval==="native")Lt.cache[s]=new this.vm.Script(l);else if(typeof this.currEval=="function"&&this.currEval.prototype&&Object.hasOwn(this.currEval.prototype,"runInNewContext")){const c=this.currEval;Lt.cache[s]=new c(l)}else if(typeof this.currEval=="function")Lt.cache[s]={runInNewContext:c=>this.currEval(l,c)};else throw new TypeError(`Unknown "eval" property "${this.currEval}"`)}try{return Lt.cache[s].runInNewContext(this.currSandbox)}catch(l){if(this.ignoreEvalErrors)return!1;throw new Error("jsonPath: "+l.message+": "+e)}};Lt.cache={};Lt.toPathString=function(e){const t=e,r=t.length;let n="$";for(let o=1;o<r;o++)/^(~|\^|@.*?\(\))$/u.test(t[o])||(n+=/^[0-9*]+$/u.test(t[o])?"["+t[o]+"]":"['"+t[o]+"']");return n};Lt.toPointer=function(e){const t=e,r=t.length;let n="";for(let o=1;o<r;o++)/^(~|\^|@.*?\(\))$/u.test(t[o])||(n+="/"+t[o].toString().replaceAll("~","~0").replaceAll("/","~1"));return n};Lt.toPathArray=function(e){const{cache:t}=Lt;if(t[e])return t[e].concat();const r=[],n=e.replaceAll(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu,";$&;").replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu,function(o,a){return"[#"+(r.push(a)-1)+"]"}).replaceAll(/\[['"]([^'\]]*)['"]\]/gu,function(o,a){return"['"+a.replaceAll(".","%@%").replaceAll("~","%%@@%%")+"']"}).replaceAll("~",";~;").replaceAll(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu,";").replaceAll("%@%",".").replaceAll("%%@@%%","~").replaceAll(/(?:;)?(\^+)(?:;)?/gu,function(o,a){return";"+a.split("").join(";")+";"}).replaceAll(/;;;|;;/gu,";..;").replaceAll(/;$|'?\]|'$/gu,"").split(";").map(function(o){const a=o.match(/#(\d+)/u);return!a||!a[1]?o:r[a[1]]});return t[e]=n,t[e].concat()};Lt.prototype.safeVm={Script:Hbe};const Wbe=function(e,t,r){const n=e.length;for(let o=0;o<n;o++){const a=e[o];r(a)&&t.push(e.splice(o--,1)[0])}};class Ube{constructor(t){this.code=t}runInNewContext(t){let r=this.code;const n=Object.keys(t),o=[];Wbe(n,o,l=>typeof t[l]=="function");const a=n.map(l=>t[l]);r=o.reduce((l,c)=>{let d=t[c].toString();return/function/u.test(d)||(d="function "+d),"var "+c+"="+d+";"+l},"")+r,!/(['"])use strict\1/u.test(r)&&!n.includes("arguments")&&(r="var arguments = undefined;"+r),r=r.replace(/;\s*$/u,"");const i=r.lastIndexOf(";"),s=i!==-1?r.slice(0,i+1)+" return "+r.slice(i+1):" return "+r;return new Function(...n,s)(...a)}}Lt.prototype.vm={Script:Ube};const bA={label:"Inspectr Operation",value:"$",description:"Root object containing the captured request, response, and metadata.",children:[{label:"Version",value:"$.version",description:"Inspectr payload version string."},{label:"Operation ID",value:"$.operation_id",description:"Unique identifier assigned to the captured operation."},{label:"Correlation ID",value:"$.correlation_id",description:"Correlation identifier propagated between services."},{label:"Request",value:"$.request",description:"Incoming HTTP request information.",children:[{label:"Method",value:"$.request.method"},{label:"URL",value:"$.request.url"},{label:"Path",value:"$.request.path"},{label:"Server",value:"$.request.server"},{label:"Client IP",value:"$.request.client_ip"},{label:"HTTP Version",value:"$.request.http_version"},{label:"Headers Size",value:"$.request.headers_size"},{label:"Headers",value:"$.request.headers",description:"Array of request headers as name/value pairs.",children:[{label:"Header Name",value:"$.request.headers[*].name"},{label:"Header Value",value:"$.request.headers[*].value"}]},{label:"Query Parameters",value:"$.request.query_params",description:"Array of query parameters as name/value pairs.",children:[{label:"Query Param Name",value:"$.request.query_params[*].name"},{label:"Query Param Value",value:"$.request.query_params[*].value"}]},{label:"Cookies",value:"$.request.cookies",description:"Array of request cookies.",children:[{label:"Cookie Name",value:"$.request.cookies[*].name"},{label:"Cookie Value",value:"$.request.cookies[*].value"}]},{label:"Body",value:"$.request.body"},{label:"Body Size",value:"$.request.body_size"},{label:"Timestamp",value:"$.request.timestamp"}]},{label:"Response",value:"$.response",description:"Outgoing HTTP response information.",children:[{label:"Status Code",value:"$.response.status"},{label:"Status Text",value:"$.response.status_text"},{label:"HTTP Version",value:"$.response.http_version"},{label:"Headers Size",value:"$.response.headers_size"},{label:"Headers",value:"$.response.headers",description:"Array of response headers as name/value pairs.",children:[{label:"Header Name",value:"$.response.headers[*].name"},{label:"Header Value",value:"$.response.headers[*].value"}]},{label:"Cookies",value:"$.response.cookies",description:"Array of response cookies.",children:[{label:"Cookie Name",value:"$.response.cookies[*].name"},{label:"Cookie Value",value:"$.response.cookies[*].value"}]},{label:"Body",value:"$.response.body"},{label:"Body Size",value:"$.response.body_size"},{label:"Timestamp",value:"$.response.timestamp"},{label:"Event Frames",value:"$.response.event_frames",description:"Server-sent events captured during the operation.",children:[{label:"Frame ID",value:"$.response.event_frames[*].id"},{label:"Frame Event",value:"$.response.event_frames[*].event"},{label:"Frame Data",value:"$.response.event_frames[*].data"},{label:"Frame Timestamp",value:"$.response.event_frames[*].timestamp"}]}]},{label:"Timing",value:"$.timing",description:"Timing metrics for the operation lifecycle.",children:[{label:"Request Timestamp",value:"$.timing.request"},{label:"Response Timestamp",value:"$.timing.response"},{label:"Duration (ms)",value:"$.timing.duration"}]},{label:"Meta",value:"$.meta",description:"Additional metadata captured alongside the operation.",children:[{label:"Proxy",value:"$.meta.proxy",children:[{label:"Instance",value:"$.meta.proxy.instance"},{label:"URL",value:"$.meta.proxy.url"}]},{label:"Ingress",value:"$.meta.ingress",children:[{label:"Headers",value:"$.meta.ingress.headers",description:"Map of ingress headers preserved by Inspectr.",children:[{label:"Header Value by Name",value:'$.meta.ingress.headers["Header-Name"]',description:"Replace Header-Name with the ingress header key."}]}]},{label:"Inspectr",value:"$.meta.inspectr",children:[{label:"Directives",value:"$.meta.inspectr.directives",description:"Map of Inspectr directive headers.",children:[{label:"Directive by Name",value:'$.meta.inspectr.directives["directive-name"]',description:"Replace directive-name with the directive key."}]},{label:"Guard",value:"$.meta.inspectr.guard",description:"Map of Inspectr Guard headers.",children:[{label:"Guard Header by Name",value:'$.meta.inspectr.guard["guard-name"]',description:"Replace guard-name with the guard header key."}]}]},{label:"Tags",value:"$.meta.tags",description:"Array of user-defined tags applied to the operation.",children:[{label:"Tag Value",value:"$.meta.tags[*]"}]}]}]};function Kbe(e){const t=[],r=n=>{n&&(n.value&&t.push({value:n.value,label:n.label,description:n.description||""}),n.children&&n.children.length>0&&n.children.forEach(o=>r(o)))};return r(e),t}const vA=Object.freeze({results:[],totalCount:0});function Vbe(e=10){const t=typeof e=="number"&&e>0?e:10,r=ca(()=>Br.queryEvents({sort:{field:"time",order:"desc"},page:1,pageSize:t}),[t],vA)||vA,n=Array.isArray(r.results)?r.results:[],o=typeof r.totalCount=="number"?r.totalCount:0;return{results:n,totalCount:o}}const yA=e=>{if(typeof e!="string")return e;const t=e.trim();if(t===""||!(t.startsWith("{")||t.startsWith("[")))return e;try{return JSON.parse(t)}catch{return e}},Gbe=e=>{if(!e||typeof e!="object")return e;const t={...e};if(e.request&&typeof e.request=="object"&&(t.request={...e.request},"body"in e.request)){const r=yA(e.request.body);r!==e.request.body&&(t.request.body=r,t.request.__rawBody=e.request.body)}if(e.response&&typeof e.response=="object"&&(t.response={...e.response},"body"in e.response)){const r=yA(e.response.body);r!==e.response.body&&(t.response.body=r,t.response.__rawBody=e.response.body)}return t};function uI(e,t,r=0){return e?e.map(n=>{const o=`${n.value||n.label}-${r}`,a=n.children&&n.children.length>0,i=`${r*12}px`;return u.jsxs("div",{className:"space-y-1",style:{paddingLeft:i},children:[u.jsxs("button",{type:"button",onClick:()=>n.value&&t(n.value),className:`flex w-full flex-col items-start rounded-md px-2 py-1 text-left text-sm transition hover:bg-blue-50 hover:text-blue-600 focus:bg-blue-100 focus:text-blue-700 focus:outline-none dark:hover:bg-blue-500/10 dark:hover:text-blue-300 dark:focus:bg-blue-500/20 dark:focus:text-blue-200 ${n.value?"":"cursor-default text-xs font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400"}`,disabled:!n.value,children:[u.jsx("span",{children:n.label}),n.description&&n.value&&u.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:n.description})]}),a&&uI(n.children,t,r+1)]},o)}):null}function cI({id:e,value:t,onChange:r,placeholder:n="$.request.path",inputClassName:o="",browseButtonLabel:a="Browse paths",className:i="",disabled:s=!1,enablePreview:l=!1}){const c=g.useId(),d=e||`json-path-input-${c}`,f=`${d}-options`,[m,p]=g.useState(!1),[h,b]=g.useState(""),[v,x]=g.useState(!1),[k,S]=g.useState(""),[j,O]=g.useState(null),[C,N]=g.useState(0),[T,M]=g.useState(""),[I,_]=g.useState(!1),R=typeof t=="string"?t.trim():"",{results:L}=Vbe(8),F=g.useMemo(()=>Kbe(bA),[]),B=g.useMemo(()=>{const W=h.trim().toLowerCase();return W?F.filter(K=>K.value.toLowerCase().includes(W)||K.label&&K.label.toLowerCase().includes(W)||K.description&&K.description.toLowerCase().includes(W)):F},[F,h]),U=W=>{W&&(r&&r(W),p(!1))};g.useEffect(()=>{var W;if(!l||!v||!L.length)return;const K=(W=L[0])==null?void 0:W.id;K&&S(q=>q||K)},[l,v,L]),g.useEffect(()=>{if(!l||!v)return;if(!R){O(null),N(0),M(""),_(!1);return}if(!k){O(null),N(0),M("Select an operation to preview"),_(!1);return}const W=L.find(K=>K.id===k);if(!W){O(null),N(0),M("Selected operation is no longer available"),_(!1);return}_(!0);try{const K=Gbe(W),q=Lt({path:R,json:K}),J=Array.isArray(q)?q:[q],V=J.length;N(V),O(V===0?null:V===1?J[0]:J),M("")}catch(K){O(null),N(0),M(K?.message||"Failed to evaluate JSON path")}finally{_(!1)}},[l,v,R,k,L]),g.useEffect(()=>{l||x(!1)},[l]);const $=()=>{if(!R)return u.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Enter a JSON path to preview the matching values."});if(!L.length)return u.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"No recent operations available. Capture traffic to preview JSON path results."});if(T)return u.jsx("div",{className:"rounded-md border border-red-200 bg-red-50 px-3 py-2 text-xs text-red-600 dark:border-red-900 dark:bg-red-950/40 dark:text-red-300",children:T});if(I)return u.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Evaluating JSON path…"});if(C===0||j===null||typeof j>"u")return u.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"No results found for this JSON path in the selected operation."});const W=(()=>{if(typeof j=="string")return j;if(typeof j=="number"||typeof j=="boolean")return String(j);try{return JSON.stringify(j,null,2)}catch{return String(j)}})();return u.jsxs("div",{className:"space-y-2",children:[C>1&&u.jsxs("p",{className:"text-xs font-medium text-gray-600 dark:text-gray-300",children:["Found ",C," matches."]}),u.jsx("pre",{className:"max-h-64 overflow-auto rounded-md border border-gray-200 bg-gray-50 p-3 text-xs text-gray-800 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-100",children:W})]})},z=L.map(W=>{var K,q,J,V,me;const X=((K=W?.request)==null?void 0:K.method)||"GET",ce=((q=W?.request)==null?void 0:q.path)||((J=W?.request)==null?void 0:J.url)||"Unknown path",oe=(V=W?.response)==null?void 0:V.status,Oe=(me=W?.request)!=null&&me.timestamp?new Date(W.request.timestamp).toLocaleString():"Unknown time",te=oe?`${oe}`:"N/A";return{id:W.id,label:`${X} ${ce} • ${te} • ${Oe}`}});return u.jsxs("div",{className:`space-y-2 ${i}`,children:[u.jsxs("div",{className:"flex gap-2",children:[u.jsxs("div",{className:"relative flex-1",children:[u.jsx("input",{id:d,list:f,value:t,onChange:W=>r&&r(W.target.value),placeholder:n,className:`block w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm transition focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 disabled:cursor-not-allowed disabled:opacity-60 dark:border-gray-700 dark:bg-gray-950 dark:text-gray-50 dark:focus:border-blue-700 dark:focus:ring-blue-700/30 ${o}`,onFocus:()=>!s&&b(""),autoComplete:"off",disabled:s}),u.jsx("datalist",{id:f,children:F.map(W=>u.jsx("option",{value:W.value,children:W.label},W.value))})]}),l&&u.jsx("button",{type:"button",onClick:()=>{s||x(W=>!W)},className:"inline-flex items-center justify-center whitespace-nowrap rounded-md border border-gray-300 bg-white px-3 py-2 text-sm font-medium text-gray-700 shadow-sm transition hover:bg-gray-50 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-200 dark:hover:bg-gray-800 dark:focus:border-blue-700 dark:focus:ring-blue-700/30 disabled:cursor-not-allowed disabled:opacity-60",disabled:s,children:v?"Hide preview":"Preview"}),u.jsx("button",{type:"button",onClick:()=>{s||(p(W=>!W),b(""))},className:"inline-flex items-center justify-center whitespace-nowrap rounded-md border border-gray-300 bg-white px-3 py-2 text-sm font-medium text-gray-700 shadow-sm transition hover:bg-gray-50 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-200 dark:hover:bg-gray-800 dark:focus:border-blue-700 dark:focus:ring-blue-700/30 disabled:cursor-not-allowed disabled:opacity-60",disabled:s,children:a})]}),m&&!s&&u.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-3 shadow-lg dark:border-gray-700 dark:bg-gray-900",children:[u.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[u.jsx("input",{type:"text",value:h,onChange:W=>b(W.target.value),placeholder:"Search JSON paths...",className:"block w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm transition focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:border-gray-700 dark:bg-gray-950 dark:text-gray-50 dark:focus:border-blue-700 dark:focus:ring-blue-700/30"}),u.jsx("button",{type:"button",onClick:()=>p(!1),className:"inline-flex items-center justify-center whitespace-nowrap rounded-md border border-gray-200 bg-gray-50 px-3 py-2 text-sm font-medium text-gray-600 transition hover:bg-gray-100 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700 dark:focus:border-blue-700 dark:focus:ring-blue-700/30",children:"Close"})]}),u.jsx("div",{className:"max-h-64 space-y-1 overflow-y-auto pr-1 text-gray-800 dark:text-gray-100",children:h.trim()?B.length>0?B.map(W=>u.jsxs("button",{type:"button",onClick:()=>U(W.value),className:"flex w-full flex-col items-start rounded-md px-2 py-1 text-left text-sm transition hover:bg-blue-50 hover:text-blue-600 focus:bg-blue-100 focus:text-blue-700 focus:outline-none dark:hover:bg-blue-500/10 dark:hover:text-blue-300 dark:focus:bg-blue-500/20 dark:focus:text-blue-200",children:[u.jsx("span",{children:W.value}),W.label&&u.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:W.label}),W.description&&u.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-500",children:W.description})]},W.value)):u.jsx("p",{className:"px-2 py-4 text-sm text-gray-500 dark:text-gray-400",children:"No matches found."}):uI([bA],U)})]}),l&&v&&!s&&u.jsxs("div",{className:"space-y-3 rounded-lg border border-gray-200 bg-white p-3 shadow-lg dark:border-gray-700 dark:bg-gray-900",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx("label",{htmlFor:`${d}-preview-operation`,className:"text-xs font-medium text-gray-600 dark:text-gray-300",children:"Preview with operation"}),u.jsxs("select",{id:`${d}-preview-operation`,value:k,onChange:W=>S(W.target.value),className:"block w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm transition focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:border-gray-700 dark:bg-gray-950 dark:text-gray-50 dark:focus:border-blue-700 dark:focus:ring-blue-700/30",children:[u.jsx("option",{value:"",children:"Select an operation…"}),z.map(W=>u.jsx("option",{value:W.id,children:W.label},W.id))]})]}),u.jsx("div",{children:$()})]})]})}function Ybe({id:e,descriptor:t,value:r,onChange:n,readOnly:o}){var a,i;if(!t||t.hidden)return null;const s=t.label||t.name,l=t.help||t.description,c=t.placeholder||"$.request.path",d=((a=t.meta)==null?void 0:a.browseLabel)||((i=t.meta)==null?void 0:i.browse_label)||"Browse paths",f=o??!!t.readonly,m=typeof r=="string"?r:r??"";return u.jsxs("div",{className:"space-y-1",children:[u.jsxs("label",{htmlFor:e,className:"text-xs font-medium text-gray-500 dark:text-gray-400",children:[s,t.required&&u.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),u.jsx(cI,{id:e,value:m,onChange:n,placeholder:c,browseButtonLabel:d,disabled:f,enablePreview:!0}),l&&u.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:l})]})}function p0({id:e,descriptor:t,value:r,onChange:n,provider:o,className:a="",readOnly:i}){if(!t||t.hidden)return null;const s=t.type==="boolean"||t.input==="boolean",l=typeof t.type=="string"&&t.type.startsWith("array"),c=t.input==="single_select"&&Array.isArray(t.choices),d=t.input==="multi_select"&&Array.isArray(t.choices),f=t.type==="integer"||t.type==="number"||t.input==="number",m=t.type==="object"||t.input==="object",p=t.input==="password",h=t.input==="json_path";let b=Abe;return s?b=Ebe:c?b=Sbe:d?b=Nbe:f?b=Obe:l?b=Cbe:m?b=Pbe:p?b=Tbe:h&&(b=Ybe),u.jsx("div",{className:a,children:u.jsx(b,{id:e,descriptor:t,value:r,onChange:n,provider:o,readOnly:i})})}function Xbe({value:e,options:t=[],onChange:r,disabled:n=!1,className:o=""}){const a=Array.isArray(t)?t:[],i=a.length>0,s=e??"",l=c=>{r?.(c.target.value)};return u.jsx("select",{value:i?s:"",onChange:l,disabled:n||!i,className:o||"block w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm transition focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:border-gray-700 dark:bg-gray-950 dark:text-gray-50 dark:focus:border-blue-700 dark:focus:ring-blue-700/30",children:i?a.map(c=>u.jsx("option",{value:c.value,children:c.label},c.value)):u.jsx("option",{value:"",disabled:!0,children:"No operators available"})})}const xA="block w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm transition focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:border-gray-700 dark:bg-gray-950 dark:text-gray-50 dark:focus:border-blue-700 dark:focus:ring-blue-700/30",Zbe="rounded-md border border-dashed border-gray-300 px-3 py-2 text-sm text-gray-500 dark:border-gray-700 dark:text-gray-400",Jbe=e=>e===!0?"true":e===!1?"false":e===""||e===null||e===void 0?"true":String(e),Qbe=(e,t)=>e?t==="number"?"e.g. 100, 200":"Enter comma-separated values":t==="number"?"e.g. 200":"e.g. /api/payments";function eve({value:e,valueType:t="string",valueRequired:r=!0,multiValue:n=!1,onChange:o,className:a,hintClassName:i}){return r?t==="boolean"?u.jsxs("select",{value:Jbe(e),onChange:s=>o?.(s.target.value),className:a||xA,children:[u.jsx("option",{value:"true",children:"true"}),u.jsx("option",{value:"false",children:"false"})]}):u.jsx("input",{type:"text",value:e??"",onChange:s=>o?.(s.target.value),placeholder:Qbe(n,t),className:a||xA}):u.jsx("div",{className:i||Zbe,children:"This operator does not require a comparison value."})}const wA=({onMoveUp:e,onMoveDown:t,disableUp:r,disableDown:n})=>u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("button",{type:"button",onClick:e,disabled:r,"aria-label":"Move up",className:"inline-flex items-center justify-center rounded-md border border-gray-200 p-1 text-gray-500 transition hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-50 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-800",children:u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-4",children:u.jsx("path",{d:"m18 15-6-6-6 6"})})}),u.jsx("button",{type:"button",onClick:t,disabled:n,"aria-label":"Move down",className:"inline-flex items-center justify-center rounded-md border border-gray-200 p-1 text-gray-500 transition hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-50 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-800",children:u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-4",children:u.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),tve=({form:e,events:t,selectedEventDescription:r,actionsCatalog:n,isEditing:o,saving:a,formErrors:i,onSubmit:s,onReset:l,onFieldChange:c,onConditionChange:d,onAddCondition:f,onRemoveCondition:m,onMoveCondition:p,onActionTypeChange:h,onActionParamChange:b,onAddAction:v,onRemoveAction:x,onMoveAction:k,operatorOptions:S})=>{const j=e.conditions.length>1,O=e.actions.length>1,C=Array.isArray(S)?S:[];return u.jsxs("form",{className:"space-y-6 rounded-lg border border-gray-200 bg-gray-50 p-4 shadow-sm dark:border-gray-800 dark:bg-[#090E1A]/60 sm:p-6",onSubmit:s,children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsx("label",{htmlFor:"rule-name",className:"text-sm font-medium text-gray-900 dark:text-gray-50",children:o?"Edit Rule":"Rule Name"}),u.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-500",children:o?"Update the selected rule and save your changes.":"Define a descriptive name for your rule."})]}),o&&u.jsx("span",{className:"inline-flex items-center rounded-full bg-blue-500/10 px-3 py-1 text-xs font-medium text-blue-600 dark:text-blue-400",children:"Editing"})]}),u.jsx("input",{id:"rule-name",type:"text",value:e.name,onChange:N=>c("name",N.target.value),placeholder:"E.g. Min. Transaction Amount USD",className:"block w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm transition focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:border-gray-800 dark:bg-[#090E1A] dark:text-gray-50 dark:focus:border-blue-700 dark:focus:ring-blue-700/30"}),u.jsxs("div",{className:"space-y-2",children:[u.jsx("label",{htmlFor:"rule-description",className:"text-sm font-medium text-gray-900 dark:text-gray-50",children:"Description"}),u.jsx("textarea",{id:"rule-description",rows:3,value:e.description,onChange:N=>c("description",N.target.value),placeholder:"Optional summary for this automation rule",className:"block w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm transition focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:border-gray-800 dark:bg-[#090E1A] dark:text-gray-50 dark:focus:border-blue-700 dark:focus:ring-blue-700/30"})]}),u.jsxs("div",{className:"grid gap-4 sm:grid-cols-[minmax(0,2fr)_minmax(0,1fr)_minmax(0,1fr)]",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx("label",{htmlFor:"rule-event",className:"text-sm font-medium text-gray-900 dark:text-gray-50",children:"Event Trigger"}),u.jsxs("select",{id:"rule-event",value:e.event,onChange:N=>c("event",N.target.value),className:"block w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm transition focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:border-gray-800 dark:bg-[#090E1A] dark:text-gray-50 dark:focus:border-blue-700 dark:focus:ring-blue-700/30",children:[t.length===0&&u.jsx("option",{value:"",children:"No events available"}),t.map(N=>u.jsx("option",{value:N.type,children:N.label||N.name||N.type},N.type))]}),t.length>0&&u.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-500",children:r||"Select the event to monitor."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx("label",{htmlFor:"rule-priority",className:"text-sm font-medium text-gray-900 dark:text-gray-50",children:"Priority"}),u.jsx("input",{id:"rule-priority",type:"number",value:e.priority,onChange:N=>c("priority",N.target.value),className:"block w-full max-w-[7rem] rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm transition focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:border-gray-800 dark:bg-[#090E1A] dark:text-gray-50 dark:focus:border-blue-700 dark:focus:ring-blue-700/30"})]}),u.jsxs("div",{className:"space-y-2 sm:justify-self-end",children:[u.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-50",children:"Activation"}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("input",{id:"rule-active",type:"checkbox",checked:e.active,onChange:N=>c("active",N.target.checked),className:"size-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500 dark:border-gray-700 dark:bg-gray-900"}),u.jsx("label",{htmlFor:"rule-active",className:"text-sm text-gray-700 dark:text-gray-200",children:"Rule is active"})]})]})]}),u.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white shadow-sm dark:border-gray-800 dark:bg-[#090E1A]",children:[u.jsxs("div",{className:"border-b border-gray-200 px-4 py-3 dark:border-gray-800",children:[u.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-50",children:"Rule Flow"}),u.jsx("div",{className:"mt-2 text-xs text-gray-500 dark:text-gray-400",children:"Configure the event, matching conditions, and resulting actions."})]}),u.jsxs("div",{className:"space-y-6 px-4 py-5",children:[u.jsxs("div",{className:"rounded-lg border-l-4 border-orange-600 bg-orange-50/60 p-4 dark:border-orange-500 dark:bg-orange-500/10",children:[u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx("span",{className:"flex aspect-square h-10 items-center justify-center rounded-lg bg-orange-600 dark:bg-orange-500","aria-hidden":"true",children:u.jsxs("svg",{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",className:"size-6 text-white",children:[u.jsx("path",{d:"M12 2v14"}),u.jsx("path",{d:"m19 9-7 7-7-7"}),u.jsx("circle",{cx:"12",cy:"21",r:"1"})]})}),u.jsxs("div",{className:"truncate",children:[u.jsx("h5",{className:"text-sm font-medium capitalize text-gray-900 dark:text-gray-50",children:"Event"}),u.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:"Select the operation event you want to monitor."})]})]}),u.jsxs("div",{className:"mt-4",children:[u.jsx("label",{className:"text-xs font-medium text-gray-900 dark:text-gray-200",htmlFor:"builder-event",children:"Event"}),u.jsx("select",{id:"builder-event",value:e.event,onChange:N=>c("event",N.target.value),className:"mt-2 block w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm transition focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:border-gray-800 dark:bg-[#090E1A] dark:text-gray-50 dark:focus:border-blue-700 dark:focus:ring-blue-700/30",children:t.map(N=>u.jsx("option",{value:N.type,children:N.name||N.type},N.type))})]})]}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[u.jsx("h5",{className:"text-sm font-semibold text-gray-900 dark:text-gray-50",children:"Conditions"}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("label",{className:"text-xs font-medium text-gray-500 dark:text-gray-400",htmlFor:"expression-type",children:"Condition Logic"}),u.jsx("select",{id:"expression-type",value:e.expressionType,onChange:N=>c("expressionType",N.target.value),className:"rounded-md border border-gray-300 bg-white px-3 py-2 text-xs text-gray-700 shadow-sm transition focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-200 dark:focus:border-blue-700 dark:focus:ring-blue-700/30",children:pbe.map(N=>u.jsx("option",{value:N.value,children:N.label},N.value))})]})]}),e.conditions.map((N,T)=>{const M=C.find(R=>R.value===N.operator)||C[0],I=M?.valueRequired!==!1,_=M?.multiValue===!0;return u.jsx("div",{className:"overflow-hidden rounded-lg border border-gray-200 bg-white shadow-sm dark:border-gray-800 dark:bg-gray-900",children:u.jsxs("div",{className:"flex items-start gap-4 px-4 py-4",children:[u.jsxs("div",{className:"flex flex-col items-center gap-2",children:[u.jsx("span",{className:"flex aspect-square h-10 items-center justify-center rounded-lg bg-sky-500","aria-hidden":"true",children:u.jsxs("svg",{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",className:"size-6 text-white",children:[u.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),u.jsx("path",{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3"}),u.jsx("path",{d:"M9 11.2h5.7"})]})}),u.jsx(wA,{onMoveUp:()=>p(T,T-1),onMoveDown:()=>p(T,T+1),disableUp:!j||T===0,disableDown:!j||T===e.conditions.length-1})]}),u.jsxs("div",{className:"flex-1 space-y-3",children:[u.jsxs("div",{className:"grid gap-3 sm:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx("label",{className:"text-xs font-medium text-gray-500 dark:text-gray-400",children:"JSON path"}),u.jsx(cI,{value:N.path,onChange:R=>d(T,"path",R),placeholder:"$.request.path",className:"!space-y-1",browseButtonLabel:"Browse",enablePreview:!0})]}),u.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx("label",{className:"text-xs font-medium text-gray-500 dark:text-gray-400",children:"Operator"}),u.jsx(Xbe,{value:N.operator,options:C,onChange:R=>d(T,"operator",R),disabled:a||C.length===0})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx("label",{className:"text-xs font-medium text-gray-500 dark:text-gray-400",children:"Value Type"}),u.jsx("select",{value:N.valueType,onChange:R=>d(T,"valueType",R.target.value),disabled:!I,className:"block w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm transition focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 disabled:cursor-not-allowed disabled:opacity-60 dark:border-gray-700 dark:bg-gray-950 dark:text-gray-50 dark:focus:border-blue-700 dark:focus:ring-blue-700/30",children:lbe.map(R=>u.jsx("option",{value:R.value,children:R.label},R.value))})]})]})]}),u.jsxs("div",{className:"grid gap-3 sm:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx("label",{className:"text-xs font-medium text-gray-500 dark:text-gray-400",children:"Compare value"}),u.jsx(eve,{value:N.value,valueType:N.valueType,valueRequired:I,multiValue:_,onChange:R=>d(T,"value",R)})]}),u.jsx("div",{className:"flex flex-wrap items-end justify-end gap-2",children:u.jsx("button",{type:"button",onClick:()=>m(T),className:"inline-flex items-center gap-2 rounded-md border border-transparent px-3 py-2 text-xs font-medium text-red-600 transition hover:border-red-200 hover:bg-red-50 disabled:cursor-not-allowed disabled:opacity-60 dark:text-red-400 dark:hover:border-red-800 dark:hover:bg-red-900/30",disabled:e.conditions.length===1,children:"Remove"})})]})]})]})},T)}),u.jsxs("button",{type:"button",onClick:f,className:"inline-flex items-center gap-2 rounded-md border border-dashed border-gray-300 px-3 py-2 text-sm font-medium text-gray-700 transition hover:border-gray-400 hover:bg-gray-100 dark:border-gray-700 dark:text-gray-200 dark:hover:border-gray-500 dark:hover:bg-gray-900",children:[u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-4","aria-hidden":"true",children:[u.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),u.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),"Add Condition"]})]}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("h5",{className:"text-sm font-semibold text-gray-900 dark:text-gray-50",children:"Actions"}),u.jsxs("button",{type:"button",onClick:v,className:"inline-flex items-center gap-2 rounded-md border border-transparent bg-blue-500 px-3 py-2 text-xs font-medium text-white transition hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-500",children:[u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-4","aria-hidden":"true",children:[u.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),u.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),"Add Action"]})]}),e.actions.map((N,T)=>{const M=n.find(L=>L.type===N.type),I=M||{params:[]},_=!M&&!!N.type,R=["overflow-hidden rounded-lg border bg-white shadow-sm dark:bg-gray-900",_?"border-amber-300 dark:border-amber-500/40":"border-gray-200 dark:border-gray-800"].join(" ");return u.jsx("div",{className:R,children:u.jsxs("div",{className:"flex items-start gap-4 px-4 py-4",children:[u.jsxs("div",{className:"flex flex-col items-center gap-2",children:[u.jsx("span",{className:"flex aspect-square h-10 items-center justify-center rounded-lg bg-emerald-500","aria-hidden":"true",children:u.jsxs("svg",{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",className:"size-6 text-white",children:[u.jsx("path",{d:"M22 12A10 10 0 1 1 12 2"}),u.jsx("path",{d:"M22 2 12 12"}),u.jsx("path",{d:"M16 2h6v6"})]})}),u.jsx(wA,{onMoveUp:()=>k(N.id,T-1),onMoveDown:()=>k(N.id,T+1),disableUp:!O||T===0,disableDown:!O||T===e.actions.length-1})]}),u.jsxs("div",{className:"flex-1 space-y-3",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[u.jsxs("div",{className:"flex-1 min-w-[180px] space-y-1",children:[u.jsx("label",{className:"text-xs font-medium text-gray-500 dark:text-gray-400",children:"Action Type"}),u.jsxs("select",{value:N.type,onChange:L=>h(N.id,L.target.value),className:"block w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm transition focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:border-gray-700 dark:bg-gray-950 dark:text-gray-50 dark:focus:border-blue-700 dark:focus:ring-blue-700/30",children:[n.length===0&&u.jsx("option",{value:"",children:"No actions available"}),_&&N.type&&u.jsx("option",{value:N.type,children:N.type}),n.map(L=>{const F=L.label||L.name,B=F&&F!==L.type?`${F} (${L.type})`:L.type;return u.jsx("option",{value:L.type,children:B},L.type)})]})]}),_&&u.jsx("div",{className:"flex items-center gap-2",children:u.jsx("span",{className:"inline-flex items-center rounded-full bg-amber-100 px-2.5 py-1 text-xs font-medium text-amber-800 dark:bg-amber-500/10 dark:text-amber-200",children:"Connector disabled"})}),u.jsx("div",{className:"flex items-center gap-2",children:u.jsx("button",{type:"button",onClick:()=>x(N.id),className:"inline-flex items-center gap-2 rounded-md border border-transparent px-3 py-2 text-xs font-medium text-red-600 transition hover:border-red-200 hover:bg-red-50 disabled:cursor-not-allowed disabled:opacity-60 dark:text-red-400 dark:hover:border-red-800 dark:hover:bg-red-900/30",disabled:e.actions.length===1,children:"Remove"})})]}),I?.description&&u.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:I.description}),_&&u.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800 dark:border-amber-500/30 dark:bg-amber-950/40 dark:text-amber-100",children:[u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"mt-0.5 size-4 flex-shrink-0","aria-hidden":"true",children:[u.jsx("path",{d:"M10.29 3.86 1.82 18a1 1 0 0 0 .86 1.5h18.64a1 1 0 0 0 .86-1.5L13.71 3.86a1 1 0 0 0-1.72 0Z"}),u.jsx("path",{d:"M12 9v4"}),u.jsx("path",{d:"M12 17h.01"})]}),u.jsxs("div",{children:[u.jsx("p",{className:"font-semibold",children:"Action unavailable"}),u.jsx("p",{className:"mt-1 text-amber-700 dark:text-amber-200/80",children:"This action is unavailable because its connector is disabled. The existing configuration is kept when you save, but the action will be skipped until the connector is enabled again."})]})]}),u.jsx("div",{className:"space-y-4",children:(I.params||[]).map(L=>{var F,B,U,$;if(L.hidden)return null;const z=`${N.id}-${L.name}`,W=(F=N.params)==null?void 0:F[L.name];L.type==="boolean"||L.input,typeof L.type=="string"&&L.type.startsWith("array"),L.input==="single_select"&&Array.isArray(L.choices),L.input==="multi_select"&&Array.isArray(L.choices),L.type==="integer"||L.type==="number"||L.input;const K=L.type==="object"||L.input==="object";L.input,L.readonly;const q=u.jsxs("label",{htmlFor:z,className:"text-xs font-medium text-gray-500 dark:text-gray-400",children:[L.label||L.name,L.required&&u.jsx("span",{className:"ml-1 text-red-500",children:"*"})]});if(K&&Array.isArray(L.variants)&&L.variants.length){const J=(B=N.params)==null?void 0:B.provider,V=L.variants.find(X=>X.value===J),me=W&&typeof W=="object"?W:{};return u.jsxs("div",{className:"space-y-2",children:[q,J?V?u.jsxs("div",{className:"space-y-3 rounded-md border border-gray-200 p-3 dark:border-gray-800",children:[V.description&&u.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-500",children:V.description}),(V.params||[]).map(X=>{var ce;if(X.hidden)return null;const oe=`${z}-${X.name}`;X.type==="boolean"||X.input,X.type==="integer"||X.type==="number"||X.input,typeof X.type=="string"&&X.type.startsWith("array"),X.type==="object"||X.input,X.input==="single_select"&&Array.isArray(X.choices),X.input,X.readonly;const Oe=me?.[X.name],te=Ne=>{b(N.id,L.name,{...me,[X.name]:Ne})};return u.jsx(p0,{id:oe,descriptor:X,provider:(ce=N.params)==null?void 0:ce.provider,value:Oe,onChange:Ne=>te(Ne)},X.name)})]}):u.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-500",children:['No options available for provider "',J,'".']}):u.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-500",children:"Select a provider to configure options."}),(L.description||L.help)&&u.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-500",children:L.description||L.help})]},L.name)}return K?u.jsx(p0,{id:z,descriptor:L,provider:(U=N.params)==null?void 0:U.provider,value:W,onChange:J=>b(N.id,L.name,J)},L.name):u.jsx(p0,{id:z,descriptor:L,provider:($=N.params)==null?void 0:$.provider,value:W,onChange:J=>b(N.id,L.name,J)},L.name)})})]})]})},N.id)}),u.jsxs("button",{type:"button",onClick:v,className:"inline-flex items-center gap-2 rounded-md border border-dashed border-gray-300 px-3 py-2 text-sm font-medium text-gray-700 transition hover:border-gray-400 hover:bg-gray-100 dark:border-gray-700 dark:text-gray-200 dark:hover:border-gray-500 dark:hover:bg-gray-900",children:[u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-4","aria-hidden":"true",children:[u.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),u.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),"Add Action"]})]})]})]}),i.length>0&&u.jsx("div",{className:"rounded-md border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 dark:border-red-800 dark:bg-red-900/30 dark:text-red-300",children:u.jsx("ul",{className:"list-disc space-y-1 pl-4",children:i.map((N,T)=>u.jsx("li",{children:N},T))})}),u.jsxs("div",{className:"flex items-center justify-end gap-3",children:[u.jsx("button",{type:"button",onClick:l,className:"inline-flex items-center rounded-md border border-gray-300 px-3 py-2 text-sm font-medium text-gray-700 transition hover:bg-gray-100 dark:border-gray-700 dark:text-gray-200 dark:hover:bg-gray-900",children:o?"Cancel edit":"Reset"}),u.jsx("button",{type:"submit",disabled:a,className:"inline-flex items-center rounded-md border border-transparent bg-blue-600 px-4 py-2 text-sm font-semibold text-white transition hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-300 disabled:cursor-not-allowed disabled:opacity-70 dark:bg-blue-500 dark:hover:bg-blue-400",children:a?"Saving…":o?"Update Rule":"Save Rule"})]})]})};function rve({open:e,title:t,description:r,onClose:n,children:o}){return e?u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4 !mt-0",children:u.jsxs("div",{className:"w-full max-w-[70%] overflow-hidden rounded-lg border border-gray-200 bg-white shadow-xl dark:border-gray-800 dark:bg-gray-900",children:[u.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-gray-200 px-4 py-4 dark:border-gray-800 sm:px-6",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-50",children:t}),r&&u.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:r})]}),u.jsx("button",{type:"button",onClick:n,className:"inline-flex items-center rounded-md border border-gray-300 p-2 text-gray-500 transition hover:bg-gray-100 dark:border-gray-700 dark:text-gray-300 dark:hover:bg-gray-800","aria-label":"Close builder dialog",children:u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-4",children:[u.jsx("line",{x1:"18",x2:"6",y1:"6",y2:"18"}),u.jsx("line",{x1:"6",x2:"18",y1:"6",y2:"18"})]})})]}),u.jsx("div",{className:"max-h-[80vh] overflow-y-auto px-4 py-4 sm:px-6",children:o})]})}):null}function nve({open:e,groupedTemplates:t,loading:r,error:n,onClose:o,onRetry:a,onSelect:i}){const[s,l]=y.useState(null),[c,d]=y.useState("");y.useEffect(()=>{var p;if(!e){l(null),d("");return}if(t.length===0){l(null);return}t.some(h=>h.id===s)||l(((p=t[0])==null?void 0:p.id)??null)},[e,t,s]);const f=y.useMemo(()=>t.find(p=>p.id===s)??null,[t,s]),m=y.useMemo(()=>{if(!f)return[];if(!c.trim())return f.items;const p=c.toLowerCase();return f.items.filter(h=>{var b,v;const x=((b=h.name)==null?void 0:b.toLowerCase())??"",k=((v=h.description)==null?void 0:v.toLowerCase())??"";return x.includes(p)||k.includes(p)})},[f,c]);return e?u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4 !mt-0",children:u.jsxs("div",{className:"w-full max-w-5xl overflow-hidden rounded-lg border border-gray-200 bg-white shadow-xl dark:border-gray-800 dark:bg-gray-900",children:[u.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-gray-200 px-4 py-4 dark:border-gray-800 sm:px-6",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-50",children:"Start from a template"}),u.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Choose a starter rule and customise it to fit your automation workflow."})]}),u.jsx("button",{type:"button",onClick:o,className:"inline-flex items-center rounded-md border border-gray-300 p-2 text-gray-500 transition hover:bg-gray-100 dark:border-gray-700 dark:text-gray-300 dark:hover:bg-gray-800","aria-label":"Close template dialog",children:u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-4",children:[u.jsx("line",{x1:"18",x2:"6",y1:"6",y2:"18"}),u.jsx("line",{x1:"6",x2:"18",y1:"6",y2:"18"})]})})]}),u.jsx("div",{className:"max-h-[80vh] overflow-y-auto px-4 py-6 sm:px-6",children:r?u.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Loading templates…"}):n?u.jsxs("div",{className:"space-y-3",children:[u.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:n}),u.jsx("button",{type:"button",onClick:a,className:"inline-flex items-center rounded-md border border-gray-300 px-3 py-1.5 text-sm font-medium text-gray-700 shadow-sm transition hover:bg-gray-50 dark:border-gray-700 dark:text-gray-200 dark:hover:bg-gray-800",children:"Try again"})]}):t.length===0?u.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"No templates available right now."}):u.jsxs("div",{className:"grid gap-6 lg:grid-cols-[260px,1fr]",children:[u.jsxs("aside",{className:"space-y-4",children:[u.jsx("h4",{className:"text-sm font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400",children:"Template groups"}),u.jsx("div",{className:"space-y-2",children:t.map(p=>{const h=p.id===s;return u.jsx("button",{type:"button",onClick:()=>{l(p.id),d("")},className:`w-full rounded-md border px-4 py-3 text-left transition ${h?"border-blue-500 bg-blue-50 text-blue-900 dark:border-blue-500 dark:bg-blue-900/30 dark:text-blue-100":"border-gray-200 bg-white text-gray-900 hover:border-blue-300 hover:bg-blue-50/60 dark:border-gray-800 dark:bg-gray-900 dark:text-gray-100 dark:hover:border-blue-500/70 dark:hover:bg-blue-900/20"}`,children:u.jsxs("div",{className:"flex items-start justify-between gap-2",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-sm font-semibold",children:p.label}),p.description&&u.jsx("p",{className:"mt-1 text-xs text-gray-600 dark:text-gray-400",children:p.description})]}),u.jsx("span",{className:"rounded-full bg-gray-100 px-2 py-0.5 text-xs font-medium text-gray-600 dark:bg-gray-800 dark:text-gray-300",children:p.items.length})]})},p.id)})})]}),u.jsxs("section",{className:"space-y-4",children:[u.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[u.jsxs("div",{children:[u.jsx("h4",{className:"text-base font-semibold text-gray-900 dark:text-gray-50",children:f?.label??"Select a group"}),f?.description&&u.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:f.description})]}),f&&u.jsxs("div",{className:"relative w-full sm:w-64",children:[u.jsx("label",{htmlFor:"template-search",className:"sr-only",children:"Search templates"}),u.jsx("input",{id:"template-search",type:"search",value:c,onChange:p=>d(p.target.value),placeholder:"Search templates",className:"w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm outline-none transition focus:border-blue-500 focus:ring-2 focus:ring-blue-500/40 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-100"}),u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"pointer-events-none absolute right-3 top-1/2 size-4 -translate-y-1/2 text-gray-400 dark:text-gray-500","aria-hidden":"true",children:[u.jsx("circle",{cx:"11",cy:"11",r:"8"}),u.jsx("path",{d:"m21 21-3.6-3.6"})]})]})]}),f?m.length===0?u.jsx("div",{className:"rounded-md border border-dashed border-gray-300 p-6 text-center text-sm text-gray-600 dark:border-gray-700 dark:text-gray-400",children:"No templates match your search in this group."}):u.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:m.map(p=>{var h;return u.jsxs("div",{className:"flex h-full flex-col justify-between rounded-lg border border-gray-200 bg-white p-4 shadow-sm transition hover:border-blue-400 hover:shadow-md dark:border-gray-800 dark:bg-gray-900",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx("h5",{className:"text-base font-semibold text-gray-900 dark:text-gray-50",children:p.name}),u.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:p.description}),u.jsxs("div",{className:"mt-3 space-y-1 text-xs text-gray-500 dark:text-gray-500",children:[u.jsxs("p",{children:[u.jsx("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:"Event:"})," ",p.event]}),u.jsxs("p",{children:[u.jsx("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:"Actions:"})," ",((h=p.actions)==null?void 0:h.length)||0]})]})]}),u.jsx("button",{type:"button",onClick:()=>i(p),className:"mt-4 inline-flex items-center justify-center rounded-md border border-transparent bg-blue-500 px-3 py-2 text-sm font-medium text-white shadow-sm transition hover:bg-blue-600 dark:bg-blue-600 dark:hover:bg-blue-500",children:"Use template"})]},p.id)})}):u.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Select a group to view its templates."})]})]})})]})}):null}function ove({open:e,rule:t,onClose:r,onPreview:n,onApply:o,loading:a,applying:i,error:s,preview:l,previewType:c="preview",tagOptions:d=[]}){const f=()=>({since:"",until:"",methods:[],path:"",host:"",tagsAll:[],tagsAny:[],statuses:[]}),[m,p]=g.useState(f),[h,b]=g.useState(!1),v=g.useMemo(()=>{if(!Array.isArray(d))return[];const $=Array.from(new Set(d.filter(z=>typeof z=="string")));return $.sort((z,W)=>z.localeCompare(W)),$},[d]);g.useEffect(()=>{e&&(p(f()),b(!1))},[e,t?.id]);const x=$=>Array.isArray($)?$.map(z=>z.trim()).filter(Boolean):[],k=$=>{const{name:z,value:W}=$.target;p(K=>({...K,[z]:W}))},S=$=>{const z=x($).slice(0,1);p(W=>({...W,methods:z}))},j=$=>{p(z=>({...z,statuses:x($)}))},O=$=>{p(z=>({...z,tagsAll:x($)}))},C=$=>{p(z=>({...z,tagsAny:x($)}))},N=()=>{p(f()),b(!1)},T=g.useMemo(()=>{var $,z,W,K,q,J;const V=[];return m.since&&V.push("Since"),m.until&&V.push("Until"),($=m.methods)!=null&&$.length&&V.push("Method"),(z=m.statuses)!=null&&z.length&&V.push("Status codes"),(W=m.path)!=null&&W.trim()&&V.push("Path"),(K=m.host)!=null&&K.trim()&&V.push("Host"),(q=m.tagsAll)!=null&&q.length&&V.push("Tags (all)"),(J=m.tagsAny)!=null&&J.length&&V.push("Tags (any)"),V},[m]);g.useEffect(()=>{T.length>0&&b(!0)},[T.length]);const M=()=>{var $,z;const W=X=>{if(!X)return;const ce=new Date(X);return Number.isNaN(ce.getTime())?void 0:ce},K=(Array.isArray(m.statuses)?m.statuses:[]).map(X=>Number(X)).filter(X=>Number.isFinite(X)),q=x(m.methods).map(X=>X.toUpperCase()),J=x(m.tagsAll),V=x(m.tagsAny),me=q[0];return{since:W(m.since),until:W(m.until),method:me,path:(($=m.path)==null?void 0:$.trim())||void 0,host:((z=m.host)==null?void 0:z.trim())||void 0,tagsAll:J.length?J:void 0,tagsAny:V.length?V:void 0,statuses:K.length?K:void 0}},I=g.useMemo(()=>{if(!l)return[];const $=l.matches||l.operations||l.items||l.sample||l.sampled||l.preview||[];return Array.isArray($)?$:[]},[l]),_=g.useMemo(()=>!l||typeof l!="object"?[]:[{key:"processed",label:"Processed",value:l.processed},{key:"matched",label:"Matched",value:l.matched},{key:"updated",label:"Updated",value:l.updated},{key:"duration_ms",label:"Duration (ms)",value:l.duration_ms}].filter($=>$.value!==void 0&&$.value!==null),[l]),R=c==="apply",L=g.useMemo(()=>l?typeof l?.matched=="number"?l.matched>0:I.length>0:!1,[l,I]),F=R?"Apply results":"Preview summary",B=R?"Affected operations":"Preview matches",U=($,z)=>{const W=$.method||$.req_method||$.http_method,K=$.path||$.req_path||$.url||$.request_path,q=$.status||$.res_status||$.http_status,J=$.time||$.ts||$.timestamp||$.at;return u.jsxs("li",{className:"rounded border border-gray-200 bg-white p-3 text-xs dark:border-gray-800 dark:bg-gray-900",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[W&&u.jsx("span",{className:"inline-flex items-center rounded bg-gray-100 px-2 py-0.5 font-medium text-gray-700 dark:bg-gray-800 dark:text-gray-300",children:W}),K&&u.jsx("span",{className:"truncate text-gray-800 dark:text-gray-200",children:K}),q!=null&&u.jsx("span",{className:"ml-auto inline-flex items-center rounded bg-gray-100 px-2 py-0.5 font-medium text-gray-700 dark:bg-gray-800 dark:text-gray-300",children:String(q)})]}),J&&u.jsx("div",{className:"mt-1 text-gray-500 dark:text-gray-400",children:String(J)}),!W&&!K&&!q&&u.jsx("pre",{className:"mt-2 overflow-auto text-[10px] leading-tight text-gray-600 dark:text-gray-400",children:JSON.stringify($,null,2)})]},z)};return e?u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4 !mt-0",children:u.jsxs("div",{className:"w-full max-w-3xl overflow-hidden rounded-lg border border-gray-200 bg-white shadow-xl dark:border-gray-800 dark:bg-gray-900",children:[u.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-gray-200 px-4 py-4 dark:border-gray-800 sm:px-6",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsxs("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-50",children:["Apply “",t?.name,"” to history"]}),u.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Optionally set filters, review the results, then apply."})]}),u.jsx("button",{type:"button",onClick:r,className:"inline-flex items-center rounded-md border border-gray-300 p-2 text-gray-500 transition hover:bg-gray-100 dark:border-gray-700 dark:text-gray-300 dark:hover:bg-gray-800","aria-label":"Close",children:u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-4",children:[u.jsx("line",{x1:"18",x2:"6",y1:"6",y2:"18"}),u.jsx("line",{x1:"6",x2:"18",y1:"6",y2:"18"})]})})]}),u.jsxs("div",{className:"max-h-[80vh] overflow-auto p-4 sm:p-6",children:[u.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-4 dark:border-gray-800 dark:bg-gray-900",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[u.jsxs("div",{children:[u.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:"Filters (optional)"}),u.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:T.length===0?"No filters applied. Inspectr will search across all stored operations.":`Active filters: ${T.join(", ")}`})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[T.length>0&&u.jsx("button",{type:"button",onClick:N,className:"rounded border border-gray-300 px-2 py-1 text-xs font-medium text-gray-600 transition hover:bg-gray-100 dark:border-gray-700 dark:text-gray-300 dark:hover:bg-gray-800",children:"Clear filters"}),u.jsx("button",{type:"button",onClick:()=>b($=>!$),className:"rounded border border-transparent bg-gray-100 px-2 py-1 text-xs font-medium text-gray-700 transition hover:bg-gray-200 dark:bg-gray-800 dark:text-gray-200 dark:hover:bg-gray-700",children:h?"Hide filters":"Show filters"})]})]}),h&&u.jsxs("div",{className:"mt-4 grid grid-cols-1 gap-3 sm:grid-cols-2",children:[u.jsxs("label",{className:"text-xs text-gray-700 dark:text-gray-300",children:["Since",u.jsx("input",{type:"datetime-local",name:"since",value:m.since,onChange:k,className:"mt-1 w-full rounded border border-gray-300 bg-white p-2 text-sm dark:border-gray-700 dark:bg-gray-900"})]}),u.jsxs("label",{className:"text-xs text-gray-700 dark:text-gray-300",children:["Until",u.jsx("input",{type:"datetime-local",name:"until",value:m.until,onChange:k,className:"mt-1 w-full rounded border border-gray-300 bg-white p-2 text-sm dark:border-gray-700 dark:bg-gray-900"})]}),u.jsxs("div",{className:"text-xs text-gray-700 dark:text-gray-300",children:[u.jsx("span",{children:"Method"}),u.jsx("div",{className:"mt-1",children:u.jsx(Hi,{options:AA,selected:m.methods,onChange:S,placeholder:"Select method",colorFn:Ek})})]}),u.jsxs("div",{className:"text-xs text-gray-700 dark:text-gray-300",children:[u.jsx("span",{children:"Status codes"}),u.jsx("div",{className:"mt-1",children:u.jsx(Hi,{options:TA,selected:m.statuses,onChange:j,placeholder:"Add status code...",colorFn:ld})})]}),u.jsxs("label",{className:"text-xs text-gray-700 dark:text-gray-300",children:["Path contains",u.jsx("input",{type:"text",name:"path",placeholder:"/api/users",value:m.path,onChange:k,className:"mt-1 w-full rounded border border-gray-300 bg-white p-2 text-sm dark:border-gray-700 dark:bg-gray-900"})]}),u.jsxs("label",{className:"text-xs text-gray-700 dark:text-gray-300",children:["Host",u.jsx("input",{type:"text",name:"host",placeholder:"api.example.com",value:m.host,onChange:k,className:"mt-1 w-full rounded border border-gray-300 bg-white p-2 text-sm dark:border-gray-700 dark:bg-gray-900"})]}),u.jsxs("div",{className:"text-xs text-gray-700 dark:text-gray-300",children:[u.jsx("span",{children:"Tags (all)"}),u.jsx("div",{className:"mt-1",children:u.jsx(Hi,{options:v,selected:m.tagsAll,onChange:O,placeholder:"Add tag..."})})]}),u.jsxs("div",{className:"text-xs text-gray-700 dark:text-gray-300",children:[u.jsx("span",{children:"Tags (any)"}),u.jsx("div",{className:"mt-1",children:u.jsx(Hi,{options:v,selected:m.tagsAny,onChange:C,placeholder:"Add tag..."})})]})]})]}),R&&!i&&!s&&u.jsx("div",{className:"mt-3 rounded border border-green-200 bg-green-50 px-3 py-2 text-xs text-green-700 dark:border-green-900 dark:bg-green-950/40 dark:text-green-300",children:"Rule applied to historical operations. Review the results below."}),s&&u.jsx("p",{className:"mt-3 text-sm text-red-600 dark:text-red-400",children:s}),u.jsxs("div",{className:"mt-4 flex w-full items-center justify-end gap-3",children:[u.jsx("button",{type:"button",onClick:()=>n(M()),disabled:a,className:"inline-flex items-center rounded-md border border-gray-300 px-3 py-2 text-sm font-medium text-gray-900 transition hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-70 dark:border-gray-700 dark:text-gray-50 dark:hover:bg-gray-800",children:a?"Previewing…":"Preview matches"}),u.jsx("button",{type:"button",onClick:()=>o(M()),disabled:i,className:"inline-flex items-center rounded-md border border-transparent bg-blue-500 px-3 py-2 text-sm font-medium text-white shadow-sm transition hover:bg-blue-600 disabled:cursor-not-allowed disabled:opacity-70 dark:bg-blue-600 dark:hover:bg-blue-500",children:i?"Applying…":"Apply now"}),u.jsx("button",{type:"button",onClick:r,className:"inline-flex items-center rounded-md border border-gray-300 px-3 py-2 text-sm font-medium text-gray-700 transition hover:bg-gray-50 dark:border-gray-700 dark:text-gray-200 dark:hover:bg-gray-800",children:"Cancel"})]}),_.length>0&&u.jsxs("div",{className:"mt-6 space-y-2",children:[u.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-50",children:F}),u.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:_.map($=>u.jsxs("div",{className:"flex items-center justify-between rounded border border-gray-200 bg-gray-50 px-4 py-3 dark:border-gray-800 dark:bg-gray-900",children:[u.jsx("span",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:$.label}),u.jsx("span",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:$.value})]},$.key))})]}),I.length>0&&u.jsxs("div",{className:"mt-6",children:[u.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-50",children:B}),u.jsx("ul",{className:"mt-2 space-y-2",children:I.map(U)})]}),!a&&l&&!L&&u.jsx("p",{className:"mt-4 text-sm text-gray-500 dark:text-gray-400",children:"No matching operations found for the selected filters."})]})]})}):null}function ave({onTagsUpdate:e}){const{client:t,setToast:r}=mr(),[n,o]=g.useState([]),[a,i]=g.useState(!0),[s,l]=g.useState(""),[c,d]=g.useState(!1),[f,m]=g.useState(null),[p,h]=g.useState(!1),[b,v]=g.useState(""),x=!!(t!=null&&t.operations),k=N=>{o(N),e?.(N)},S=async()=>{if(x)try{d(!0),l("");const N=await t.operations.listTags(),T=Array.isArray(N?.tags)?N.tags:[];T.sort((M,I)=>M.localeCompare(I)),k(T)}catch(N){console.error("Failed to refresh tags",N),l(N?.message||"Failed to refresh tags")}finally{d(!1)}};g.useEffect(()=>{if(!x)return;let N=!1;return(async()=>{try{i(!0);const T=await t.operations.listTags();if(N)return;const M=Array.isArray(T?.tags)?T.tags:[];M.sort((I,_)=>I.localeCompare(_)),k(M)}catch(T){if(N)return;console.error("Failed to load tags",T),l(T?.message||"Failed to load tags")}finally{N||i(!1)}})(),()=>{N=!0}},[x,t]);const j=N=>{m(N),v("")},O=()=>{m(null),v("")},C=async()=>{if(!(!f||!(t!=null&&t.operations)))try{h(!0),v("");const N=await t.operations.bulkDeleteTag({tag:f,dryRun:!1});r?.({type:"success",message:`Tag "${f}" removed from matching operations`}),m(null),S()}catch(N){console.error("Bulk delete tag failed",N),v(N?.message||"Failed to delete tag"),r?.({type:"error",message:N?.message||"Failed to delete tag"})}finally{h(!1)}};return u.jsxs("section",{className:"rounded-lg border border-gray-200 bg-white shadow-sm dark:border-gray-800 dark:bg-gray-900",children:[u.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4 border-b border-gray-200 px-4 py-4 dark:border-gray-800",children:[u.jsxs("div",{children:[u.jsx("h2",{className:"text-base font-semibold text-gray-900 dark:text-gray-50",children:"Operation Tags"}),u.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:"View and remove tags across operations."})]}),u.jsx("div",{className:"flex items-center gap-3",children:u.jsx("button",{type:"button",onClick:S,title:"Refresh tags",disabled:c||a,className:"inline-flex items-center rounded-md border border-gray-300 px-3 py-1.5 text-sm font-medium text-gray-700 shadow-sm transition hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-70 dark:border-gray-700 dark:text-gray-200 dark:hover:bg-gray-900",children:c?"Refreshing…":"Refresh"})})]}),u.jsxs("div",{className:"px-4 pt-2 pb-4",children:[s&&u.jsx("div",{className:"mb-3 rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-700 dark:border-red-900/50 dark:bg-red-950 dark:text-red-300",children:s}),a?u.jsx("div",{className:"py-8 text-center text-sm text-gray-500 dark:text-gray-400",children:"Loading tags…"}):n.length===0?u.jsx("div",{className:"py-8 text-center text-sm text-gray-500 dark:text-gray-400",children:"No tags found."}):u.jsx("ul",{className:"divide-y divide-gray-200 dark:divide-gray-800",children:n.map(N=>u.jsxs("li",{className:"flex items-center justify-between gap-3 py-2",children:[u.jsx("div",{className:"inline-flex items-center gap-2",children:u.jsx(cs,{tag:N})}),u.jsxs("button",{type:"button",onClick:()=>j(N),className:"inline-flex items-center gap-1 rounded-md border border-red-200 px-2.5 py-1.5 text-xs font-medium text-red-700 transition hover:bg-red-50 dark:border-red-900/40 dark:text-red-300 dark:hover:bg-red-950",title:`Remove tag "${N}" from operations`,children:[u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"-ms-0.5",children:[u.jsx("path",{d:"M3 6h18"}),u.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}),u.jsx("path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),u.jsx("line",{x1:"10",x2:"10",y1:"11",y2:"17"}),u.jsx("line",{x1:"14",x2:"14",y1:"11",y2:"17"})]}),"Remove"]})]},N))})]}),u.jsx(Dm,{open:!!f,isDeleting:p,error:b,onCancel:O,onConfirm:C,title:"Remove tag from operations?",description:f?u.jsxs(u.Fragment,{children:["This will remove the tag ",u.jsx("span",{className:"font-semibold",children:f})," from all matching operations. This action cannot be undone."]}):"",confirmLabel:"Delete Tag"})]})}function ive({open:e,rule:t,onClose:r}){const{client:n,setToast:o}=mr(),[a,i]=g.useState(!1),[s,l]=g.useState(""),c=g.useMemo(()=>t?.name||"All rules",[t]);if(!e)return null;const d=async()=>{var f;if((f=n?.rules)!=null&&f.export){i(!0),l("");try{const{blob:m,filename:p}=await n.rules.export({id:t?.id}),h=URL.createObjectURL(m),b=document.createElement("a");b.href=h,b.download=p||"rules.yaml",document.body.appendChild(b),b.click(),b.remove(),URL.revokeObjectURL(h),o?.({type:"success",message:`Downloaded ${p||"rules.yaml"}`}),r?.()}catch(m){console.error("Export download failed",m),l(m?.message||"Failed to export rules")}finally{i(!1)}}};return u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4 !mt-0",children:u.jsxs("div",{className:"w-full max-w-md overflow-hidden rounded-lg border border-gray-200 bg-white shadow-xl dark:border-gray-800 dark:bg-gray-900",children:[u.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-gray-200 px-4 py-4 dark:border-gray-800 sm:px-6",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-50",children:"Export rules"}),u.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Download YAML export",t!=null&&t.name?` for "${c}"`:"","."]}),t?.name&&u.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-500",children:["Rule: ",c]})]}),u.jsx("button",{type:"button",onClick:r,className:"inline-flex items-center rounded-md border border-gray-300 p-2 text-gray-500 transition hover:bg-gray-100 dark:border-gray-700 dark:text-gray-300 dark:hover:bg-gray-800","aria-label":"Close export dialog",children:u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-4",children:[u.jsx("line",{x1:"18",x2:"6",y1:"6",y2:"18"}),u.jsx("line",{x1:"6",x2:"18",y1:"6",y2:"18"})]})})]}),u.jsxs("div",{className:"space-y-4 px-4 py-4 sm:px-6",children:[s&&u.jsx("div",{className:"rounded-md border border-red-300 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-800 dark:bg-red-950/50 dark:text-red-300",children:s}),u.jsx("div",{className:"flex items-center justify-end",children:u.jsx("button",{type:"button",onClick:d,disabled:a,className:"inline-flex items-center rounded-md border border-transparent bg-blue-600 px-4 py-2 text-sm font-semibold text-white transition hover:bg-blue-700 disabled:opacity-60 focus:outline-none focus:ring-2 focus:ring-blue-300 dark:bg-blue-500 dark:hover:bg-blue-400",children:a?"Preparing…":"Download rules.yaml"})})]})]})})}function sve({open:e,onCancel:t,onImport:r,onImported:n}){const{client:o,setToast:a}=mr(),[i,s]=g.useState(""),[l,c]=g.useState(null),[d,f]=g.useState(""),[m,p]=g.useState(!1),[h,b]=g.useState(!1);if(g.useEffect(()=>{e||(s(""),c(null),f(""),p(!1),b(!1))},[e]),!e)return null;const v=k=>{var S;const j=((S=k.target.files)==null?void 0:S[0])||null;c(j),f("")},x=async()=>{var k;if((k=o?.rules)!=null&&k.import){if(!l&&!i.trim()){f("Select a YAML file or paste YAML content.");return}p(!0),f("");try{let S=i;if(l)try{S=await new Response(l).text()}catch(C){console.error("Failed to read file",C),f("Could not read the selected file. Please reselect it or paste the YAML."),p(!1);return}const j=await o.rules.import(S,{overwrite:h}),O=j?.rule||(Array.isArray(j?.rules)?j.rules[0]:null);if(a?.({type:"success",message:"Import completed"}),n)try{await n()}catch{}O&&r&&r(O),t?.()}catch(S){console.error("Import failed",S),f(S?.message||"Failed to import rules")}finally{p(!1)}}};return u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4 !mt-0",children:u.jsxs("div",{className:"w-full max-w-xl overflow-hidden rounded-lg border border-gray-200 bg-white shadow-xl dark:border-gray-800 dark:bg-gray-900",children:[u.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-gray-200 px-4 py-4 dark:border-gray-800 sm:px-6",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-50",children:"Import rules"}),u.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Upload a .yaml export or paste YAML content."})]}),u.jsx("button",{type:"button",onClick:t,className:"inline-flex items-center rounded-md border border-gray-300 p-2 text-gray-500 transition hover:bg-gray-100 dark:border-gray-700 dark:text-gray-300 dark:hover:bg-gray-800","aria-label":"Close import dialog",children:u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-4",children:[u.jsx("line",{x1:"18",x2:"6",y1:"6",y2:"18"}),u.jsx("line",{x1:"6",x2:"18",y1:"6",y2:"18"})]})})]}),u.jsxs("div",{className:"space-y-4 px-4 py-4 sm:px-6",children:[d&&u.jsx("div",{className:"rounded-md border border-red-300 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-800 dark:bg-red-950/50 dark:text-red-300",children:d}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("label",{htmlFor:"rule-import-file",className:"shrink-0 text-xs font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400",children:"YAML file"}),u.jsx("input",{id:"rule-import-file",type:"file",accept:".yaml,.yml,text/yaml,application/x-yaml,application/yaml",onChange:v,onClick:k=>{k.currentTarget.value=null},className:"block w-full text-sm text-gray-700 file:mr-3 file:rounded-md file:border file:border-gray-300 file:bg-white file:px-3 file:py-2 file:text-sm file:font-medium file:text-gray-700 hover:file:bg-gray-50 dark:text-gray-200 dark:file:border-gray-700 dark:file:bg-gray-900"})]}),u.jsxs("div",{children:[u.jsx("label",{htmlFor:"rule-import-yaml",className:"text-xs font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400",children:"Or paste YAML"}),u.jsx("textarea",{id:"rule-import-yaml",value:i,onChange:k=>s(k.target.value),rows:12,placeholder:`# name: Example rule
143
+ # event: ...
144
+ # expression:
145
+ # op: and
146
+ # args: ...`,className:"mt-2 block w-full rounded-md border border-gray-300 bg-white px-3 py-2 font-mono text-xs text-gray-800 shadow-inner focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:border-gray-800 dark:bg-[#0B101F] dark:text-gray-100 dark:focus:border-blue-700 dark:focus:ring-blue-800/50"})]}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("label",{className:"inline-flex items-center gap-2 text-sm text-gray-700 dark:text-gray-300",children:[u.jsx("input",{type:"checkbox",checked:h,onChange:k=>b(k.target.checked),className:"h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500 dark:border-gray-700 dark:bg-gray-900"}),"Overwrite existing rules"]}),u.jsxs("div",{className:"flex justify-end gap-3",children:[u.jsx("button",{type:"button",onClick:t,disabled:m,className:"inline-flex items-center rounded-md border border-gray-300 px-4 py-2 text-sm font-medium text-gray-700 transition hover:bg-gray-100 disabled:opacity-60 dark:border-gray-700 dark:text-gray-200 dark:hover:bg-gray-800",children:"Cancel"}),u.jsx("button",{type:"button",onClick:x,disabled:m,className:"inline-flex items-center rounded-md border border-transparent bg-blue-600 px-4 py-2 text-sm font-semibold text-white transition hover:bg-blue-700 disabled:opacity-60 focus:outline-none focus:ring-2 focus:ring-blue-300 dark:bg-blue-500 dark:hover:bg-blue-400",children:m?"Importing…":"Import"})]})]})]})]})})}const m0=(e,t,r)=>{var n;return{name:"",description:"",event:((n=e?.[0])==null?void 0:n.type)||"",priority:10,active:!0,expressionType:"and",conditions:[kk(r)],actions:t!=null&&t.length?[ec(t[0])]:[]}},lve=(e,t,r=!1)=>{const n=o=>{if(t==="number"){const a=Number(o);return Number.isNaN(a)?o:a}return t==="boolean"?typeof o=="boolean"?o:typeof o=="string"?o==="true":!!o:o};return r?(Array.isArray(e)?e:tc(e)).map(o=>n(o)):n(e)};function uve(){var e;const{client:t,setToast:r}=mr(),[n,o]=g.useState([]),[a,i]=g.useState(null),[s,l]=g.useState([]),[c,d]=g.useState([]),[f,m]=g.useState(!0),[p,h]=g.useState(!1),[b,v]=g.useState(""),[x,k]=g.useState(null),[S,j]=g.useState(!1),[O,C]=g.useState(null),N=g.useRef(!1),[T,M]=g.useState(!1),[I,_]=g.useState(null),[R,L]=g.useState(""),[F,B]=g.useState(!1),[U,$]=g.useState(!1),[z,W]=g.useState([]),[K,q]=g.useState([]),[J,V]=g.useState(!1),[me,X]=g.useState(""),[ce,oe]=g.useState(!1),[Oe,te]=g.useState(null),[Ne,ve]=g.useState(!1),[G,ye]=g.useState(!1),[le,ge]=g.useState(""),[Ce,Me]=g.useState(null),[Ye,Ve]=g.useState(null),[$e,Ze]=g.useState(!1),[rt,nt]=g.useState(null),[ht,ft]=g.useState(!1),[vt,Qt]=g.useState([]),Je=(be,he=1)=>{const Ie=Array.isArray(be?.rules)?be.rules:[];o(Ie);const Pe=be?.meta;if(Pe&&typeof Pe=="object"){const Qe={...Pe},tt=Number(Qe.page??he);Qe.page=Number.isFinite(tt)&&tt>0?tt:1,i(Qe)}else i(null)},dt=async(be=1)=>{if(!(t!=null&&t.rules))return null;const he=Number(be),Ie=Number.isFinite(he)&&he>0?he:1;try{return await t.rules.list({page:Ie})}catch(Pe){if(Ie===1)return await t.rules.list();throw Pe}},[Gt,Rr]=g.useState([]),ut=g.useMemo(()=>cbe(Gt),[Gt]),Wt=g.useMemo(()=>dbe(Gt),[Gt]),Fr=g.useMemo(()=>fbe(Gt),[Gt]),wr=g.useMemo(()=>lI(Gt),[Gt]),[ze,sr]=g.useState(()=>m0([],[],wr)),[qo,sn]=g.useState([]);g.useEffect(()=>{if(!(t!=null&&t.rules))return;let be=!1;return(async()=>{var he;try{m(!0);const[Ie,Pe,Qe,tt]=await Promise.all([dt(1),t.rules.getEvents(),t.rules.getActions(),t.rules.getOperators()]);if(be)return;Je(Ie,((he=Ie?.meta)==null?void 0:he.page)??1),l(Pe.events||[]),d(Qe.actions||[]);const pt=Array.isArray(tt)?tt:Array.isArray(tt?.operators)?tt.operators:[];Rr(ube(pt)),v("")}catch(Ie){if(be)return;console.error("Failed to load rules",Ie),v(Ie?.message||"Failed to load rules")}finally{be||m(!1)}})(),()=>{be=!0}},[t]),g.useEffect(()=>{f||N.current||(sr(m0(s,c,wr)),N.current=!0)},[f,s,c,wr]),g.useEffect(()=>{if(!Array.isArray(ut)||ut.length===0)return;const be=new Set(ut.map(he=>he.value));sr(he=>{var Ie;if(!((Ie=he?.conditions)!=null&&Ie.length))return he;let Pe=!1;const Qe=he.conditions.map(tt=>be.has(tt.operator)?tt:(Pe=!0,{...tt,operator:wr}));return Pe?{...he,conditions:Qe}:he})},[ut,wr]);const We=g.useMemo(()=>s.reduce((be,he)=>(be[he.type]=he,be),{}),[s]),lo=async(be=a?.page||1)=>{if(!(t!=null&&t.rules))return null;const he=Number(be),Ie=Number.isFinite(he)&&he>0?he:1;let Pe=null;try{h(!0),Pe=await dt(Ie),Je(Pe,Ie),v("")}catch(Qe){console.error("Failed to refresh rules",Qe),v(Qe?.message||"Failed to refresh rules")}finally{h(!1)}return Pe},Fd=async be=>{const he=Number(be)||1;he!==(a?.page||1)&&await lo(he)},hu=async be=>{if(!(t!=null&&t.rules)||!(be!=null&&be.id))return;const he=!be.active;try{await t.rules.update(be.id,{...be,active:he}),r?.({type:"success",message:`Rule "${be.name||"Untitled"}" ${he?"activated":"paused"}`}),await lo()}catch(Ie){console.error("Toggle rule active failed",Ie),r?.({type:"error",message:Ie?.message||"Failed to update rule status"})}},gu=async()=>{var be;try{V(!0),X("");const[he,Ie]=await Promise.all([fetch("https://templates.inspectr.dev/api/rules/templates"),fetch("https://templates.inspectr.dev/api/rules/templates/group-types")]);if(!he.ok)throw new Error(`Template fetch failed (${he.status})`);if(!Ie.ok)throw new Error(`Group types fetch failed (${Ie.status})`);const Pe=await he.json(),Qe=await Ie.json();W(Array.isArray(Pe)?Pe:[]),q(Array.isArray(Qe)?Qe:[])}catch(he){console.error("Failed to load templates",he),he?.name==="TypeError"||(be=he?.message)!=null&&be.includes("Failed to fetch")?(X(""),$(!1),Na(),C(null),sn([]),M(!0),W([]),q([])):X(he?.message||"Failed to load templates")}finally{V(!1)}},Na=()=>{sr(m0(s,c,wr)),sn([]),C(null)},js=()=>{M(!1),Na()},Zh=(be,he)=>{sr(Ie=>({...Ie,[be]:he}))},Oa=(be,he,Ie)=>{sr(Pe=>{const Qe=Pe.conditions.map((tt,pt)=>{if(pt!==be)return tt;if(he==="valueType"){if(Ie==="boolean"){const St=tt.value==="false"?"false":"true";return{...tt,valueType:Ie,value:St}}if(tt.valueType==="boolean")return{...tt,valueType:Ie,value:""}}if(he==="operator"){const St=(Fr[Ie]||{}).valueRequired!==!1,nr=St?tt.valueType:"string";let Yt=tt.value;return St?nr==="boolean"&&Yt===""&&(Yt="true"):Yt="",{...tt,operator:Ie,valueType:nr,value:Yt}}return{...tt,[he]:Ie}});return{...Pe,conditions:Qe}})},Ca=(be,he)=>{sr(Ie=>({...Ie,conditions:hA(Ie.conditions,be,he)}))},bu=()=>{sr(be=>({...be,conditions:[...be.conditions,kk(wr)]}))},Es=be=>{sr(he=>{if(he.conditions.length===1)return he;const Ie=he.conditions.filter((Pe,Qe)=>Qe!==be);return{...he,conditions:Ie}})},Ft=be=>c.find(he=>he.type===be),kr=()=>{sr(be=>{const he=c[0],Ie=he?ec(he):{id:Gf(),type:"",params:{}};return{...be,actions:[...be.actions,Ie]}})},Jh=be=>{sr(he=>he.actions.length===1?he:{...he,actions:he.actions.filter(Ie=>Ie.id!==be)})},Ss=(be,he)=>{sr(Ie=>({...Ie,actions:Ie.actions.map(Pe=>{var Qe;if(Pe.id!==be)return Pe;const tt=Ft(he);if(!tt)return{...Pe,type:he,definitionMissing:!!he,originalParams:Pe.originalParams??Pe.params??{}};const pt=ec(tt);try{const St=(tt.params||[]).find(gt=>gt.name==="provider"),nr=(tt.params||[]).find(gt=>gt.name==="provider_options"),Yt=(Qe=pt.params)==null?void 0:Qe.provider;if(St&&nr&&Array.isArray(nr.variants)){const gt=nr.variants.find(yt=>yt.value===Yt);if(gt){const yt=(gt.params||[]).reduce((Tt,br)=>(Tt[br.name]=wk(br),Tt),{});pt.params.provider_options=yt}}}catch{}return{...pt,id:be,type:he}})}))},Ns=(be,he,Ie)=>{sr(Pe=>({...Pe,actions:Pe.actions.map(Qe=>{var tt;if(Qe.id!==be)return Qe;const pt={...Qe.params,[he]:Ie};if(he==="provider"){const St=Ft(Qe.type),nr=(tt=St?.params)==null?void 0:tt.find(Yt=>Yt.name==="provider_options");if(nr&&Array.isArray(nr.variants)){const Yt=nr.variants.find(gt=>gt.value===Ie);Yt?pt.provider_options=(Yt.params||[]).reduce((gt,yt)=>(gt[yt.name]=wk(yt),gt),{}):pt.provider_options={}}else pt.provider_options={}}return{...Qe,params:pt}})}))},Os=(be,he)=>{sr(Ie=>{const Pe=Ie.actions.findIndex(Qe=>Qe.id===be);return Pe===-1?Ie:{...Ie,actions:hA(Ie.actions,Pe,he)}})},Cs=be=>{var he,Ie;const Pe=String(((he=be?.expression)==null?void 0:he.op)||"and").toLowerCase(),Qe=bm(be?.expression),tt=Qe.length?Qe.map(gt=>{var yt;const Tt=gt.right;let br;Array.isArray(Tt)?Tt.every(er=>typeof er=="number")?br="number":Tt.every(er=>typeof er=="boolean")?br="boolean":br="string":br=hbe(Tt);let ot;return Array.isArray(Tt)?ot=Tt.join(", "):br==="boolean"?ot=Tt?"true":"false":Tt==null?ot="":ot=String(Tt),{path:((yt=gt.left)==null?void 0:yt.path)||"",operator:gt.op||"==",valueType:br,value:ot}}):[kk(wr)],pt=(()=>{var gt;return(gt=be?.actions)!=null&&gt.length?be.actions.map(yt=>{const Tt=Ft(yt.type);if(!Tt){let er={};if(yt!=null&&yt.params&&typeof yt.params=="object")try{er=JSON.parse(JSON.stringify(yt.params))}catch{er={...yt.params}}return{id:Gf(),type:yt.type||"",params:er,definitionMissing:!!yt.type,originalParams:er}}const br=ec(Tt),ot={...br.params};return(Tt.params||[]).forEach(er=>{var Kd;const Cn=(Kd=yt.params)==null?void 0:Kd[er.name];er.type==="boolean"?ot[er.name]=Cn===void 0?ot[er.name]:xk(Cn):typeof er.type=="string"&&er.type.startsWith("array")?Array.isArray(Cn)?ot[er.name]=Cn.join(", "):ot[er.name]=Cn||"":er.type==="object"?Cn&&typeof Cn=="object"?ot[er.name]=Cn:ot[er.name]={}:ot[er.name]=Cn==null?"":String(Cn)}),{...br,id:Gf(),type:yt.type||"",params:ot}}):c.length?[ec(c[0])]:[]})(),St=be?.event,nr=((Ie=s[0])==null?void 0:Ie.type)||"",Yt=s.some(gt=>gt.type===St)?St:nr;return{name:be?.name||"",description:be?.description||"",event:Yt,priority:be?.priority??10,active:be?.active!==!1,expressionType:Pe,conditions:tt,actions:pt}},uo=()=>{const be=[];return ze.name.trim()||be.push("Rule name is required."),ze.event||be.push("Select an event for the rule."),ze.conditions.forEach((he,Ie)=>{he.path.trim()||be.push(`Condition ${Ie+1} is missing a data path.`);const Pe=Fr[he.operator]||{};Pe.valueRequired!==!1&&(Pe.multiValue?(Array.isArray(he.value)?he.value:tc(he.value)).length||be.push(`Condition ${Ie+1} is missing a value.`):`${he.value}`.trim()===""&&be.push(`Condition ${Ie+1} is missing a value.`))}),ze.conditions.length||be.push("Add at least one condition."),ze.actions.length||be.push("Add at least one action."),ze.actions.forEach(he=>{const Ie=Ft(he.type);if(!Ie){he.type||be.push("Every action must have a type.");return}(Ie.params||[]).forEach(Pe=>{var Qe;const tt=(Qe=he.params)==null?void 0:Qe[Pe.name];if(typeof Pe.type=="string"&&Pe.type.startsWith("array")){const pt=tc(tt);!Pe.readonly&&Pe.required&&pt.length===0&&be.push(`${Pe.name} is required for the ${he.type} action.`)}else if(Pe.type==="string")!Pe.readonly&&Pe.required&&!`${tt??""}`.trim()&&be.push(`${Pe.name} is required for the ${he.type} action.`);else if(Pe.type==="boolean")!Pe.readonly&&Pe.required&&typeof tt!="boolean"&&be.push(`${Pe.name} must be toggled for the ${he.type} action.`);else if(Pe.type==="integer"||Pe.type==="number"){const pt=Number(tt);!Pe.readonly&&Pe.required&&!Number.isFinite(pt)&&be.push(`${Pe.name} must be a valid ${Pe.type} for the ${he.type} action.`)}else if(Pe.type==="object"&&Pe.required&&!Pe.readonly){if(tt==null||typeof tt=="object"&&Object.keys(tt).length===0)be.push(`${Pe.name} is required for the ${he.type} action.`);else if(typeof tt=="string")try{const pt=JSON.parse(tt);(!pt||typeof pt!="object")&&be.push(`${Pe.name} must be a valid JSON object for the ${he.type} action.`)}catch{be.push(`${Pe.name} must be valid JSON for the ${he.type} action.`)}}})}),be},Pa=()=>({name:ze.name.trim(),description:ze.description.trim()||void 0,event:ze.event,priority:Number(ze.priority)||0,active:!!ze.active,expression:{op:ze.expressionType,args:ze.conditions.map(be=>{const he=Fr[be.operator]||{},Ie=he.valueRequired!==!1,Pe={op:be.operator,left:{path:be.path.trim()}};if(Ie){const Qe=lve(be.value,be.valueType,he.multiValue===!0);Pe.right=Qe}return Pe})},actions:ze.actions.map(be=>{const he=Ft(be.type);if(!he){const Pe=be.originalParams&&Object.keys(be.originalParams).length?be.originalParams:be.params||{};return{type:be.type,params:Pe}}const Ie={};return(he.params||[]).forEach(Pe=>{var Qe,tt;const pt=(Qe=be.params)==null?void 0:Qe[Pe.name];if(typeof Pe.type=="string"&&Pe.type.startsWith("array")){const St=tc(pt);(Pe.required||St.length)&&(Ie[Pe.name]=St)}else if(Pe.type==="boolean")pt!==void 0&&(Ie[Pe.name]=xk(pt));else if(Pe.type==="integer"||Pe.type==="number"){if(pt!==void 0&&pt!==""){const St=Number(pt);Number.isFinite(St)&&(Ie[Pe.name]=St)}}else if(Pe.type==="object"){if(pt){if(typeof pt=="object"){let St=pt;if(Pe.input==="multi_select"&&Array.isArray(Pe.choices)){const nr={};Object.entries(pt).forEach(([Yt,gt])=>{var yt;const Tt=Pe.choices.find(ot=>{var er;return(((er=ot.meta)==null?void 0:er.key)||ot.value)===Yt}),br=(yt=Tt?.meta)==null?void 0:yt.type;if(br==="integer"||br==="number"){const ot=Number(gt);nr[Yt]=Number.isFinite(ot)?ot:gt}else if(br==="boolean")nr[Yt]=gt===!0||gt==="true"||gt==="1";else if(br==="object")try{nr[Yt]=typeof gt=="string"?JSON.parse(gt):gt}catch{nr[Yt]=gt}else nr[Yt]=gt}),St=nr}else if(Array.isArray(Pe.variants)&&Pe.name==="provider_options"){const nr=(tt=be.params)==null?void 0:tt.provider,Yt=Pe.variants.find(gt=>gt.value===nr);if(Yt){const gt={};(Yt.params||[]).forEach(yt=>{const Tt=pt[yt.name];if(Tt!==void 0)if(yt.type==="integer"||yt.type==="number"){const br=Number(Tt);gt[yt.name]=Number.isFinite(br)?br:Tt}else if(yt.type==="boolean")gt[yt.name]=Tt===!0||Tt==="true"||Tt==="1";else if(typeof yt.type=="string"&&yt.type.startsWith("array"))gt[yt.name]=Array.isArray(Tt)?Tt:tc(Tt);else if(yt.type==="object")try{gt[yt.name]=typeof Tt=="string"?JSON.parse(Tt):Tt}catch{gt[yt.name]=Tt}else gt[yt.name]=Tt}),St=gt}}(Pe.required||Object.keys(St).length)&&(Ie[Pe.name]=St)}else if(typeof pt=="string")try{const St=JSON.parse(pt);St&&typeof St=="object"&&(Pe.required||Object.keys(St).length)&&(Ie[Pe.name]=St)}catch{}}}else{const St=typeof pt=="string"?pt.trim():pt;(Pe.required||St!=null&&St!=="")&&(Ie[Pe.name]=St)}}),{type:be.type,params:Ie}})}),co=async be=>{if(be.preventDefault(),!(t!=null&&t.rules))return;const he=uo();if(he.length){sn(he);return}sn([]),j(!0);const Ie=Pa(),Pe=!!O;try{const Qe=Pe?await t.rules.replace(O,Ie):await t.rules.create(Ie);r?.({message:Pe?"Rule updated":"Rule saved",subMessage:`${Ie.name} applied successfully.`}),Qe!=null&&Qe.id&&o(tt=>{const pt=tt.findIndex(nr=>nr.id===Qe.id);if(pt===-1)return[Qe,...tt];const St=[...tt];return St[pt]=Qe,St}),await lo(),js()}catch(Qe){console.error("Failed to save rule",Qe),sn([Qe?.message||"Failed to save rule"])}finally{j(!1)}},Ps=be=>{c.length&&(sr(Cs(be)),C(be.id||null),sn([]),M(!0),k(be.id||null))},Qh=be=>{_(be),L("")},fo=async()=>{if(!(!(t!=null&&t.rules)||!I)){B(!0),L("");try{await t.rules.delete(I.id),o(be=>be.filter(he=>he.id!==I.id)),O&&I.id===O&&js(),x===I.id&&k(null),r?.({message:"Rule deleted",subMessage:`${I.name||"Rule"} removed successfully.`}),await lo(),_(null)}catch(be){console.error("Failed to delete rule",be),L(be?.message||"Failed to delete rule")}finally{B(!1)}}},$d=()=>{F||(_(null),L(""))},Wo=()=>{O?js():Na()},Bd=()=>{Na(),M(!0)},vu=()=>{$(!0),!J&&z.length===0&&gu()},hr=be=>{c.length&&(sr(Cs(be)),C(null),sn([]),$(!1),M(!0))},Uo=be=>{const he=Cs(be);sr(he),C(null),sn([]),M(!0)},qn=be=>{be&&(nt(be),Ze(!0))},zd=()=>{Ze(!1),nt(null)},Aa=()=>{ft(!0)},As=()=>{ft(!1)},yu=be=>{be&&(sr(Cs(be)),C(null),sn([]),ft(!1),M(!0),k(null))},xu=(e=We[ze.event])==null?void 0:e.description,Ko=O?"Edit rule":"Create rule",Hd=O?"Update the event, conditions, and actions for this automation rule.":"Define the event trigger, matching conditions, and resulting actions for your new rule.",Ei=g.useMemo(()=>K.reduce((be,he)=>(be[he.id]=he,be),{}),[K]),qd=g.useMemo(()=>{if(!z.length)return[];const be=[];K.forEach(Ie=>{const Pe=z.filter(Qe=>Qe.group_type===Ie.id);Pe.length&&be.push({id:Ie.id,label:Ie.label,description:Ie.description,items:Pe})});const he=z.filter(Ie=>!Ie.group_type||!Ei[Ie.group_type]);return he.length&&be.push({id:"uncategorized",label:"Other Templates",description:"General-purpose rules without a defined category.",items:he}),be},[z,K,Ei]),At=be=>{te(be),oe(!0),ge(""),Me(null),Ve(null)},Wd=()=>{oe(!1),te(null),ge(""),Me(null),ve(!1),ye(!1),Ve(null)},Ud=async be=>{if(!(!(t!=null&&t.rules)||!(Oe!=null&&Oe.id)))try{ve(!0),ge("");const he=await t.rules.applyToHistory(Oe.id,{...be,dryRun:!0});Me(he||{}),Ve("preview")}catch(he){console.error("Preview apply failed",he),ge(he?.message||"Failed to preview")}finally{ve(!1)}},Ts=async be=>{if(!(!(t!=null&&t.rules)||!(Oe!=null&&Oe.id)))try{ye(!0),ge("");const he=await t.rules.applyToHistory(Oe.id,{...be,dryRun:!1});Me(he||{}),Ve("apply"),r?.({type:"success",message:"Rule applied to matching historical operations"})}catch(he){console.error("Apply to history failed",he),ge(he?.message||"Failed to apply"),r?.({type:"error",message:he?.message||"Failed to apply rule"})}finally{ye(!1)}};return u.jsxs("div",{className:"min-h-screen flex flex-col space-y-6",children:[u.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-3 flex-1 min-h-0",children:[u.jsx("div",{className:"lg:col-span-2 min-h-0 flex flex-col",children:u.jsx(jbe,{rules:n,events:s,loading:f,error:b,isRefreshing:p,openRuleId:x,onToggleRule:k,onRefresh:lo,onEditRule:Ps,onDeleteRule:Qh,onCreateRule:Bd,onStartFromTemplate:vu,onApplyHistory:At,onDuplicateRule:Uo,onPauseRule:hu,onExportRule:qn,onImportRule:Aa,meta:a,onPageChange:Fd,paginationAlwaysShow:!1,operatorLabelMap:Wt})}),u.jsx("div",{className:"lg:col-span-1",children:u.jsx(ave,{onTagsUpdate:Qt})})]}),u.jsx(Dm,{open:!!I,rule:I,isDeleting:F,error:R,onCancel:$d,onConfirm:fo}),u.jsx(rve,{open:T,title:Ko,description:Hd,onClose:js,children:u.jsx(tve,{form:ze,events:s,selectedEventDescription:xu,actionsCatalog:c,isEditing:!!O,saving:S,formErrors:qo,onSubmit:co,onReset:Wo,onFieldChange:Zh,onConditionChange:Oa,onAddCondition:bu,onRemoveCondition:Es,onMoveCondition:Ca,onActionTypeChange:Ss,onActionParamChange:Ns,onAddAction:kr,onRemoveAction:Jh,onMoveAction:Os,operatorOptions:ut})}),u.jsx(nve,{open:U,groupedTemplates:qd,loading:J,error:me,onClose:()=>$(!1),onRetry:gu,onSelect:hr}),u.jsx(ove,{open:ce,rule:Oe,onClose:Wd,onPreview:Ud,onApply:Ts,loading:Ne,applying:G,error:le,preview:Ce,previewType:Ye,tagOptions:vt}),u.jsx(ive,{open:$e,rule:rt,onClose:zd}),u.jsx(sve,{open:ht,onCancel:As,onImport:yu,onImported:lo})]})}function dI({count:e,color:t="red",className:r=""}){if(!e||e<=0)return null;const n=t==="green"?"bg-green-600":t==="orange"?"bg-orange-500":"bg-red-600";return u.jsx("span",{className:`inline-flex items-center justify-center px-1.5 py-0.5 text-xs font-semibold leading-none text-white ${n} rounded-full ${r}`,children:e})}function cve(){const{apiEndpoint:e,setApiEndpoint:t,client:r}=mr(),[n,o]=g.useState(e),[a,i]=g.useState(null),s=async l=>{l.preventDefault();const c=n.replace(/\/+$/,"");t(c),r.configure({apiEndpoint:c});try{i(null),await r.service.getHealth()}catch(d){i(d.message)}};return u.jsxs(u.Fragment,{children:[u.jsxs("form",{className:"grid grid-cols-1 gap-10 md:grid-cols-3 items-end",onSubmit:s,children:[u.jsxs("div",{className:"self-start",children:[u.jsx("h2",{className:"font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"API Endpoint"}),u.jsx("p",{className:"mt-1 text-tremor-default leading-6 text-tremor-content dark:text-dark-tremor-content",children:"Set the base URL for the Inspectr API."})]}),u.jsxs("div",{className:"sm:max-w-3xl md:col-span-2",children:[u.jsx(K8,{id:"api-endpoint",name:"api-endpoint",placeholder:"https://localhost:4004/api",value:n,onValueChange:l=>o(l),className:`mt-2 focus:ring-2 focus:ring-offset-0 ${a?"border-red-500 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500":""}`}),a&&u.jsxs("p",{className:"mt-2 text-sm text-red-600",children:["Cannot connect to ",n]}),u.jsx("div",{className:"flex items-center justify-end space-x-4 pt-4",children:u.jsx("button",{type:"submit",className:"whitespace-nowrap rounded-tremor-default bg-tremor-brand px-4 py-2.5 text-tremor-default font-medium text-tremor-brand-inverted shadow-tremor-input hover:bg-tremor-brand-emphasis dark:bg-dark-tremor-brand dark:text-dark-tremor-brand-inverted dark:shadow-dark-tremor-input dark:hover:bg-dark-tremor-brand-emphasis",children:"Save API Endpoint"})})]})]}),u.jsx(ji,{className:"my-10"})]})}function aa({variant:e="auto",filled:t=!1,backgroundClass:r="",children:n}){const o="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium border",a={success:"border-green-500 text-green-500",error:"border-red-500 text-red-500",neutral:"border-gray-300 text-gray-800 dark:border-gray-600 dark:text-gray-200"},i={success:"bg-green-500 text-white border-green-500",error:"bg-red-500 text-white border-red-500",neutral:"bg-gray-300 text-gray-800 border-gray-300 dark:bg-gray-600 dark:text-gray-200"},s=["ok","active","running","on","yes"],l=["nok","inactive","stopped","off","no"],c=String(n).trim().toLowerCase();let d;e==="auto"?s.includes(c.toLowerCase())?d="success":l.includes(c.toLowerCase())?d="error":d="neutral":d=e;const f=t?i[d]:a[d];return u.jsx("span",{className:`${o} ${f} ${r}`,children:n})}function h0({component:e}){const{client:t}=mr(),[r,n]=g.useState("loading"),[o,a]=g.useState(null),i=g.useRef(()=>{}),s=500;g.useEffect(()=>{let d=!1;async function f(){d||(n("loading"),a(null));const m=Date.now();try{const p=await t.service.ping(e),h=Date.now()-m,b=()=>{d||(n(p.status),a(p.error||null))};h<s?setTimeout(b,s-h):b()}catch(p){const h=Date.now()-m,b=()=>{d||(n("down"),a(p.message))};h<s?setTimeout(b,s-h):b()}}return i.current=f,f(),()=>{d=!0}},[t.service,e]);const l=r==="up"?"fill-green-500":r==="down"?"fill-red-500":"fill-gray-400 animate-pulse",c=o?`${o}`:`${e}: ${r}`;return u.jsx(Im,{content:c,sideOffset:4,side:"left",onClick:()=>i.current(),children:u.jsx("svg",{viewBox:"0 0 6 6","aria-hidden":"true",className:ii("w-3 h-3 cursor-pointer",l),children:u.jsx("circle",{r:"3",cx:"3",cy:"3"})})})}function dve(){const{apiEndpoint:e,proxyEndpoint:t,ingressEndpoint:r,client:n}=mr(),[o,a]=g.useState(null),[i,s]=g.useState(null),l=async()=>{try{s(null),a(null);const c=await n.service.getHealth();a(c)}catch(c){console.error("Health error",c),s(c.message)}};return g.useEffect(()=>{l()},[e]),u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"grid grid-cols-1 gap-10 md:grid-cols-3",children:[u.jsxs("div",{children:[u.jsx("h2",{className:"font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Inspectr"}),u.jsx("p",{className:"mt-1 text-tremor-default leading-6 text-tremor-content dark:text-dark-tremor-content",children:"Information about the connected Inspectr service itself."})]}),u.jsxs("div",{className:"sm:max-w-3xl md:col-span-2",children:[!o&&!i&&u.jsx("p",{className:"mt-2 text-tremor-default",children:"Loading…"}),u.jsxs(Rd,{className:"mt-4 divide-y divide-tremor-border dark:divide-dark-tremor-border",children:[u.jsxs(Er,{className:"py-3 flex justify-between",children:[u.jsx("span",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Status"}),u.jsx(aa,{filled:"true",children:o?.message??"NOK"})]}),u.jsxs(Er,{className:"py-3 flex justify-between",children:[u.jsx("span",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Version"}),u.jsx("span",{className:"text-tremor-content dark:text-dark-tremor-content",children:o?.version??"-"})]}),o&&u.jsxs(u.Fragment,{children:[u.jsxs(Er,{className:"py-3 flex justify-between",children:[u.jsx("span",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Running since"}),u.jsx("span",{className:"text-tremor-content dark:text-dark-tremor-content",children:new Date(o.start_time).toLocaleString()})]}),u.jsxs(Er,{className:"py-3 flex justify-between",children:[u.jsx("span",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Mode"}),u.jsx(aa,{variant:"neutral",children:o.mode})]}),u.jsxs(Er,{className:"py-3 flex justify-between",children:[u.jsx("span",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Proxy URL"}),t?u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx("span",{className:"text-tremor-content dark:text-dark-tremor-content break-all",children:t}),u.jsx(cn,{textToCopy:t,showLabel:!1})]}):u.jsx("span",{className:"text-tremor-default dark:text-dark-tremor-content",children:"Not set"})]}),o?.backend&&u.jsxs(Er,{className:"py-3 flex justify-between",children:[u.jsx("span",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Backend URL"}),u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx(h0,{component:"backend"}),u.jsx("span",{className:"text-tremor-content dark:text-dark-tremor-content break-all",children:o.backend}),u.jsx(cn,{textToCopy:o.backend,showLabel:!1})]})]}),o?.mode==="mock"&&u.jsxs(Er,{className:"py-3 flex justify-between",children:[u.jsx("span",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Mock URL"}),u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx(h0,{component:"mock"}),u.jsx("span",{className:"text-tremor-content dark:text-dark-tremor-content break-all",children:t}),u.jsx(cn,{textToCopy:t,showLabel:!1})]})]}),o?.mode==="catch"&&u.jsxs(Er,{className:"py-3 flex justify-between",children:[u.jsx("span",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Catch URL"}),u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx(h0,{component:"catch"}),u.jsx("span",{className:"text-tremor-content dark:text-dark-tremor-content break-all",children:t}),u.jsx(cn,{textToCopy:t,showLabel:!1})]})]}),u.jsxs(Er,{className:"py-3 flex justify-between",children:[u.jsx("span",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Expose"}),u.jsx(aa,{children:o!=null&&o.expose?"Yes":"No"})]}),o.expose&&r&&u.jsxs(Er,{className:"py-3 flex justify-between",children:[u.jsx("span",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Expose URL"}),u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx("span",{className:"text-tremor-content dark:text-dark-tremor-content break-all",children:r}),u.jsx(cn,{textToCopy:r,showLabel:!1})]})]}),u.jsxs(Er,{className:"py-3 flex justify-between",children:[u.jsx("span",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"App"}),u.jsx(aa,{children:o!=null&&o.app?"Yes":"No"})]})]})]})]})]}),u.jsx(ji,{className:"my-10"})]})}function fve({open:e,onClose:t,initialUrl:r="",onSubmit:n}){const[o,a]=g.useState(r),[i,s]=g.useState(null),[l,c]=g.useState(!1);if(g.useEffect(()=>{e&&(a(r),s(null),+c(!1))},[e,r]),!e)return null;const d=async()=>{c(!0),s(null);try{await n(o),t()}catch(f){console.error("Mock launch error",f),s(f.message||"Failed to launch mock"),c(!1)}};return u.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[u.jsx("div",{className:"absolute inset-0 bg-black opacity-50",onClick:t}),u.jsxs("div",{className:"relative bg-white rounded-lg shadow-xl max-w-lg w-full mx-4 p-6 z-10",children:[u.jsxs("div",{className:"flex items-center justify-between mb-4",children:[u.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Set OpenAPI URL"}),u.jsx("button",{onClick:t,className:"text-gray-600 hover:text-gray-800","aria-label":"Close",disabled:l,children:"×"})]}),u.jsxs("div",{className:"mb-4",children:[u.jsx("label",{htmlFor:"openapi-url",className:"block text-sm font-medium text-gray-700",children:"OpenAPI Spec URL"}),u.jsx("input",{id:"openapi-url",type:"url",value:o,onChange:f=>{a(f.target.value),i&&s(null)},placeholder:"https://example.com/openapi.yaml",disabled:l,className:"mt-1 block w-full rounded-md shadow-sm sm:text-sm "+(i?"border-red-500 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500":"border-gray-300 focus:ring-blue-500 focus:border-blue-500")}),i&&u.jsx("p",{className:"mt-2 text-sm text-red-600",children:i})]}),u.jsxs("div",{className:"flex justify-end space-x-3",children:[u.jsx("button",{onClick:t,className:"px-4 py-2 bg-gray-200 text-gray-700 rounded hover:bg-gray-300",disabled:l,children:"Cancel"}),u.jsx("button",{onClick:d,className:`px-4 py-2 text-white rounded ${l?"bg-gray-400 cursor-not-allowed":"bg-blue-600 hover:bg-blue-700"}`,disabled:l,children:l?"Loading…":"Launch Mock"})]})]})]})}function pve(){const{client:e}=mr(),[t,r]=g.useState(null),[n,o]=g.useState(!1),a=async()=>{try{const s=await e.mock.getConfig();r(s)}catch(s){console.error("Mock info error",s),r(null)}},i=async s=>{try{await e.mock.launch(s),a()}catch(l){throw console.error("Mock launch error",l),l}};return g.useEffect(()=>{a()},[]),u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"grid grid-cols-1 gap-10 md:grid-cols-3",children:[u.jsxs("div",{children:[u.jsx("h2",{className:"font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Mock Details"}),u.jsx("p",{className:"mt-1 text-tremor-default leading-6 text-tremor-content dark:text-dark-tremor-content",children:"Information about your mock configuration."}),u.jsx("div",{className:"mt-4",children:u.jsx("button",{onClick:()=>o(!0),className:"whitespace-nowrap rounded-tremor-default bg-tremor-brand px-4 py-2.5 text-tremor-default font-medium text-tremor-brand-inverted shadow-tremor-input hover:bg-tremor-brand-emphasis dark:bg-dark-tremor-brand dark:text-dark-tremor-brand-inverted dark:shadow-dark-tremor-input dark:hover:bg-dark-tremor-brand-emphasis",children:"Set OpenAPI"})})]}),u.jsxs("div",{className:"sm:max-w-3xl md:col-span-2",children:[!t&&u.jsx("p",{className:"mt-2 text-tremor-default",children:"Loading mock info…"}),t&&u.jsxs(Rd,{className:"mt-4 divide-y divide-tremor-border dark:divide-dark-tremor-border",children:[u.jsxs(Er,{className:"py-3 flex justify-between",children:[u.jsx("span",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Status"}),u.jsx(aa,{filled:"true",children:t!=null&&t.status?"Active":"Inactive"})]}),u.jsxs(Er,{className:"py-3 flex justify-between",children:[u.jsx("span",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"OpenAPI Spec"}),u.jsx("a",{href:t.openapi,target:"_blank",rel:"noopener noreferrer",className:"underline text-tremor-content dark:text-dark-tremor-content",children:t.openapi})]}),u.jsxs(Er,{className:"py-3 flex justify-between",children:[u.jsx("span",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Examples"}),u.jsx(aa,{variant:"neutral",children:t?.examples})]})]})]})]}),u.jsx(fve,{open:n,onClose:()=>o(!1),initialUrl:t?.openapi,onSubmit:i}),u.jsx(ji,{className:"my-10"})]})}function mve({open:e,onClose:t,initialSecret:r="",initialTtl:n="",onSubmit:o}){const[a,i]=g.useState(r),[s,l]=g.useState(n),[c,d]=g.useState(null),[f,m]=g.useState(!1);if(g.useEffect(()=>{e&&(i(r),l(n),d(null),m(!1))},[e,r,n]),!e)return null;const p=async()=>{m(!0),d(null);try{await o(a,s),t()}catch(h){console.error("Authentication save error",h),d(h.message||"Failed to save"),m(!1)}};return u.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[u.jsx("div",{className:"absolute inset-0 bg-black opacity-50",onClick:t}),u.jsxs("div",{className:"relative bg-white rounded-lg shadow-xl max-w-lg w-full mx-4 p-6 z-10",children:[u.jsxs("div",{className:"flex items-center justify-between mb-4",children:[u.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Authentication Guard Settings"}),u.jsx("button",{onClick:t,className:"text-gray-600 hover:text-gray-800","aria-label":"Close",disabled:f,children:"×"})]}),u.jsxs("div",{className:"mb-4",children:[u.jsx("label",{htmlFor:"auth-secret",className:"block text-sm font-medium text-gray-700",children:"Secret"}),u.jsx("input",{id:"auth-secret",type:"text",value:a,onChange:h=>{i(h.target.value),c&&d(null)},disabled:f,className:"mt-1 block w-full rounded-md shadow-sm border-gray-300 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"})]}),u.jsxs("div",{className:"mb-4",children:[u.jsx("label",{htmlFor:"auth-ttl",className:"block text-sm font-medium text-gray-700",children:"TTL (hours, optional)"}),u.jsx("input",{id:"auth-ttl",type:"number",value:s,onChange:h=>{l(h.target.value),c&&d(null)},placeholder:"24",disabled:f,className:"mt-1 block w-full rounded-md shadow-sm border-gray-300 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"})]}),c&&u.jsx("p",{className:"mt-2 text-sm text-red-600",children:c}),u.jsxs("div",{className:"flex justify-end space-x-3",children:[u.jsx("button",{onClick:t,className:"px-4 py-2 bg-gray-200 text-gray-700 rounded hover:bg-gray-300",disabled:f,children:"Cancel"}),u.jsx("button",{onClick:p,className:`px-4 py-2 text-white rounded ${f?"bg-gray-400 cursor-not-allowed":"bg-blue-600 hover:bg-blue-700"}`,disabled:f,children:f?"Saving…":"Save"})]})]})]})}function hve(){const{apiEndpoint:e,client:t}=mr(),[r,n]=g.useState(null),[o,a]=g.useState(""),[i,s]=g.useState(""),[l,c]=g.useState(!1),[d,f]=g.useState(null),[m,p]=g.useState(!1),h=async()=>{try{f(null);const x=await t.auth.getAuthenticationSettings();n(x),a(x.secret||""),s(String(x.token_ttl||"")),c(!!x.enabled)}catch(x){console.error("Authentication info error",x),f(x.message)}},b=async(x=o,k=i,S=l)=>{try{const j={enabled:S,secret:x,token_ttl:k?parseInt(k,10):void 0},O=await t.auth.updateAuthenticationSettings(j);n(O),a(O.secret||""),s(String(O.token_ttl||"")),c(!!O.enabled),f(null)}catch(j){console.error("Security save error",j),f(j.message)}},v=async()=>{await b(o,i,l)};return g.useEffect(()=>{h()},[e]),u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"grid grid-cols-1 gap-10 md:grid-cols-3 items-start",children:[u.jsxs("div",{className:"self-start",children:[u.jsx("h2",{className:"font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Backend Authentication Guard"}),u.jsx("p",{className:"mt-1 text-tremor-default leading-6 text-tremor-content dark:text-dark-tremor-content",children:"Use one of the following API Keys to authenticate requests to your backend."}),u.jsx("div",{className:"mt-4",children:u.jsx("button",{type:"button",onClick:()=>p(!0),className:"whitespace-nowrap rounded-tremor-default bg-tremor-brand px-4 py-2.5 text-tremor-default font-medium text-tremor-brand-inverted shadow-tremor-input hover:bg-tremor-brand-emphasis dark:bg-dark-tremor-brand dark:text-dark-tremor-brand-inverted dark:shadow-dark-tremor-input dark:hover:bg-dark-tremor-brand-emphasis",children:"Configure Authentication"})})]}),u.jsxs("div",{className:"sm:max-w-3xl md:col-span-2 space-y-4",children:[u.jsxs("div",{className:"flex items-center space-x-3",children:[u.jsx("input",{id:"auth-enabled",type:"checkbox",checked:l,onChange:x=>{const k=x.target.checked;c(k),b(o,i,k)},className:"h-5 w-5 rounded border-gray-300 text-tremor-brand focus:ring-tremor-brand"}),u.jsx("label",{htmlFor:"auth-enabled",className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Authentication Guard Enabled"})]}),r&&u.jsxs(Rd,{className:"mt-4 divide-y divide-tremor-border dark:divide-dark-tremor-border",children:[u.jsxs(Er,{className:"py-3 flex justify-between",children:[u.jsx("span",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong min-w-10",children:"inspectr-auth-key"}),u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx("span",{className:"text-tremor-content dark:text-dark-tremor-content break-all",children:r.auth_key||"-"}),u.jsx(cn,{textToCopy:r.auth_key||"",showLabel:!1})]})]}),u.jsxs(Er,{className:"py-3 flex justify-between items-start",children:[u.jsx("span",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong w-40 flex-shrink-0",children:"inspectr-auth-token"}),u.jsxs("div",{className:"flex flex-col items-end space-y-1",children:[u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx("span",{className:"text-tremor-content dark:text-dark-tremor-content break-all",children:r.auth_token||"-"}),u.jsx(cn,{textToCopy:r.auth_token||"",showLabel:!1})]}),u.jsx("div",{className:"flex items-center space-x-2",children:u.jsx("button",{type:"button",onClick:v,className:"px-2 py-0.5 rounded bg-tremor-brand text-white hover:bg-tremor-brand-emphasis text-xs",children:"Renew"})})]})]}),u.jsxs(Er,{className:"py-3 flex justify-between",children:[u.jsx("span",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"inspectr-auth-token Expiration"}),u.jsx("span",{className:"text-tremor-content dark:text-dark-tremor-content",children:r.auth_token_expiration?new Date(r.auth_token_expiration).toLocaleString():"-"})]})]}),d&&u.jsx("p",{className:"text-sm text-red-600",children:d})]})]}),u.jsx(mve,{open:m,onClose:()=>p(!1),initialSecret:o,initialTtl:i,onSubmit:async(x,k)=>{a(x),s(k),await b(x,k,l)}}),u.jsx(ji,{className:"my-10"})]})}const kA=[{slug:"feat_export_openapi",title:"Export as OpenAPI Document",description:"Export your API operations as an OpenAPI document. This document can be used as a starting point for building a custom OpenAPI document.",image:"https://inspectr.dev/preview/export-openapi.png"},{slug:"feat_export_postman",title:"Export as Postman Collection",description:"Export your API operations as a Postman collection. The Postman collection contains all requests based on the Inspectr Operations history.",image:"https://inspectr.dev/preview/export-postman.png"},{slug:"feat_export_mcp_server",title:"MCP Server",description:"Enable Inspectr's MCP Server to expose operations and data via the Model Context Protocol for compatible AI Agents like Claude, ChatGPT, and more.",image:void 0}],gve=[{slug:"feat_connectors",title:"Inspectr Connectors",description:"Forward Inspectr events to other services by configuring outbound connectors.",image:void 0,defaultEnabled:!1,removeWhenFalse:!0},{slug:"feat_rules_ui",title:"Rules Experience",description:"Toggle access to the Rules engine.",image:void 0,defaultEnabled:!1,removeWhenFalse:!0},{slug:"feat_insights_display",title:"Insights Display",description:"Show the insights explorer navigation with Endpoint, List, Table, and Timeline modes.",image:void 0,defaultEnabled:!1,removeWhenFalse:!0},{slug:"feat_statistics_compare",title:"Statistics Compare Mode",description:"Enable the Compare tab and navigation within Inspectr statistics.",image:void 0,defaultEnabled:!1,removeWhenFalse:!0}];function bve(){const[e]=Cr("future","false"),t=e==="true",r=y.useMemo(()=>t?[...kA,...gve]:kA,[t]).map(n=>{const[o,a]=Bn(n.slug,n.defaultEnabled,n.removeWhenFalse);return{...n,enabled:o,setEnabled:a}});return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"grid grid-cols-1 gap-10 md:grid-cols-3 items-start",children:[u.jsxs("div",{className:"self-start",children:[u.jsx("h2",{className:"font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Feature Previews"}),u.jsx("p",{className:"mt-1 text-tremor-default leading-6 text-tremor-content dark:text-dark-tremor-content",children:"Enable or disable experimental features."})]}),u.jsx("div",{className:"sm:max-w-3xl md:col-span-2 space-y-6",children:r.map(n=>u.jsxs("div",{className:"flex items-start space-x-4",children:[u.jsxs("div",{className:"flex-1",children:[u.jsx("h3",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:n.title}),u.jsx("p",{className:"mt-1 text-tremor-content dark:text-dark-tremor-content",children:n.description})]}),n.image&&u.jsx("img",{src:n.image,alt:n.slug,className:"w-32 border border-tremor-border dark:border-dark-tremor-border rounded"}),u.jsxs("div",{className:"flex items-center pt-1 space-x-3",children:[u.jsxs(KT,{checked:!!n.enabled,onChange:()=>n.setEnabled(!n.enabled),className:ii("relative inline-flex h-5 w-9 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-tremor-brand focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60",n.enabled?"bg-tremor-brand dark:bg-dark-tremor-brand":"bg-gray-200 dark:bg-gray-700"),children:[u.jsx("span",{className:"sr-only",children:n.enabled?"Disable feature preview":"Enable feature preview"}),u.jsx("span",{"aria-hidden":"true",className:ii("pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white shadow-lg ring-0 transition duration-200 ease-in-out",n.enabled?"translate-x-4":"translate-x-0")})]}),u.jsx("span",{className:"text-sm font-medium text-tremor-content dark:text-dark-tremor-content",children:n.enabled?"Enabled":"Disabled"})]})]},n.slug))})]}),u.jsx(ji,{className:"my-10"})]})}function vve(){const{client:e}=mr(),[t]=Bn("feat_export_mcp_server"),[r,n]=g.useState(null),[o,a]=g.useState(null),[i,s]=g.useState(!1);if(g.useEffect(()=>{(async()=>{if(t)try{a(null);const c=await e.service.getInfo();n(c)}catch(c){console.error("Info error",c),a(c.message||"Failed to load service info")}})()},[e,t]),!t)return null;const l=r?.mcp||{};return l?.auth,u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"grid grid-cols-1 gap-10 md:grid-cols-3",children:[u.jsxs("div",{children:[u.jsx("h2",{className:"font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"MCP Server (Preview)"}),u.jsx("p",{className:"mt-1 text-tremor-default leading-6 text-tremor-content dark:text-dark-tremor-content",children:"Connection details for the built-in MCP server for Inspectr."})]}),u.jsxs("div",{className:"sm:max-w-3xl md:col-span-2",children:[!r&&!o&&u.jsx("p",{className:"mt-2 text-tremor-default",children:"Loading…"}),o&&u.jsx("p",{className:"mt-2 text-tremor-default text-red-600 dark:text-red-400",children:o}),u.jsxs(Rd,{className:"mt-4 divide-y divide-tremor-border dark:divide-dark-tremor-border",children:[u.jsxs(Er,{className:"py-3 flex justify-between",children:[u.jsx("span",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"URL"}),u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx("span",{className:"text-tremor-content dark:text-dark-tremor-content break-all",children:l?.url||"-"}),l?.url&&u.jsx(cn,{textToCopy:l.url,showLabel:!1})]})]}),u.jsxs(Er,{className:"py-3 flex justify-between",children:[u.jsx("span",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Protocol"}),u.jsx("span",{className:"text-tremor-content dark:text-dark-tremor-content",children:l?.protocol||"-"})]})]})]})]}),u.jsx(ji,{className:"my-10"})]})}const yve={name:"",server_url:"",description:"",enabled:!0,headers:{}},jA=(e={})=>{if(!e||typeof e!="object")return[{key:"",value:""}];const t=Object.entries(e);return t.length===0?[{key:"",value:""}]:t.map(([r,n])=>({key:r,value:String(n??"")}))},xve=e=>e.reduce((t,{key:r,value:n})=>{const o=r.trim();return o&&(t[o]=n??""),t},{}),wve=(e={})=>{const t=Object.entries(e||{});if(t.length===0)return{authName:"Authorization",authToken:"",restHeaders:{}};const r=t.map(([l,c])=>[l,c,l.toLowerCase()]);let n=r.find(([,,l])=>l==="authorization");if(n||(n=r.find(([,l])=>typeof l=="string"&&/^\s*Bearer\s+/i.test(l))),!n)return{authName:"Authorization",authToken:"",restHeaders:e};const[o,a]=n,i=typeof a=="string"?a.replace(/^\s*Bearer\s+/i,""):String(a??""),s=t.filter(([l])=>l!==o).reduce((l,[c,d])=>(l[c]=d,l),{});return{authName:o,authToken:i,restHeaders:s}};function kve({open:e,mode:t="create",initialData:r=yve,onClose:n,onSubmit:o}){const[a,i]=g.useState(r.name||""),[s,l]=g.useState(r.server_url||""),[c,d]=g.useState(r.description||""),[f,m]=g.useState(typeof r.enabled=="boolean"?r.enabled:!0),[p,h]=g.useState(jA(r.headers)),[b,v]=g.useState("Authorization"),[x,k]=g.useState(""),[S,j]=g.useState(!1),[O,C]=g.useState(null),[N,T]=g.useState(!1);g.useEffect(()=>{if(e){i(r.name||""),l(r.server_url||""),d(r.description||""),m(typeof r.enabled=="boolean"?r.enabled:!0);const{authName:B,authToken:U,restHeaders:$}=wve(r.headers);v(B||"Authorization"),k(U||""),h(jA($));const z=Object.keys($||{}).length>0;j(!!U||z),C(null),T(!1)}},[e,r]);const M=g.useMemo(()=>N||!a.trim()||!s.trim(),[N,a,s]);if(!e)return null;const I=(B,U,$)=>{h(z=>{const W=[...z];return W[B]={...W[B],[U]:$},W})},_=()=>{h(B=>[...B,{key:"",value:""}])},R=B=>{h(U=>U.length===1?[{key:"",value:""}]:U.filter(($,z)=>z!==B))},L=async()=>{if(!M){T(!0),C(null);try{const B={name:a.trim(),server_url:s.trim(),description:c.trim(),enabled:!!f},U=xve(p),$=b.trim(),z=x.trim();$&&z&&(U[$]=/^Bearer\s+/i.test(z)?z:`Bearer ${z}`),B.headers=U,await o(B),n()}catch(B){console.error("Connector save error",B),C(B?.message||"Failed to save connector"),T(!1)}}},F=()=>j(B=>!B);return u.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[u.jsx("div",{className:"absolute inset-0 bg-black opacity-40",onClick:()=>N?null:n()}),u.jsxs("div",{className:"relative z-10 w-full max-w-2xl mx-4 rounded-lg bg-white p-6 shadow-xl",children:[u.jsxs("div",{className:"flex items-center justify-between mb-4",children:[u.jsx("h3",{className:"text-lg font-medium text-gray-900",children:t==="edit"?"Edit Connector":"Create Connector"}),u.jsx("button",{type:"button",onClick:n,className:"text-gray-500 hover:text-gray-700","aria-label":"Close",disabled:N,children:"×"})]}),u.jsxs("div",{className:"space-y-4 max-h-[70vh] overflow-y-auto pr-1",children:[u.jsxs("div",{children:[u.jsx("label",{htmlFor:"connector-name",className:"block text-sm font-medium text-gray-700",children:"Name"}),u.jsx("input",{id:"connector-name",type:"text",value:a,onChange:B=>i(B.target.value),disabled:N,className:"mt-1 block w-full rounded-md border border-gray-300 px-3 py-2 text-sm shadow-sm focus:border-tremor-brand focus:outline-none focus:ring-1 focus:ring-tremor-brand",placeholder:"Custom Connector"})]}),u.jsxs("div",{children:[u.jsx("label",{htmlFor:"connector-server-url",className:"block text-sm font-medium text-gray-700",children:"Server URL"}),u.jsx("input",{id:"connector-server-url",type:"url",value:s,onChange:B=>l(B.target.value),disabled:N,className:"mt-1 block w-full rounded-md border border-gray-300 px-3 py-2 text-sm shadow-sm focus:border-tremor-brand focus:outline-none focus:ring-1 focus:ring-tremor-brand",placeholder:"http://localhost:3100"})]}),u.jsxs("div",{children:[u.jsxs("label",{htmlFor:"connector-description",className:"block text-sm font-medium text-gray-700",children:["Description ",u.jsx("span",{className:"text-xs text-gray-300",children:"(optional)"})]}),u.jsx("input",{id:"connector-description",value:c,onChange:B=>d(B.target.value),disabled:N,className:"mt-1 block w-full rounded-md border border-gray-300 px-3 py-2 text-sm shadow-sm focus:border-tremor-brand focus:outline-none focus:ring-1 focus:ring-tremor-brand",placeholder:"A custom connector for integrating with Inspectr Rules."})]}),u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx("input",{id:"connector-enabled",type:"checkbox",checked:!!f,onChange:B=>m(B.target.checked),disabled:N,className:"h-5 w-5 rounded border-gray-300 text-tremor-brand focus:ring-tremor-brand"}),u.jsx("label",{htmlFor:"connector-enabled",className:"text-sm font-medium text-gray-700",children:"Enabled"})]}),u.jsxs("div",{children:[u.jsx("button",{type:"button",onClick:F,className:"text-sm font-medium text-tremor-brand hover:text-tremor-brand-emphasis",disabled:N,children:"Configure authentication & headers"}),S&&u.jsxs("div",{className:"mt-3 space-y-4 rounded-lg border border-tremor-border bg-tremor-background-muted p-4 dark:border-dark-tremor-border dark:bg-dark-tremor-background",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-sm font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"API Token Authentication"}),u.jsxs("div",{className:"mt-3 grid gap-3 sm:grid-cols-2",children:[u.jsxs("div",{children:[u.jsx("label",{htmlFor:"connector-auth-header",className:"block text-sm font-medium text-gray-700",children:"Header Name"}),u.jsx("input",{id:"connector-auth-header",type:"text",value:b,onChange:B=>v(B.target.value),disabled:N,className:"mt-1 block w-full rounded-md border border-gray-300 px-3 py-2 text-sm shadow-sm focus:border-tremor-brand focus:outline-none focus:ring-1 focus:ring-tremor-brand",placeholder:"Authorization"})]}),u.jsxs("div",{children:[u.jsx("label",{htmlFor:"connector-auth-token",className:"block text-sm font-medium text-gray-700",children:"Bearer Token"}),u.jsx("input",{id:"connector-auth-token",type:"text",value:x,onChange:B=>k(B.target.value),disabled:N,className:"mt-1 block w-full rounded-md border border-gray-300 px-3 py-2 text-sm shadow-sm focus:border-tremor-brand focus:outline-none focus:ring-1 focus:ring-tremor-brand",placeholder:"Bearer Token"})]})]})]}),u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"block text-sm font-medium text-gray-700",children:"Additional Headers"}),u.jsx("button",{type:"button",onClick:_,disabled:N,className:"text-sm font-medium text-tremor-brand hover:text-tremor-brand-emphasis",children:"Add header"})]}),u.jsx("div",{className:"mt-2 space-y-2",children:p.map((B,U)=>u.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_1fr_auto]",children:[u.jsx("input",{type:"text",value:B.key,onChange:$=>I(U,"key",$.target.value),placeholder:"Header name",disabled:N,className:"rounded-md border border-gray-300 px-3 py-2 text-sm shadow-sm focus:border-tremor-brand focus:outline-none focus:ring-1 focus:ring-tremor-brand"}),u.jsx("input",{type:"text",value:B.value,onChange:$=>I(U,"value",$.target.value),placeholder:"Header value",disabled:N,className:"rounded-md border border-gray-300 px-3 py-2 text-sm shadow-sm focus:border-tremor-brand focus:outline-none focus:ring-1 focus:ring-tremor-brand"}),u.jsx("button",{type:"button",onClick:()=>R(U),disabled:N,className:"text-sm text-red-600 hover:text-red-700",children:"Remove"})]},U))})]})]})]}),O&&u.jsx("p",{className:"text-sm text-red-600",children:O})]}),u.jsxs("div",{className:"mt-6 flex justify-end space-x-3",children:[u.jsx("button",{type:"button",onClick:n,disabled:N,className:"rounded-md bg-gray-200 px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-300",children:"Cancel"}),u.jsx("button",{type:"button",onClick:L,disabled:M,className:`rounded-md px-4 py-2 text-sm font-medium text-white ${M?"bg-gray-400 cursor-not-allowed":"bg-tremor-brand hover:bg-tremor-brand-emphasis"}`,children:N?"Saving…":t==="edit"?"Save changes":"Create connector"})]})]})]})}const EA={pending:{label:"Pending",description:"Inspectr is still discovering the connector metadata.",dotClass:"fill-amber-500 dark:fill-amber-400 animate-pulse",badgeProps:{variant:"neutral",filled:!0,backgroundClass:"border-amber-300 bg-amber-100 text-amber-700 dark:border-amber-500 dark:bg-amber-900/40 dark:text-amber-200"}},ready:{label:"Ready",description:"The connector is healthy and routable.",dotClass:"fill-emerald-500 dark:fill-emerald-400",badgeProps:{variant:"success",filled:!0}},disabled:{label:"Disabled",description:"The connector is disabled and will never receive traffic.",dotClass:"fill-gray-300 dark:fill-gray-500",badgeProps:{variant:"neutral",filled:!0,backgroundClass:"border-gray-300 bg-gray-200 text-gray-600 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-300"}},disconnected:{label:"Disconnected",description:"The connector is temporarily unreachable and will be retried with backoff.",dotClass:"fill-rose-500 dark:fill-rose-400",badgeProps:{variant:"error",filled:!0}},unknown:{label:"Unknown",description:"The connector status is unknown.",dotClass:"fill-gray-300 dark:fill-gray-600 animate-pulse",badgeProps:{variant:"neutral",filled:!0,backgroundClass:"border-gray-300 bg-gray-200 text-gray-600 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-300"}}},fI=e=>{var t,r;const n=e?.status||((t=e?.record)==null?void 0:t.status);return n?String(n).toLowerCase():((r=e?.record)==null?void 0:r.enabled)===!1?"disabled":e?.ready===!0?"ready":e?.ready===!1?"disconnected":"pending"},EE=e=>EA[e]||EA.unknown,jve=e=>e?Array.isArray(e)?e:Array.isArray(e.connectors)?e.connectors:[]:[],gc=e=>{if(!e)return"-";try{return new Date(e).toLocaleString()}catch{return e}},Eve=({headers:e})=>{const t=g.useMemo(()=>!e||typeof e!="object"?[]:Object.entries(e),[e]);return t.length===0?u.jsx("p",{className:"text-sm text-tremor-content",children:"No headers configured."}):u.jsx("dl",{className:"mt-1 space-y-1",children:t.map(([r,n])=>u.jsxs("div",{className:"grid grid-cols-[120px_1fr] gap-2 text-sm",children:[u.jsx("dt",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:r}),u.jsx("dd",{className:"break-all text-tremor-content dark:text-dark-tremor-content",children:String(n??"")})]},r))})},Sve=({actions:e})=>!Array.isArray(e)||e.length===0?u.jsx("p",{className:"text-sm text-tremor-content",children:"No actions exposed."}):u.jsx("div",{className:"space-y-2",children:e.map(t=>u.jsxs("div",{className:"rounded border border-tremor-border p-3",children:[u.jsx("p",{className:"text-sm font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:t?.label||t?.type||"Action"}),u.jsx("p",{className:"mt-1 text-sm text-tremor-content dark:text-dark-tremor-content",children:t?.description||"No description provided."}),Array.isArray(t?.params)&&t.params.length>0&&u.jsxs("div",{className:"mt-2 text-xs text-tremor-content dark:text-dark-tremor-content",children:[u.jsx("p",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Parameters"}),u.jsx("ul",{className:"mt-1 space-y-1 list-disc pl-5",children:t.params.map(r=>u.jsxs("li",{children:[u.jsx("span",{className:"font-medium",children:r?.name}),r!=null&&r.required?" (required)":""," - ",r?.description||r?.type]},r?.name||r?.type))})]})]},t?.type||t?.label))}),pI=({status:e,lastSync:t,error:r})=>{const n=e?String(e).toLowerCase():"unknown",o=EE(n),a=[o.description];t&&a.push(`Last sync: ${gc(t)}`),r&&a.push(`Last error: ${r}`);const i=u.jsx("span",{className:"block whitespace-pre-line",children:a.filter(Boolean).join(`
147
+ `)});return u.jsx(Im,{content:i,sideOffset:4,side:"left",children:u.jsx("svg",{viewBox:"0 0 6 6","aria-hidden":"true",className:ii("h-3 w-3",o.dotClass),children:u.jsx("circle",{r:"3",cx:"3",cy:"3"})})})},Nve=({open:e})=>u.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",className:ii("h-4 w-4 text-tremor-content-subtle transition-transform duration-200 dark:text-dark-tremor-content-subtle",e?"-rotate-180":"rotate-0"),children:u.jsx("path",{fill:"currentColor",d:"M5.23 7.21a.75.75 0 0 1 1.06.02L10 10.94l3.71-3.71a.75.75 0 0 1 1.06 1.06l-4.24 4.25a.75.75 0 0 1-1.06 0L5.21 8.29a.75.75 0 0 1 .02-1.08Z"})}),g0=({title:e,defaultOpen:t=!1,children:r})=>u.jsx(Mg,{defaultOpen:t,children:({open:n})=>u.jsxs("div",{className:"rounded-lg border border-tremor-border bg-white dark:border-dark-tremor-border dark:bg-dark-tremor-background",children:[u.jsxs(Mg.Button,{className:"flex w-full items-center justify-between gap-3 px-4 py-3 text-sm font-semibold bg-gray-100 text-tremor-content-strong transition hover:bg-gray-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-tremor-brand dark:text-dark-tremor-content-strong dark:hover:bg-dark-tremor-background-muted",children:[u.jsx("span",{children:e}),u.jsx(Nve,{open:n})]}),u.jsx(Mg.Panel,{className:"mt-4 px-4 pb-4 text-sm text-tremor-content dark:text-dark-tremor-content",children:r})]})}),Ove=({connector:e})=>{const t=e?.record||{},r=e?.info||{},n=e?.actions,o=fI(e),a=EE(o);return u.jsxs("div",{className:"mt-4 space-y-3",children:[u.jsxs(g0,{title:"Connector Details",defaultOpen:!0,children:[u.jsxs("dl",{className:"grid gap-y-2 sm:grid-cols-2",children:[u.jsxs("div",{children:[u.jsx("dt",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Status"}),u.jsxs("dd",{className:"space-y-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(pI,{status:o,lastSync:e?.last_sync,error:e?.last_error}),u.jsx(aa,{...a.badgeProps||{},children:a.label})]}),u.jsx("p",{className:"text-xs text-tremor-content-subtle dark:text-dark-tremor-content-subtle",children:a.description})]})]}),u.jsxs("div",{children:[u.jsx("dt",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Source"}),u.jsx("dd",{children:t.source||"-"})]}),u.jsxs("div",{children:[u.jsx("dt",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Created"}),u.jsx("dd",{children:gc(t.created_at)})]}),u.jsxs("div",{children:[u.jsx("dt",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Updated"}),u.jsx("dd",{children:gc(t.updated_at)})]}),u.jsxs("div",{children:[u.jsx("dt",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Last sync"}),u.jsx("dd",{children:gc(e?.last_sync)})]}),e?.last_error&&u.jsxs("div",{className:"sm:col-span-2",children:[u.jsx("dt",{className:"font-medium text-tremor-content-strong text-red-600 dark:text-red-400",children:"Last error"}),u.jsx("dd",{className:"text-red-600 dark:text-red-400",children:e.last_error})]})]}),u.jsxs("div",{className:"mt-4",children:[u.jsx("p",{className:"text-sm font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Headers"}),u.jsx(Eve,{headers:t.headers})]})]}),u.jsx(g0,{title:"Service Info",children:r&&Object.keys(r).length>0?u.jsxs("dl",{className:"space-y-2",children:[u.jsxs("div",{children:[u.jsx("dt",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Name"}),u.jsx("dd",{children:r.name||"-"})]}),u.jsxs("div",{children:[u.jsx("dt",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Version"}),u.jsx("dd",{children:r.version||"-"})]}),u.jsxs("div",{children:[u.jsx("dt",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Protocol version"}),u.jsx("dd",{children:r.protocol_version??"-"})]}),u.jsxs("div",{children:[u.jsx("dt",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Maintainer"}),u.jsx("dd",{children:r.maintainer||"-"})]}),u.jsxs("div",{children:[u.jsx("dt",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Description"}),u.jsx("dd",{children:r.description||"-"})]}),u.jsxs("div",{children:[u.jsx("dt",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Supported events"}),u.jsx("dd",{children:Array.isArray(r.supported_events)&&r.supported_events.length>0?r.supported_events.join(", "):"—"})]}),u.jsxs("div",{children:[u.jsx("dt",{className:"font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Supported models"}),u.jsx("dd",{children:Array.isArray(r.supported_models)&&r.supported_models.length>0?r.supported_models.map(i=>`${i?.kind||"-"} ${i!=null&&i.version?`(${i.version})`:""}`).join(", "):"—"})]})]}):u.jsx("p",{children:"No metadata available."})}),u.jsx(g0,{title:"Actions",children:u.jsx(Sve,{actions:n})})]})};function Cve(){const{client:e,setToast:t}=mr(),[r,n]=g.useState([]),[o,a]=g.useState(!0),[i,s]=g.useState(null),[l,c]=g.useState(null),[d,f]=g.useState(!1),[m,p]=g.useState("create"),[h,b]=g.useState(null),[v,x]=g.useState(null),[k,S]=g.useState(null),[j,O]=g.useState(!1),[C,N]=g.useState(""),T=g.useCallback(async()=>{try{a(!0),s(null);const $=await e.connectors.list(),z=jve($);n(z),c(W=>W&&(z.some(K=>{var q;return((q=K?.record)==null?void 0:q.id)===W})?W:null))}catch($){console.error("Connectors load error",$),s($?.message||"Failed to load connectors"),n([])}finally{a(!1)}},[e]);g.useEffect(()=>{T()},[T]);const M=()=>{p("create"),b(null),f(!0)},I=$=>{p("edit"),b($?.record||null),f(!0)},_=$=>{const z=$?.record;z!=null&&z.id&&(S(z),N(""))},R=async()=>{if(k!=null&&k.id){O(!0),N(""),x(k.id);try{await e.connectors.delete(k.id),t?.({message:"Connector deleted",type:"success"}),l===k.id&&c(null),S(null),T()}catch($){console.error("Connector delete error",$),t?.({type:"error",message:$?.message||"Failed to delete connector"}),N($?.message||"Failed to delete connector")}finally{O(!1),x(null)}}},L=()=>{j||(S(null),N(""))},F=async $=>{if(m==="edit"&&h!=null&&h.id){const W=await e.connectors.update(h.id,$);return t?.({message:"Connector updated",type:"success"}),T(),W}const z=await e.connectors.create($);return t?.({message:"Connector created",type:"success"}),T(),z},B=async $=>{const z=$?.record;if(z!=null&&z.id){x(z.id);try{const W={name:z.name,server_url:z.server_url,description:z.description,enabled:!z.enabled,headers:z.headers||{}};await e.connectors.update(z.id,W),t?.({message:`Connector ${z.enabled?"disabled":"enabled"}`,type:"success"}),T()}catch(W){console.error("Connector toggle error",W),t?.({type:"error",message:W?.message||"Failed to update connector status"})}finally{x(null)}}},U=r.length>0;return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"grid grid-cols-1 gap-10 md:grid-cols-3 items-start",children:[u.jsxs("div",{children:[u.jsx("h2",{className:"font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Connectors (Preview)"}),u.jsx("p",{className:"mt-1 text-tremor-default leading-6 text-tremor-content dark:text-dark-tremor-content",children:"Manage outbound connectors to forward Inspectr events to other services."}),u.jsxs("div",{className:"mt-4 flex flex-wrap gap-3",children:[u.jsx("button",{type:"button",onClick:M,className:"rounded-tremor-default bg-tremor-brand px-4 py-2.5 text-tremor-default font-medium text-tremor-brand-inverted shadow-tremor-input hover:bg-tremor-brand-emphasis dark:bg-dark-tremor-brand dark:text-dark-tremor-brand-inverted dark:shadow-dark-tremor-input dark:hover:bg-dark-tremor-brand-emphasis",children:"Create connector"}),u.jsx("button",{type:"button",onClick:T,className:"rounded-tremor-default border border-tremor-border px-4 py-2.5 text-tremor-default font-medium text-tremor-content hover:bg-tremor-background-muted dark:border-dark-tremor-border dark:text-dark-tremor-content dark:hover:bg-dark-tremor-background-muted",children:"Refresh"})]})]}),u.jsxs("div",{className:"sm:max-w-4xl md:col-span-2",children:[o&&u.jsx("p",{className:"text-tremor-default",children:"Loading connectors…"}),!o&&i&&u.jsx("p",{className:"text-sm text-red-600",children:i}),!o&&!i&&!U&&u.jsx("div",{className:"rounded-lg border border-dashed border-tremor-border p-6 text-center text-sm text-tremor-content dark:border-dark-tremor-border dark:text-dark-tremor-content",children:"No connectors yet. Create one to start forwarding events."}),!o&&!i&&U&&u.jsx("div",{className:"space-y-4",children:r.map(($,z)=>{const W=$?.record||{},K=W.id||W.name||`connector-${z}`,q=v===W.id,J=fI($),V=EE(J);return u.jsxs("div",{className:"rounded-lg border border-tremor-border bg-white p-4 shadow-sm dark:border-dark-tremor-border dark:bg-dark-tremor-background",children:[u.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsx("p",{className:"text-base font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:W.name||"Unnamed connector"}),u.jsx("p",{className:"text-sm text-tremor-content dark:text-dark-tremor-content",children:W.description||"No description provided."})]}),u.jsxs("div",{className:"flex gap-2 sm:justify-end self-start",children:[u.jsx("button",{type:"button",onClick:()=>c(me=>me===W.id?null:W.id),className:"rounded-md border border-tremor-border px-3 py-2 text-sm font-medium text-tremor-content hover:bg-tremor-background-muted dark:border-dark-tremor-border dark:text-dark-tremor-content dark:hover:bg-dark-tremor-background-muted disabled:cursor-not-allowed disabled:opacity-70",disabled:q,children:(W.id,"Details")}),u.jsx("button",{type:"button",onClick:()=>I($),className:"rounded-md border border-tremor-border px-3 py-2 text-sm font-medium text-tremor-content hover:bg-tremor-background-muted dark:border-dark-tremor-border dark:text-dark-tremor-content dark:hover:bg-dark-tremor-background-muted disabled:cursor-not-allowed disabled:opacity-70",disabled:q,children:"Edit"}),u.jsx("button",{type:"button",onClick:()=>_($),className:"rounded-md border border-red-200 px-3 py-2 text-sm font-medium text-red-600 hover:bg-red-50 disabled:cursor-not-allowed disabled:opacity-70",disabled:q,children:"Delete"})]}),u.jsx("div",{className:"sm:col-span-2",children:u.jsxs("div",{className:"flex items-center justify-between text-xs",children:[u.jsx("p",{className:"uppercase tracking-wide text-tremor-content-subtle dark:text-dark-tremor-content-subtle",children:W.server_url||"—"}),$?.last_sync&&u.jsxs("p",{className:"text-tremor-content-subtle dark:text-dark-tremor-content-subtle",children:["Last sync: ",gc($.last_sync)]})]})}),J!=="ready"&&$?.last_error&&u.jsx("div",{className:"sm:col-span-2",children:u.jsxs("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-800 dark:border-amber-600 dark:bg-amber-950/40 dark:text-amber-200",children:[u.jsx("span",{className:"font-medium",children:"Connection warning:"})," ",$.last_error]})}),u.jsx("div",{className:"sm:col-span-2",children:u.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-xs text-tremor-content dark:text-dark-tremor-content",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{children:"Connection"}),u.jsx(pI,{status:J,lastSync:$?.last_sync,error:$?.last_error}),u.jsx(aa,{...V.badgeProps||{},children:V.label})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{children:"Status"}),u.jsx(aa,{variant:W.enabled?"success":"neutral",filled:!0,children:W.enabled?"Enabled":"Disabled"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs(KT,{checked:!!W.enabled,onChange:()=>B($),disabled:q,className:ii("relative inline-flex h-5 w-9 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-tremor-brand focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60",W.enabled?"bg-tremor-brand dark:bg-dark-tremor-brand":"bg-gray-200 dark:bg-gray-700"),children:[u.jsx("span",{className:"sr-only",children:W.enabled?"Disable connector":"Enable connector"}),u.jsx("span",{"aria-hidden":"true",className:ii("pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white shadow-lg ring-0 transition duration-200 ease-in-out",W.enabled?"translate-x-4":"translate-x-0")})]}),u.jsx("span",{className:"font-medium",children:W.enabled?"Disable":"Enable"})]})]})})]}),l===W.id&&u.jsx(Ove,{connector:$})]},K)})})]})]}),u.jsx(Dm,{open:!!k,rule:k,title:"Delete connector?",description:u.jsxs(u.Fragment,{children:["This will permanently remove"," ",u.jsx("span",{className:"font-medium",children:k?.name||k?.id||"this connector"})," ","and its configuration."]}),confirmLabel:"Delete Connector",isDeleting:j,error:C,onCancel:L,onConfirm:R}),u.jsx(kve,{open:d,mode:m,initialData:h||void 0,onClose:()=>f(!1),onSubmit:F}),u.jsx(ji,{className:"my-10"})]})}const SA=[{slug:"general",label:"General"},{slug:"mock",label:"Mock"},{slug:"guard",label:"Authentication Guard"},{slug:"connectors",label:"Connectors"},{slug:"previews",label:"Feature Previews"}],NA=()=>{const{slug:e,operationId:t}=a2();return e==="settings"&&t?t:"general"};function Pve(){const[e,t]=g.useState(NA),[r]=Bn("feat_connectors");g.useEffect(()=>{const a=()=>t(NA());return window.addEventListener("hashchange",a),()=>window.removeEventListener("hashchange",a)},[]),g.useEffect(()=>{e==="connectors"&&!r&&(window.history.replaceState(null,"","#settings/general"),t("general"))},[r,e]);const n=a=>{window.history.pushState(null,"",`#settings/${a}`),t(a)},o=r?SA:SA.filter(a=>a.slug!=="connectors");return u.jsxs("div",{className:"flex flex-col md:flex-row min-h-[calc(100vh-120px)] bg-white dark:bg-gray-950",children:[u.jsx("aside",{className:"md:w-56 border-b md:border-b-0 md:border-r border-tremor-border dark:border-dark-tremor-border md:min-h-full",children:u.jsx("nav",{className:"flex md:flex-col",children:o.map(a=>u.jsx("button",{onClick:()=>n(a.slug),className:`px-4 py-2 text-left text-tremor-default border-b md:border-b-0 md:border-l-4 md:py-3 ${e===a.slug?"md:border-tremor-brand md:text-tremor-brand text-tremor-brand font-medium bg-tremor-brand/5 dark:bg-dark-tremor-brand/10":"border-transparent text-tremor-content hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted"}`,children:a.label},a.slug))})}),u.jsxs("div",{className:"flex-1 h-full overflow-y-auto p-4 sm:px-6 sm:pb-10 sm:pt-10 lg:px-10 lg:pt-7 max-w-5xl mx-auto",children:[e==="general"&&u.jsxs(u.Fragment,{children:[u.jsx(cve,{}),u.jsx(dve,{}),u.jsx(vve,{})]}),e==="connectors"&&r&&u.jsx(Cve,{}),e==="mock"&&u.jsx(pve,{}),e==="guard"&&u.jsx(hve,{}),e==="previews"&&u.jsx(bve,{})]})]})}function sd({message:e="No operations captured yet."}){return u.jsx("div",{className:"flex items-center justify-center rounded-tremor-small border border-dashed border-tremor-border py-16 text-sm text-tremor-content-subtle dark:border-dark-tremor-border dark:text-dark-tremor-content",children:e})}function mI({method:e}){return u.jsx("span",{className:`inline-flex items-center rounded-full px-2.5 py-1 text-xs font-semibold ${Ek(e)}`,children:e||"N/A"})}function SE({status:e}){const t=typeof e=="number"?e:Number(e);return u.jsx("span",{className:`inline-flex items-center rounded-full px-2.5 py-1 text-xs font-semibold ${ld(t)}`,children:e??"—"})}const Ave=e=>{const t=Number(e)||0;return t>=95?{label:"Healthy",color:"bg-emerald-500"}:t>=80?{label:"Warning",color:"bg-amber-500"}:{label:"Critical",color:"bg-rose-500"}};function Tve({endpoint:e}){const{method:t,path:r,host:n,count:o,successRate:a,averageDuration:i,p95Duration:s,chartData:l,latestStatus:c,seriesLoading:d,seriesError:f}=e,m=g.useMemo(()=>new Intl.NumberFormat,[]),p=Ave(a),h=d&&!l.length,b=f&&!l.length;return u.jsx(fr,{className:"h-full rounded-tremor-small border border-tremor-border dark:border-dark-tremor-border",children:u.jsxs("div",{className:"flex flex-col gap-4",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(mI,{method:t}),u.jsx(Gn,{className:"text-lg text-tremor-content-strong dark:text-dark-tremor-content-strong",children:r})]}),n?u.jsx(zt,{className:"text-xs text-tremor-content-subtle dark:text-dark-tremor-content",children:n}):null]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs(kh,{color:"slate",children:["Requests ",m.format(o)]}),u.jsx(SE,{status:c})]})]}),u.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-4",children:[u.jsx("div",{className:"lg:col-span-3",children:h?u.jsx("div",{className:"flex h-36 items-center justify-center rounded-md border border-dashed border-tremor-border text-sm text-tremor-content-subtle dark:border-dark-tremor-border dark:text-dark-tremor-content",children:"Loading series…"}):b?u.jsx("div",{className:"flex h-36 items-center justify-center rounded-md border border-rose-200 bg-rose-50 px-3 text-sm text-rose-700 dark:border-rose-900 dark:bg-rose-900/20 dark:text-rose-300",children:"Failed to load series"}):l.length?u.jsx(h9,{data:l,index:"time",categories:["duration","baseline"],colors:["cyan","gray"],showYAxis:!1,showLegend:!1,className:"h-36"}):u.jsx("div",{className:"flex h-36 items-center justify-center rounded-md border border-dashed border-tremor-border text-sm text-tremor-content-subtle dark:border-dark-tremor-border dark:text-dark-tremor-content",children:"No recent series data"})}),u.jsxs("div",{className:"flex flex-col justify-between gap-4 rounded-tremor-small bg-gray-50 p-4 dark:bg-dark-tremor-background",children:[u.jsxs("div",{children:[u.jsx(zt,{className:"text-sm text-tremor-content dark:text-dark-tremor-content",children:"Success rate"}),u.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[u.jsxs(ua,{className:"!text-xl",children:[a,"%"]}),u.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium text-white ${p.color}`,children:p.label})]})]}),u.jsxs("div",{children:[u.jsx(zt,{className:"text-sm text-tremor-content dark:text-dark-tremor-content",children:"Avg duration"}),u.jsx(ua,{className:"!text-xl",children:i?`${i}ms`:"N/A"}),u.jsxs(zt,{className:"mt-1 text-xs text-tremor-content-subtle dark:text-dark-tremor-content",children:["p95 ",s?`${s}ms`:"N/A"]})]})]})]})]})})}function Mve({endpoints:e,loading:t,error:r}){return t?u.jsx(fr,{className:"rounded-tremor-small border border-dashed border-tremor-border py-12 text-center text-sm text-tremor-content-subtle dark:border-dark-tremor-border dark:text-dark-tremor-content",children:"Loading endpoint summary…"}):r?u.jsxs(fr,{className:"rounded-tremor-small border border-rose-200 bg-rose-50 p-6 text-sm text-rose-700 dark:border-rose-900 dark:bg-rose-900/20 dark:text-rose-300",children:["Failed to load endpoint summary: ",r.message||"Unexpected error"]}):e.length?u.jsx(Xh,{numItemsSm:1,numItemsMd:1,numItemsLg:1,className:"gap-4",children:e.map(n=>u.jsx(Tve,{endpoint:n},n.key))}):u.jsx(sd,{message:"No endpoint activity to display yet."})}function _ve({operation:e}){return u.jsx(fr,{className:"h-full rounded-tremor-small border border-tremor-border dark:border-dark-tremor-border",children:u.jsxs("div",{className:"flex flex-col gap-3",children:[u.jsxs("div",{className:"flex items-start justify-between gap-3",children:[u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(mI,{method:e.method}),u.jsx(zt,{className:`text-xs font-semibold ${ud(e.method)}`,children:e.method})]}),u.jsx(Gn,{className:"text-base text-tremor-content-strong dark:text-dark-tremor-content-strong",children:e.path}),u.jsx(zt,{className:"text-xs text-tremor-content-subtle dark:text-dark-tremor-content",children:zi(e.timestamp)}),e.host?u.jsxs(zt,{className:"text-xs text-tremor-content-subtle dark:text-dark-tremor-content",children:["Host ",e.host]}):null]}),u.jsxs("div",{className:"flex flex-col items-end gap-2",children:[u.jsx(SE,{status:e.status}),u.jsx(kh,{color:"blue",children:ts(e.duration)})]})]}),e.tags.length>0?u.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.tags.slice(0,6).map(t=>u.jsx(cs,{tag:t},t.token)),e.tags.length>6?u.jsxs("span",{className:"text-xs text-tremor-content-subtle dark:text-dark-tremor-content",children:["+",e.tags.length-6," more"]}):null]}):null]})})}const Ive=100,Dve=40;function Lve({operations:e}){return e.length?u.jsx(Xh,{numItemsSm:1,numItemsLg:2,className:"gap-4",children:e.slice(0,Ive).map(t=>u.jsx(_ve,{operation:t},t.id))}):u.jsx(sd,{message:"Operations will appear here once traffic flows."})}function Rve({operations:e}){return e.length?u.jsx(fr,{className:"rounded-tremor-small border border-tremor-border dark:border-dark-tremor-border",children:u.jsx("div",{className:"overflow-x-auto",children:u.jsxs(Y8,{children:[u.jsx(Z8,{children:u.jsxs(vk,{children:[u.jsx(Fi,{children:"Status"}),u.jsx(Fi,{children:"Method"}),u.jsx(Fi,{children:"Path"}),u.jsx(Fi,{children:"Duration"}),u.jsx(Fi,{children:"Timestamp"}),u.jsx(Fi,{children:"Host"})]})}),u.jsx(X8,{children:e.map(t=>u.jsxs(vk,{children:[u.jsx(Ri,{children:u.jsx(SE,{status:t.status})}),u.jsx(Ri,{children:u.jsx("span",{className:`font-semibold ${ud(t.method)}`,children:t.method})}),u.jsx(Ri,{className:"max-w-md truncate",children:t.path}),u.jsx(Ri,{children:ts(t.duration)}),u.jsx(Ri,{className:"min-w-[160px]",children:zi(t.timestamp)}),u.jsx(Ri,{children:t.host||"—"})]},t.id))})]})})}):u.jsx(sd,{message:"No operations available for tabular view."})}const Fve=e=>{if(!Number.isFinite(e))return"—";const t=new Date(e);return Number.isNaN(t.getTime())?"—":t.toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1})},$ve=e=>e>=500?"bg-rose-500/80":e>=400&&e<500?"bg-amber-500/80":e>=300&&e<400?"bg-blue-500/70":e>=200&&e<300?"bg-emerald-500/80":"bg-slate-400/70",OA=e=>Math.min(Math.max(e,0),100);function Bve({operations:e}){const t=g.useMemo(()=>new Date,[]),r=g.useMemo(()=>obe("Today",t),[t]),n=r?.start??kE(t),o=r?.end??jE(t),[a,i]=g.useState(r?.label??"Custom"),[s,l]=g.useState(n),[c,d]=g.useState(o),[f,m]=g.useState(!1),[p,h]=g.useState(new Date(t.getTime()-7*24*60*60*1e3).toISOString().split("T")[0]),[b,v]=g.useState("00:00"),[x,k]=g.useState(t.toISOString().split("T")[0]),[S,j]=g.useState("23:59"),[O,C]=g.useState(null),[N,T]=g.useState(!1),[M,I]=g.useState(""),_=g.useMemo(()=>{const X=new Map;return e.forEach(ce=>{ce.tags.forEach(oe=>{X.has(oe.raw)||X.set(oe.raw,oe)})}),Array.from(X.keys()).sort((ce,oe)=>ce.localeCompare(oe))},[e]);g.useEffect(()=>{O&&(_.includes(O)||C(null))},[_,O]),g.useEffect(()=>{_.length||N&&T(!1)},[_,N]),g.useEffect(()=>{var X,ce;if(!f)return;const oe=new Date(s),Oe=new Date(c);Number.isNaN(oe.getTime())||(h(oe.toISOString().split("T")[0]),v(((X=oe.toISOString().split("T")[1])==null?void 0:X.slice(0,5))||"00:00")),Number.isNaN(Oe.getTime())||(k(Oe.toISOString().split("T")[0]),j(((ce=Oe.toISOString().split("T")[1])==null?void 0:ce.slice(0,5))||"00:00"))},[f,s,c]);const R=g.useMemo(()=>{var X;return O&&((X=pl(O))==null?void 0:X.token)||null},[O]),L=g.useMemo(()=>Date.parse(s),[s]),F=g.useMemo(()=>Date.parse(c),[c]),B=Number.isFinite(L)&&Number.isFinite(F)&&F>L,U=B?F-L:1,$=g.useMemo(()=>B?e.filter(X=>!X.timestampMs||X.timestampMs<L||X.timestampMs>F?!1:R?X.tags.some(ce=>ce.token===R):!0).sort((X,ce)=>(X.timestampMs||0)-(ce.timestampMs||0)):[],[e,B,L,F,R]),z=g.useMemo(()=>{if(!$.length)return[];if(!N)return[{key:"all",label:null,operations:$.map(ce=>({operation:ce}))}];const X=new Map;return $.forEach(ce=>{if(!ce.tags.length){const oe=X.get("__untagged__")||{key:"__untagged__",label:null,operations:[]};oe.operations.push({operation:ce}),X.set("__untagged__",oe);return}ce.tags.forEach(oe=>{const Oe=oe.token;X.has(Oe)||X.set(Oe,{key:Oe,label:oe,operations:[]}),X.get(Oe).operations.push({operation:ce,tag:oe})})}),Array.from(X.values()).sort((ce,oe)=>{var Oe,te;const Ne=((Oe=ce.label)==null?void 0:Oe.display)||"Untagged",ve=((te=oe.label)==null?void 0:te.display)||"Untagged";return Ne.localeCompare(ve)})},[$,N]),W=g.useMemo(()=>{if(!B)return[];const X=4,ce=[];for(let oe=0;oe<=X;oe+=1){const Oe=oe/X;ce.push({key:oe,percent:Oe*100,label:Fve(L+Oe*U)})}return ce},[B,L,U]),K=X=>{i(X.label),l(X.start),d(X.end),m(!1),I("")},q=()=>{m(X=>!X),f||i("Custom")},J=()=>{if(!p||!x){I("Select start and end dates.");return}const X=new Date(`${p}T${b||"00:00"}:00`),ce=new Date(`${x}T${S||"00:00"}:00`);if(Number.isNaN(X.getTime())||Number.isNaN(ce.getTime())){I("Unable to parse custom range.");return}if(X>ce){I("Start must be before end.");return}l(X.toISOString()),d(ce.toISOString()),i("Custom"),m(!1),I("")},V=`${zi(s)} – ${zi(c)}`,me=_.length>0;return u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[u.jsxs("div",{className:"relative flex flex-wrap items-center gap-3",children:[u.jsx(iI,{selectedRange:a,onSelect:K,onCustomClick:q}),f?u.jsx("div",{className:"absolute left-0 top-full z-20 mt-2 w-72 rounded-md border border-tremor-border bg-tremor-background p-3 shadow-xl dark:border-dark-tremor-border dark:bg-gray-950",children:u.jsxs("div",{className:"flex flex-col gap-3 text-xs text-tremor-content dark:text-dark-tremor-content",children:[u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide",children:"Start"}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{type:"date",value:p,onChange:X=>{h(X.target.value),I("")},className:"w-full rounded border border-tremor-border px-2 py-1 text-sm focus:outline-none focus-visible:ring-2 focus-visible:ring-tremor-brand dark:border-dark-tremor-border dark:bg-gray-900"}),u.jsx("input",{type:"time",value:b,onChange:X=>{v(X.target.value),I("")},className:"w-full rounded border border-tremor-border px-2 py-1 text-sm focus:outline-none focus-visible:ring-2 focus-visible:ring-tremor-brand dark:border-dark-tremor-border dark:bg-gray-900"})]})]}),u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide",children:"End"}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{type:"date",value:x,onChange:X=>{k(X.target.value),I("")},className:"w-full rounded border border-tremor-border px-2 py-1 text-sm focus:outline-none focus-visible:ring-2 focus-visible:ring-tremor-brand dark:border-dark-tremor-border dark:bg-gray-900"}),u.jsx("input",{type:"time",value:S,onChange:X=>{j(X.target.value),I("")},className:"w-full rounded border border-tremor-border px-2 py-1 text-sm focus:outline-none focus-visible:ring-2 focus-visible:ring-tremor-brand dark:border-dark-tremor-border dark:bg-gray-900"})]})]}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx("button",{type:"button",className:"rounded border border-tremor-border px-2 py-1 text-xs font-medium text-tremor-content hover:bg-tremor-background-subtle dark:border-dark-tremor-border dark:text-dark-tremor-content dark:hover:bg-dark-tremor-background-subtle",onClick:()=>m(!1),children:"Cancel"}),u.jsx("button",{type:"button",className:"rounded bg-tremor-brand px-3 py-1 text-xs font-medium text-white hover:bg-tremor-brand-emphasis",onClick:J,children:"Apply range"})]}),M?u.jsx("p",{className:"text-[11px] text-rose-600 dark:text-rose-400",children:M}):null]})}):null,u.jsx(Vf,{options:_,selected:O,onSelect:C,placeholder:"Filter by tag"})]}),u.jsx("div",{className:"flex items-center gap-3",children:u.jsxs("label",{className:"flex items-center gap-2 text-xs font-medium text-tremor-content dark:text-dark-tremor-content",children:[u.jsx("input",{type:"checkbox",className:"size-4 rounded border-tremor-border text-tremor-brand focus:ring-tremor-brand dark:border-dark-tremor-border dark:bg-gray-900",checked:N,disabled:!me,onChange:X=>T(X.target.checked)}),"Group by tags"]})})]}),u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 text-xs text-tremor-content-subtle dark:text-dark-tremor-content",children:[u.jsx("span",{children:V}),u.jsxs("span",{children:[$.length," operations"]})]}),M?u.jsx("p",{className:"text-xs text-rose-600 dark:text-rose-400",children:M}):null,u.jsx(fr,{className:"rounded-tremor-small border border-tremor-border dark:border-dark-tremor-border",children:B?z.length===0?u.jsx(sd,{message:"No operations captured in the selected range."}):u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:gap-4",children:[u.jsx("div",{className:"hidden md:block md:w-1/3 lg:w-1/5"}),u.jsx("div",{className:"w-full md:w-2/3 lg:w-4/5",children:u.jsxs("div",{className:"relative h-12",children:[u.jsx("div",{className:"absolute inset-x-0 top-1/2 -translate-y-1/2 border-t border-dashed border-tremor-border dark:border-dark-tremor-border"}),W.map(X=>u.jsx("div",{className:"absolute -translate-x-1/2 whitespace-nowrap text-[11px] font-medium text-tremor-content-subtle dark:text-dark-tremor-content",style:{left:`${OA(X.percent)}%`},children:X.label},X.key))]})})]}),u.jsx("div",{className:"space-y-4",children:z.map(X=>u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"flex items-center justify-between text-xs text-tremor-content-strong dark:text-dark-tremor-content-strong",children:[u.jsx("div",{className:"flex items-center gap-2",children:N?X.label?u.jsx(cs,{tag:X.label}):u.jsx("span",{className:"rounded-full bg-slate-100 px-3 py-1 text-[11px] font-medium text-slate-600 dark:bg-dark-tremor-background-subtle dark:text-dark-tremor-content",children:"Untagged"}):u.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-tremor-content-subtle dark:text-dark-tremor-content",children:"All operations"})}),u.jsxs("span",{className:"text-[11px] text-tremor-content-subtle dark:text-dark-tremor-content",children:[X.operations.length," ops"]})]}),u.jsx("div",{className:"space-y-3",children:X.operations.map(({operation:ce,tag:oe},Oe)=>{const te=ce.timestampMs??0,Ne=Number.isFinite(ce.duration)?ce.duration:0,ve=Ne>0?te+Ne:te,G=Math.max(te,L),ye=Math.max(G,Math.min(ve,F)),le=(G-L)/U*100,ge=(ye-G)/U*100,Ce=OA(le),Me=ge>0?`${Math.max(ge,.8)}%`:"6px",Ye=ge>0?void 0:"translateX(-50%)",Ve=`${ce.method} ${ce.path}
148
+ ${zi(ce.timestamp)}
149
+ Duration ${ts(ce.duration)}`,$e=$ve(ce.status),Ze=`${ce.id||ce.operationId||ce.timestampMs||"op"}-${oe?.token||"all"}-${Oe}`;return u.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-stretch md:gap-4",children:[u.jsxs("div",{className:"w-full min-w-0 md:w-1/3 lg:w-1/5",children:[u.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[u.jsx("span",{className:`font-semibold uppercase ${ud(ce.method)}`,children:ce.method}),u.jsx("span",{className:"max-w-md truncate text-xs text-tremor-content-subtle dark:text-dark-tremor-content",children:ce.path||"/"}),u.jsxs("span",{className:"max-w-md truncate text-[11px] text-tremor-content-subtle dark:text-dark-tremor-content",children:["(",ts(ce.duration),")"]})]}),u.jsx("div",{className:"text-[11px] text-tremor-content-subtle dark:text-dark-tremor-content",children:zi(ce.timestamp)})]}),u.jsx("div",{className:"w-full md:w-2/3 lg:w-4/5",children:u.jsx("div",{className:"relative h-10 rounded-tremor-small border border-dashed border-tremor-border bg-tremor-background-subtle dark:border-dark-tremor-border dark:bg-dark-tremor-background-subtle",children:u.jsxs("div",{className:`absolute inset-y-1 flex items-center overflow-hidden rounded ${$e} text-[10px] font-semibold uppercase tracking-wide text-white shadow-sm`,style:{left:`${Ce}%`,width:Me,transform:Ye},title:Ve,children:[u.jsx("span",{className:"px-2 truncate",children:ce.method}),u.jsxs("span",{className:"px-2 truncate",children:["Duration ",ts(ce.duration)]})]})})})]},Ze)})})]},X.key))})]}):u.jsx(sd,{message:"Select a valid time range to view the timeline."})})]})}const zve=e=>{if(!e)return null;try{return new URL(e)}catch{return null}},Hve=e=>{var t,r;if(!e)return null;const n=((t=e.raw)==null?void 0:t.data)||{},o=n.request||{},a=n.response||{},i=n.timing||{},s=(e.method||o.method||"GET").toUpperCase(),l=e.status_code??a.status??null,c=e.duration??i.duration,d=Number.isFinite(Number(c))?Number(c):null,f=e.time||o.timestamp||null,m=zve(o.url||e.url||""),p=o.path||e.path||m?.pathname||o.url||e.url||"/",h=o.server||m?.host||"",b=Array.isArray((r=n.meta)==null?void 0:r.tags)?n.meta.tags:Array.isArray(e.tags)?e.tags:[],v=Am(b);return{id:e.id,operationId:e.operation_id,method:s,status:l,duration:d,timestamp:f,timestampMs:f?Date.parse(f):null,path:p,host:h,url:o.url||e.url||"",request:o,response:a,timing:i,tags:v,raw:n}},qve=e=>{if(!e)return"Unknown";const t=new Date(e);return Number.isNaN(t.getTime())?"Unknown":t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})},CA=(e,t)=>`${e} ${t}`;function Wve(){var e,t,r,n;const{client:o}=mr(),[a,i]=g.useState(null),[s,l]=g.useState(null),[c,d]=g.useState(!1),[f,m]=g.useState({}),p=ca(()=>Br.db.events.orderBy("time").last(),[],null)||null,h=ca(()=>Br.db.events.orderBy("time").reverse().toArray(),[],[])||[],b=g.useMemo(()=>h.map(O=>Hve(O)).filter(Boolean).sort((O,C)=>(C.timestampMs||0)-(O.timestampMs||0)),[h]);g.useEffect(()=>{var O;if(!((O=o?.operations)!=null&&O.summarize))return;let C=!0;return(async()=>{d(!0),l(null);try{const N=await o.operations.summarize();C&&(i(N),m({}))}catch(N){C&&l(N)}finally{C&&d(!1)}})(),()=>{C=!1}},[o,p?.id]),g.useEffect(()=>{var O,C;if(!((O=o?.operations)!=null&&O.getSeries)||!((C=a?.summaries)!=null&&C.length))return;let N=!0;return(async()=>{const T=a.summaries;await Promise.all(T.map(async M=>{const I=CA(M.method,M.path);m(_=>({..._,[I]:{..._[I]||{},loading:!0,error:null}}));try{const _=await o.operations.getSeries({method:M.method,path:M.path,seriesLimit:Dve});if(!N)return;m(R=>({...R,[I]:{...R[I]||{},loading:!1,data:_,error:null}}))}catch(_){if(!N)return;m(R=>({...R,[I]:{...R[I]||{},loading:!1,error:_}}))}}))})(),()=>{N=!1}},[o,a?.summaries]);const v=g.useMemo(()=>{var O;return(O=a?.summaries)!=null&&O.length?a.summaries.map(C=>{var N;const T=CA(C.method,C.path),M=f[T]||{},I=(((N=M.data)==null?void 0:N.series)||[]).slice(-40).map(_=>({time:qve(_.ts),duration:_.duration??0,baseline:_.baseline??C.averageDuration??0}));return{...C,key:T,chartData:I,seriesLoading:M.loading??!1,seriesError:M.error||null}}):[]},[a,f]),x=((e=a?.totals)==null?void 0:e.totalOperations)??b.length,k=(t=a?.totals)==null?void 0:t.totalEndpoints,S=(r=a?.totals)==null?void 0:r.errorCount,j=(n=a?.totals)==null?void 0:n.averageDuration;return u.jsxs("div",{className:"space-y-6",children:[u.jsxs(fr,{className:"rounded-tremor-small border border-tremor-border dark:border-dark-tremor-border",children:[u.jsxs(G8,{justifyContent:"between",alignItems:"start",children:[u.jsxs("div",{children:[u.jsx(Gn,{className:"text-lg text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Insights Explorer"}),u.jsx(zt,{className:"mt-1 text-sm text-tremor-content dark:text-dark-tremor-content",children:"Get more insights into the operations by grouping them by endpoint, as time line view, as rich cards, or in a compact table"})]}),u.jsx(kh,{color:s?"rose":"slate",children:c?"Loading…":`Total ${x}`})]}),u.jsxs(Xh,{numItemsSm:1,numItemsLg:3,className:"mt-6 gap-4",children:[u.jsxs(fr,{className:"bg-gray-50 shadow-none dark:bg-dark-tremor-background",children:[u.jsx(zt,{className:"text-sm text-tremor-content dark:text-dark-tremor-content",children:"Unique endpoints"}),u.jsx(ua,{className:"mt-2",children:k})]}),u.jsxs(fr,{className:"bg-gray-50 shadow-none dark:bg-dark-tremor-background",children:[u.jsx(zt,{className:"text-sm text-tremor-content dark:text-dark-tremor-content",children:"Errors"}),u.jsxs(ua,{className:"mt-2",children:[S," ",u.jsxs("span",{className:"text-base font-normal text-tremor-content-subtle dark:text-dark-tremor-content",children:["(",x?Math.round(S/x*100):0,"%)"]})]})]}),u.jsxs(fr,{className:"bg-gray-50 shadow-none dark:bg-dark-tremor-background",children:[u.jsx(zt,{className:"text-sm text-tremor-content dark:text-dark-tremor-content",children:"Avg duration"}),u.jsx(ua,{className:"mt-2",children:j?`${j}ms`:"N/A"})]})]})]}),u.jsxs(xE,{children:[u.jsxs(yE,{children:[u.jsx(Qi,{children:"Endpoint mode"}),u.jsx(Qi,{children:"List mode"}),u.jsx(Qi,{children:"Table mode"}),u.jsx(Qi,{children:"Timeline mode"})]}),u.jsxs(wE,{className:"mt-6 space-y-6",children:[u.jsx(es,{children:u.jsx(Mve,{endpoints:v,loading:c,error:s})}),u.jsx(es,{children:u.jsx(Lve,{operations:b})}),u.jsx(es,{children:u.jsx(Rve,{operations:b})}),u.jsx(es,{children:u.jsx(Bve,{operations:b})})]})]})]})}function Uve(){const{client:e,setToast:t}=mr(),[r,n]=g.useState(!1),[o,a]=g.useState(""),[i,s]=g.useState(null),[l,c]=g.useState(!1),[d,f]=g.useState(null);g.useEffect(()=>{const b=new URLSearchParams(window.location.search).get("openapi");b&&(a(b),n(!0),m())},[]);const m=async()=>{try{const b=await e.service.getHealth();f(b.mode)}catch{}},p=()=>{l||n(!1)},h=async()=>{c(!0),s(null);try{await e.mock.launch(o),t({message:"Mock launched",subMessage:"Serving mock from OpenAPI spec",type:"success"}),n(!1)}catch(b){console.error("Mock launch error",b),s(b.message||"Failed to launch mock"),c(!1)}};return r?u.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[u.jsx("div",{className:"absolute inset-0 bg-black opacity-50",onClick:p}),u.jsxs("div",{className:"relative bg-white rounded-lg shadow-xl max-w-3xl w-full mx-4 p-6 z-10",children:[u.jsxs("div",{className:"flex items-center justify-between mb-4",children:[u.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Configure Inspectr Mock"}),u.jsx("button",{onClick:p,className:"text-gray-600 hover:text-gray-800","aria-label":"Close",disabled:l,children:"×"})]}),d==="proxy"?u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"mb-2 text-sm text-gray-700",children:"Inspectr lets you serve a mock API based on an OpenAPI spec."}),u.jsxs("div",{className:"mb-6 p-4 bg-yellow-50 border border-yellow-200 rounded",children:[u.jsxs("p",{className:"text-sm font-medium text-yellow-800",children:["Inspectr is currently running in ",u.jsx("strong",{children:"proxy"})," mode."]}),u.jsx("p",{className:"mt-2 text-sm text-yellow-800",children:"To switch to mock mode, restart Inspectr with:"}),u.jsxs("pre",{className:"mt-2 p-2 bg-gray-100 text-xs rounded overflow-auto",children:['npx @inspectr/inspectr --mock-backend="',o,'"']}),u.jsx(cn,{textToCopy:`npx @inspectr/inspectr --mock-backend=${o}`})]}),u.jsx("p",{className:"mb-4 text-sm text-gray-700",children:"Follow the instructions above to start Inspectr as Mock server from the OpenAPI spec."}),u.jsx("div",{className:"flex justify-end",children:u.jsx("button",{onClick:p,className:"px-4 py-2 bg-gray-200 text-gray-700 rounded hover:bg-gray-300",children:"Cancel"})})]}):u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"mb-2 text-sm text-gray-700",children:"Inspectr lets you serve a mock API based on an OpenAPI spec."}),u.jsxs("p",{className:"mb-4 text-sm text-gray-700",children:["You’re about to use ",u.jsx("b",{children:o})," for mock responses. This will replace any existing mock configuration or catch-mode settings."]}),u.jsxs("div",{className:"mb-4",children:[u.jsx("label",{htmlFor:"openapi-url",className:"block text-sm font-medium text-gray-700",children:"OpenAPI Spec URL"}),u.jsx("input",{id:"openapi-url",type:"url",value:o,onChange:b=>{a(b.target.value),s(null)},placeholder:"https://example.com/openapi.yaml",disabled:l,className:"mt-1 block w-full rounded-md shadow-sm sm:text-sm "+(i?"border-red-500 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500":"border-gray-300 focus:ring-blue-500 focus:border-blue-500")}),i&&u.jsx("p",{className:"mt-2 text-sm text-red-600",children:i})]}),u.jsxs("div",{className:"flex justify-end space-x-3",children:[u.jsx("button",{onClick:p,className:"px-4 py-2 bg-gray-200 text-gray-700 rounded hover:bg-gray-300",disabled:l,children:"Cancel"}),u.jsx("button",{onClick:h,className:`px-4 py-2 text-white rounded ${l?"bg-gray-400 cursor-not-allowed":"bg-red-600 hover:bg-red-700"}`,disabled:l,children:l?"Loading…":"Confirm"})]})]})]})]}):null}function Kve({open:e,onClose:t}){const{client:r,setToast:n}=mr(),[o,a]=g.useState("json"),[i,s]=g.useState(!1),[l,c]=g.useState("preset"),[d,f]=g.useState(""),[m,p]=g.useState(""),[h,b]=g.useState(""),[v]=Bn("feat_export_openapi"),[x]=Bn("feat_export_postman"),[k,S]=g.useState("");g.useEffect(()=>{e||S("")},[e]);const j=async()=>{s(!0),S("");try{const O={format:o};l==="preset"?d&&(O.preset=d):(m&&(O.since=new Date(m).toISOString()),h&&(O.until=new Date(h).toISOString()));const C=await r.operations.export(O),N=new Date,T=F=>F.toString().padStart(2,"0"),M=`${N.getFullYear()}-${T(N.getMonth()+1)}-${T(N.getDate())}-${T(N.getHours())}${T(N.getMinutes())}`,I=URL.createObjectURL(C),_=document.createElement("a");_.href=I;const R=o==="phar"?"phar":"json",L=o==="json"?"":`_${o}`;_.download=`inspectr_operations_${M}${L}.${R}`,_.click(),URL.revokeObjectURL(I),t&&t()}catch(O){console.error("Export failed",O);const C=O?.message||"Export failed";S(C),n({message:"Export failed",subMessage:C,type:"error"})}finally{s(!1)}};return e?u.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[u.jsx("div",{className:"absolute inset-0 bg-black opacity-50",onClick:t}),u.jsxs("div",{className:"relative bg-white rounded-lg shadow-xl max-w-md w-full mx-4 p-6 z-10",children:[u.jsxs("div",{className:"flex items-center justify-between mb-4",children:[u.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Export Operations"}),u.jsx("button",{onClick:t,className:"text-gray-600 hover:text-gray-800","aria-label":"Close",children:"×"})]}),u.jsxs("div",{className:"mb-4",children:[u.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Time Range"}),u.jsxs("div",{className:"mt-1 flex items-center space-x-4",children:[u.jsxs("label",{className:"inline-flex items-center",children:[u.jsx("input",{type:"radio",name:"timeOption",value:"preset",checked:l==="preset",onChange:()=>c("preset"),className:"form-radio"}),u.jsx("span",{className:"ml-2",children:"Preset"})]}),u.jsxs("label",{className:"inline-flex items-center",children:[u.jsx("input",{type:"radio",name:"timeOption",value:"custom",checked:l==="custom",onChange:()=>c("custom"),className:"form-radio"}),u.jsx("span",{className:"ml-2",children:"Custom"})]})]}),l==="preset"&&u.jsxs("select",{value:d,onChange:O=>f(O.target.value),className:"mt-2 block w-full rounded-md border-gray-300 shadow-sm sm:text-sm",children:[u.jsx("option",{value:"",children:"-- Select preset --"}),u.jsx("option",{value:"1h",children:"Last hour"}),u.jsx("option",{value:"24h",children:"Last 24 hours"}),u.jsx("option",{value:"7d",children:"Last 7 days"}),u.jsx("option",{value:"30d",children:"Last 30 days"}),u.jsx("option",{value:"start",children:"Since start Inspectr"}),u.jsx("option",{value:"first",children:"Since first operation"})]}),l==="custom"&&u.jsxs("div",{className:"mt-2 space-y-2",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm",children:"Since"}),u.jsx("input",{type:"datetime-local",value:m,onChange:O=>p(O.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm sm:text-sm"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm",children:"Until (optional)"}),u.jsx("input",{type:"datetime-local",value:h,onChange:O=>b(O.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm sm:text-sm"})]})]})]}),u.jsxs("div",{className:"mb-4",children:[u.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Format"}),u.jsxs("select",{value:o,onChange:O=>a(O.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:ring-blue-500 focus:border-blue-500 sm:text-sm",children:[u.jsx("option",{value:"json",children:"JSON"}),v&&u.jsx("option",{value:"openapi",children:"OpenAPI (preview)"}),x&&u.jsx("option",{value:"postman",children:"Postman (preview)"})]})]}),k&&u.jsx("p",{className:"mb-4 text-sm text-red-600",role:"alert",children:k}),u.jsxs("div",{className:"flex justify-end space-x-3",children:[u.jsx("button",{onClick:t,className:"px-4 py-2 bg-gray-200 text-gray-700 rounded hover:bg-gray-300",children:"Cancel"}),u.jsx("button",{onClick:j,disabled:i,className:`px-4 py-2 text-white rounded ${i?"bg-gray-400":"bg-blue-600 hover:bg-blue-700"}`,children:i?"Exporting…":"Export"})]})]})]}):null}function Vve({open:e,onClose:t,onContinue:r,onCancelRecording:n,startTime:o}){const{client:a,setToast:i}=mr(),[s,l]=g.useState("json"),[c,d]=g.useState(!1),[f]=Bn("feat_export_openapi"),[m]=Bn("feat_export_postman"),[p,h]=g.useState(""),b=ca(async()=>o?await Br.db.events.where("time").above(o).count():0,[o]);g.useEffect(()=>{e||h("")},[e]);const v=async()=>{d(!0),h("");try{const x=await a.operations.export({since:o,format:s}),k=new Date,S=M=>M.toString().padStart(2,"0"),j=`${k.getFullYear()}-${S(k.getMonth()+1)}-${S(k.getDate())}-${S(k.getHours())}${S(k.getMinutes())}`,O=URL.createObjectURL(x),C=document.createElement("a");C.href=O;const N=s==="phar"?"phar":"json",T=s==="json"?"":`_${s}`;C.download=`inspectr_operations_${j}${T}.${N}`,C.click(),URL.revokeObjectURL(O),t&&t()}catch(x){console.error("Export failed",x);const k=x?.message||"Export failed";h(k),i({message:"Export failed",subMessage:k,type:"error"})}finally{d(!1)}};return e?u.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[u.jsx("div",{className:"absolute inset-0 bg-black opacity-50",onClick:t}),u.jsxs("div",{className:"relative bg-white rounded-lg shadow-xl max-w-lg w-full mx-4 p-6 z-10",children:[u.jsxs("div",{className:"flex items-center justify-between mb-4",children:[u.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Export Recording"}),u.jsx("button",{onClick:t,className:"text-gray-600 hover:text-gray-800","aria-label":"Close",children:"×"})]}),u.jsxs("p",{className:"text-sm mb-4",children:[b," operations recorded since ",new Date(o).toLocaleString()]}),u.jsxs("div",{className:"mb-4",children:[u.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Format"}),u.jsxs("select",{value:s,onChange:x=>l(x.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:ring-blue-500 focus:border-blue-500 sm:text-sm",children:[u.jsx("option",{value:"json",children:"JSON"}),f&&u.jsx("option",{value:"openapi",children:"OpenAPI (preview)"}),m&&u.jsx("option",{value:"postman",children:"Postman (preview)"})]})]}),p&&u.jsx("p",{className:"-mt-2 mb-4 text-sm text-red-600",role:"alert",children:p}),u.jsxs("div",{className:"flex justify-end space-x-3",children:[u.jsx("button",{onClick:r,className:"px-4 py-2 bg-gray-200 text-gray-700 rounded hover:bg-gray-300",children:"Continue Recording"}),u.jsx("button",{onClick:n,className:"px-4 py-2 bg-orange-200 text-gray-700 rounded hover:bg-orange-300",children:"Cancel Recording"}),u.jsx("button",{onClick:v,disabled:c,className:`px-4 py-2 text-white rounded ${c?"bg-gray-400":"bg-blue-600 hover:bg-blue-700"}`,children:c?"Exporting…":"Export"})]})]})]}):null}function Gve({open:e,onClose:t}){const{client:r,setToast:n}=mr(),[o,a]=g.useState(null),[i,s]=g.useState(!1),l=async()=>{if(o){s(!0);try{await r.operations.import(o),n({message:"Import completed",type:"success"}),t&&t()}catch(c){console.error("Import failed",c),n({message:"Import failed",subMessage:c.message,type:"error"})}finally{s(!1)}}};return e?u.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[u.jsx("div",{className:"absolute inset-0 bg-black opacity-50",onClick:t}),u.jsxs("div",{className:"relative bg-white rounded-lg shadow-xl max-w-md w-full mx-4 p-6 z-10",children:[u.jsxs("div",{className:"flex items-center justify-between mb-4",children:[u.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Import Operations"}),u.jsx("button",{onClick:t,className:"text-gray-600 hover:text-gray-800","aria-label":"Close",children:"×"})]}),u.jsx("div",{className:"mb-4",children:u.jsx("input",{type:"file",accept:".json",onChange:c=>a(c.target.files[0]),className:"mt-1 block w-full text-sm"})}),u.jsxs("div",{className:"flex justify-end space-x-3",children:[u.jsx("button",{onClick:t,className:"px-4 py-2 bg-gray-200 text-gray-700 rounded hover:bg-gray-300",children:"Cancel"}),u.jsx("button",{onClick:l,disabled:!o||i,className:`px-4 py-2 text-white rounded ${!o||i?"bg-gray-400":"bg-blue-600 hover:bg-blue-700"}`,children:i?"Importing…":"Import"})]})]})]}):null}function hI(...e){return e.filter(Boolean).join(" ")}const Yve=[{name:"Request History",slug:"inspectr",component:A6},{name:"Insights",slug:"insights",component:Wve},{name:"Statistics",slug:"statistics",component:sbe},{name:"Usage",slug:"usage",component:Kge},{name:"Rules",slug:"rules",component:uve},{name:"Settings",slug:"settings",component:Pve}],Xve=e=>u.jsx("svg",{fill:"currentColor",height:"24",width:"24",viewBox:"0 0 1648 1648",xmlns:"http://www.w3.org/2000/svg",...e,children:u.jsx("path",{d:"m610 216.654c-66.158 4.092-126.119 35.849-164.917 87.346-8.408 11.16-13.344 19.191-19.983 32.513-12.431 24.946-19.521 50.434-22.11 79.487-1.665 18.687-.854 826.238.841 837.939 7.867 54.284 32.465 101.134 70.706 134.667 16.297 14.291 32.283 24.657 53.963 34.991 16.889 8.05 34.568 13.468 60.5 18.541 9.019 1.764 52.201 1.795 61.5.044 26.487-4.989 43.97-10.341 61-18.675 15.131-7.406 21.53-11.135 60.5-35.267 20.813-12.887 23.095-14.298 29.5-18.24l13-8 13-8c6.901-4.247 12.593-7.767 29.54-18.271 5.796-3.593 12.771-7.863 15.5-9.49 2.728-1.626 8.56-5.19 12.96-7.921 4.4-2.73 72.575-44.711 151.5-93.29s150.925-92.918 160-98.531c9.075-5.612 24.15-14.936 33.5-20.719s23.075-14.234 30.5-18.78c85.169-52.142 120.029-73.942 130.014-81.304 40.974-30.211 68.344-69.764 81.788-118.194 13.864-49.94 8.549-104.847-14.809-153-16.836-34.708-41.252-62.432-74.993-85.154-4.125-2.778-17.625-11.26-30-18.849s-27-16.594-32.5-20.009c-5.5-3.416-109.45-67.427-231-142.246-306.386-188.593-335.221-206.352-350-215.553-30.562-19.028-59.301-29.911-90-34.083-11.697-1.59-30.408-2.514-39.5-1.952m-10.5 77.269c-39.541 6.402-76.013 29.73-97.661 62.467-13.001 19.66-19.718 38.39-22.802 63.584-1.472 12.028-1.434 802.191.04 818.026 1.861 19.998 6.142 35.48 14.415 52.133 17.942 36.114 53.025 64.18 91.508 73.203 3.575.839 8.975 2.118 12 2.844 8.221 1.973 40.343 1.613 49.971-.56 32.301-7.289 65.233-26.686 94.817-55.849 15.26-15.042 22.884-24.803 33.571-42.979 13.939-23.706 20.949-43.36 27.745-77.792 1.004-5.086 1.428-50 1.949-206.5.465-139.686 1.001-201.809 1.777-206 .611-3.3 1.608-9.15 2.217-13 1.672-10.583 4.039-21.117 7.191-32 8.179-28.247 20.714-55.13 37.188-79.751 24.262-36.262 53.189-63.572 93.074-87.872 4.95-3.016 12.825-7.435 17.5-9.82s8.95-4.668 9.5-5.074c3.565-2.63 34.688-13.266 52.465-17.93 6.2-1.627 11.49-3.174 11.754-3.439 1.003-1.002-1.016-2.602-10.967-8.689-5.639-3.449-16.552-10.172-24.252-14.94-13.435-8.319-31.76-19.604-58.5-36.029-6.875-4.222-16.1-9.911-20.5-12.641-7.667-4.758-73.088-45.103-122.5-75.546-75.227-46.348-108.509-66.591-116.5-70.86-9.422-5.033-25.23-10.76-37.043-13.419-7.967-1.794-40.076-2.843-47.957-1.567m473.5 305.564c-5.775.685-11.625 1.491-13 1.792-1.375.3-5.2 1.088-8.5 1.749-7.914 1.587-27.103 7.461-36.5 11.174-38.797 15.33-75.171 44.925-98.829 80.41-11.24 16.86-21.329 38.407-26.167 55.888-2.443 8.825-3.85 14.608-4.866 20-.621 3.3-1.653 8.475-2.292 11.5-.846 4.008-1.345 59.624-1.837 205-.618 182.331-.824 200.361-2.399 209.5-1.629 9.459-4.196 22.506-6.744 34.279-.628 2.903-.881 5.54-.561 5.859.596.596 455.986-279.084 472.195-290.001 17.547-11.819 36.335-33.412 46.291-53.203 3.956-7.863 9.527-23.924 11.597-33.434 4.848-22.272 3.572-48.26-3.506-71.387-6.907-22.572-18.055-40.93-35.316-58.158-12.705-12.681-16.829-15.485-79.066-53.756-7.15-4.397-15.7-9.654-19-11.684-3.3-2.029-8.925-5.504-12.5-7.722-53.826-33.397-67.199-40.611-88.616-47.8-29.343-9.85-61.599-13.421-90.384-10.006m-1066.25 1048.256c3.988.189 10.513.189 14.5 0 3.988-.19.725-.346-7.25-.346s-11.238.156-7.25.346",fillRule:"evenodd"})});function fye(){const[e]=Bn("feat_rules_ui",!1),[t]=Bn("feat_insights_display",!1),r=g.useMemo(()=>{let S=Yve;return e!==!0&&(S=S.filter(j=>j.slug!=="rules")),t!==!0&&(S=S.filter(j=>j.slug!=="insights")),S},[e,t]),[n,o]=g.useState(()=>r[0]),{currentNav:a,handleTabClick:i}=dH(r),s=a.component,[l,c]=g.useState(!1),[d,f]=g.useState(!1),[m,p]=Cr("recordStart",null),[h,b]=g.useState(()=>!!m);g.useEffect(()=>{b(!!m)},[m]),g.useEffect(()=>{a&&o(a)},[a]);const[v,x]=g.useState(!1),k=ca(async()=>!h||!m?0:await Br.db.events.where("time").above(m).count(),[h,m]);return u.jsxs(P$,{children:[u.jsx(Uve,{}),u.jsxs("div",{className:"flex flex-col min-h-screen",children:[u.jsx("div",{className:"border-b border-tremor-border dark:border-dark-tremor-border relative h-full overflow-hidden bg-gray-50 dark:bg-dark-tremor-background-subtle",children:u.jsx("div",{className:"px-4 sm:px-6 lg:px-8",children:u.jsxs("div",{className:"overflow flex h-16 sm:space-x-7 items-center",children:[u.jsx("div",{className:"hidden shrink-0 sm:flex sm:items-center",children:u.jsx("a",{href:"/",className:"p-1.5",children:u.jsx(Xve,{className:"size-4 shrink-0 w-8 h-8 text-tremor-content-strong dark:text-dark-tremor-content-strong","aria-hidden":!0})})}),u.jsx("nav",{className:"flex-1 -mb-px flex space-x-6","aria-label":"Tabs",children:r.map(S=>S.slug==="inspectr"?u.jsx(Jve,{navItem:S,isActive:S.slug===a.slug,onClick:()=>i(S),isCurrent:S.name===n.name},S.slug):u.jsx("button",{onClick:()=>i(S),className:hI(S.slug===a.slug?"dark:text-tremor-dark-brand border-tremor-brand text-tremor-brand":"border-transparent text-tremor-content-emphasis hover:border-tremor-content-subtle hover:text-tremor-content-strong dark:text-dark-tremor-content-emphasis hover:dark:border-dark-tremor-content-subtle hover:dark:text-dark-tremor-content-strong","inline-flex items-center whitespace-nowrap border-b-2 px-2 text-tremor-default font-medium"),"aria-current":S.name===n.name?"page":void 0,children:S.name},S.slug))}),u.jsxs("div",{className:"ml-auto flex items-center space-x-2",children:[u.jsx("button",{className:"px-2 py-1 text-cyan-500 hover:text-white border border-cyan-500 hover:bg-cyan-500 rounded text-xs",onClick:()=>c(!0),children:"Export"}),u.jsx("button",{className:"px-2 py-1 text-cyan-500 hover:text-white border border-cyan-500 hover:bg-cyan-500 rounded text-xs",onClick:()=>f(!0),children:"Import"}),u.jsxs("div",{className:"relative",children:[u.jsxs("button",{disabled:v,className:`px-2 py-1 rounded text-xs flex items-center border border-green-500 ${h?"text-white bg-green-500":"text-green-500 hover:text-white hover:bg-green-500"} `,onClick:()=>{h?k>0?x(!0):(b(!1),p(null)):(p(new Date().toISOString()),b(!0))},children:[u.jsx("span",{className:`mr-1 block w-2 h-2 ${h?"bg-red-600 animate-pulse":"bg-red-600 rounded-full"}`}),h?"Stop Recording":"Start Recording"]}),h&&k>0&&u.jsx("span",{className:"absolute -top-3 -right-2",children:u.jsx(dI,{count:k})})]})]})]})})}),u.jsx("div",{className:"flex-grow overflow-auto",children:["insights","statistics","settings","usage","rules"].includes(a.slug)?u.jsx("div",{className:"p-4 sm:p-6 lg:p-8 bg-gray-50 dark:bg-gray-950",children:u.jsx(s,{},a.slug)}):u.jsx(A6,{},"inspectr")}),u.jsx(Zve,{}),u.jsx(Kve,{open:l,onClose:()=>c(!1)}),u.jsx(Gve,{open:d,onClose:()=>f(!1)}),u.jsx(Vve,{open:v,onContinue:()=>{x(!1)},onCancelRecording:()=>{x(!1),b(!1),p(null)},onClose:()=>x(!1),startTime:m})]})]})}const Zve=()=>{const{toast:e,setToast:t}=mr();return e?u.jsx(Df,{message:e.message,subMessage:e.subMessage,type:e.type,onClose:()=>t(null)}):null},Jve=({navItem:e,isActive:t,onClick:r,isCurrent:n})=>{const{connectionStatus:o}=mr(),[a,i]=Cr("inspectrLastSeenAt",null),s=ca(async()=>{try{const f=await Br.db.events.orderBy("time").last();return f?.time||null}catch{return null}},[]);g.useEffect(()=>{!a&&s&&i(s)},[s]),g.useEffect(()=>{t&&s&&i(s)},[t,s]);const l=ca(async()=>{if(!a)return 0;try{return await Br.db.events.where("time").above(a).count()}catch{return 0}},[a]),c=o==="connected"?"green":o==="disconnected"?"red":"orange",d=()=>{const f=s||new Date().toISOString();i(f),r&&r()};return u.jsxs("button",{onClick:d,className:hI(t?"dark:text-tremor-dark-brand border-tremor-brand text-tremor-brand":"border-transparent text-tremor-content-emphasis hover:border-tremor-content-subtle hover:text-tremor-content-strong dark:text-dark-tremor-content-emphasis hover:dark:border-dark-tremor-content-subtle hover:dark:text-dark-tremor-content-strong","inline-flex items-center whitespace-nowrap border-b-2 px-2 text-tremor-default font-medium relative"),"aria-current":n?"page":void 0,children:[e.name,!t&&l>0&&u.jsx("span",{className:"absolute -top-3 -right-2",children:u.jsx(dI,{count:l,color:c})})]},e.slug)};export{fye as Workspace};