@kong-ui-public/analytics-utilities 7.0.0 → 7.1.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.
@@ -1,2 +1,2 @@
1
- (function(c,C){typeof exports=="object"&&typeof module<"u"?C(exports):typeof define=="function"&&define.amd?define(["exports"],C):(c=typeof globalThis<"u"?globalThis:c||self,C(c["kong-ui-public-vitals-utilities"]={}))})(this,function(c){"use strict";var As=Object.defineProperty;var Fs=(c,C,h)=>C in c?As(c,C,{enumerable:!0,configurable:!0,writable:!0,value:h}):c[C]=h;var b=(c,C,h)=>Fs(c,typeof C!="symbol"?C+"":C,h);var h=(e=>(e.FIFTEEN_MIN="15m",e.ONE_HOUR="1h",e.SIX_HOUR="6h",e.TWELVE_HOUR="12h",e.ONE_DAY="24h",e.SEVEN_DAY="7d",e.THIRTY_DAY="30d",e.CURRENT_WEEK="current_week",e.CURRENT_MONTH="current_month",e.CURRENT_QUARTER="current_quarter",e.PREVIOUS_WEEK="previous_week",e.PREVIOUS_MONTH="previous_month",e.PREVIOUS_QUARTER="previous_quarter",e))(h||{});const Qr=["horizontal_bar","vertical_bar","timeseries_line","choropleth_map","timeseries_bar","doughnut"],Ne=["in","not_in","selector"],Zr=["=","!="],Br=["=","!=","<",">","<=",">="],ct=["empty","not_empty"],Kr=["starts_with","ends_with"],Jr=["absolute","relative"],lt=["15m","1h","6h","12h","24h","7d","current_week","previous_week","30d","current_month","previous_month"],Pe=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],re=e=>e.filter(t=>t!=="time"),fe=["api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],Re=re(fe),ke=["active_services","request_count","request_per_minute","response_latency_average"],Ce=[...fe,"application","consumer","country_code","iso_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version"],xe=re(Ce),dt=[...ke,"response_latency_p99","response_latency_p95","response_latency_p50","upstream_latency_p99","upstream_latency_p95","upstream_latency_p50","upstream_latency_average","kong_latency_p99","kong_latency_p95","kong_latency_p50","kong_latency_average","response_size_p99","response_size_p95","response_size_p50","response_size_average","response_size_sum","request_size_p99","request_size_p95","request_size_p50","request_size_average","request_size_sum"],Ie=["control_plane","control_plane_group","gateway_service","consumer","application","route","ai_provider","ai_response_model","ai_request_model","llm_cache_status","llm_embeddings_provider","llm_embeddings_model","time"],Ye=re(Ie),ft=["total_tokens","prompt_tokens","completion_tokens","ai_request_count","cost","llm_cache_embeddings_latency_average","llm_cache_fetch_latency_average","llm_latency_average","llm_embeddings_tokens","llm_embeddings_cost"],mt=["api_product","api_product_version","application","auth_type","client_ip","consumer","consumer_group","control_plane","control_plane_group","country_code","data_plane_node","data_plane_node_version","gateway_service","header_host","header_user_agent","http_method","iso_code","request_id","request_uri","response_header_content_type","response_source","route","service_port","service_protocol","sse","status_code_grouped","time","trace_id","upstream_uri","upstream_status_code_grouped","websocket"],en=re(mt),ht=["auth_type","client_ip","country_code","data_plane_node_version","header_host","header_user_agent","http_method","request_id","request_uri","response_header_content_type","response_source","service_port","service_protocol","trace_id","upstream_uri"],tn=ht,yt=["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","request_body_size","response_body_size","response_header_content_length","status_code","upstream_status_code"],rn=re(yt),nn=["15M","1H","6H","12H","24H","7D"],an=["basic","advanced","ai"],He={basic:new Set(Re),advanced:new Set(xe),ai:new Set(Ye)},sn=(e,t)=>t.filter(r=>"dimension"in r?He[e].has(r.dimension):He[e].has(r.field)),on=["horizontal_bar","vertical_bar","gauge","doughnut","timeseries_line","timeseries_bar","golden_signals","top_n","slottable"],ne={type:"string"},$={type:"string"},gt={type:"boolean"},pt={type:["object","array"],items:{type:"string"},additionalProperties:{type:"string"}},wt={type:"object",properties:{type:{type:"string",enum:["slottable"]},id:{type:"string"}},required:["type","id"],additionalProperties:!1},_t={type:"object",properties:{type:{type:"string",enum:["horizontal_bar","vertical_bar"]},stacked:{type:"boolean"},chartDatasetColors:pt,syntheticsDataKey:ne,chartTitle:$,allowCsvExport:gt},required:["type"],additionalProperties:!1},bt={type:"object",properties:{type:{type:"string",enum:["timeseries_line","timeseries_bar"]},stacked:{type:"boolean"},threshold:{type:"object",additionalProperties:{type:"number"}},chartDatasetColors:pt,syntheticsDataKey:ne,chartTitle:$,allowCsvExport:gt},required:["type"],additionalProperties:!1},Tt={type:"object",properties:{type:{type:"string",enum:["gauge"]},metricDisplay:{type:"string",enum:["hidden","single","full"]},reverseDataset:{type:"boolean"},numerator:{type:"number"},syntheticsDataKey:ne,chartTitle:$},required:["type"],additionalProperties:!1},Dt={type:"object",properties:{type:{type:"string",enum:["doughnut"]},syntheticsDataKey:ne,chartTitle:$},required:["type"],additionalProperties:!1},Mt={type:"object",properties:{chartTitle:$,syntheticsDataKey:ne,type:{type:"string",enum:["top_n"]},description:{type:"string"},entityLink:{type:"string"}},required:["type"],additionalProperties:!1},Ot={type:"object",properties:{chartTitle:$,type:{type:"string",enum:["golden_signals"]},longCardTitles:{type:"boolean"},description:{type:"string"},percentileLatency:{type:"boolean"}},required:["type"],additionalProperties:!1},qe={granularity:{type:"string",description:'Force time grouping into buckets of this duration. Only has an effect if "time" is in the "dimensions" list.',enum:Pe},time_range:{type:"object",description:"The time range to query.",anyOf:[{type:"object",properties:{tz:{type:"string",default:"Etc/UTC"},type:{type:"string",enum:["relative"]},time_range:{type:"string",enum:lt,default:"1h"}},required:["type","time_range"],additionalProperties:!1},{type:"object",description:"A duration representing an exact start and end time.",properties:{tz:{type:"string"},type:{type:"string",enum:["absolute"]},start:{type:"string"},end:{type:"string"}},required:["type","start","end"],additionalProperties:!1}],default:{type:"relative",time_range:"1h"}},limit:{type:"number"},meta:{type:"object"}},Ae=e=>({type:"array",description:"List of aggregated metrics to collect across the requested time span.",items:{type:"string",enum:e}}),Fe=e=>({type:"array",description:"List of attributes or entity types to group by.",minItems:0,maxItems:2,items:{type:"string",enum:e}}),Ge=e=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"A filter that specifies which data to include in the query",properties:{dimension:{type:"string",enum:e},type:{type:"string",enum:Ne},values:{type:"array",items:{type:["string","number","null"]}}},required:["dimension","type","values"],additionalProperties:!1},{type:"object",description:"In filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:Ne},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:ct}},required:["field","operator"],additionalProperties:!1}]}}),St={type:"object",description:"A query to launch at the advanced explore API",properties:{datasource:{type:"string",enum:["advanced"]},metrics:Ae(dt),dimensions:Fe(Ce),filters:Ge(xe),...qe},required:["datasource"],additionalProperties:!1},vt={type:"object",description:"A query to launch at the basic explore API",properties:{datasource:{type:"string",enum:["basic"]},metrics:Ae(ke),dimensions:Fe(fe),filters:Ge(Re),...qe},required:["datasource"],additionalProperties:!1},Et={type:"object",description:"A query to launch at the AI explore API",properties:{datasource:{type:"string",enum:["ai"]},metrics:Ae(ft),dimensions:Fe(Ie),filters:Ge(Ye),...qe},required:["datasource"],additionalProperties:!1},Nt={anyOf:[St,vt,Et]},Pt={type:"object",properties:{query:Nt,chart:{anyOf:[_t,Tt,Dt,bt,Ot,Mt,wt]}},required:["query","chart"],additionalProperties:!1},Rt={type:"object",properties:{position:{type:"object",properties:{col:{type:"number"},row:{type:"number"}},description:"Position of the tile in the grid.",required:["col","row"],additionalProperties:!1},size:{type:"object",properties:{cols:{type:"number"},rows:{type:"number"},fitToContent:{type:"boolean"}},description:"Number of columns and rows the tile occupies. If fitToContent is true for every tile in a row, and each tile only occupies 1 row, then the row will auto-fit to its content.",required:["cols","rows"],additionalProperties:!1}},required:["position","size"],additionalProperties:!1},kt={type:"object",properties:{definition:Pt,layout:Rt,id:{type:"string",description:"Unique identifier for the tile. If not provided, one will be generated."}},required:["definition","layout"],additionalProperties:!1},un={type:"object",properties:{tiles:{type:"array",items:kt},tileHeight:{type:"number",description:"Height of each tile in pixels."},gridSize:{type:"object",properties:{cols:{type:"number"},rows:{type:"number"}},description:"Number of columns and rows in the grid.",required:["cols","rows"],additionalProperties:!1}},required:["tiles","gridSize"],additionalProperties:!1},Ct=6048e5,cn=864e5,ln=60,dn=3600,xt=Symbol.for("constructDateFrom");function x(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&xt in e?e[xt](t):e instanceof Date?new e.constructor(t):new Date(t)}function T(e,t){return x(t||e,e)}function It(e,t,r){const n=T(e,r==null?void 0:r.in);return isNaN(t)?x(e,NaN):(n.setDate(n.getDate()+t),n)}function fn(e,t,r){const n=T(e,r==null?void 0:r.in);if(isNaN(t))return x(e,NaN);const i=n.getDate(),o=x(e,n.getTime());o.setMonth(n.getMonth()+t+1,0);const l=o.getDate();return i>=l?o:(n.setFullYear(o.getFullYear(),o.getMonth(),i),n)}let mn={};function ae(){return mn}function I(e,t){var f,m,g,y;const r=ae(),n=(t==null?void 0:t.weekStartsOn)??((m=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:m.weekStartsOn)??r.weekStartsOn??((y=(g=r.locale)==null?void 0:g.options)==null?void 0:y.weekStartsOn)??0,i=T(e,t==null?void 0:t.in),o=i.getDay(),l=(o<n?7:0)+o-n;return i.setDate(i.getDate()-l),i.setHours(0,0,0,0),i}function me(e,t){return I(e,{...t,weekStartsOn:1})}function Yt(e,t){const r=T(e,t==null?void 0:t.in),n=r.getFullYear(),i=x(r,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const o=me(i),l=x(r,0);l.setFullYear(n,0,4),l.setHours(0,0,0,0);const f=me(l);return r.getTime()>=o.getTime()?n+1:r.getTime()>=f.getTime()?n:n-1}function Ht(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 hn(e,...t){const r=x.bind(null,t.find(n=>typeof n=="object"));return t.map(r)}function he(e,t){const r=T(e,t==null?void 0:t.in);return r.setHours(0,0,0,0),r}function yn(e,t,r){const[n,i]=hn(r==null?void 0:r.in,e,t),o=he(n),l=he(i),f=+o-Ht(o),m=+l-Ht(l);return Math.round((f-m)/cn)}function gn(e,t){const r=Yt(e,t),n=x(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),me(n)}function pn(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function wn(e){return!(!pn(e)&&typeof e!="number"||isNaN(+T(e)))}function X(e,t){const r=T(e,t==null?void 0:t.in);return r.setDate(1),r.setHours(0,0,0,0),r}function _n(e,t){const r=T(e,t==null?void 0:t.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}const bn={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"}},Tn=(e,t,r)=>{let n;const i=bn[e];return typeof i=="string"?n=i:t===1?n=i.one:n=i.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function We(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const Dn={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Mn={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},On={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Sn={date:We({formats:Dn,defaultWidth:"full"}),time:We({formats:Mn,defaultWidth:"full"}),dateTime:We({formats:On,defaultWidth:"full"})},vn={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},En=(e,t,r,n)=>vn[e];function ie(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let i;if(n==="formatting"&&e.formattingValues){const l=e.defaultFormattingWidth||e.defaultWidth,f=r!=null&&r.width?String(r.width):l;i=e.formattingValues[f]||e.formattingValues[l]}else{const l=e.defaultWidth,f=r!=null&&r.width?String(r.width):e.defaultWidth;i=e.values[f]||e.values[l]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const Nn={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Pn={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Rn={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"]},kn={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"]},Cn={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"}},xn={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"}},In={ordinalNumber:(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"},era:ie({values:Nn,defaultWidth:"wide"}),quarter:ie({values:Pn,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ie({values:Rn,defaultWidth:"wide"}),day:ie({values:kn,defaultWidth:"wide"}),dayPeriod:ie({values:Cn,defaultWidth:"wide",formattingValues:xn,defaultFormattingWidth:"wide"})};function se(e){return(t,r={})=>{const n=r.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const l=o[0],f=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],m=Array.isArray(f)?Hn(f,p=>p.test(l)):Yn(f,p=>p.test(l));let g;g=e.valueCallback?e.valueCallback(m):m,g=r.valueCallback?r.valueCallback(g):g;const y=t.slice(l.length);return{value:g,rest:y}}}function Yn(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function Hn(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function qn(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const i=n[0],o=t.match(e.parsePattern);if(!o)return null;let l=e.valueCallback?e.valueCallback(o[0]):o[0];l=r.valueCallback?r.valueCallback(l):l;const f=t.slice(i.length);return{value:l,rest:f}}}const An=/^(\d+)(th|st|nd|rd)?/i,Fn=/\d+/i,Gn={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},Wn={any:[/^b/i,/^(a|c)/i]},jn={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ln={any:[/1/i,/2/i,/3/i,/4/i]},Un={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},zn={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]},Vn={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},$n={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]},Xn={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},Qn={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}},Zn={ordinalNumber:qn({matchPattern:An,parsePattern:Fn,valueCallback:e=>parseInt(e,10)}),era:se({matchPatterns:Gn,defaultMatchWidth:"wide",parsePatterns:Wn,defaultParseWidth:"any"}),quarter:se({matchPatterns:jn,defaultMatchWidth:"wide",parsePatterns:Ln,defaultParseWidth:"any",valueCallback:e=>e+1}),month:se({matchPatterns:Un,defaultMatchWidth:"wide",parsePatterns:zn,defaultParseWidth:"any"}),day:se({matchPatterns:Vn,defaultMatchWidth:"wide",parsePatterns:$n,defaultParseWidth:"any"}),dayPeriod:se({matchPatterns:Xn,defaultMatchWidth:"any",parsePatterns:Qn,defaultParseWidth:"any"})},Bn={code:"en-US",formatDistance:Tn,formatLong:Sn,formatRelative:En,localize:In,match:Zn,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Kn(e,t){const r=T(e,t==null?void 0:t.in);return yn(r,_n(r))+1}function Jn(e,t){const r=T(e,t==null?void 0:t.in),n=+me(r)-+gn(r);return Math.round(n/Ct)+1}function qt(e,t){var y,p,v,E;const r=T(e,t==null?void 0:t.in),n=r.getFullYear(),i=ae(),o=(t==null?void 0:t.firstWeekContainsDate)??((p=(y=t==null?void 0:t.locale)==null?void 0:y.options)==null?void 0:p.firstWeekContainsDate)??i.firstWeekContainsDate??((E=(v=i.locale)==null?void 0:v.options)==null?void 0:E.firstWeekContainsDate)??1,l=x((t==null?void 0:t.in)||e,0);l.setFullYear(n+1,0,o),l.setHours(0,0,0,0);const f=I(l,t),m=x((t==null?void 0:t.in)||e,0);m.setFullYear(n,0,o),m.setHours(0,0,0,0);const g=I(m,t);return+r>=+f?n+1:+r>=+g?n:n-1}function ea(e,t){var f,m,g,y;const r=ae(),n=(t==null?void 0:t.firstWeekContainsDate)??((m=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??r.firstWeekContainsDate??((y=(g=r.locale)==null?void 0:g.options)==null?void 0:y.firstWeekContainsDate)??1,i=qt(e,t),o=x((t==null?void 0:t.in)||e,0);return o.setFullYear(i,0,n),o.setHours(0,0,0,0),I(o,t)}function ta(e,t){const r=T(e,t==null?void 0:t.in),n=+I(r,t)-+ea(r,t);return Math.round(n/Ct)+1}function w(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const F={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return w(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):w(r+1,2)},d(e,t){return w(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 w(e.getHours()%12||12,t.length)},H(e,t){return w(e.getHours(),t.length)},m(e,t){return w(e.getMinutes(),t.length)},s(e,t){return w(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),i=Math.trunc(n*Math.pow(10,r-3));return w(i,t.length)}},Q={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},At={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(),i=n>0?n:1-n;return r.ordinalNumber(i,{unit:"year"})}return F.y(e,t)},Y:function(e,t,r,n){const i=qt(e,n),o=i>0?i:1-i;if(t==="YY"){const l=o%100;return w(l,2)}return t==="Yo"?r.ordinalNumber(o,{unit:"year"}):w(o,t.length)},R:function(e,t){const r=Yt(e);return w(r,t.length)},u:function(e,t){const r=e.getFullYear();return w(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 w(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 w(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 F.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 w(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 i=ta(e,n);return t==="wo"?r.ordinalNumber(i,{unit:"week"}):w(i,t.length)},I:function(e,t,r){const n=Jn(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):w(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):F.d(e,t)},D:function(e,t,r){const n=Kn(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):w(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 i=e.getDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return w(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const i=e.getDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return w(o,t.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),i=n===0?7:n;switch(t){case"i":return String(i);case"ii":return w(i,t.length);case"io":return r.ordinalNumber(i,{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 i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let i;switch(n===12?i=Q.noon:n===0?i=Q.midnight:i=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let i;switch(n>=17?i=Q.evening:n>=12?i=Q.afternoon:n>=4?i=Q.morning:i=Q.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{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 F.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):F.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):w(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):w(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):F.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):F.s(e,t)},S:function(e,t){return F.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return Gt(n);case"XXXX":case"XX":return W(n);case"XXXXX":case"XXX":default:return W(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return Gt(n);case"xxxx":case"xx":return W(n);case"xxxxx":case"xxx":default:return W(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ft(n,":");case"OOOO":default:return"GMT"+W(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ft(n,":");case"zzzz":default:return"GMT"+W(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return w(n,t.length)},T:function(e,t,r){return w(+e,t.length)}};function Ft(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Math.trunc(n/60),o=n%60;return o===0?r+String(i):r+String(i)+t+w(o,2)}function Gt(e,t){return e%60===0?(e>0?"-":"+")+w(Math.abs(e)/60,2):W(e,t)}function W(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=w(Math.trunc(n/60),2),o=w(n%60,2);return r+i+t+o}const Wt=(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"})}},jt=(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"})}},ra={p:jt,P:(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],i=r[2];if(!i)return Wt(e,t);let o;switch(n){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",Wt(n,t)).replace("{{time}}",jt(i,t))}},na=/^D+$/,aa=/^Y+$/,ia=["D","DD","YY","YYYY"];function sa(e){return na.test(e)}function oa(e){return aa.test(e)}function ua(e,t,r){const n=ca(e,t,r);if(console.warn(n),ia.includes(e))throw new RangeError(n)}function ca(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 la=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,da=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,fa=/^'([^]*?)'?$/,ma=/''/g,ha=/[a-zA-Z]/;function Lt(e,t,r){var y,p,v,E,k,Y,ce,j;const n=ae(),i=(r==null?void 0:r.locale)??n.locale??Bn,o=(r==null?void 0:r.firstWeekContainsDate)??((p=(y=r==null?void 0:r.locale)==null?void 0:y.options)==null?void 0:p.firstWeekContainsDate)??n.firstWeekContainsDate??((E=(v=n.locale)==null?void 0:v.options)==null?void 0:E.firstWeekContainsDate)??1,l=(r==null?void 0:r.weekStartsOn)??((Y=(k=r==null?void 0:r.locale)==null?void 0:k.options)==null?void 0:Y.weekStartsOn)??n.weekStartsOn??((j=(ce=n.locale)==null?void 0:ce.options)==null?void 0:j.weekStartsOn)??0,f=T(e,r==null?void 0:r.in);if(!wn(f))throw new RangeError("Invalid time value");let m=t.match(da).map(O=>{const D=O[0];if(D==="p"||D==="P"){const L=ra[D];return L(O,i.formatLong)}return O}).join("").match(la).map(O=>{if(O==="''")return{isToken:!1,value:"'"};const D=O[0];if(D==="'")return{isToken:!1,value:ya(O)};if(At[D])return{isToken:!0,value:O};if(D.match(ha))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return{isToken:!1,value:O}});i.localize.preprocessor&&(m=i.localize.preprocessor(f,m));const g={firstWeekContainsDate:o,weekStartsOn:l,locale:i};return m.map(O=>{if(!O.isToken)return O.value;const D=O.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&oa(D)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&sa(D))&&ua(D,t,String(e));const L=At[D[0]];return L(f,D,i.localize,g)}).join("")}function ya(e){const t=e.match(fa);return t?t[1].replace(ma,"'"):e}function ga(e,t){const r=T(e,t==null?void 0:t.in),n=r.getFullYear(),i=r.getMonth(),o=x(r,0);return o.setFullYear(n,i+1,0),o.setHours(0,0,0,0),o.getDate()}function pa(){return Object.assign({},ae())}function Ut(e){return+T(e)}function zt(e){return Math.trunc(+T(e)/1e3)}function wa(e){return Math.trunc(e*dn)}function _a(e){const t=e/ln;return Math.trunc(t)}function Vt(e,t,r){return fn(e,-t,r)}function $t(e,t,r){const n=pa(),i=Da(e,r.timeZone,r.locale??n.locale);return"formatToParts"in i?ba(i,t):Ta(i,t)}function ba(e,t){const r=e.formatToParts(t);for(let n=r.length-1;n>=0;--n)if(r[n].type==="timeZoneName")return r[n].value}function Ta(e,t){const r=e.format(t).replace(/\u200E/g,""),n=/ [\w-+ ]+$/.exec(r);return n?n[0].substr(1):""}function Da(e,t,r){return new Intl.DateTimeFormat(r?[r.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function Ma(e,t){const r=Na(t);return"formatToParts"in r?Sa(r,e):va(r,e)}const Oa={year:0,month:1,day:2,hour:3,minute:4,second:5};function Sa(e,t){try{const r=e.formatToParts(t),n=[];for(let i=0;i<r.length;i++){const o=Oa[r[i].type];o!==void 0&&(n[o]=parseInt(r[i].value,10))}return n}catch(r){if(r instanceof RangeError)return[NaN];throw r}}function va(e,t){const r=e.format(t),n=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(r);return[parseInt(n[3],10),parseInt(n[1],10),parseInt(n[2],10),parseInt(n[4],10),parseInt(n[5],10),parseInt(n[6],10)]}const je={},Xt=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),Ea=Xt==="06/25/2014, 00:00:00"||Xt==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function Na(e){return je[e]||(je[e]=Ea?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),je[e]}function Le(e,t,r,n,i,o,l){const f=new Date(0);return f.setUTCFullYear(e,t,r),f.setUTCHours(n,i,o,l),f}const Qt=36e5,Pa=6e4,Ue={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function oe(e,t,r){if(!e)return 0;let n=Ue.timezoneZ.exec(e);if(n)return 0;let i,o;if(n=Ue.timezoneHH.exec(e),n)return i=parseInt(n[1],10),Zt(i)?-(i*Qt):NaN;if(n=Ue.timezoneHHMM.exec(e),n){i=parseInt(n[2],10);const l=parseInt(n[3],10);return Zt(i,l)?(o=Math.abs(i)*Qt+l*Pa,n[1]==="+"?-o:o):NaN}if(Ca(e)){t=new Date(t||Date.now());const l=r?t:Ra(t),f=ze(l,e);return-(r?f:ka(t,f,e))}return NaN}function Ra(e){return Le(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function ze(e,t){const r=Ma(e,t),n=Le(r[0],r[1]-1,r[2],r[3]%24,r[4],r[5],0).getTime();let i=e.getTime();const o=i%1e3;return i-=o>=0?o:1e3+o,n-i}function ka(e,t,r){let i=e.getTime()-t;const o=ze(new Date(i),r);if(t===o)return t;i-=o-t;const l=ze(new Date(i),r);return o===l?o:Math.max(o,l)}function Zt(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const Bt={};function Ca(e){if(Bt[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Bt[e]=!0,!0}catch{return!1}}const xa=60*1e3,Ia={X:function(e,t,r){const n=Ve(r.timeZone,e);if(n===0)return"Z";switch(t){case"X":return Kt(n);case"XXXX":case"XX":return Z(n);case"XXXXX":case"XXX":default:return Z(n,":")}},x:function(e,t,r){const n=Ve(r.timeZone,e);switch(t){case"x":return Kt(n);case"xxxx":case"xx":return Z(n);case"xxxxx":case"xxx":default:return Z(n,":")}},O:function(e,t,r){const n=Ve(r.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+Ya(n,":");case"OOOO":default:return"GMT"+Z(n,":")}},z:function(e,t,r){switch(t){case"z":case"zz":case"zzz":return $t("short",e,r);case"zzzz":default:return $t("long",e,r)}}};function Ve(e,t){const r=e?oe(e,t,!0)/xa:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(r))throw new RangeError("Invalid time zone specified: "+e);return r}function ye(e,t){const r=e<0?"-":"";let n=Math.abs(e).toString();for(;n.length<t;)n="0"+n;return r+n}function Z(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=ye(Math.floor(n/60),2),o=ye(Math.floor(n%60),2);return r+i+t+o}function Kt(e,t){return e%60===0?(e>0?"-":"+")+ye(Math.abs(e)/60,2):Z(e,t)}function Ya(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),o=n%60;return o===0?r+String(i):r+String(i)+t+ye(o,2)}function Jt(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const er=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,$e=36e5,tr=6e4,Ha=2,S={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:er};function ge(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const r=t.additionalDigits==null?Ha:Number(t.additionalDigits);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const n=qa(e),{year:i,restDateString:o}=Aa(n.date,r),l=Fa(o,i);if(l===null||isNaN(l.getTime()))return new Date(NaN);if(l){const f=l.getTime();let m=0,g;if(n.time&&(m=Ga(n.time),m===null||isNaN(m)))return new Date(NaN);if(n.timeZone||t.timeZone){if(g=oe(n.timeZone||t.timeZone,new Date(f+m)),isNaN(g))return new Date(NaN)}else g=Jt(new Date(f+m)),g=Jt(new Date(f+m+g));return new Date(f+m+g)}else return new Date(NaN)}function qa(e){const t={};let r=S.dateTimePattern.exec(e),n;if(r?(t.date=r[1],n=r[3]):(r=S.datePattern.exec(e),r?(t.date=r[1],n=r[2]):(t.date=null,n=e)),n){const i=S.timeZone.exec(n);i?(t.time=n.replace(i[1],""),t.timeZone=i[1].trim()):t.time=n}return t}function Aa(e,t){if(e){const r=S.YYY[t],n=S.YYYYY[t];let i=S.YYYY.exec(e)||n.exec(e);if(i){const o=i[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(i=S.YY.exec(e)||r.exec(e),i){const o=i[1];return{year:parseInt(o,10)*100,restDateString:e.slice(o.length)}}}return{year:null}}function Fa(e,t){if(t===null)return null;let r,n,i;if(!e||!e.length)return r=new Date(0),r.setUTCFullYear(t),r;let o=S.MM.exec(e);if(o)return r=new Date(0),n=parseInt(o[1],10)-1,ar(t,n)?(r.setUTCFullYear(t,n),r):new Date(NaN);if(o=S.DDD.exec(e),o){r=new Date(0);const l=parseInt(o[1],10);return La(t,l)?(r.setUTCFullYear(t,0,l),r):new Date(NaN)}if(o=S.MMDD.exec(e),o){r=new Date(0),n=parseInt(o[1],10)-1;const l=parseInt(o[2],10);return ar(t,n,l)?(r.setUTCFullYear(t,n,l),r):new Date(NaN)}if(o=S.Www.exec(e),o)return i=parseInt(o[1],10)-1,ir(i)?rr(t,i):new Date(NaN);if(o=S.WwwD.exec(e),o){i=parseInt(o[1],10)-1;const l=parseInt(o[2],10)-1;return ir(i,l)?rr(t,i,l):new Date(NaN)}return null}function Ga(e){let t,r,n=S.HH.exec(e);if(n)return t=parseFloat(n[1].replace(",",".")),Xe(t)?t%24*$e:NaN;if(n=S.HHMM.exec(e),n)return t=parseInt(n[1],10),r=parseFloat(n[2].replace(",",".")),Xe(t,r)?t%24*$e+r*tr:NaN;if(n=S.HHMMSS.exec(e),n){t=parseInt(n[1],10),r=parseInt(n[2],10);const i=parseFloat(n[3].replace(",","."));return Xe(t,r,i)?t%24*$e+r*tr+i*1e3:NaN}return null}function rr(e,t,r){t=t||0,r=r||0;const n=new Date(0);n.setUTCFullYear(e,0,4);const i=n.getUTCDay()||7,o=t*7+r+1-i;return n.setUTCDate(n.getUTCDate()+o),n}const Wa=[31,28,31,30,31,30,31,31,30,31,30,31],ja=[31,29,31,30,31,30,31,31,30,31,30,31];function nr(e){return e%400===0||e%4===0&&e%100!==0}function ar(e,t,r){if(t<0||t>11)return!1;if(r!=null){if(r<1)return!1;const n=nr(e);if(n&&r>ja[t]||!n&&r>Wa[t])return!1}return!0}function La(e,t){if(t<1)return!1;const r=nr(e);return!(r&&t>366||!r&&t>365)}function ir(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Xe(e,t,r){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||r!=null&&(r<0||r>=60))}const Ua=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function za(e,t,r={}){t=String(t);const n=t.match(Ua);if(n){const i=ge(r.originalDate||e,r);t=n.reduce(function(o,l){if(l[0]==="'")return o;const f=o.indexOf(l),m=o[f-1]==="'",g=o.replace(l,"'"+Ia[l[0]](i,l,r)+"'");return m?g.substring(0,f-1)+g.substring(f+1):g},t)}return Lt(e,t,r)}function sr(e,t,r){e=ge(e,r);const n=oe(t,e,!0),i=new Date(e.getTime()-n),o=new Date(0);return o.setFullYear(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),o.setHours(i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()),o}function Va(e,t,r,n){return n={...n,timeZone:t,originalDate:e},za(sr(e,t,{timeZone:n.timeZone}),r,n)}function $a(e,t,r){if(typeof e=="string"&&!e.match(er))return ge(e,{...r,timeZone:t});e=ge(e,r);const n=Le(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),i=oe(t,new Date(n));return new Date(n+i)}function or(e,t){return-oe(e,t)}function Xa(e){return Lt(e,"yyyy-MM-dd'T'HH:mm:ss.SSSXXX")}function Qe(e,t={}){if(!e)return e;const r=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let n="MMM dd, yyy hh:mm a";t.short&&(n="MMM dd, yyy"),t.includeTZ&&(n+=" (z)");const i=new Date(e);return Va(i,r,n)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}function Qa(e,t){return`${Qe(e.getTime())} - ${Qe(t.getTime(),{includeTZ:!0})}`}const ue={secondly:1e3,tenSecondly:10*1e3,thirtySecondly:30*1e3,minutely:60*1e3,fiveMinutely:5*60*1e3,tenMinutely:10*60*1e3,thirtyMinutely:30*60*1e3,hourly:60*60*1e3,twoHourly:2*60*60*1e3,twelveHourly:12*60*60*1e3,daily:60*60*24*1e3,weekly:60*60*24*7*1e3,trend:0};function Za(e,t){return e.map(r=>({value:r,label:t.t(`configuration.vitals.reports.granularity.${r}`)}))}function ur(e,t){return{duration:e,type:"duration",origin:t}}function Ba(e){return e&&Pe.find(r=>e<=ue[r])||null}function cr(e,t,r,n){const i=ue[r];let o=0;return i>=ue.daily&&(n?o=-or(n,t):o=t.getTimezoneOffset()*60*1e3),new Date(e((t.getTime()-o)/i)*i+o)}function lr(e,t,r){return cr(Math.floor,e,t,r)}function Ze(e,t,r){return cr(Math.ceil,e,t,r)}class pe{constructor(t,r,n){b(this,"timeframe");b(this,"tz");b(this,"dataGranularity");if(this.constructor===pe)throw new Error("BaseQueryTime is not meant to be used directly.");this.timeframe=t,this.tz=r,this.dataGranularity=n??t.dataGranularity}calculateStartDate(t,r,n=1){if(t)return new Date(this.endDate().getTime()-this.timeframe.timeframeLengthMs()*n);{const i=this.endDate(),o=this.timeframe.rawStart(this.tz),l=lr(o,r,this.tz),m=(i.getTime()-l.getTime())*(n-1);return new Date(l.getTime()-m)}}granularitySeconds(){return Math.floor(this.granularityMs()/1e3)}granularityDruid(){return ur(this.granularityMs(),this.startDate().toISOString())}startSeconds(){return zt(this.startDate())}endSeconds(){return zt(this.endDate())}startMs(){return Ut(this.startDate())}endMs(){return Ut(this.endDate())}}class Ka extends pe{constructor(r,n,i,o,l){super(r,i,o);b(this,"granularity");n&&r.allowedGranularities(l).has(n)?this.granularity=n:l?this.granularity=r.fineGrainedDefaultGranularity??r.defaultResponseGranularity:this.granularity=r.defaultResponseGranularity}startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.granularity)}endDate(){return Ze(this.timeframe.rawEnd(),this.granularity,this.tz)}granularityMs(){return ue[this.granularity]}}class dr extends pe{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity)}endDate(){return Ze(this.timeframe.rawEnd(this.tz),this.dataGranularity,this.tz)}granularityMs(){return this.endDate().getTime()-this.startDate().getTime()}}class Ja extends dr{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity,2)}granularityMs(){return this.endDate().getTime()-super.startDate().getTime()}}var we=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ei(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _e={exports:{}};_e.exports,function(e,t){var r=200,n="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",l="[object Array]",f="[object Boolean]",m="[object Date]",g="[object Error]",y="[object Function]",p="[object GeneratorFunction]",v="[object Map]",E="[object Number]",k="[object Object]",Y="[object Promise]",ce="[object RegExp]",j="[object Set]",O="[object String]",D="[object Symbol]",L="[object WeakMap]",hr="[object ArrayBuffer]",Te="[object DataView]",yr="[object Float32Array]",gr="[object Float64Array]",pr="[object Int8Array]",wr="[object Int16Array]",_r="[object Int32Array]",br="[object Uint8Array]",Tr="[object Uint8ClampedArray]",Dr="[object Uint16Array]",Mr="[object Uint32Array]",hi=/[\\^$.*+?()[\]{}|]/g,yi=/\w*$/,gi=/^\[object .+?Constructor\]$/,pi=/^(?:0|[1-9]\d*)$/,_={};_[o]=_[l]=_[hr]=_[Te]=_[f]=_[m]=_[yr]=_[gr]=_[pr]=_[wr]=_[_r]=_[v]=_[E]=_[k]=_[ce]=_[j]=_[O]=_[D]=_[br]=_[Tr]=_[Dr]=_[Mr]=!0,_[g]=_[y]=_[L]=!1;var wi=typeof we=="object"&&we&&we.Object===Object&&we,_i=typeof self=="object"&&self&&self.Object===Object&&self,H=wi||_i||Function("return this")(),Or=t&&!t.nodeType&&t,Sr=Or&&!0&&e&&!e.nodeType&&e,bi=Sr&&Sr.exports===Or;function Ti(a,s){return a.set(s[0],s[1]),a}function Di(a,s){return a.add(s),a}function Mi(a,s){for(var u=-1,d=a?a.length:0;++u<d&&s(a[u],u,a)!==!1;);return a}function Oi(a,s){for(var u=-1,d=s.length,M=a.length;++u<d;)a[M+u]=s[u];return a}function vr(a,s,u,d){for(var M=-1,N=a?a.length:0;++M<N;)u=s(u,a[M],M,a);return u}function Si(a,s){for(var u=-1,d=Array(a);++u<a;)d[u]=s(u);return d}function vi(a,s){return a==null?void 0:a[s]}function Er(a){var s=!1;if(a!=null&&typeof a.toString!="function")try{s=!!(a+"")}catch{}return s}function Nr(a){var s=-1,u=Array(a.size);return a.forEach(function(d,M){u[++s]=[M,d]}),u}function Ke(a,s){return function(u){return a(s(u))}}function Pr(a){var s=-1,u=Array(a.size);return a.forEach(function(d){u[++s]=d}),u}var Ei=Array.prototype,Ni=Function.prototype,De=Object.prototype,Je=H["__core-js_shared__"],Rr=function(){var a=/[^.]+$/.exec(Je&&Je.keys&&Je.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""}(),kr=Ni.toString,G=De.hasOwnProperty,Me=De.toString,Pi=RegExp("^"+kr.call(G).replace(hi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Cr=bi?H.Buffer:void 0,xr=H.Symbol,Ir=H.Uint8Array,Ri=Ke(Object.getPrototypeOf,Object),ki=Object.create,Ci=De.propertyIsEnumerable,xi=Ei.splice,Yr=Object.getOwnPropertySymbols,Ii=Cr?Cr.isBuffer:void 0,Yi=Ke(Object.keys,Object),et=ee(H,"DataView"),le=ee(H,"Map"),tt=ee(H,"Promise"),rt=ee(H,"Set"),nt=ee(H,"WeakMap"),de=ee(Object,"create"),Hi=V(et),qi=V(le),Ai=V(tt),Fi=V(rt),Gi=V(nt),Hr=xr?xr.prototype:void 0,qr=Hr?Hr.valueOf:void 0;function U(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var d=a[s];this.set(d[0],d[1])}}function Wi(){this.__data__=de?de(null):{}}function ji(a){return this.has(a)&&delete this.__data__[a]}function Li(a){var s=this.__data__;if(de){var u=s[a];return u===n?void 0:u}return G.call(s,a)?s[a]:void 0}function Ui(a){var s=this.__data__;return de?s[a]!==void 0:G.call(s,a)}function zi(a,s){var u=this.__data__;return u[a]=de&&s===void 0?n:s,this}U.prototype.clear=Wi,U.prototype.delete=ji,U.prototype.get=Li,U.prototype.has=Ui,U.prototype.set=zi;function q(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var d=a[s];this.set(d[0],d[1])}}function Vi(){this.__data__=[]}function $i(a){var s=this.__data__,u=Oe(s,a);if(u<0)return!1;var d=s.length-1;return u==d?s.pop():xi.call(s,u,1),!0}function Xi(a){var s=this.__data__,u=Oe(s,a);return u<0?void 0:s[u][1]}function Qi(a){return Oe(this.__data__,a)>-1}function Zi(a,s){var u=this.__data__,d=Oe(u,a);return d<0?u.push([a,s]):u[d][1]=s,this}q.prototype.clear=Vi,q.prototype.delete=$i,q.prototype.get=Xi,q.prototype.has=Qi,q.prototype.set=Zi;function K(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var d=a[s];this.set(d[0],d[1])}}function Bi(){this.__data__={hash:new U,map:new(le||q),string:new U}}function Ki(a){return Se(this,a).delete(a)}function Ji(a){return Se(this,a).get(a)}function es(a){return Se(this,a).has(a)}function ts(a,s){return Se(this,a).set(a,s),this}K.prototype.clear=Bi,K.prototype.delete=Ki,K.prototype.get=Ji,K.prototype.has=es,K.prototype.set=ts;function J(a){this.__data__=new q(a)}function rs(){this.__data__=new q}function ns(a){return this.__data__.delete(a)}function as(a){return this.__data__.get(a)}function is(a){return this.__data__.has(a)}function ss(a,s){var u=this.__data__;if(u instanceof q){var d=u.__data__;if(!le||d.length<r-1)return d.push([a,s]),this;u=this.__data__=new K(d)}return u.set(a,s),this}J.prototype.clear=rs,J.prototype.delete=ns,J.prototype.get=as,J.prototype.has=is,J.prototype.set=ss;function os(a,s){var u=st(a)||ks(a)?Si(a.length,String):[],d=u.length,M=!!d;for(var N in a)G.call(a,N)&&!(M&&(N=="length"||Es(N,d)))&&u.push(N);return u}function Ar(a,s,u){var d=a[s];(!(G.call(a,s)&&jr(d,u))||u===void 0&&!(s in a))&&(a[s]=u)}function Oe(a,s){for(var u=a.length;u--;)if(jr(a[u][0],s))return u;return-1}function us(a,s){return a&&Fr(s,ot(s),a)}function at(a,s,u,d,M,N,A){var P;if(d&&(P=N?d(a,M,N,A):d(a)),P!==void 0)return P;if(!ve(a))return a;var zr=st(a);if(zr){if(P=Os(a),!s)return Ts(a,P)}else{var te=z(a),Vr=te==y||te==p;if(xs(a))return hs(a,s);if(te==k||te==o||Vr&&!N){if(Er(a))return N?a:{};if(P=Ss(Vr?{}:a),!s)return Ds(a,us(P,a))}else{if(!_[te])return N?a:{};P=vs(a,te,at,s)}}A||(A=new J);var $r=A.get(a);if($r)return $r;if(A.set(a,P),!zr)var Xr=u?Ms(a):ot(a);return Mi(Xr||a,function(ut,Ee){Xr&&(Ee=ut,ut=a[Ee]),Ar(P,Ee,at(ut,s,u,d,Ee,a,A))}),P}function cs(a){return ve(a)?ki(a):{}}function ls(a,s,u){var d=s(a);return st(a)?d:Oi(d,u(a))}function ds(a){return Me.call(a)}function fs(a){if(!ve(a)||Ps(a))return!1;var s=Ur(a)||Er(a)?Pi:gi;return s.test(V(a))}function ms(a){if(!Wr(a))return Yi(a);var s=[];for(var u in Object(a))G.call(a,u)&&u!="constructor"&&s.push(u);return s}function hs(a,s){if(s)return a.slice();var u=new a.constructor(a.length);return a.copy(u),u}function it(a){var s=new a.constructor(a.byteLength);return new Ir(s).set(new Ir(a)),s}function ys(a,s){var u=s?it(a.buffer):a.buffer;return new a.constructor(u,a.byteOffset,a.byteLength)}function gs(a,s,u){var d=s?u(Nr(a),!0):Nr(a);return vr(d,Ti,new a.constructor)}function ps(a){var s=new a.constructor(a.source,yi.exec(a));return s.lastIndex=a.lastIndex,s}function ws(a,s,u){var d=s?u(Pr(a),!0):Pr(a);return vr(d,Di,new a.constructor)}function _s(a){return qr?Object(qr.call(a)):{}}function bs(a,s){var u=s?it(a.buffer):a.buffer;return new a.constructor(u,a.byteOffset,a.length)}function Ts(a,s){var u=-1,d=a.length;for(s||(s=Array(d));++u<d;)s[u]=a[u];return s}function Fr(a,s,u,d){u||(u={});for(var M=-1,N=s.length;++M<N;){var A=s[M],P=void 0;Ar(u,A,P===void 0?a[A]:P)}return u}function Ds(a,s){return Fr(a,Gr(a),s)}function Ms(a){return ls(a,ot,Gr)}function Se(a,s){var u=a.__data__;return Ns(s)?u[typeof s=="string"?"string":"hash"]:u.map}function ee(a,s){var u=vi(a,s);return fs(u)?u:void 0}var Gr=Yr?Ke(Yr,Object):Hs,z=ds;(et&&z(new et(new ArrayBuffer(1)))!=Te||le&&z(new le)!=v||tt&&z(tt.resolve())!=Y||rt&&z(new rt)!=j||nt&&z(new nt)!=L)&&(z=function(a){var s=Me.call(a),u=s==k?a.constructor:void 0,d=u?V(u):void 0;if(d)switch(d){case Hi:return Te;case qi:return v;case Ai:return Y;case Fi:return j;case Gi:return L}return s});function Os(a){var s=a.length,u=a.constructor(s);return s&&typeof a[0]=="string"&&G.call(a,"index")&&(u.index=a.index,u.input=a.input),u}function Ss(a){return typeof a.constructor=="function"&&!Wr(a)?cs(Ri(a)):{}}function vs(a,s,u,d){var M=a.constructor;switch(s){case hr:return it(a);case f:case m:return new M(+a);case Te:return ys(a,d);case yr:case gr:case pr:case wr:case _r:case br:case Tr:case Dr:case Mr:return bs(a,d);case v:return gs(a,d,u);case E:case O:return new M(a);case ce:return ps(a);case j:return ws(a,d,u);case D:return _s(a)}}function Es(a,s){return s=s??i,!!s&&(typeof a=="number"||pi.test(a))&&a>-1&&a%1==0&&a<s}function Ns(a){var s=typeof a;return s=="string"||s=="number"||s=="symbol"||s=="boolean"?a!=="__proto__":a===null}function Ps(a){return!!Rr&&Rr in a}function Wr(a){var s=a&&a.constructor,u=typeof s=="function"&&s.prototype||De;return a===u}function V(a){if(a!=null){try{return kr.call(a)}catch{}try{return a+""}catch{}}return""}function Rs(a){return at(a,!0,!0)}function jr(a,s){return a===s||a!==a&&s!==s}function ks(a){return Cs(a)&&G.call(a,"callee")&&(!Ci.call(a,"callee")||Me.call(a)==o)}var st=Array.isArray;function Lr(a){return a!=null&&Is(a.length)&&!Ur(a)}function Cs(a){return Ys(a)&&Lr(a)}var xs=Ii||qs;function Ur(a){var s=ve(a)?Me.call(a):"";return s==y||s==p}function Is(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=i}function ve(a){var s=typeof a;return!!a&&(s=="object"||s=="function")}function Ys(a){return!!a&&typeof a=="object"}function ot(a){return Lr(a)?os(a):ms(a)}function Hs(){return[]}function qs(){return!1}e.exports=Rs}(_e,_e.exports);var ti=_e.exports;const ri=ei(ti),B=(e,t)=>new Date(e.getTime()-or(t,e));class R{constructor(t){b(this,"timeframeText");b(this,"key");b(this,"display");b(this,"timeframeLength");b(this,"allowedTiers");b(this,"defaultResponseGranularity");b(this,"dataGranularity");b(this,"isRelative");b(this,"fineGrainedDefaultGranularity");b(this,"_startCustom");b(this,"_endCustom");b(this,"_allowedGranularitiesOverride");this.display=t.display,this.timeframeText=t.timeframeText,this.key=t.key,this.timeframeLength=t.timeframeLength,this.allowedTiers=t.allowedTiers,this.defaultResponseGranularity=t.defaultResponseGranularity,this.dataGranularity=t.dataGranularity,this.isRelative=t.isRelative,this._startCustom=t.startCustom,this._endCustom=t.endCustom,this._allowedGranularitiesOverride=t.allowedGranularitiesOverride,this.fineGrainedDefaultGranularity=t.fineGrainedDefaultGranularity}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(t){if(this._allowedGranularitiesOverride&&t)return new Set(this._allowedGranularitiesOverride);const r=new Set,n=this.maximumTimeframeLength()/3600;return n<=6&&r.add("minutely"),n>=2&&n<=7*24&&r.add("hourly"),n>=2*24&&r.add("daily"),n>=2*24*14&&r.add("weekly"),r}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const r=$a(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return sr(r,t)}}class ni extends R{rawStart(t){let r=I(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(r=B(r,t)),r}maximumTimeframeLength(){return 60*60*24*7}}class ai extends R{rawStart(t){let r=X(this.tzAdjustedDate(t));return t&&(r=B(r,t)),r}maximumTimeframeLength(){return 60*60*24*31}}class ii extends R{rawEnd(t){let r=I(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(r=B(r,t)),r}rawStart(t){const r=this.tzAdjustedDate(t);let n=I(r.setDate(r.getDate()-7),{weekStartsOn:1});return t&&(n=B(n,t)),n}}class si extends R{rawEnd(t){let r=X(this.tzAdjustedDate(t));return t&&(r=B(r,t)),r}rawStart(t){let r=X(Vt(this.tzAdjustedDate(t),1));return t&&(r=B(r,t)),r}}const fr=new Map([[h.FIFTEEN_MIN,new R({key:h.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"thirtySecondly",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]})],[h.ONE_HOUR,new R({key:h.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"minutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]})],[h.SIX_HOUR,new R({key:h.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"fiveMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]})],[h.TWELVE_HOUR,new R({key:h.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"tenMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]})],[h.ONE_DAY,new R({key:h.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"thirtyMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]})],[h.SEVEN_DAY,new R({key:h.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[h.THIRTY_DAY,new R({key:h.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twelveHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]})],[h.CURRENT_WEEK,new ni({key:h.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const e=I(new Date,{weekStartsOn:1});return(he(It(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[h.CURRENT_MONTH,new ai({key:h.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const e=X(new Date);return(he(It(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})],[h.PREVIOUS_WEEK,new ii({key:h.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[h.PREVIOUS_MONTH,new si({key:h.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=X(new Date),r=X(Vt(new Date,1));return t.getTimezoneOffset()!==r.getTimezoneOffset()&&(e=mr(t,r)),60*60*24*ga(new Date().setMonth(new Date().getMonth()-1))+wa(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})]]);function oi(e){const t=new Date(e.start),r=new Date(e.end),n=(r.getTime()-t.getTime())/1e3;return e.timePeriodsKey&&ri(fr.get(e.timePeriodsKey))||new R({key:"custom",timeframeText:"custom",display:"custom",startCustom:t,endCustom:r,timeframeLength:()=>n,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["free","plus","enterprise"]})}function ui(e){return{...e.key!=="custom"&&{timePeriodsKey:e.key},start:e.rawStart(),end:e.rawEnd()}}function ci(e){return{key:e.key,display:e.display,timeframeText:e.timeframeText,timeframeLength:()=>e.key,start:()=>e.rawStart(),end:()=>e.rawEnd()}}function mr(e,t){return _a(e.getTimezoneOffset()-t.getTimezoneOffset())}const li={"15M":h.FIFTEEN_MIN,"1H":h.ONE_HOUR,"6H":h.SIX_HOUR,"12H":h.TWELVE_HOUR,"24H":h.ONE_DAY,"7D":h.SEVEN_DAY,"15m":h.FIFTEEN_MIN,"1h":h.ONE_HOUR,"6h":h.SIX_HOUR,"12h":h.TWELVE_HOUR,"24h":h.ONE_DAY,"7d":h.SEVEN_DAY,"30d":h.THIRTY_DAY,current_week:h.CURRENT_WEEK,current_month:h.CURRENT_MONTH,previous_week:h.PREVIOUS_WEEK,previous_month:h.PREVIOUS_MONTH};class be{constructor(t){b(this,"_seed");this._seed=t}next(t,r){const n=Math.sin(this._seed++)*1e4,i=n-Math.floor(n);return Math.floor(i*(r-t+1))+t}}const di=(e,t)=>{const r=Be(10,1e4),n=new be(r),i=Date.now()-6*60*60*1e3,o=Date.now(),l=[];let f=0;for(let y=i;y<=o;y+=60*60*1e3)if(t)for(const p in t)t[p].forEach(v=>{f+=n.next(50,500);const E={[p]:v,[e.name]:f},k={version:"1.0",timestamp:new Date(y).toISOString(),event:E};l.push(k)});else{f+=n.next(50,500);const p={version:"1.0",timestamp:new Date(y).toISOString(),event:{[e.name]:f}};l.push(p)}const m={};if(t)for(const y in t)m[y]={},t[y].forEach(p=>{m[y][p]={name:p,deleted:!1}});const g={start_ms:i,end_ms:o,query_id:"12345",metric_names:[e.name],metric_units:{[e.name]:e.unit},granularity_ms:60*60*1e3,display:m};return{data:l,meta:g}},fi=e=>{const t=Be(10,1e4),r=new be(t),n=Date.now()-6*60*60*1e3,i=Date.now(),o=[],l={};e.forEach(m=>{l[m.name]=0});for(let m=n;m<=i;m+=60*60*1e3){const g={};e.forEach(p=>{l[p.name]+=r.next(50,500),g[p.name]=l[p.name]});const y={version:"1.0",timestamp:new Date(m).toISOString(),event:g};o.push(y)}const f={start_ms:n,end_ms:i,query_id:"12345",metric_names:e.map(m=>m.name),metric_units:e.reduce((m,g)=>(m[g.name]=g.unit,m),{}),granularity_ms:60*60*1e3,display:{}};return{data:o,meta:f}},mi=(e,t)=>{const r=Math.floor(Math.random()*9991)+10,n=new be(r),i=Date.now()-6*60*60*1e3,o=Date.now(),l=new Date((i+o)/2).toISOString(),f=[];if(t){const y=Object.keys(t),p=Object.values(t),v=(E,k)=>{if(k===y.length){e.forEach(Y=>{E[Y.name]=n.next(50,500)}),f.push({version:"1.0",timestamp:new Date().toISOString(),event:{...E}});return}p[k].forEach(Y=>{v({...E,[y[k]]:Y},k+1)})};v({},0)}else{const y={};e.forEach(p=>{y[p.name]=n.next(50,500)}),f.push({version:"1.0",timestamp:l,event:y})}const m={};if(t)for(const y in t)m[y]={},t[y].forEach(p=>{m[y][p]={name:p,deleted:!1}});const g={start_ms:i,end_ms:o,query_id:"12345",metric_names:e.map(y=>y.name),metric_units:e.reduce((y,p)=>(y[p.name]=p.unit,y),{}),truncated:!1,limit:50,display:m,granularity_ms:o-i};return{data:f,meta:g}};function Be(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1)+e)}c.DeltaQueryTime=Ja,c.Granularities=ue,c.REFRESH_INTERVAL_MS=3e4,c.SeededRandom=be,c.TIMEFRAME_LOOKUP=li,c.TimePeriods=fr,c.Timeframe=R,c.TimeframeKeys=h,c.TimeseriesQueryTime=Ka,c.UnaryQueryTime=dr,c.aiExploreAggregations=ft,c.aiQuerySchema=Et,c.barChartSchema=_t,c.basicExploreAggregations=ke,c.basicQuerySchema=vt,c.ceilToNearestTimeGrain=Ze,c.dashboardConfigSchema=un,c.dashboardTileTypes=on,c.datasourceToFilterableDimensions=He,c.datePickerSelectionToTimeframe=oi,c.doughnutChartSchema=Dt,c.dstOffsetHours=mr,c.exploreAggregations=dt,c.exploreFilterTypesV2=Ne,c.exploreV4QuerySchema=St,c.filterableAiExploreDimensions=Ye,c.filterableBasicExploreDimensions=Re,c.filterableExploreDimensions=xe,c.filterableRequestDimensions=en,c.filterableRequestMetrics=rn,c.filterableRequestWildcardDimensions=tn,c.floorToNearestTimeGrain=lr,c.formatISOTimeWithTZ=Xa,c.formatTime=Qe,c.formatTimeRange=Qa,c.gaugeChartSchema=Tt,c.generateCrossSectionalData=mi,c.generateMultipleMetricTimeSeriesData=fi,c.generateSingleMetricTimeSeriesData=di,c.granularitiesToOptions=Za,c.granularityMsToQuery=ur,c.granularityValues=Pe,c.metricCardSchema=Ot,c.msToGranularity=Ba,c.queryDatasources=an,c.queryableAiExploreDimensions=Ie,c.queryableBasicExploreDimensions=fe,c.queryableExploreDimensions=Ce,c.queryableRequestDimensions=mt,c.queryableRequestMetrics=yt,c.queryableRequestWildcardDimensions=ht,c.rand=Be,c.relativeTimeRangeValuesRequestV2=nn,c.relativeTimeRangeValuesV4=lt,c.reportChartTypes=Qr,c.requestFilterTypeEmptyV2=ct,c.requestFilterTypeEqualsV2=Zr,c.requestFilterTypeMetricV2=Br,c.requestFilterTypeWildcardV2=Kr,c.slottableSchema=wt,c.stripUnknownFilters=sn,c.tileConfigSchema=kt,c.tileDefinitionSchema=Pt,c.tileLayoutSchema=Rt,c.timeRangeTypeV2=Jr,c.timeframeToDatepickerSelection=ui,c.timeframeToDatepickerTimeperiod=ci,c.timeseriesChartSchema=bt,c.topNTableSchema=Mt,c.validDashboardQuery=Nt,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
1
+ (function(c,k){typeof exports=="object"&&typeof module<"u"?k(exports):typeof define=="function"&&define.amd?define(["exports"],k):(c=typeof globalThis<"u"?globalThis:c||self,k(c["kong-ui-public-vitals-utilities"]={}))})(this,function(c){"use strict";var As=Object.defineProperty;var Fs=(c,k,h)=>k in c?As(c,k,{enumerable:!0,configurable:!0,writable:!0,value:h}):c[k]=h;var b=(c,k,h)=>Fs(c,typeof k!="symbol"?k+"":k,h);var h=(e=>(e.FIFTEEN_MIN="15m",e.ONE_HOUR="1h",e.SIX_HOUR="6h",e.TWELVE_HOUR="12h",e.ONE_DAY="24h",e.SEVEN_DAY="7d",e.THIRTY_DAY="30d",e.CURRENT_WEEK="current_week",e.CURRENT_MONTH="current_month",e.CURRENT_QUARTER="current_quarter",e.PREVIOUS_WEEK="previous_week",e.PREVIOUS_MONTH="previous_month",e.PREVIOUS_QUARTER="previous_quarter",e))(h||{});const Qr=["horizontal_bar","vertical_bar","timeseries_line","choropleth_map","timeseries_bar","doughnut"],Ne=["in","not_in","selector"],Zr=["=","!="],Br=["=","!=","<",">","<=",">="],ct=["empty","not_empty"],Kr=["starts_with","ends_with"],Jr=["absolute","relative"],lt=["15m","1h","6h","12h","24h","7d","current_week","previous_week","30d","current_month","previous_month"],Pe=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],re=e=>e.filter(t=>t!=="time"),fe=["api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],Ie=re(fe),Re=["active_services","request_count","request_per_minute","response_latency_average"],ke=[...fe,"application","consumer","country_code","iso_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version"],Ce=re(ke),dt=[...Re,"response_latency_p99","response_latency_p95","response_latency_p50","upstream_latency_p99","upstream_latency_p95","upstream_latency_p50","upstream_latency_average","kong_latency_p99","kong_latency_p95","kong_latency_p50","kong_latency_average","response_size_p99","response_size_p95","response_size_p50","response_size_average","response_size_sum","request_size_p99","request_size_p95","request_size_p50","request_size_average","request_size_sum"],xe=["control_plane","control_plane_group","gateway_service","consumer","application","route","ai_provider","ai_response_model","ai_request_model","llm_cache_status","llm_embeddings_provider","llm_embeddings_model","time"],Ye=re(xe),ft=["total_tokens","prompt_tokens","completion_tokens","ai_request_count","cost","llm_cache_embeddings_latency_average","llm_cache_fetch_latency_average","llm_latency_average","llm_embeddings_tokens","llm_embeddings_cost"],mt=["api_product","api_product_version","application","auth_type","client_ip","consumer","consumer_group","control_plane","control_plane_group","country_code","data_plane_node","data_plane_node_version","gateway_service","header_host","header_user_agent","http_method","iso_code","request_id","request_uri","response_header_content_type","response_source","route","service_port","service_protocol","sse","status_code_grouped","time","trace_id","upstream_uri","upstream_status_code_grouped","websocket"],en=re(mt),ht=["auth_type","client_ip","country_code","data_plane_node_version","header_host","header_user_agent","http_method","request_id","request_uri","response_header_content_type","response_source","service_port","service_protocol","trace_id","upstream_uri"],tn=ht,yt=["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","request_body_size","response_body_size","response_header_content_length","status_code","upstream_status_code"],rn=re(yt),nn=["15M","1H","6H","12H","24H","7D"],an=["basic","advanced","ai"],He={basic:new Set(Ie),advanced:new Set(Ce),ai:new Set(Ye)},sn=(e,t)=>t.filter(r=>"dimension"in r?He[e].has(r.dimension):He[e].has(r.field)),on=["horizontal_bar","vertical_bar","gauge","doughnut","timeseries_line","timeseries_bar","golden_signals","top_n","slottable"],ne={type:"string"},$={type:"string"},gt={type:"boolean"},pt={type:["object","array"],items:{type:"string"},additionalProperties:{type:"string"}},wt={type:"object",properties:{type:{type:"string",enum:["slottable"]},id:{type:"string"}},required:["type","id"],additionalProperties:!1},_t={type:"object",properties:{type:{type:"string",enum:["horizontal_bar","vertical_bar"]},stacked:{type:"boolean"},chartDatasetColors:pt,syntheticsDataKey:ne,chartTitle:$,allowCsvExport:gt},required:["type"],additionalProperties:!1},bt={type:"object",properties:{type:{type:"string",enum:["timeseries_line","timeseries_bar"]},stacked:{type:"boolean"},threshold:{type:"object",additionalProperties:{type:"number"}},chartDatasetColors:pt,syntheticsDataKey:ne,chartTitle:$,allowCsvExport:gt},required:["type"],additionalProperties:!1},Tt={type:"object",properties:{type:{type:"string",enum:["gauge"]},metricDisplay:{type:"string",enum:["hidden","single","full"]},reverseDataset:{type:"boolean"},numerator:{type:"number"},syntheticsDataKey:ne,chartTitle:$},required:["type"],additionalProperties:!1},Dt={type:"object",properties:{type:{type:"string",enum:["doughnut"]},syntheticsDataKey:ne,chartTitle:$},required:["type"],additionalProperties:!1},Ot={type:"object",properties:{chartTitle:$,syntheticsDataKey:ne,type:{type:"string",enum:["top_n"]},description:{type:"string"},entityLink:{type:"string"}},required:["type"],additionalProperties:!1},Mt={type:"object",properties:{chartTitle:$,type:{type:"string",enum:["golden_signals"]},longCardTitles:{type:"boolean"},description:{type:"string"},percentileLatency:{type:"boolean"}},required:["type"],additionalProperties:!1},qe={granularity:{type:"string",description:'Force time grouping into buckets of this duration. Only has an effect if "time" is in the "dimensions" list.',enum:Pe},time_range:{type:"object",description:"The time range to query.",anyOf:[{type:"object",properties:{tz:{type:"string",default:"Etc/UTC"},type:{type:"string",enum:["relative"]},time_range:{type:"string",enum:lt,default:"1h"}},required:["type","time_range"],additionalProperties:!1},{type:"object",description:"A duration representing an exact start and end time.",properties:{tz:{type:"string"},type:{type:"string",enum:["absolute"]},start:{type:"string"},end:{type:"string"}},required:["type","start","end"],additionalProperties:!1}],default:{type:"relative",time_range:"1h"}},limit:{type:"number"},meta:{type:"object"}},Ae=e=>({type:"array",description:"List of aggregated metrics to collect across the requested time span.",items:{type:"string",enum:e}}),Fe=e=>({type:"array",description:"List of attributes or entity types to group by.",minItems:0,maxItems:2,items:{type:"string",enum:e}}),Ge=e=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"A filter that specifies which data to include in the query",properties:{dimension:{type:"string",enum:e},type:{type:"string",enum:Ne},values:{type:"array",items:{type:["string","number","null"]}}},required:["dimension","type","values"],additionalProperties:!1},{type:"object",description:"In filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:Ne},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:ct}},required:["field","operator"],additionalProperties:!1}]}}),St={type:"object",description:"A query to launch at the advanced explore API",properties:{datasource:{type:"string",enum:["advanced"]},metrics:Ae(dt),dimensions:Fe(ke),filters:Ge(Ce),...qe},required:["datasource"],additionalProperties:!1},vt={type:"object",description:"A query to launch at the basic explore API",properties:{datasource:{type:"string",enum:["basic"]},metrics:Ae(Re),dimensions:Fe(fe),filters:Ge(Ie),...qe},required:["datasource"],additionalProperties:!1},Et={type:"object",description:"A query to launch at the AI explore API",properties:{datasource:{type:"string",enum:["ai"]},metrics:Ae(ft),dimensions:Fe(xe),filters:Ge(Ye),...qe},required:["datasource"],additionalProperties:!1},Nt={anyOf:[St,vt,Et]},Pt={type:"object",properties:{query:Nt,chart:{anyOf:[_t,Tt,Dt,bt,Mt,Ot,wt]}},required:["query","chart"],additionalProperties:!1},It={type:"object",properties:{position:{type:"object",properties:{col:{type:"number"},row:{type:"number"}},description:"Position of the tile in the grid.",required:["col","row"],additionalProperties:!1},size:{type:"object",properties:{cols:{type:"number"},rows:{type:"number"},fitToContent:{type:"boolean"}},description:"Number of columns and rows the tile occupies. If fitToContent is true for every tile in a row, and each tile only occupies 1 row, then the row will auto-fit to its content.",required:["cols","rows"],additionalProperties:!1}},required:["position","size"],additionalProperties:!1},Rt={type:"object",properties:{definition:Pt,layout:It,id:{type:"string",description:"Unique identifier for the tile. If not provided, one will be generated."}},required:["definition","layout"],additionalProperties:!1},un={type:"object",properties:{tiles:{type:"array",items:Rt},tileHeight:{type:"number",description:"Height of each tile in pixels."},gridSize:{type:"object",properties:{cols:{type:"number"},rows:{type:"number"}},description:"Number of columns and rows in the grid.",required:["cols","rows"],additionalProperties:!1}},required:["tiles","gridSize"],additionalProperties:!1},kt=6048e5,cn=864e5,ln=60,dn=3600,Ct=Symbol.for("constructDateFrom");function C(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Ct in e?e[Ct](t):e instanceof Date?new e.constructor(t):new Date(t)}function T(e,t){return C(t||e,e)}function xt(e,t,r){const n=T(e,r==null?void 0:r.in);return isNaN(t)?C(e,NaN):(n.setDate(n.getDate()+t),n)}function fn(e,t,r){const n=T(e,r==null?void 0:r.in);if(isNaN(t))return C(e,NaN);const i=n.getDate(),o=C(e,n.getTime());o.setMonth(n.getMonth()+t+1,0);const l=o.getDate();return i>=l?o:(n.setFullYear(o.getFullYear(),o.getMonth(),i),n)}let mn={};function ae(){return mn}function x(e,t){var f,m,g,y;const r=ae(),n=(t==null?void 0:t.weekStartsOn)??((m=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:m.weekStartsOn)??r.weekStartsOn??((y=(g=r.locale)==null?void 0:g.options)==null?void 0:y.weekStartsOn)??0,i=T(e,t==null?void 0:t.in),o=i.getDay(),l=(o<n?7:0)+o-n;return i.setDate(i.getDate()-l),i.setHours(0,0,0,0),i}function me(e,t){return x(e,{...t,weekStartsOn:1})}function Yt(e,t){const r=T(e,t==null?void 0:t.in),n=r.getFullYear(),i=C(r,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const o=me(i),l=C(r,0);l.setFullYear(n,0,4),l.setHours(0,0,0,0);const f=me(l);return r.getTime()>=o.getTime()?n+1:r.getTime()>=f.getTime()?n:n-1}function Ht(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 hn(e,...t){const r=C.bind(null,t.find(n=>typeof n=="object"));return t.map(r)}function he(e,t){const r=T(e,t==null?void 0:t.in);return r.setHours(0,0,0,0),r}function yn(e,t,r){const[n,i]=hn(r==null?void 0:r.in,e,t),o=he(n),l=he(i),f=+o-Ht(o),m=+l-Ht(l);return Math.round((f-m)/cn)}function gn(e,t){const r=Yt(e,t),n=C(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),me(n)}function pn(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function wn(e){return!(!pn(e)&&typeof e!="number"||isNaN(+T(e)))}function X(e,t){const r=T(e,t==null?void 0:t.in);return r.setDate(1),r.setHours(0,0,0,0),r}function _n(e,t){const r=T(e,t==null?void 0:t.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}const bn={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"}},Tn=(e,t,r)=>{let n;const i=bn[e];return typeof i=="string"?n=i:t===1?n=i.one:n=i.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function We(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const Dn={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},On={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Mn={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Sn={date:We({formats:Dn,defaultWidth:"full"}),time:We({formats:On,defaultWidth:"full"}),dateTime:We({formats:Mn,defaultWidth:"full"})},vn={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},En=(e,t,r,n)=>vn[e];function ie(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let i;if(n==="formatting"&&e.formattingValues){const l=e.defaultFormattingWidth||e.defaultWidth,f=r!=null&&r.width?String(r.width):l;i=e.formattingValues[f]||e.formattingValues[l]}else{const l=e.defaultWidth,f=r!=null&&r.width?String(r.width):e.defaultWidth;i=e.values[f]||e.values[l]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const Nn={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Pn={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},In={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"]},Rn={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"]},kn={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"}},Cn={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"}},xn={ordinalNumber:(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"},era:ie({values:Nn,defaultWidth:"wide"}),quarter:ie({values:Pn,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ie({values:In,defaultWidth:"wide"}),day:ie({values:Rn,defaultWidth:"wide"}),dayPeriod:ie({values:kn,defaultWidth:"wide",formattingValues:Cn,defaultFormattingWidth:"wide"})};function se(e){return(t,r={})=>{const n=r.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const l=o[0],f=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],m=Array.isArray(f)?Hn(f,p=>p.test(l)):Yn(f,p=>p.test(l));let g;g=e.valueCallback?e.valueCallback(m):m,g=r.valueCallback?r.valueCallback(g):g;const y=t.slice(l.length);return{value:g,rest:y}}}function Yn(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function Hn(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function qn(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const i=n[0],o=t.match(e.parsePattern);if(!o)return null;let l=e.valueCallback?e.valueCallback(o[0]):o[0];l=r.valueCallback?r.valueCallback(l):l;const f=t.slice(i.length);return{value:l,rest:f}}}const An=/^(\d+)(th|st|nd|rd)?/i,Fn=/\d+/i,Gn={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},Wn={any:[/^b/i,/^(a|c)/i]},jn={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ln={any:[/1/i,/2/i,/3/i,/4/i]},Un={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},zn={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]},Vn={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},$n={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]},Xn={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},Qn={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}},Zn={ordinalNumber:qn({matchPattern:An,parsePattern:Fn,valueCallback:e=>parseInt(e,10)}),era:se({matchPatterns:Gn,defaultMatchWidth:"wide",parsePatterns:Wn,defaultParseWidth:"any"}),quarter:se({matchPatterns:jn,defaultMatchWidth:"wide",parsePatterns:Ln,defaultParseWidth:"any",valueCallback:e=>e+1}),month:se({matchPatterns:Un,defaultMatchWidth:"wide",parsePatterns:zn,defaultParseWidth:"any"}),day:se({matchPatterns:Vn,defaultMatchWidth:"wide",parsePatterns:$n,defaultParseWidth:"any"}),dayPeriod:se({matchPatterns:Xn,defaultMatchWidth:"any",parsePatterns:Qn,defaultParseWidth:"any"})},Bn={code:"en-US",formatDistance:Tn,formatLong:Sn,formatRelative:En,localize:xn,match:Zn,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Kn(e,t){const r=T(e,t==null?void 0:t.in);return yn(r,_n(r))+1}function Jn(e,t){const r=T(e,t==null?void 0:t.in),n=+me(r)-+gn(r);return Math.round(n/kt)+1}function qt(e,t){var y,p,v,E;const r=T(e,t==null?void 0:t.in),n=r.getFullYear(),i=ae(),o=(t==null?void 0:t.firstWeekContainsDate)??((p=(y=t==null?void 0:t.locale)==null?void 0:y.options)==null?void 0:p.firstWeekContainsDate)??i.firstWeekContainsDate??((E=(v=i.locale)==null?void 0:v.options)==null?void 0:E.firstWeekContainsDate)??1,l=C((t==null?void 0:t.in)||e,0);l.setFullYear(n+1,0,o),l.setHours(0,0,0,0);const f=x(l,t),m=C((t==null?void 0:t.in)||e,0);m.setFullYear(n,0,o),m.setHours(0,0,0,0);const g=x(m,t);return+r>=+f?n+1:+r>=+g?n:n-1}function ea(e,t){var f,m,g,y;const r=ae(),n=(t==null?void 0:t.firstWeekContainsDate)??((m=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??r.firstWeekContainsDate??((y=(g=r.locale)==null?void 0:g.options)==null?void 0:y.firstWeekContainsDate)??1,i=qt(e,t),o=C((t==null?void 0:t.in)||e,0);return o.setFullYear(i,0,n),o.setHours(0,0,0,0),x(o,t)}function ta(e,t){const r=T(e,t==null?void 0:t.in),n=+x(r,t)-+ea(r,t);return Math.round(n/kt)+1}function w(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const F={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return w(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):w(r+1,2)},d(e,t){return w(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 w(e.getHours()%12||12,t.length)},H(e,t){return w(e.getHours(),t.length)},m(e,t){return w(e.getMinutes(),t.length)},s(e,t){return w(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),i=Math.trunc(n*Math.pow(10,r-3));return w(i,t.length)}},Q={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},At={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(),i=n>0?n:1-n;return r.ordinalNumber(i,{unit:"year"})}return F.y(e,t)},Y:function(e,t,r,n){const i=qt(e,n),o=i>0?i:1-i;if(t==="YY"){const l=o%100;return w(l,2)}return t==="Yo"?r.ordinalNumber(o,{unit:"year"}):w(o,t.length)},R:function(e,t){const r=Yt(e);return w(r,t.length)},u:function(e,t){const r=e.getFullYear();return w(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 w(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 w(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 F.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 w(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 i=ta(e,n);return t==="wo"?r.ordinalNumber(i,{unit:"week"}):w(i,t.length)},I:function(e,t,r){const n=Jn(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):w(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):F.d(e,t)},D:function(e,t,r){const n=Kn(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):w(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 i=e.getDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return w(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const i=e.getDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return w(o,t.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),i=n===0?7:n;switch(t){case"i":return String(i);case"ii":return w(i,t.length);case"io":return r.ordinalNumber(i,{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 i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let i;switch(n===12?i=Q.noon:n===0?i=Q.midnight:i=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let i;switch(n>=17?i=Q.evening:n>=12?i=Q.afternoon:n>=4?i=Q.morning:i=Q.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{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 F.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):F.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):w(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):w(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):F.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):F.s(e,t)},S:function(e,t){return F.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return Gt(n);case"XXXX":case"XX":return W(n);case"XXXXX":case"XXX":default:return W(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return Gt(n);case"xxxx":case"xx":return W(n);case"xxxxx":case"xxx":default:return W(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ft(n,":");case"OOOO":default:return"GMT"+W(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ft(n,":");case"zzzz":default:return"GMT"+W(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return w(n,t.length)},T:function(e,t,r){return w(+e,t.length)}};function Ft(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Math.trunc(n/60),o=n%60;return o===0?r+String(i):r+String(i)+t+w(o,2)}function Gt(e,t){return e%60===0?(e>0?"-":"+")+w(Math.abs(e)/60,2):W(e,t)}function W(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=w(Math.trunc(n/60),2),o=w(n%60,2);return r+i+t+o}const Wt=(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"})}},jt=(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"})}},ra={p:jt,P:(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],i=r[2];if(!i)return Wt(e,t);let o;switch(n){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",Wt(n,t)).replace("{{time}}",jt(i,t))}},na=/^D+$/,aa=/^Y+$/,ia=["D","DD","YY","YYYY"];function sa(e){return na.test(e)}function oa(e){return aa.test(e)}function ua(e,t,r){const n=ca(e,t,r);if(console.warn(n),ia.includes(e))throw new RangeError(n)}function ca(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 la=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,da=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,fa=/^'([^]*?)'?$/,ma=/''/g,ha=/[a-zA-Z]/;function Lt(e,t,r){var y,p,v,E,R,Y,ce,j;const n=ae(),i=(r==null?void 0:r.locale)??n.locale??Bn,o=(r==null?void 0:r.firstWeekContainsDate)??((p=(y=r==null?void 0:r.locale)==null?void 0:y.options)==null?void 0:p.firstWeekContainsDate)??n.firstWeekContainsDate??((E=(v=n.locale)==null?void 0:v.options)==null?void 0:E.firstWeekContainsDate)??1,l=(r==null?void 0:r.weekStartsOn)??((Y=(R=r==null?void 0:r.locale)==null?void 0:R.options)==null?void 0:Y.weekStartsOn)??n.weekStartsOn??((j=(ce=n.locale)==null?void 0:ce.options)==null?void 0:j.weekStartsOn)??0,f=T(e,r==null?void 0:r.in);if(!wn(f))throw new RangeError("Invalid time value");let m=t.match(da).map(M=>{const D=M[0];if(D==="p"||D==="P"){const L=ra[D];return L(M,i.formatLong)}return M}).join("").match(la).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const D=M[0];if(D==="'")return{isToken:!1,value:ya(M)};if(At[D])return{isToken:!0,value:M};if(D.match(ha))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return{isToken:!1,value:M}});i.localize.preprocessor&&(m=i.localize.preprocessor(f,m));const g={firstWeekContainsDate:o,weekStartsOn:l,locale:i};return m.map(M=>{if(!M.isToken)return M.value;const D=M.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&oa(D)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&sa(D))&&ua(D,t,String(e));const L=At[D[0]];return L(f,D,i.localize,g)}).join("")}function ya(e){const t=e.match(fa);return t?t[1].replace(ma,"'"):e}function ga(e,t){const r=T(e,t==null?void 0:t.in),n=r.getFullYear(),i=r.getMonth(),o=C(r,0);return o.setFullYear(n,i+1,0),o.setHours(0,0,0,0),o.getDate()}function pa(){return Object.assign({},ae())}function Ut(e){return+T(e)}function zt(e){return Math.trunc(+T(e)/1e3)}function wa(e){return Math.trunc(e*dn)}function _a(e){const t=e/ln;return Math.trunc(t)}function Vt(e,t,r){return fn(e,-t,r)}function $t(e,t,r){const n=pa(),i=Da(e,r.timeZone,r.locale??n.locale);return"formatToParts"in i?ba(i,t):Ta(i,t)}function ba(e,t){const r=e.formatToParts(t);for(let n=r.length-1;n>=0;--n)if(r[n].type==="timeZoneName")return r[n].value}function Ta(e,t){const r=e.format(t).replace(/\u200E/g,""),n=/ [\w-+ ]+$/.exec(r);return n?n[0].substr(1):""}function Da(e,t,r){return new Intl.DateTimeFormat(r?[r.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function Oa(e,t){const r=Na(t);return"formatToParts"in r?Sa(r,e):va(r,e)}const Ma={year:0,month:1,day:2,hour:3,minute:4,second:5};function Sa(e,t){try{const r=e.formatToParts(t),n=[];for(let i=0;i<r.length;i++){const o=Ma[r[i].type];o!==void 0&&(n[o]=parseInt(r[i].value,10))}return n}catch(r){if(r instanceof RangeError)return[NaN];throw r}}function va(e,t){const r=e.format(t),n=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(r);return[parseInt(n[3],10),parseInt(n[1],10),parseInt(n[2],10),parseInt(n[4],10),parseInt(n[5],10),parseInt(n[6],10)]}const je={},Xt=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),Ea=Xt==="06/25/2014, 00:00:00"||Xt==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function Na(e){return je[e]||(je[e]=Ea?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),je[e]}function Le(e,t,r,n,i,o,l){const f=new Date(0);return f.setUTCFullYear(e,t,r),f.setUTCHours(n,i,o,l),f}const Qt=36e5,Pa=6e4,Ue={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function oe(e,t,r){if(!e)return 0;let n=Ue.timezoneZ.exec(e);if(n)return 0;let i,o;if(n=Ue.timezoneHH.exec(e),n)return i=parseInt(n[1],10),Zt(i)?-(i*Qt):NaN;if(n=Ue.timezoneHHMM.exec(e),n){i=parseInt(n[2],10);const l=parseInt(n[3],10);return Zt(i,l)?(o=Math.abs(i)*Qt+l*Pa,n[1]==="+"?-o:o):NaN}if(ka(e)){t=new Date(t||Date.now());const l=r?t:Ia(t),f=ze(l,e);return-(r?f:Ra(t,f,e))}return NaN}function Ia(e){return Le(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function ze(e,t){const r=Oa(e,t),n=Le(r[0],r[1]-1,r[2],r[3]%24,r[4],r[5],0).getTime();let i=e.getTime();const o=i%1e3;return i-=o>=0?o:1e3+o,n-i}function Ra(e,t,r){let i=e.getTime()-t;const o=ze(new Date(i),r);if(t===o)return t;i-=o-t;const l=ze(new Date(i),r);return o===l?o:Math.max(o,l)}function Zt(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const Bt={};function ka(e){if(Bt[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Bt[e]=!0,!0}catch{return!1}}const Ca=60*1e3,xa={X:function(e,t,r){const n=Ve(r.timeZone,e);if(n===0)return"Z";switch(t){case"X":return Kt(n);case"XXXX":case"XX":return Z(n);case"XXXXX":case"XXX":default:return Z(n,":")}},x:function(e,t,r){const n=Ve(r.timeZone,e);switch(t){case"x":return Kt(n);case"xxxx":case"xx":return Z(n);case"xxxxx":case"xxx":default:return Z(n,":")}},O:function(e,t,r){const n=Ve(r.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+Ya(n,":");case"OOOO":default:return"GMT"+Z(n,":")}},z:function(e,t,r){switch(t){case"z":case"zz":case"zzz":return $t("short",e,r);case"zzzz":default:return $t("long",e,r)}}};function Ve(e,t){const r=e?oe(e,t,!0)/Ca:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(r))throw new RangeError("Invalid time zone specified: "+e);return r}function ye(e,t){const r=e<0?"-":"";let n=Math.abs(e).toString();for(;n.length<t;)n="0"+n;return r+n}function Z(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=ye(Math.floor(n/60),2),o=ye(Math.floor(n%60),2);return r+i+t+o}function Kt(e,t){return e%60===0?(e>0?"-":"+")+ye(Math.abs(e)/60,2):Z(e,t)}function Ya(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),o=n%60;return o===0?r+String(i):r+String(i)+t+ye(o,2)}function Jt(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const er=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,$e=36e5,tr=6e4,Ha=2,S={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:er};function ge(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const r=t.additionalDigits==null?Ha:Number(t.additionalDigits);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const n=qa(e),{year:i,restDateString:o}=Aa(n.date,r),l=Fa(o,i);if(l===null||isNaN(l.getTime()))return new Date(NaN);if(l){const f=l.getTime();let m=0,g;if(n.time&&(m=Ga(n.time),m===null||isNaN(m)))return new Date(NaN);if(n.timeZone||t.timeZone){if(g=oe(n.timeZone||t.timeZone,new Date(f+m)),isNaN(g))return new Date(NaN)}else g=Jt(new Date(f+m)),g=Jt(new Date(f+m+g));return new Date(f+m+g)}else return new Date(NaN)}function qa(e){const t={};let r=S.dateTimePattern.exec(e),n;if(r?(t.date=r[1],n=r[3]):(r=S.datePattern.exec(e),r?(t.date=r[1],n=r[2]):(t.date=null,n=e)),n){const i=S.timeZone.exec(n);i?(t.time=n.replace(i[1],""),t.timeZone=i[1].trim()):t.time=n}return t}function Aa(e,t){if(e){const r=S.YYY[t],n=S.YYYYY[t];let i=S.YYYY.exec(e)||n.exec(e);if(i){const o=i[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(i=S.YY.exec(e)||r.exec(e),i){const o=i[1];return{year:parseInt(o,10)*100,restDateString:e.slice(o.length)}}}return{year:null}}function Fa(e,t){if(t===null)return null;let r,n,i;if(!e||!e.length)return r=new Date(0),r.setUTCFullYear(t),r;let o=S.MM.exec(e);if(o)return r=new Date(0),n=parseInt(o[1],10)-1,ar(t,n)?(r.setUTCFullYear(t,n),r):new Date(NaN);if(o=S.DDD.exec(e),o){r=new Date(0);const l=parseInt(o[1],10);return La(t,l)?(r.setUTCFullYear(t,0,l),r):new Date(NaN)}if(o=S.MMDD.exec(e),o){r=new Date(0),n=parseInt(o[1],10)-1;const l=parseInt(o[2],10);return ar(t,n,l)?(r.setUTCFullYear(t,n,l),r):new Date(NaN)}if(o=S.Www.exec(e),o)return i=parseInt(o[1],10)-1,ir(i)?rr(t,i):new Date(NaN);if(o=S.WwwD.exec(e),o){i=parseInt(o[1],10)-1;const l=parseInt(o[2],10)-1;return ir(i,l)?rr(t,i,l):new Date(NaN)}return null}function Ga(e){let t,r,n=S.HH.exec(e);if(n)return t=parseFloat(n[1].replace(",",".")),Xe(t)?t%24*$e:NaN;if(n=S.HHMM.exec(e),n)return t=parseInt(n[1],10),r=parseFloat(n[2].replace(",",".")),Xe(t,r)?t%24*$e+r*tr:NaN;if(n=S.HHMMSS.exec(e),n){t=parseInt(n[1],10),r=parseInt(n[2],10);const i=parseFloat(n[3].replace(",","."));return Xe(t,r,i)?t%24*$e+r*tr+i*1e3:NaN}return null}function rr(e,t,r){t=t||0,r=r||0;const n=new Date(0);n.setUTCFullYear(e,0,4);const i=n.getUTCDay()||7,o=t*7+r+1-i;return n.setUTCDate(n.getUTCDate()+o),n}const Wa=[31,28,31,30,31,30,31,31,30,31,30,31],ja=[31,29,31,30,31,30,31,31,30,31,30,31];function nr(e){return e%400===0||e%4===0&&e%100!==0}function ar(e,t,r){if(t<0||t>11)return!1;if(r!=null){if(r<1)return!1;const n=nr(e);if(n&&r>ja[t]||!n&&r>Wa[t])return!1}return!0}function La(e,t){if(t<1)return!1;const r=nr(e);return!(r&&t>366||!r&&t>365)}function ir(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Xe(e,t,r){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||r!=null&&(r<0||r>=60))}const Ua=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function za(e,t,r={}){t=String(t);const n=t.match(Ua);if(n){const i=ge(r.originalDate||e,r);t=n.reduce(function(o,l){if(l[0]==="'")return o;const f=o.indexOf(l),m=o[f-1]==="'",g=o.replace(l,"'"+xa[l[0]](i,l,r)+"'");return m?g.substring(0,f-1)+g.substring(f+1):g},t)}return Lt(e,t,r)}function sr(e,t,r){e=ge(e,r);const n=oe(t,e,!0),i=new Date(e.getTime()-n),o=new Date(0);return o.setFullYear(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),o.setHours(i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()),o}function Va(e,t,r,n){return n={...n,timeZone:t,originalDate:e},za(sr(e,t,{timeZone:n.timeZone}),r,n)}function $a(e,t,r){if(typeof e=="string"&&!e.match(er))return ge(e,{...r,timeZone:t});e=ge(e,r);const n=Le(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),i=oe(t,new Date(n));return new Date(n+i)}function or(e,t){return-oe(e,t)}function Xa(e){return Lt(e,"yyyy-MM-dd'T'HH:mm:ss.SSSXXX")}function Qe(e,t={}){if(!e)return e;const r=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let n="MMM dd, yyy hh:mm a";t.short&&(n="MMM dd, yyy"),t.includeTZ&&(n+=" (z)");const i=new Date(e);return Va(i,r,n)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}function Qa(e,t){return`${Qe(e.getTime())} - ${Qe(t.getTime(),{includeTZ:!0})}`}const ue={secondly:1e3,tenSecondly:10*1e3,thirtySecondly:30*1e3,minutely:60*1e3,fiveMinutely:5*60*1e3,tenMinutely:10*60*1e3,thirtyMinutely:30*60*1e3,hourly:60*60*1e3,twoHourly:2*60*60*1e3,twelveHourly:12*60*60*1e3,daily:60*60*24*1e3,weekly:60*60*24*7*1e3,trend:0};function Za(e,t){return e.map(r=>({value:r,label:t.t(`configuration.vitals.reports.granularity.${r}`)}))}function ur(e,t){return{duration:e,type:"duration",origin:t}}function Ba(e){return e&&Pe.find(r=>e<=ue[r])||null}function cr(e,t,r,n){const i=ue[r];let o=0;return i>=ue.daily&&(n?o=-or(n,t):o=t.getTimezoneOffset()*60*1e3),new Date(e((t.getTime()-o)/i)*i+o)}function lr(e,t,r){return cr(Math.floor,e,t,r)}function Ze(e,t,r){return cr(Math.ceil,e,t,r)}class pe{constructor(t,r,n){b(this,"timeframe");b(this,"tz");b(this,"dataGranularity");if(this.constructor===pe)throw new Error("BaseQueryTime is not meant to be used directly.");this.timeframe=t,this.tz=r,this.dataGranularity=n??t.dataGranularity}calculateStartDate(t,r,n=1){if(t)return new Date(this.endDate().getTime()-this.timeframe.timeframeLengthMs()*n);{const i=this.endDate(),o=this.timeframe.rawStart(this.tz),l=lr(o,r,this.tz),m=(i.getTime()-l.getTime())*(n-1);return new Date(l.getTime()-m)}}granularitySeconds(){return Math.floor(this.granularityMs()/1e3)}granularityDruid(){return ur(this.granularityMs(),this.startDate().toISOString())}startSeconds(){return zt(this.startDate())}endSeconds(){return zt(this.endDate())}startMs(){return Ut(this.startDate())}endMs(){return Ut(this.endDate())}}class Ka extends pe{constructor(r,n,i,o,l){super(r,i,o);b(this,"granularity");n&&r.allowedGranularities(l).has(n)?this.granularity=n:l?this.granularity=r.fineGrainedDefaultGranularity??r.defaultResponseGranularity:this.granularity=r.defaultResponseGranularity}startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.granularity)}endDate(){return Ze(this.timeframe.rawEnd(),this.granularity,this.tz)}granularityMs(){return ue[this.granularity]}}class dr extends pe{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity)}endDate(){return Ze(this.timeframe.rawEnd(this.tz),this.dataGranularity,this.tz)}granularityMs(){return this.endDate().getTime()-this.startDate().getTime()}}class Ja extends dr{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity,2)}granularityMs(){return this.endDate().getTime()-super.startDate().getTime()}}var we=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ei(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _e={exports:{}};_e.exports,function(e,t){var r=200,n="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",l="[object Array]",f="[object Boolean]",m="[object Date]",g="[object Error]",y="[object Function]",p="[object GeneratorFunction]",v="[object Map]",E="[object Number]",R="[object Object]",Y="[object Promise]",ce="[object RegExp]",j="[object Set]",M="[object String]",D="[object Symbol]",L="[object WeakMap]",hr="[object ArrayBuffer]",Te="[object DataView]",yr="[object Float32Array]",gr="[object Float64Array]",pr="[object Int8Array]",wr="[object Int16Array]",_r="[object Int32Array]",br="[object Uint8Array]",Tr="[object Uint8ClampedArray]",Dr="[object Uint16Array]",Or="[object Uint32Array]",hi=/[\\^$.*+?()[\]{}|]/g,yi=/\w*$/,gi=/^\[object .+?Constructor\]$/,pi=/^(?:0|[1-9]\d*)$/,_={};_[o]=_[l]=_[hr]=_[Te]=_[f]=_[m]=_[yr]=_[gr]=_[pr]=_[wr]=_[_r]=_[v]=_[E]=_[R]=_[ce]=_[j]=_[M]=_[D]=_[br]=_[Tr]=_[Dr]=_[Or]=!0,_[g]=_[y]=_[L]=!1;var wi=typeof we=="object"&&we&&we.Object===Object&&we,_i=typeof self=="object"&&self&&self.Object===Object&&self,H=wi||_i||Function("return this")(),Mr=t&&!t.nodeType&&t,Sr=Mr&&!0&&e&&!e.nodeType&&e,bi=Sr&&Sr.exports===Mr;function Ti(a,s){return a.set(s[0],s[1]),a}function Di(a,s){return a.add(s),a}function Oi(a,s){for(var u=-1,d=a?a.length:0;++u<d&&s(a[u],u,a)!==!1;);return a}function Mi(a,s){for(var u=-1,d=s.length,O=a.length;++u<d;)a[O+u]=s[u];return a}function vr(a,s,u,d){for(var O=-1,N=a?a.length:0;++O<N;)u=s(u,a[O],O,a);return u}function Si(a,s){for(var u=-1,d=Array(a);++u<a;)d[u]=s(u);return d}function vi(a,s){return a==null?void 0:a[s]}function Er(a){var s=!1;if(a!=null&&typeof a.toString!="function")try{s=!!(a+"")}catch{}return s}function Nr(a){var s=-1,u=Array(a.size);return a.forEach(function(d,O){u[++s]=[O,d]}),u}function Ke(a,s){return function(u){return a(s(u))}}function Pr(a){var s=-1,u=Array(a.size);return a.forEach(function(d){u[++s]=d}),u}var Ei=Array.prototype,Ni=Function.prototype,De=Object.prototype,Je=H["__core-js_shared__"],Ir=function(){var a=/[^.]+$/.exec(Je&&Je.keys&&Je.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""}(),Rr=Ni.toString,G=De.hasOwnProperty,Oe=De.toString,Pi=RegExp("^"+Rr.call(G).replace(hi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),kr=bi?H.Buffer:void 0,Cr=H.Symbol,xr=H.Uint8Array,Ii=Ke(Object.getPrototypeOf,Object),Ri=Object.create,ki=De.propertyIsEnumerable,Ci=Ei.splice,Yr=Object.getOwnPropertySymbols,xi=kr?kr.isBuffer:void 0,Yi=Ke(Object.keys,Object),et=ee(H,"DataView"),le=ee(H,"Map"),tt=ee(H,"Promise"),rt=ee(H,"Set"),nt=ee(H,"WeakMap"),de=ee(Object,"create"),Hi=V(et),qi=V(le),Ai=V(tt),Fi=V(rt),Gi=V(nt),Hr=Cr?Cr.prototype:void 0,qr=Hr?Hr.valueOf:void 0;function U(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var d=a[s];this.set(d[0],d[1])}}function Wi(){this.__data__=de?de(null):{}}function ji(a){return this.has(a)&&delete this.__data__[a]}function Li(a){var s=this.__data__;if(de){var u=s[a];return u===n?void 0:u}return G.call(s,a)?s[a]:void 0}function Ui(a){var s=this.__data__;return de?s[a]!==void 0:G.call(s,a)}function zi(a,s){var u=this.__data__;return u[a]=de&&s===void 0?n:s,this}U.prototype.clear=Wi,U.prototype.delete=ji,U.prototype.get=Li,U.prototype.has=Ui,U.prototype.set=zi;function q(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var d=a[s];this.set(d[0],d[1])}}function Vi(){this.__data__=[]}function $i(a){var s=this.__data__,u=Me(s,a);if(u<0)return!1;var d=s.length-1;return u==d?s.pop():Ci.call(s,u,1),!0}function Xi(a){var s=this.__data__,u=Me(s,a);return u<0?void 0:s[u][1]}function Qi(a){return Me(this.__data__,a)>-1}function Zi(a,s){var u=this.__data__,d=Me(u,a);return d<0?u.push([a,s]):u[d][1]=s,this}q.prototype.clear=Vi,q.prototype.delete=$i,q.prototype.get=Xi,q.prototype.has=Qi,q.prototype.set=Zi;function K(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var d=a[s];this.set(d[0],d[1])}}function Bi(){this.__data__={hash:new U,map:new(le||q),string:new U}}function Ki(a){return Se(this,a).delete(a)}function Ji(a){return Se(this,a).get(a)}function es(a){return Se(this,a).has(a)}function ts(a,s){return Se(this,a).set(a,s),this}K.prototype.clear=Bi,K.prototype.delete=Ki,K.prototype.get=Ji,K.prototype.has=es,K.prototype.set=ts;function J(a){this.__data__=new q(a)}function rs(){this.__data__=new q}function ns(a){return this.__data__.delete(a)}function as(a){return this.__data__.get(a)}function is(a){return this.__data__.has(a)}function ss(a,s){var u=this.__data__;if(u instanceof q){var d=u.__data__;if(!le||d.length<r-1)return d.push([a,s]),this;u=this.__data__=new K(d)}return u.set(a,s),this}J.prototype.clear=rs,J.prototype.delete=ns,J.prototype.get=as,J.prototype.has=is,J.prototype.set=ss;function os(a,s){var u=st(a)||Rs(a)?Si(a.length,String):[],d=u.length,O=!!d;for(var N in a)G.call(a,N)&&!(O&&(N=="length"||Es(N,d)))&&u.push(N);return u}function Ar(a,s,u){var d=a[s];(!(G.call(a,s)&&jr(d,u))||u===void 0&&!(s in a))&&(a[s]=u)}function Me(a,s){for(var u=a.length;u--;)if(jr(a[u][0],s))return u;return-1}function us(a,s){return a&&Fr(s,ot(s),a)}function at(a,s,u,d,O,N,A){var P;if(d&&(P=N?d(a,O,N,A):d(a)),P!==void 0)return P;if(!ve(a))return a;var zr=st(a);if(zr){if(P=Ms(a),!s)return Ts(a,P)}else{var te=z(a),Vr=te==y||te==p;if(Cs(a))return hs(a,s);if(te==R||te==o||Vr&&!N){if(Er(a))return N?a:{};if(P=Ss(Vr?{}:a),!s)return Ds(a,us(P,a))}else{if(!_[te])return N?a:{};P=vs(a,te,at,s)}}A||(A=new J);var $r=A.get(a);if($r)return $r;if(A.set(a,P),!zr)var Xr=u?Os(a):ot(a);return Oi(Xr||a,function(ut,Ee){Xr&&(Ee=ut,ut=a[Ee]),Ar(P,Ee,at(ut,s,u,d,Ee,a,A))}),P}function cs(a){return ve(a)?Ri(a):{}}function ls(a,s,u){var d=s(a);return st(a)?d:Mi(d,u(a))}function ds(a){return Oe.call(a)}function fs(a){if(!ve(a)||Ps(a))return!1;var s=Ur(a)||Er(a)?Pi:gi;return s.test(V(a))}function ms(a){if(!Wr(a))return Yi(a);var s=[];for(var u in Object(a))G.call(a,u)&&u!="constructor"&&s.push(u);return s}function hs(a,s){if(s)return a.slice();var u=new a.constructor(a.length);return a.copy(u),u}function it(a){var s=new a.constructor(a.byteLength);return new xr(s).set(new xr(a)),s}function ys(a,s){var u=s?it(a.buffer):a.buffer;return new a.constructor(u,a.byteOffset,a.byteLength)}function gs(a,s,u){var d=s?u(Nr(a),!0):Nr(a);return vr(d,Ti,new a.constructor)}function ps(a){var s=new a.constructor(a.source,yi.exec(a));return s.lastIndex=a.lastIndex,s}function ws(a,s,u){var d=s?u(Pr(a),!0):Pr(a);return vr(d,Di,new a.constructor)}function _s(a){return qr?Object(qr.call(a)):{}}function bs(a,s){var u=s?it(a.buffer):a.buffer;return new a.constructor(u,a.byteOffset,a.length)}function Ts(a,s){var u=-1,d=a.length;for(s||(s=Array(d));++u<d;)s[u]=a[u];return s}function Fr(a,s,u,d){u||(u={});for(var O=-1,N=s.length;++O<N;){var A=s[O],P=void 0;Ar(u,A,P===void 0?a[A]:P)}return u}function Ds(a,s){return Fr(a,Gr(a),s)}function Os(a){return ls(a,ot,Gr)}function Se(a,s){var u=a.__data__;return Ns(s)?u[typeof s=="string"?"string":"hash"]:u.map}function ee(a,s){var u=vi(a,s);return fs(u)?u:void 0}var Gr=Yr?Ke(Yr,Object):Hs,z=ds;(et&&z(new et(new ArrayBuffer(1)))!=Te||le&&z(new le)!=v||tt&&z(tt.resolve())!=Y||rt&&z(new rt)!=j||nt&&z(new nt)!=L)&&(z=function(a){var s=Oe.call(a),u=s==R?a.constructor:void 0,d=u?V(u):void 0;if(d)switch(d){case Hi:return Te;case qi:return v;case Ai:return Y;case Fi:return j;case Gi:return L}return s});function Ms(a){var s=a.length,u=a.constructor(s);return s&&typeof a[0]=="string"&&G.call(a,"index")&&(u.index=a.index,u.input=a.input),u}function Ss(a){return typeof a.constructor=="function"&&!Wr(a)?cs(Ii(a)):{}}function vs(a,s,u,d){var O=a.constructor;switch(s){case hr:return it(a);case f:case m:return new O(+a);case Te:return ys(a,d);case yr:case gr:case pr:case wr:case _r:case br:case Tr:case Dr:case Or:return bs(a,d);case v:return gs(a,d,u);case E:case M:return new O(a);case ce:return ps(a);case j:return ws(a,d,u);case D:return _s(a)}}function Es(a,s){return s=s??i,!!s&&(typeof a=="number"||pi.test(a))&&a>-1&&a%1==0&&a<s}function Ns(a){var s=typeof a;return s=="string"||s=="number"||s=="symbol"||s=="boolean"?a!=="__proto__":a===null}function Ps(a){return!!Ir&&Ir in a}function Wr(a){var s=a&&a.constructor,u=typeof s=="function"&&s.prototype||De;return a===u}function V(a){if(a!=null){try{return Rr.call(a)}catch{}try{return a+""}catch{}}return""}function Is(a){return at(a,!0,!0)}function jr(a,s){return a===s||a!==a&&s!==s}function Rs(a){return ks(a)&&G.call(a,"callee")&&(!ki.call(a,"callee")||Oe.call(a)==o)}var st=Array.isArray;function Lr(a){return a!=null&&xs(a.length)&&!Ur(a)}function ks(a){return Ys(a)&&Lr(a)}var Cs=xi||qs;function Ur(a){var s=ve(a)?Oe.call(a):"";return s==y||s==p}function xs(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=i}function ve(a){var s=typeof a;return!!a&&(s=="object"||s=="function")}function Ys(a){return!!a&&typeof a=="object"}function ot(a){return Lr(a)?os(a):ms(a)}function Hs(){return[]}function qs(){return!1}e.exports=Is}(_e,_e.exports);var ti=_e.exports;const ri=ei(ti),B=(e,t)=>new Date(e.getTime()-or(t,e));class I{constructor(t){b(this,"timeframeText");b(this,"key");b(this,"display");b(this,"timeframeLength");b(this,"allowedTiers");b(this,"defaultResponseGranularity");b(this,"dataGranularity");b(this,"isRelative");b(this,"fineGrainedDefaultGranularity");b(this,"_startCustom");b(this,"_endCustom");b(this,"_allowedGranularitiesOverride");this.display=t.display,this.timeframeText=t.timeframeText,this.key=t.key,this.timeframeLength=t.timeframeLength,this.allowedTiers=t.allowedTiers,this.defaultResponseGranularity=t.defaultResponseGranularity,this.dataGranularity=t.dataGranularity,this.isRelative=t.isRelative,this._startCustom=t.startCustom,this._endCustom=t.endCustom,this._allowedGranularitiesOverride=t.allowedGranularitiesOverride,this.fineGrainedDefaultGranularity=t.fineGrainedDefaultGranularity}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(t){if(this._allowedGranularitiesOverride&&t)return new Set(this._allowedGranularitiesOverride);const r=new Set,n=this.maximumTimeframeLength()/3600;return n<=6&&r.add("minutely"),n>=2&&n<=7*24&&r.add("hourly"),n>=2*24&&r.add("daily"),n>=2*24*14&&r.add("weekly"),r}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const r=$a(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return sr(r,t)}}class ni extends I{rawStart(t){let r=x(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(r=B(r,t)),r}maximumTimeframeLength(){return 60*60*24*7}}class ai extends I{rawStart(t){let r=X(this.tzAdjustedDate(t));return t&&(r=B(r,t)),r}maximumTimeframeLength(){return 60*60*24*31}}class ii extends I{rawEnd(t){let r=x(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(r=B(r,t)),r}rawStart(t){const r=this.tzAdjustedDate(t);let n=x(r.setDate(r.getDate()-7),{weekStartsOn:1});return t&&(n=B(n,t)),n}}class si extends I{rawEnd(t){let r=X(this.tzAdjustedDate(t));return t&&(r=B(r,t)),r}rawStart(t){let r=X(Vt(this.tzAdjustedDate(t),1));return t&&(r=B(r,t)),r}}const fr=new Map([[h.FIFTEEN_MIN,new I({key:h.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"thirtySecondly",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]})],[h.ONE_HOUR,new I({key:h.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"minutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]})],[h.SIX_HOUR,new I({key:h.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"fiveMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]})],[h.TWELVE_HOUR,new I({key:h.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"tenMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]})],[h.ONE_DAY,new I({key:h.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"thirtyMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]})],[h.SEVEN_DAY,new I({key:h.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[h.THIRTY_DAY,new I({key:h.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twelveHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]})],[h.CURRENT_WEEK,new ni({key:h.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const e=x(new Date,{weekStartsOn:1});return(he(xt(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[h.CURRENT_MONTH,new ai({key:h.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const e=X(new Date);return(he(xt(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})],[h.PREVIOUS_WEEK,new ii({key:h.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[h.PREVIOUS_MONTH,new si({key:h.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=X(new Date),r=X(Vt(new Date,1));return t.getTimezoneOffset()!==r.getTimezoneOffset()&&(e=mr(t,r)),60*60*24*ga(new Date().setMonth(new Date().getMonth()-1))+wa(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})]]);function oi(e){const t=new Date(e.start),r=new Date(e.end),n=(r.getTime()-t.getTime())/1e3;return e.timePeriodsKey&&ri(fr.get(e.timePeriodsKey))||new I({key:"custom",timeframeText:"custom",display:"custom",startCustom:t,endCustom:r,timeframeLength:()=>n,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["free","plus","enterprise"]})}function ui(e){return{...e.key!=="custom"&&{timePeriodsKey:e.key},start:e.rawStart(),end:e.rawEnd()}}function ci(e){return{key:e.key,display:e.display,timeframeText:e.timeframeText,timeframeLength:()=>e.key,start:()=>e.rawStart(),end:()=>e.rawEnd()}}function mr(e,t){return _a(e.getTimezoneOffset()-t.getTimezoneOffset())}const li={"15M":h.FIFTEEN_MIN,"1H":h.ONE_HOUR,"6H":h.SIX_HOUR,"12H":h.TWELVE_HOUR,"24H":h.ONE_DAY,"7D":h.SEVEN_DAY,"15m":h.FIFTEEN_MIN,"1h":h.ONE_HOUR,"6h":h.SIX_HOUR,"12h":h.TWELVE_HOUR,"24h":h.ONE_DAY,"7d":h.SEVEN_DAY,"30d":h.THIRTY_DAY,current_week:h.CURRENT_WEEK,current_month:h.CURRENT_MONTH,previous_week:h.PREVIOUS_WEEK,previous_month:h.PREVIOUS_MONTH};class be{constructor(t){b(this,"_seed");this._seed=t}next(t,r){const n=Math.sin(this._seed++)*1e4,i=n-Math.floor(n);return Math.floor(i*(r-t+1))+t}}const di=(e,t)=>{const r=Be(10,1e4),n=new be(r),i=Date.now()-6*60*60*1e3,o=Date.now(),l=[];let f=0;for(let y=i;y<=o;y+=60*60*1e3)if(t)for(const p in t)t[p].forEach(v=>{f+=n.next(50,500);const E={[p]:v,[e.name]:f},R={version:"1.0",timestamp:new Date(y).toISOString(),event:E};l.push(R)});else{f+=n.next(50,500);const p={version:"1.0",timestamp:new Date(y).toISOString(),event:{[e.name]:f}};l.push(p)}const m={};if(t)for(const y in t)m[y]={},t[y].forEach(p=>{m[y][p]={name:p,deleted:!1}});const g={start_ms:i,end_ms:o,start:new Date(i).toISOString(),end:new Date(o).toISOString(),query_id:"12345",metric_names:[e.name],metric_units:{[e.name]:e.unit},granularity_ms:60*60*1e3,display:m};return{data:l,meta:g}},fi=e=>{const t=Be(10,1e4),r=new be(t),n=Date.now()-6*60*60*1e3,i=Date.now(),o=[],l={};e.forEach(m=>{l[m.name]=0});for(let m=n;m<=i;m+=60*60*1e3){const g={};e.forEach(p=>{l[p.name]+=r.next(50,500),g[p.name]=l[p.name]});const y={version:"1.0",timestamp:new Date(m).toISOString(),event:g};o.push(y)}const f={start_ms:n,end_ms:i,start:new Date(n).toISOString(),end:new Date(i).toISOString(),query_id:"12345",metric_names:e.map(m=>m.name),metric_units:e.reduce((m,g)=>(m[g.name]=g.unit,m),{}),granularity_ms:60*60*1e3,display:{}};return{data:o,meta:f}},mi=(e,t)=>{const r=Math.floor(Math.random()*9991)+10,n=new be(r),i=Date.now()-6*60*60*1e3,o=Date.now(),l=new Date((i+o)/2).toISOString(),f=[];if(t){const y=Object.keys(t),p=Object.values(t),v=(E,R)=>{if(R===y.length){e.forEach(Y=>{E[Y.name]=n.next(50,500)}),f.push({version:"1.0",timestamp:new Date().toISOString(),event:{...E}});return}p[R].forEach(Y=>{v({...E,[y[R]]:Y},R+1)})};v({},0)}else{const y={};e.forEach(p=>{y[p.name]=n.next(50,500)}),f.push({version:"1.0",timestamp:l,event:y})}const m={};if(t)for(const y in t)m[y]={},t[y].forEach(p=>{m[y][p]={name:p,deleted:!1}});const g={start_ms:i,end_ms:o,start:new Date(i).toISOString(),end:new Date(o).toISOString(),query_id:"12345",metric_names:e.map(y=>y.name),metric_units:e.reduce((y,p)=>(y[p.name]=p.unit,y),{}),truncated:!1,limit:50,display:m,granularity_ms:o-i};return{data:f,meta:g}};function Be(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1)+e)}c.DeltaQueryTime=Ja,c.Granularities=ue,c.REFRESH_INTERVAL_MS=3e4,c.SeededRandom=be,c.TIMEFRAME_LOOKUP=li,c.TimePeriods=fr,c.Timeframe=I,c.TimeframeKeys=h,c.TimeseriesQueryTime=Ka,c.UnaryQueryTime=dr,c.aiExploreAggregations=ft,c.aiQuerySchema=Et,c.barChartSchema=_t,c.basicExploreAggregations=Re,c.basicQuerySchema=vt,c.ceilToNearestTimeGrain=Ze,c.dashboardConfigSchema=un,c.dashboardTileTypes=on,c.datasourceToFilterableDimensions=He,c.datePickerSelectionToTimeframe=oi,c.doughnutChartSchema=Dt,c.dstOffsetHours=mr,c.exploreAggregations=dt,c.exploreFilterTypesV2=Ne,c.exploreV4QuerySchema=St,c.filterableAiExploreDimensions=Ye,c.filterableBasicExploreDimensions=Ie,c.filterableExploreDimensions=Ce,c.filterableRequestDimensions=en,c.filterableRequestMetrics=rn,c.filterableRequestWildcardDimensions=tn,c.floorToNearestTimeGrain=lr,c.formatISOTimeWithTZ=Xa,c.formatTime=Qe,c.formatTimeRange=Qa,c.gaugeChartSchema=Tt,c.generateCrossSectionalData=mi,c.generateMultipleMetricTimeSeriesData=fi,c.generateSingleMetricTimeSeriesData=di,c.granularitiesToOptions=Za,c.granularityMsToQuery=ur,c.granularityValues=Pe,c.metricCardSchema=Mt,c.msToGranularity=Ba,c.queryDatasources=an,c.queryableAiExploreDimensions=xe,c.queryableBasicExploreDimensions=fe,c.queryableExploreDimensions=ke,c.queryableRequestDimensions=mt,c.queryableRequestMetrics=yt,c.queryableRequestWildcardDimensions=ht,c.rand=Be,c.relativeTimeRangeValuesRequestV2=nn,c.relativeTimeRangeValuesV4=lt,c.reportChartTypes=Qr,c.requestFilterTypeEmptyV2=ct,c.requestFilterTypeEqualsV2=Zr,c.requestFilterTypeMetricV2=Br,c.requestFilterTypeWildcardV2=Kr,c.slottableSchema=wt,c.stripUnknownFilters=sn,c.tileConfigSchema=Rt,c.tileDefinitionSchema=Pt,c.tileLayoutSchema=It,c.timeRangeTypeV2=Jr,c.timeframeToDatepickerSelection=ui,c.timeframeToDatepickerTimeperiod=ci,c.timeseriesChartSchema=bt,c.topNTableSchema=Ot,c.validDashboardQuery=Nt,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
2
2
  //# sourceMappingURL=vitals-utilities.umd.js.map