@kong-ui-public/analytics-utilities 11.1.1-pr.2453.55b43e75c.0 → 11.1.1-pr.2453.d6b67fa4a.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.
@@ -6,8 +6,10 @@ type RequestExportOptions = {
6
6
  buildQuery: (limit: number) => DatasourceAwareQuery;
7
7
  /** Default limit (e.g. EXPORT_RECORD_LIMIT) */
8
8
  defaultLimit?: number;
9
+ /** Injection key (defaults to INJECT_QUERY_PROVIDER) */
10
+ injectKey?: string;
9
11
  };
10
- export declare function useAnalyticsRequestExport({ buildQuery, defaultLimit }: RequestExportOptions): {
12
+ export declare function useAnalyticsRequestExport({ buildQuery, defaultLimit, injectKey }: RequestExportOptions): {
11
13
  exportState: Ref<CsvExportState, CsvExportState>;
12
14
  requestExport: (limit?: number) => Promise<void>;
13
15
  cancelExport: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"requestExport.d.ts","sourceRoot":"","sources":["../../../src/utils/requestExport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC9B,OAAO,KAAK,EAAoC,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AACjH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAK9C,KAAK,oBAAoB,GAAG;IAC1B,0FAA0F;IAC1F,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,oBAAoB,CAAA;IACnD,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,wBAAgB,yBAAyB,CAAC,EAAE,UAAU,EAAE,YAAkC,EAAE,EAAE,oBAAoB;;4BAqB5E,MAAM,KAAkB,OAAO,CAAC,IAAI,CAAC;;;EA0B1E"}
1
+ {"version":3,"file":"requestExport.d.ts","sourceRoot":"","sources":["../../../src/utils/requestExport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC9B,OAAO,KAAK,EAAoC,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AACjH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAK9C,KAAK,oBAAoB,GAAG;IAC1B,0FAA0F;IAC1F,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,oBAAoB,CAAA;IACnD,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,wBAAgB,yBAAyB,CAAC,EAAE,UAAU,EAAE,YAAkC,EAAE,SAAS,EAAE,EAAE,oBAAoB;;4BAqBvF,MAAM,KAAkB,OAAO,CAAC,IAAI,CAAC;;;EA0B1E"}
@@ -1,2 +1,2 @@
1
- "use strict";var va=Object.defineProperty;var Ea=(e,t,r)=>t in e?va(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var T=(e,t,r)=>Ea(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const We=require("vue"),xa=30*1e3,or=250,ur="analytics-query-provider";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 Na=["horizontal_bar","vertical_bar","timeseries_line","choropleth_map","timeseries_bar","donut","single_value"],cr=["in","not_in","selector"],Pa=["=","!="],Ia=["=","!=","<",">","<=",">="],lr=["empty","not_empty"],Ra=["starts_with","ends_with"],Ca=["absolute","relative"],dr=["15m","1h","6h","12h","24h","7d","current_week","previous_week","30d","current_month","previous_month"],Qe=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],se=e=>e.filter(t=>t!=="time"),ve=["api","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],oe=se(ve),Ze=["active_services","request_count","request_per_minute","response_latency_average"],Ke=[...ve,"application","consumer","country_code","iso_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm"],ue=se(Ke),fr=[...Ze,"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"],Je=["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","realm","status_code","status_code_grouped","ai_plugin"],ce=se(Je),mr=["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"],hr=["api","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","portal","realm","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"],yr=se(hr),gr=["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"],ka=gr,pr=["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"],_r=se(pr),Ya=["15M","1H","6H","12H","24H","7D"],Ga=["basic","api_usage","llm_usage"],wr={basic:new Set(oe),api_usage:new Set(ue),llm_usage:new Set(ce)},Aa=(e,t)=>t.filter(r=>wr[e].has(r.field)),Tr=["AF","AX","AL","DZ","AS","AD","AO","AI","AQ","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY","BE","BZ","BJ","BM","BT","BO","BQ","BA","BW","BV","BR","IO","BN","BG","BF","BI","CV","KH","CM","CA","KY","CF","TD","CL","CN","CX","CC","CO","KM","CG","CD","CK","CR","CI","HR","CU","CW","CY","CZ","DK","DJ","DM","DO","EC","EG","SV","GQ","ER","EE","SZ","ET","FK","FO","FJ","FI","FR","GF","PF","TF","GA","GM","GE","DE","GH","GI","GR","GL","GD","GP","GU","GT","GG","GN","GW","GY","HT","HM","VA","HN","HK","HU","IS","IN","ID","IR","IQ","IE","IM","IL","IT","JM","JP","JE","JO","KZ","KE","KI","KP","KR","KW","KG","LA","LV","LB","LS","LR","LY","LI","LT","LU","MO","MG","MW","MY","MV","ML","MT","MH","MQ","MR","MU","YT","MX","FM","MD","MC","MN","ME","MS","MA","MZ","MM","NA","NR","NP","NL","NC","NZ","NI","NE","NG","NU","NF","MK","MP","NO","OM","PK","PW","PS","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","RE","RO","RU","RW","BL","SH","KN","LC","MF","PM","VC","WS","SM","ST","SA","SN","RS","SC","SL","SG","SX","SK","SI","SB","SO","ZA","GS","SS","ES","LK","SD","SR","SJ","SE","CH","SY","TW","TJ","TZ","TH","TL","TG","TK","TO","TT","TN","TR","TM","TC","TV","UG","UA","AE","GB","UM","US","UY","UZ","VU","VE","VN","VG","VI","WF","EH","YE","ZM","ZW"],Ha=["horizontal_bar","vertical_bar","gauge","donut","timeseries_line","timeseries_bar","golden_signals","top_n","slottable","single_value","choropleth_map"],le={type:"string"},q={type:"string"},br={type:"boolean"},Dr={type:["object","array"],items:{type:"string"},additionalProperties:{type:"string"}},Mr={type:"object",properties:{type:{type:"string",enum:["slottable"]},id:{type:"string"}},required:["type","id"],additionalProperties:!1},Or={type:"object",properties:{type:{type:"string",enum:["horizontal_bar","vertical_bar"]},stacked:{type:"boolean"},chart_dataset_colors:Dr,synthetics_data_key:le,chart_title:q,allow_csv_export:br},required:["type"],additionalProperties:!1},Sr={type:"object",properties:{type:{type:"string",enum:["timeseries_line","timeseries_bar"]},stacked:{type:"boolean"},threshold:{type:"object",additionalProperties:{type:"number"}},chart_dataset_colors:Dr,synthetics_data_key:le,chart_title:q,allow_csv_export:br},required:["type"],additionalProperties:!1},vr={type:"object",properties:{type:{type:"string",enum:["gauge"]},metric_display:{type:"string",enum:["hidden","single","full"]},reverse_dataset:{type:"boolean"},numerator:{type:"number"},synthetics_data_key:le,chart_title:q},required:["type"],additionalProperties:!1},Er={type:"object",properties:{type:{type:"string",enum:["donut"]},synthetics_data_key:le,chart_title:q},required:["type"],additionalProperties:!1},xr={type:"object",properties:{chart_title:q,synthetics_data_key:le,type:{type:"string",enum:["top_n"]},description:{type:"string"},entity_link:{type:"string"}},required:["type"],additionalProperties:!1},Nr={type:"object",properties:{chart_title:q,type:{type:"string",enum:["golden_signals"]},long_card_titles:{type:"boolean"},description:{type:"string"},percentile_latency:{type:"boolean"}},required:["type"],additionalProperties:!1},Pr={type:"object",properties:{type:{type:"string",enum:["single_value"]},decimal_points:{type:"number"},chart_title:q},required:["type"],additionalProperties:!1},Ir={type:"object",properties:{type:{type:"string",enum:["choropleth_map"]},chart_title:q,fit_to_country:{type:"string",enum:Tr},legend:{type:"boolean",default:!1},bounds:{type:"array",minItems:2,maxItems:2,items:{type:"array",minItems:2,maxItems:2,items:[{type:"number",minimum:-180,maximum:180},{type:"number",minimum:-90,maximum:90}]}}},required:["type"],additionalProperties:!1},Fa={type:"object",properties:{tz:{type:"string",default:"Etc/UTC"},type:{type:"string",enum:["relative"]},time_range:{type:"string",enum:dr,default:"1h"}},required:["type","time_range"],additionalProperties:!1},qa={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},et={granularity:{type:"string",description:'Force time grouping into buckets of this duration. Only has an effect if "time" is in the "dimensions" list.',enum:Qe},time_range:{type:"object",description:"The time range to query.",anyOf:[Fa,qa],default:{type:"relative",time_range:"1h"}},limit:{type:"number"},meta:{type:"object"}},tt=e=>({type:"array",description:"List of aggregated metrics to collect across the requested time span.",items:{type:"string",enum:e}}),rt=e=>({type:"array",description:"List of attributes or entity types to group by.",minItems:0,maxItems:2,items:{type:"string",enum:e}}),Ee=e=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:cr},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:lr}},required:["field","operator"],additionalProperties:!1}]}}),Rr={type:"object",description:"A query to launch at the advanced explore API",properties:{datasource:{type:"string",enum:["api_usage"]},metrics:tt(fr),dimensions:rt(Ke),filters:Ee(ue),...et},required:["datasource"],additionalProperties:!1},Cr={type:"object",description:"A query to launch at the basic explore API",properties:{datasource:{type:"string",enum:["basic"]},metrics:tt(Ze),dimensions:rt(ve),filters:Ee(oe),...et},required:["datasource"],additionalProperties:!1},kr={type:"object",description:"A query to launch at the AI explore API",properties:{datasource:{type:"string",enum:["llm_usage"]},metrics:tt(mr),dimensions:rt(Je),filters:Ee(ce),...et},required:["datasource"],additionalProperties:!1},Yr={anyOf:[Rr,Cr,kr]},Gr={type:"object",properties:{query:Yr,chart:{anyOf:[Or,vr,Er,Sr,Nr,xr,Mr,Pr,Ir]}},required:["query","chart"],additionalProperties:!1},Ar={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"},fit_to_content:{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},Hr={type:"object",properties:{type:{type:"string",enum:["chart"]},definition:Gr,layout:Ar,id:{type:"string",description:"Unique identifier for the tile. If not provided, one will be generated."}},required:["type","definition","layout"],additionalProperties:!1},Wa={type:"object",properties:{tiles:{type:"array",items:Hr},tile_height:{type:"number",description:"Height of each tile in pixels."},preset_filters:Ee([...new Set([...ue,...oe,...ce])]),template_id:{type:["string","null"],description:"Template id which was used to instantiate this dashboard."}},required:["tiles"],additionalProperties:!1},La=e=>{const t=[];return oe.includes(e)&&t.push("basic"),ue.includes(e)&&t.push("api_usage"),ce.includes(e)&&t.push("llm_usage"),(yr.includes(e)||_r.includes(e))&&t.push("requests"),t},Fr=6048e5,Ua=864e5,ja=60,Va=3600,Wt=Symbol.for("constructDateFrom");function R(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Wt in e?e[Wt](t):e instanceof Date?new e.constructor(t):new Date(t)}function M(e,t){return R(t||e,e)}function Lt(e,t,r){const n=M(e,r==null?void 0:r.in);return isNaN(t)?R(e,NaN):(n.setDate(n.getDate()+t),n)}function za(e,t,r){const n=M(e,r==null?void 0:r.in);if(isNaN(t))return R(e,NaN);const i=n.getDate(),o=R(e,n.getTime());o.setMonth(n.getMonth()+t+1,0);const c=o.getDate();return i>=c?o:(n.setFullYear(o.getFullYear(),o.getMonth(),i),n)}let Ba={};function de(){return Ba}function A(e,t){var d,m,f,p;const r=de(),n=(t==null?void 0:t.weekStartsOn)??((m=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:m.weekStartsOn)??r.weekStartsOn??((p=(f=r.locale)==null?void 0:f.options)==null?void 0:p.weekStartsOn)??0,i=M(e,t==null?void 0:t.in),o=i.getDay(),c=(o<n?7:0)+o-n;return i.setDate(i.getDate()-c),i.setHours(0,0,0,0),i}function be(e,t){return A(e,{...t,weekStartsOn:1})}function qr(e,t){const r=M(e,t==null?void 0:t.in),n=r.getFullYear(),i=R(r,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const o=be(i),c=R(r,0);c.setFullYear(n,0,4),c.setHours(0,0,0,0);const d=be(c);return r.getTime()>=o.getTime()?n+1:r.getTime()>=d.getTime()?n:n-1}function Ut(e){const t=M(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 Xa(e,...t){const r=R.bind(null,t.find(n=>typeof n=="object"));return t.map(r)}function De(e,t){const r=M(e,t==null?void 0:t.in);return r.setHours(0,0,0,0),r}function $a(e,t,r){const[n,i]=Xa(r==null?void 0:r.in,e,t),o=De(n),c=De(i),d=+o-Ut(o),m=+c-Ut(c);return Math.round((d-m)/Ua)}function Qa(e,t){const r=qr(e,t),n=R(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),be(n)}function Za(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Ka(e){return!(!Za(e)&&typeof e!="number"||isNaN(+M(e)))}function J(e,t){const r=M(e,t==null?void 0:t.in);return r.setDate(1),r.setHours(0,0,0,0),r}function Ja(e,t){const r=M(e,t==null?void 0:t.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}const ei={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"}},ti=(e,t,r)=>{let n;const i=ei[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 Le(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const ri={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ni={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ai={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ii={date:Le({formats:ri,defaultWidth:"full"}),time:Le({formats:ni,defaultWidth:"full"}),dateTime:Le({formats:ai,defaultWidth:"full"})},si={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},oi=(e,t,r,n)=>si[e];function ne(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let i;if(n==="formatting"&&e.formattingValues){const c=e.defaultFormattingWidth||e.defaultWidth,d=r!=null&&r.width?String(r.width):c;i=e.formattingValues[d]||e.formattingValues[c]}else{const c=e.defaultWidth,d=r!=null&&r.width?String(r.width):e.defaultWidth;i=e.values[d]||e.values[c]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const ui={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ci={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},li={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"]},di={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"]},fi={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"}},mi={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"}},hi=(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"},yi={ordinalNumber:hi,era:ne({values:ui,defaultWidth:"wide"}),quarter:ne({values:ci,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ne({values:li,defaultWidth:"wide"}),day:ne({values:di,defaultWidth:"wide"}),dayPeriod:ne({values:fi,defaultWidth:"wide",formattingValues:mi,defaultFormattingWidth:"wide"})};function ae(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 c=o[0],d=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],m=Array.isArray(d)?pi(d,y=>y.test(c)):gi(d,y=>y.test(c));let f;f=e.valueCallback?e.valueCallback(m):m,f=r.valueCallback?r.valueCallback(f):f;const p=t.slice(c.length);return{value:f,rest:p}}}function gi(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function pi(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function _i(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 c=e.valueCallback?e.valueCallback(o[0]):o[0];c=r.valueCallback?r.valueCallback(c):c;const d=t.slice(i.length);return{value:c,rest:d}}}const wi=/^(\d+)(th|st|nd|rd)?/i,Ti=/\d+/i,bi={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},Di={any:[/^b/i,/^(a|c)/i]},Mi={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Oi={any:[/1/i,/2/i,/3/i,/4/i]},Si={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},vi={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]},Ei={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},xi={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]},Ni={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},Pi={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}},Ii={ordinalNumber:_i({matchPattern:wi,parsePattern:Ti,valueCallback:e=>parseInt(e,10)}),era:ae({matchPatterns:bi,defaultMatchWidth:"wide",parsePatterns:Di,defaultParseWidth:"any"}),quarter:ae({matchPatterns:Mi,defaultMatchWidth:"wide",parsePatterns:Oi,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ae({matchPatterns:Si,defaultMatchWidth:"wide",parsePatterns:vi,defaultParseWidth:"any"}),day:ae({matchPatterns:Ei,defaultMatchWidth:"wide",parsePatterns:xi,defaultParseWidth:"any"}),dayPeriod:ae({matchPatterns:Ni,defaultMatchWidth:"any",parsePatterns:Pi,defaultParseWidth:"any"})},Ri={code:"en-US",formatDistance:ti,formatLong:ii,formatRelative:oi,localize:yi,match:Ii,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Ci(e,t){const r=M(e,t==null?void 0:t.in);return $a(r,Ja(r))+1}function ki(e,t){const r=M(e,t==null?void 0:t.in),n=+be(r)-+Qa(r);return Math.round(n/Fr)+1}function Wr(e,t){var p,y,g,x;const r=M(e,t==null?void 0:t.in),n=r.getFullYear(),i=de(),o=(t==null?void 0:t.firstWeekContainsDate)??((y=(p=t==null?void 0:t.locale)==null?void 0:p.options)==null?void 0:y.firstWeekContainsDate)??i.firstWeekContainsDate??((x=(g=i.locale)==null?void 0:g.options)==null?void 0:x.firstWeekContainsDate)??1,c=R((t==null?void 0:t.in)||e,0);c.setFullYear(n+1,0,o),c.setHours(0,0,0,0);const d=A(c,t),m=R((t==null?void 0:t.in)||e,0);m.setFullYear(n,0,o),m.setHours(0,0,0,0);const f=A(m,t);return+r>=+d?n+1:+r>=+f?n:n-1}function Yi(e,t){var d,m,f,p;const r=de(),n=(t==null?void 0:t.firstWeekContainsDate)??((m=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:m.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(f=r.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,i=Wr(e,t),o=R((t==null?void 0:t.in)||e,0);return o.setFullYear(i,0,n),o.setHours(0,0,0,0),A(o,t)}function Gi(e,t){const r=M(e,t==null?void 0:t.in),n=+A(r,t)-+Yi(r,t);return Math.round(n/Fr)+1}function _(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 _(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):_(r+1,2)},d(e,t){return _(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 _(e.getHours()%12||12,t.length)},H(e,t){return _(e.getHours(),t.length)},m(e,t){return _(e.getMinutes(),t.length)},s(e,t){return _(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),i=Math.trunc(n*Math.pow(10,r-3));return _(i,t.length)}},Z={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},jt={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=Wr(e,n),o=i>0?i:1-i;if(t==="YY"){const c=o%100;return _(c,2)}return t==="Yo"?r.ordinalNumber(o,{unit:"year"}):_(o,t.length)},R:function(e,t){const r=qr(e);return _(r,t.length)},u:function(e,t){const r=e.getFullYear();return _(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 _(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 _(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 _(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=Gi(e,n);return t==="wo"?r.ordinalNumber(i,{unit:"week"}):_(i,t.length)},I:function(e,t,r){const n=ki(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):_(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=Ci(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):_(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 _(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 _(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 _(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=Z.noon:n===0?i=Z.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=Z.evening:n>=12?i=Z.afternoon:n>=4?i=Z.morning:i=Z.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"}):_(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):_(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 zt(n);case"XXXX":case"XX":return z(n);case"XXXXX":case"XXX":default:return z(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return zt(n);case"xxxx":case"xx":return z(n);case"xxxxx":case"xxx":default:return z(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Vt(n,":");case"OOOO":default:return"GMT"+z(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Vt(n,":");case"zzzz":default:return"GMT"+z(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return _(n,t.length)},T:function(e,t,r){return _(+e,t.length)}};function Vt(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+_(o,2)}function zt(e,t){return e%60===0?(e>0?"-":"+")+_(Math.abs(e)/60,2):z(e,t)}function z(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=_(Math.trunc(n/60),2),o=_(n%60,2);return r+i+t+o}const Bt=(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"})}},Lr=(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"})}},Ai=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],i=r[2];if(!i)return Bt(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}}",Bt(n,t)).replace("{{time}}",Lr(i,t))},Hi={p:Lr,P:Ai},Fi=/^D+$/,qi=/^Y+$/,Wi=["D","DD","YY","YYYY"];function Li(e){return Fi.test(e)}function Ui(e){return qi.test(e)}function ji(e,t,r){const n=Vi(e,t,r);if(console.warn(n),Wi.includes(e))throw new RangeError(n)}function Vi(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 zi=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Bi=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Xi=/^'([^]*?)'?$/,$i=/''/g,Qi=/[a-zA-Z]/;function Ur(e,t,r){var p,y,g,x,P,I,C,W;const n=de(),i=(r==null?void 0:r.locale)??n.locale??Ri,o=(r==null?void 0:r.firstWeekContainsDate)??((y=(p=r==null?void 0:r.locale)==null?void 0:p.options)==null?void 0:y.firstWeekContainsDate)??n.firstWeekContainsDate??((x=(g=n.locale)==null?void 0:g.options)==null?void 0:x.firstWeekContainsDate)??1,c=(r==null?void 0:r.weekStartsOn)??((I=(P=r==null?void 0:r.locale)==null?void 0:P.options)==null?void 0:I.weekStartsOn)??n.weekStartsOn??((W=(C=n.locale)==null?void 0:C.options)==null?void 0:W.weekStartsOn)??0,d=M(e,r==null?void 0:r.in);if(!Ka(d))throw new RangeError("Invalid time value");let m=t.match(Bi).map(O=>{const b=O[0];if(b==="p"||b==="P"){const L=Hi[b];return L(O,i.formatLong)}return O}).join("").match(zi).map(O=>{if(O==="''")return{isToken:!1,value:"'"};const b=O[0];if(b==="'")return{isToken:!1,value:Zi(O)};if(jt[b])return{isToken:!0,value:O};if(b.match(Qi))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:O}});i.localize.preprocessor&&(m=i.localize.preprocessor(d,m));const f={firstWeekContainsDate:o,weekStartsOn:c,locale:i};return m.map(O=>{if(!O.isToken)return O.value;const b=O.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&Ui(b)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&Li(b))&&ji(b,t,String(e));const L=jt[b[0]];return L(d,b,i.localize,f)}).join("")}function Zi(e){const t=e.match(Xi);return t?t[1].replace($i,"'"):e}function Ki(e,t){const r=M(e,t==null?void 0:t.in),n=r.getFullYear(),i=r.getMonth(),o=R(r,0);return o.setFullYear(n,i+1,0),o.setHours(0,0,0,0),o.getDate()}function Ji(){return Object.assign({},de())}function Xt(e){return+M(e)}function $t(e){return Math.trunc(+M(e)/1e3)}function es(e){return Math.trunc(e*Va)}function ts(e){const t=e/ja;return Math.trunc(t)}function jr(e,t,r){return za(e,-1,r)}function Qt(e,t,r){const n=Ji(),i=as(e,r.timeZone,r.locale??n.locale);return"formatToParts"in i?rs(i,t):ns(i,t)}function rs(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 ns(e,t){const r=e.format(t).replace(/\u200E/g,""),n=/ [\w-+ ]+$/.exec(r);return n?n[0].substr(1):""}function as(e,t,r){return new Intl.DateTimeFormat(r?[r.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function is(e,t){const r=ls(t);return"formatToParts"in r?os(r,e):us(r,e)}const ss={year:0,month:1,day:2,hour:3,minute:4,second:5};function os(e,t){try{const r=e.formatToParts(t),n=[];for(let i=0;i<r.length;i++){const o=ss[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 us(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 Ue={},Zt=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")),cs=Zt==="06/25/2014, 00:00:00"||Zt==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function ls(e){return Ue[e]||(Ue[e]=cs?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"})),Ue[e]}function nt(e,t,r,n,i,o,c){const d=new Date(0);return d.setUTCFullYear(e,t,r),d.setUTCHours(n,i,o,c),d}const Kt=36e5,ds=6e4,je={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function fe(e,t,r){if(!e)return 0;let n=je.timezoneZ.exec(e);if(n)return 0;let i,o;if(n=je.timezoneHH.exec(e),n)return i=parseInt(n[1],10),Jt(i)?-(i*Kt):NaN;if(n=je.timezoneHHMM.exec(e),n){i=parseInt(n[2],10);const c=parseInt(n[3],10);return Jt(i,c)?(o=Math.abs(i)*Kt+c*ds,n[1]==="+"?-o:o):NaN}if(hs(e)){t=new Date(t||Date.now());const c=r?t:fs(t),d=Xe(c,e);return-(r?d:ms(t,d,e))}return NaN}function fs(e){return nt(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function Xe(e,t){const r=is(e,t),n=nt(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 ms(e,t,r){let i=e.getTime()-t;const o=Xe(new Date(i),r);if(t===o)return t;i-=o-t;const c=Xe(new Date(i),r);return o===c?o:Math.max(o,c)}function Jt(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const er={};function hs(e){if(er[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),er[e]=!0,!0}catch{return!1}}const ys=60*1e3,gs={X:function(e,t,r){const n=Ve(r.timeZone,e);if(n===0)return"Z";switch(t){case"X":return tr(n);case"XXXX":case"XX":return K(n);case"XXXXX":case"XXX":default:return K(n,":")}},x:function(e,t,r){const n=Ve(r.timeZone,e);switch(t){case"x":return tr(n);case"xxxx":case"xx":return K(n);case"xxxxx":case"xxx":default:return K(n,":")}},O:function(e,t,r){const n=Ve(r.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+ps(n,":");case"OOOO":default:return"GMT"+K(n,":")}},z:function(e,t,r){switch(t){case"z":case"zz":case"zzz":return Qt("short",e,r);case"zzzz":default:return Qt("long",e,r)}}};function Ve(e,t){const r=e?fe(e,t,!0)/ys:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(r))throw new RangeError("Invalid time zone specified: "+e);return r}function Me(e,t){const r=e<0?"-":"";let n=Math.abs(e).toString();for(;n.length<t;)n="0"+n;return r+n}function K(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Me(Math.floor(n/60),2),o=Me(Math.floor(n%60),2);return r+i+t+o}function tr(e,t){return e%60===0?(e>0?"-":"+")+Me(Math.abs(e)/60,2):K(e,t)}function ps(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+Me(o,2)}function rr(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 Vr=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,ze=36e5,nr=6e4,_s=2,S={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,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:Vr};function Oe(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?_s: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=ws(e),{year:i,restDateString:o}=Ts(n.date,r),c=bs(o,i);if(c===null||isNaN(c.getTime()))return new Date(NaN);if(c){const d=c.getTime();let m=0,f;if(n.time&&(m=Ds(n.time),m===null||isNaN(m)))return new Date(NaN);if(n.timeZone||t.timeZone){if(f=fe(n.timeZone||t.timeZone,new Date(d+m)),isNaN(f))return new Date(NaN)}else f=rr(new Date(d+m)),f=rr(new Date(d+m+f));return new Date(d+m+f)}else return new Date(NaN)}function ws(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 Ts(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 bs(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,ir(t,n)?(r.setUTCFullYear(t,n),r):new Date(NaN);if(o=S.DDD.exec(e),o){r=new Date(0);const c=parseInt(o[1],10);return Ss(t,c)?(r.setUTCFullYear(t,0,c),r):new Date(NaN)}if(o=S.MMDD.exec(e),o){r=new Date(0),n=parseInt(o[1],10)-1;const c=parseInt(o[2],10);return ir(t,n,c)?(r.setUTCFullYear(t,n,c),r):new Date(NaN)}if(o=S.Www.exec(e),o)return i=parseInt(o[1],10)-1,sr(i)?ar(t,i):new Date(NaN);if(o=S.WwwD.exec(e),o){i=parseInt(o[1],10)-1;const c=parseInt(o[2],10)-1;return sr(i,c)?ar(t,i,c):new Date(NaN)}return null}function Ds(e){let t,r,n=S.HH.exec(e);if(n)return t=parseFloat(n[1].replace(",",".")),Be(t)?t%24*ze:NaN;if(n=S.HHMM.exec(e),n)return t=parseInt(n[1],10),r=parseFloat(n[2].replace(",",".")),Be(t,r)?t%24*ze+r*nr: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 Be(t,r,i)?t%24*ze+r*nr+i*1e3:NaN}return null}function ar(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 Ms=[31,28,31,30,31,30,31,31,30,31,30,31],Os=[31,29,31,30,31,30,31,31,30,31,30,31];function zr(e){return e%400===0||e%4===0&&e%100!==0}function ir(e,t,r){if(t<0||t>11)return!1;if(r!=null){if(r<1)return!1;const n=zr(e);if(n&&r>Os[t]||!n&&r>Ms[t])return!1}return!0}function Ss(e,t){if(t<1)return!1;const r=zr(e);return!(r&&t>366||!r&&t>365)}function sr(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Be(e,t,r){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||r!=null&&(r<0||r>=60))}const vs=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Es(e,t,r={}){t=String(t);const n=t.match(vs);if(n){const i=Oe(r.originalDate||e,r);t=n.reduce(function(o,c){if(c[0]==="'")return o;const d=o.indexOf(c),m=o[d-1]==="'",f=o.replace(c,"'"+gs[c[0]](i,c,r)+"'");return m?f.substring(0,d-1)+f.substring(d+1):f},t)}return Ur(e,t,r)}function Br(e,t,r){e=Oe(e,r);const n=fe(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 xs(e,t,r,n){return n={...n,timeZone:t,originalDate:e},Es(Br(e,t,{timeZone:n.timeZone}),r,n)}function Ns(e,t,r){if(typeof e=="string"&&!e.match(Vr))return Oe(e,{...r,timeZone:t});e=Oe(e,r);const n=nt(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),i=fe(t,new Date(n));return new Date(n+i)}function Xr(e,t){return-fe(e,t)}function Ps(e){return Ur(e,"yyyy-MM-dd'T'HH:mm:ss.SSSXXX")}function $e(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 xs(i,r,n)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}function Is(e,t){return`${$e(e.getTime())} - ${$e(t.getTime(),{includeTZ:!0})}`}const ie={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 Rs(e,t){return e.map(r=>({value:r,label:t.t(`configuration.vitals.reports.granularity.${r}`)}))}function $r(e,t){return{duration:e,type:"duration",origin:t}}function Cs(e){return e&&Qe.find(r=>e<=ie[r])||null}function Qr(e,t,r,n){const i=ie[r];let o=0;return i>=ie.daily&&(n?o=-Xr(n,t):o=t.getTimezoneOffset()*60*1e3),new Date(e((t.getTime()-o)/i)*i+o)}function Zr(e,t,r){return Qr(Math.floor,e,t,r)}function at(e,t,r){return Qr(Math.ceil,e,t,r)}class xe{constructor(t,r,n){T(this,"timeframe");T(this,"tz");T(this,"dataGranularity");if(this.constructor===xe)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),c=Zr(o,r,this.tz),m=(i.getTime()-c.getTime())*(n-1);return new Date(c.getTime()-m)}}granularitySeconds(){return Math.floor(this.granularityMs()/1e3)}granularityDruid(){return $r(this.granularityMs(),this.startDate().toISOString())}startSeconds(){return $t(this.startDate())}endSeconds(){return $t(this.endDate())}startMs(){return Xt(this.startDate())}endMs(){return Xt(this.endDate())}}class ks extends xe{constructor(r,n,i,o,c){super(r,i,o);T(this,"granularity");n&&r.allowedGranularities(c).has(n)?this.granularity=n:c?this.granularity=r.fineGrainedDefaultGranularity??r.defaultResponseGranularity:this.granularity=r.defaultResponseGranularity}startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.granularity)}endDate(){return at(this.timeframe.rawEnd(),this.granularity,this.tz)}granularityMs(){return ie[this.granularity]}}class Kr extends xe{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity)}endDate(){return at(this.timeframe.rawEnd(this.tz),this.dataGranularity,this.tz)}granularityMs(){return this.endDate().getTime()-this.startDate().getTime()}}class Ys extends Kr{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity,2)}granularityMs(){return this.endDate().getTime()-super.startDate().getTime()}}var Te=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Gs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Se={exports:{}};Se.exports;(function(e,t){var r=200,n="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",c="[object Array]",d="[object Boolean]",m="[object Date]",f="[object Error]",p="[object Function]",y="[object GeneratorFunction]",g="[object Map]",x="[object Number]",P="[object Object]",I="[object Promise]",C="[object RegExp]",W="[object Set]",O="[object String]",b="[object Symbol]",L="[object WeakMap]",st="[object ArrayBuffer]",me="[object DataView]",ot="[object Float32Array]",ut="[object Float64Array]",ct="[object Int8Array]",lt="[object Int16Array]",dt="[object Int32Array]",ft="[object Uint8Array]",mt="[object Uint8ClampedArray]",ht="[object Uint16Array]",yt="[object Uint32Array]",tn=/[\\^$.*+?()[\]{}|]/g,rn=/\w*$/,nn=/^\[object .+?Constructor\]$/,an=/^(?:0|[1-9]\d*)$/,w={};w[o]=w[c]=w[st]=w[me]=w[d]=w[m]=w[ot]=w[ut]=w[ct]=w[lt]=w[dt]=w[g]=w[x]=w[P]=w[C]=w[W]=w[O]=w[b]=w[ft]=w[mt]=w[ht]=w[yt]=!0,w[f]=w[p]=w[L]=!1;var sn=typeof Te=="object"&&Te&&Te.Object===Object&&Te,on=typeof self=="object"&&self&&self.Object===Object&&self,k=sn||on||Function("return this")(),gt=t&&!t.nodeType&&t,pt=gt&&!0&&e&&!e.nodeType&&e,un=pt&&pt.exports===gt;function cn(a,s){return a.set(s[0],s[1]),a}function ln(a,s){return a.add(s),a}function dn(a,s){for(var u=-1,l=a?a.length:0;++u<l&&s(a[u],u,a)!==!1;);return a}function fn(a,s){for(var u=-1,l=s.length,D=a.length;++u<l;)a[D+u]=s[u];return a}function _t(a,s,u,l){for(var D=-1,v=a?a.length:0;++D<v;)u=s(u,a[D],D,a);return u}function mn(a,s){for(var u=-1,l=Array(a);++u<a;)l[u]=s(u);return l}function hn(a,s){return a==null?void 0:a[s]}function wt(a){var s=!1;if(a!=null&&typeof a.toString!="function")try{s=!!(a+"")}catch{}return s}function Tt(a){var s=-1,u=Array(a.size);return a.forEach(function(l,D){u[++s]=[D,l]}),u}function Pe(a,s){return function(u){return a(s(u))}}function bt(a){var s=-1,u=Array(a.size);return a.forEach(function(l){u[++s]=l}),u}var yn=Array.prototype,gn=Function.prototype,he=Object.prototype,Ie=k["__core-js_shared__"],Dt=function(){var a=/[^.]+$/.exec(Ie&&Ie.keys&&Ie.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""}(),Mt=gn.toString,H=he.hasOwnProperty,ye=he.toString,pn=RegExp("^"+Mt.call(H).replace(tn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ot=un?k.Buffer:void 0,St=k.Symbol,vt=k.Uint8Array,_n=Pe(Object.getPrototypeOf,Object),wn=Object.create,Tn=he.propertyIsEnumerable,bn=yn.splice,Et=Object.getOwnPropertySymbols,Dn=Ot?Ot.isBuffer:void 0,Mn=Pe(Object.keys,Object),Re=$(k,"DataView"),te=$(k,"Map"),Ce=$(k,"Promise"),ke=$(k,"Set"),Ye=$(k,"WeakMap"),re=$(Object,"create"),On=V(Re),Sn=V(te),vn=V(Ce),En=V(ke),xn=V(Ye),xt=St?St.prototype:void 0,Nt=xt?xt.valueOf:void 0;function U(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var l=a[s];this.set(l[0],l[1])}}function Nn(){this.__data__=re?re(null):{}}function Pn(a){return this.has(a)&&delete this.__data__[a]}function In(a){var s=this.__data__;if(re){var u=s[a];return u===n?void 0:u}return H.call(s,a)?s[a]:void 0}function Rn(a){var s=this.__data__;return re?s[a]!==void 0:H.call(s,a)}function Cn(a,s){var u=this.__data__;return u[a]=re&&s===void 0?n:s,this}U.prototype.clear=Nn,U.prototype.delete=Pn,U.prototype.get=In,U.prototype.has=Rn,U.prototype.set=Cn;function Y(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var l=a[s];this.set(l[0],l[1])}}function kn(){this.__data__=[]}function Yn(a){var s=this.__data__,u=ge(s,a);if(u<0)return!1;var l=s.length-1;return u==l?s.pop():bn.call(s,u,1),!0}function Gn(a){var s=this.__data__,u=ge(s,a);return u<0?void 0:s[u][1]}function An(a){return ge(this.__data__,a)>-1}function Hn(a,s){var u=this.__data__,l=ge(u,a);return l<0?u.push([a,s]):u[l][1]=s,this}Y.prototype.clear=kn,Y.prototype.delete=Yn,Y.prototype.get=Gn,Y.prototype.has=An,Y.prototype.set=Hn;function B(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var l=a[s];this.set(l[0],l[1])}}function Fn(){this.__data__={hash:new U,map:new(te||Y),string:new U}}function qn(a){return pe(this,a).delete(a)}function Wn(a){return pe(this,a).get(a)}function Ln(a){return pe(this,a).has(a)}function Un(a,s){return pe(this,a).set(a,s),this}B.prototype.clear=Fn,B.prototype.delete=qn,B.prototype.get=Wn,B.prototype.has=Ln,B.prototype.set=Un;function X(a){this.__data__=new Y(a)}function jn(){this.__data__=new Y}function Vn(a){return this.__data__.delete(a)}function zn(a){return this.__data__.get(a)}function Bn(a){return this.__data__.has(a)}function Xn(a,s){var u=this.__data__;if(u instanceof Y){var l=u.__data__;if(!te||l.length<r-1)return l.push([a,s]),this;u=this.__data__=new B(l)}return u.set(a,s),this}X.prototype.clear=jn,X.prototype.delete=Vn,X.prototype.get=zn,X.prototype.has=Bn,X.prototype.set=Xn;function $n(a,s){var u=He(a)||wa(a)?mn(a.length,String):[],l=u.length,D=!!l;for(var v in a)H.call(a,v)&&!(D&&(v=="length"||ya(v,l)))&&u.push(v);return u}function Pt(a,s,u){var l=a[s];(!(H.call(a,s)&&kt(l,u))||u===void 0&&!(s in a))&&(a[s]=u)}function ge(a,s){for(var u=a.length;u--;)if(kt(a[u][0],s))return u;return-1}function Qn(a,s){return a&&It(s,Fe(s),a)}function Ge(a,s,u,l,D,v,G){var E;if(l&&(E=v?l(a,D,v,G):l(a)),E!==void 0)return E;if(!_e(a))return a;var At=He(a);if(At){if(E=fa(a),!s)return ca(a,E)}else{var Q=j(a),Ht=Q==p||Q==y;if(ba(a))return ra(a,s);if(Q==P||Q==o||Ht&&!v){if(wt(a))return v?a:{};if(E=ma(Ht?{}:a),!s)return la(a,Qn(E,a))}else{if(!w[Q])return v?a:{};E=ha(a,Q,Ge,s)}}G||(G=new X);var Ft=G.get(a);if(Ft)return Ft;if(G.set(a,E),!At)var qt=u?da(a):Fe(a);return dn(qt||a,function(qe,we){qt&&(we=qe,qe=a[we]),Pt(E,we,Ge(qe,s,u,l,we,a,G))}),E}function Zn(a){return _e(a)?wn(a):{}}function Kn(a,s,u){var l=s(a);return He(a)?l:fn(l,u(a))}function Jn(a){return ye.call(a)}function ea(a){if(!_e(a)||pa(a))return!1;var s=Gt(a)||wt(a)?pn:nn;return s.test(V(a))}function ta(a){if(!Ct(a))return Mn(a);var s=[];for(var u in Object(a))H.call(a,u)&&u!="constructor"&&s.push(u);return s}function ra(a,s){if(s)return a.slice();var u=new a.constructor(a.length);return a.copy(u),u}function Ae(a){var s=new a.constructor(a.byteLength);return new vt(s).set(new vt(a)),s}function na(a,s){var u=s?Ae(a.buffer):a.buffer;return new a.constructor(u,a.byteOffset,a.byteLength)}function aa(a,s,u){var l=s?u(Tt(a),!0):Tt(a);return _t(l,cn,new a.constructor)}function ia(a){var s=new a.constructor(a.source,rn.exec(a));return s.lastIndex=a.lastIndex,s}function sa(a,s,u){var l=s?u(bt(a),!0):bt(a);return _t(l,ln,new a.constructor)}function oa(a){return Nt?Object(Nt.call(a)):{}}function ua(a,s){var u=s?Ae(a.buffer):a.buffer;return new a.constructor(u,a.byteOffset,a.length)}function ca(a,s){var u=-1,l=a.length;for(s||(s=Array(l));++u<l;)s[u]=a[u];return s}function It(a,s,u,l){u||(u={});for(var D=-1,v=s.length;++D<v;){var G=s[D],E=void 0;Pt(u,G,E===void 0?a[G]:E)}return u}function la(a,s){return It(a,Rt(a),s)}function da(a){return Kn(a,Fe,Rt)}function pe(a,s){var u=a.__data__;return ga(s)?u[typeof s=="string"?"string":"hash"]:u.map}function $(a,s){var u=hn(a,s);return ea(u)?u:void 0}var Rt=Et?Pe(Et,Object):Oa,j=Jn;(Re&&j(new Re(new ArrayBuffer(1)))!=me||te&&j(new te)!=g||Ce&&j(Ce.resolve())!=I||ke&&j(new ke)!=W||Ye&&j(new Ye)!=L)&&(j=function(a){var s=ye.call(a),u=s==P?a.constructor:void 0,l=u?V(u):void 0;if(l)switch(l){case On:return me;case Sn:return g;case vn:return I;case En:return W;case xn:return L}return s});function fa(a){var s=a.length,u=a.constructor(s);return s&&typeof a[0]=="string"&&H.call(a,"index")&&(u.index=a.index,u.input=a.input),u}function ma(a){return typeof a.constructor=="function"&&!Ct(a)?Zn(_n(a)):{}}function ha(a,s,u,l){var D=a.constructor;switch(s){case st:return Ae(a);case d:case m:return new D(+a);case me:return na(a,l);case ot:case ut:case ct:case lt:case dt:case ft:case mt:case ht:case yt:return ua(a,l);case g:return aa(a,l,u);case x:case O:return new D(a);case C:return ia(a);case W:return sa(a,l,u);case b:return oa(a)}}function ya(a,s){return s=s??i,!!s&&(typeof a=="number"||an.test(a))&&a>-1&&a%1==0&&a<s}function ga(a){var s=typeof a;return s=="string"||s=="number"||s=="symbol"||s=="boolean"?a!=="__proto__":a===null}function pa(a){return!!Dt&&Dt in a}function Ct(a){var s=a&&a.constructor,u=typeof s=="function"&&s.prototype||he;return a===u}function V(a){if(a!=null){try{return Mt.call(a)}catch{}try{return a+""}catch{}}return""}function _a(a){return Ge(a,!0,!0)}function kt(a,s){return a===s||a!==a&&s!==s}function wa(a){return Ta(a)&&H.call(a,"callee")&&(!Tn.call(a,"callee")||ye.call(a)==o)}var He=Array.isArray;function Yt(a){return a!=null&&Da(a.length)&&!Gt(a)}function Ta(a){return Ma(a)&&Yt(a)}var ba=Dn||Sa;function Gt(a){var s=_e(a)?ye.call(a):"";return s==p||s==y}function Da(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=i}function _e(a){var s=typeof a;return!!a&&(s=="object"||s=="function")}function Ma(a){return!!a&&typeof a=="object"}function Fe(a){return Yt(a)?$n(a):ta(a)}function Oa(){return[]}function Sa(){return!1}e.exports=_a})(Se,Se.exports);var As=Se.exports;const Hs=Gs(As),ee=(e,t)=>new Date(e.getTime()-Xr(t,e));class N{constructor(t){T(this,"timeframeText");T(this,"key");T(this,"display");T(this,"timeframeLength");T(this,"allowedTiers");T(this,"defaultResponseGranularity");T(this,"dataGranularity");T(this,"isRelative");T(this,"fineGrainedDefaultGranularity");T(this,"_startCustom");T(this,"_endCustom");T(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=Ns(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Br(r,t)}}class Fs extends N{rawStart(t){let r=A(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(r=ee(r,t)),r}maximumTimeframeLength(){return 60*60*24*7}}class qs extends N{rawStart(t){let r=J(this.tzAdjustedDate(t));return t&&(r=ee(r,t)),r}maximumTimeframeLength(){return 60*60*24*31}}class Ws extends N{rawEnd(t){let r=A(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(r=ee(r,t)),r}rawStart(t){const r=this.tzAdjustedDate(t);let n=A(r.setDate(r.getDate()-7),{weekStartsOn:1});return t&&(n=ee(n,t)),n}}class Ls extends N{rawEnd(t){let r=J(this.tzAdjustedDate(t));return t&&(r=ee(r,t)),r}rawStart(t){let r=J(jr(this.tzAdjustedDate(t)));return t&&(r=ee(r,t)),r}}const Jr=new Map([[h.FIFTEEN_MIN,new N({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 N({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 N({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 N({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 N({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 N({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 N({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 Fs({key:h.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const e=A(new Date,{weekStartsOn:1});return(De(Lt(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 qs({key:h.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const e=J(new Date);return(De(Lt(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})],[h.PREVIOUS_WEEK,new Ws({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 Ls({key:h.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=J(new Date),r=J(jr(new Date));return t.getTimezoneOffset()!==r.getTimezoneOffset()&&(e=en(t,r)),60*60*24*Ki(new Date().setMonth(new Date().getMonth()-1))+es(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})]]);function Us(e){const t=new Date(e.start),r=new Date(e.end),n=(r.getTime()-t.getTime())/1e3;return e.timePeriodsKey&&Hs(Jr.get(e.timePeriodsKey))||new N({key:"custom",timeframeText:"custom",display:"custom",startCustom:t,endCustom:r,timeframeLength:()=>n,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["free","plus","enterprise"]})}function js(e){return{...e.key!=="custom"&&{timePeriodsKey:e.key},start:e.rawStart(),end:e.rawEnd()}}function Vs(e){return{key:e.key,display:e.display,timeframeText:e.timeframeText,timeframeLength:()=>e.key,start:()=>e.rawStart(),end:()=>e.rawEnd()}}function en(e,t){return ts(e.getTimezoneOffset()-t.getTimezoneOffset())}const zs={"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 Ne{constructor(t){T(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 Bs=(e,t,r)=>{const n=it(10,1e4),i=new Ne(n),o=Date.now()-6*60*60*1e3,c=Date.now(),d=[];let m=0;for(let y=o;y<=c;y+=60*60*1e3)if(t)for(const g in t)t[g].forEach(x=>{m+=i.next(50,500);const P={[g]:x,[e.name]:m},I={version:"1.0",timestamp:new Date(y).toISOString(),event:P};d.push(I)});else{m+=i.next(50,500);const g={version:"1.0",timestamp:new Date(y).toISOString(),event:{[e.name]:m}};d.push(g)}const f={};if(t)for(const y in t)f[y]={},t[y].forEach(g=>{f[y][g]={name:g,deleted:!1}});const p={start_ms:o,end_ms:c,start:new Date(o).toISOString(),end:new Date(c).toISOString(),query_id:"12345",metric_names:[e.name],metric_units:{[e.name]:e.unit},granularity_ms:60*60*1e3,display:f,...r??{}};return{data:d,meta:p}},Xs=(e,t)=>{const r=it(10,1e4),n=new Ne(r),i=Date.now()-6*60*60*1e3,o=Date.now(),c=[],d={};e.forEach(f=>{d[f.name]=0});for(let f=i;f<=o;f+=60*60*1e3){const p={};e.forEach(g=>{d[g.name]+=n.next(50,500),p[g.name]=d[g.name]});const y={version:"1.0",timestamp:new Date(f).toISOString(),event:p};c.push(y)}const m={start_ms:i,end_ms:o,start:new Date(i).toISOString(),end:new Date(o).toISOString(),query_id:"12345",metric_names:e.map(f=>f.name),metric_units:e.reduce((f,p)=>(f[p.name]=p.unit,f),{}),granularity_ms:60*60*1e3,display:{},...t??{}};return{data:c,meta:m}},$s=(e,t,r)=>{const n=Math.floor(Math.random()*9991)+10,i=new Ne(n),o=Date.now()-6*60*60*1e3,c=Date.now(),d=new Date((o+c)/2).toISOString(),m=[];if(t){const y=Object.keys(t),g=Object.values(t),x=(P,I)=>{if(I===y.length){e.forEach(C=>{P[C.name]=i.next(1e3,5e7)}),m.push({version:"1.0",timestamp:new Date().toISOString(),event:{...P}});return}g[I].forEach(C=>{x({...P,[y[I]]:C},I+1)})};x({},0)}else{const y={};e.forEach(g=>{y[g.name]=i.next(50,500)}),m.push({version:"1.0",timestamp:d,event:y})}const f={};if(t)for(const y in t)f[y]={},t[y].forEach(g=>{f[y][g]={name:g,deleted:!1}});const p={start_ms:o,end_ms:c,start:new Date(o).toISOString(),end:new Date(c).toISOString(),query_id:"12345",metric_names:e.map(y=>y.name),metric_units:e.reduce((y,g)=>(y[g.name]=g.unit,y),{}),truncated:!1,limit:50,display:f,granularity_ms:c-o,...r??{}};return{data:m,meta:p}};function it(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1)+e)}function Qs({buildQuery:e,defaultLimit:t=or}){const r=We.inject(ur);if(!(r!=null&&r.queryFn))throw new Error("useAnalyticsRequestExport: missing injected query bridge.");const n=We.ref({status:"loading"});let i=null;const o=()=>{i==null||i.abort(),i=null},c=()=>{n.value={status:"loading"}};We.onUnmounted(o);async function d(m=t){n.value={status:"loading"},i==null||i.abort(),i=new AbortController;try{if(r){const f=e(m),p=await r.queryFn(f,i);p&&(n.value={status:"success",chartData:p})}}catch(f){n.value={status:"error",error:f}}}return{exportState:n,requestExport:d,cancelExport:o,resetExport:c}}exports.DeltaQueryTime=Ys;exports.EXPORT_RECORD_LIMIT=or;exports.Granularities=ie;exports.INJECT_QUERY_PROVIDER=ur;exports.REFRESH_INTERVAL_MS=xa;exports.SeededRandom=Ne;exports.TIMEFRAME_LOOKUP=zs;exports.TimePeriods=Jr;exports.Timeframe=N;exports.TimeframeKeys=h;exports.TimeseriesQueryTime=ks;exports.UnaryQueryTime=Kr;exports.aiExploreAggregations=mr;exports.apiUsageQuerySchema=Rr;exports.barChartSchema=Or;exports.basicExploreAggregations=Ze;exports.basicQuerySchema=Cr;exports.ceilToNearestTimeGrain=at;exports.choroplethMapSchema=Ir;exports.countryISOA2=Tr;exports.dashboardConfigSchema=Wa;exports.dashboardTileTypes=Ha;exports.datasourceToFilterableDimensions=wr;exports.datePickerSelectionToTimeframe=Us;exports.donutChartSchema=Er;exports.dstOffsetHours=en;exports.exploreAggregations=fr;exports.exploreFilterTypesV2=cr;exports.filterableAiExploreDimensions=ce;exports.filterableBasicExploreDimensions=oe;exports.filterableExploreDimensions=ue;exports.filterableRequestDimensions=yr;exports.filterableRequestMetrics=_r;exports.filterableRequestWildcardDimensions=ka;exports.floorToNearestTimeGrain=Zr;exports.formatISOTimeWithTZ=Ps;exports.formatTime=$e;exports.formatTimeRange=Is;exports.gaugeChartSchema=vr;exports.generateCrossSectionalData=$s;exports.generateMultipleMetricTimeSeriesData=Xs;exports.generateSingleMetricTimeSeriesData=Bs;exports.getFieldDataSources=La;exports.granularitiesToOptions=Rs;exports.granularityMsToQuery=$r;exports.granularityValues=Qe;exports.llmUsageSchema=kr;exports.metricCardSchema=Nr;exports.msToGranularity=Cs;exports.queryDatasources=Ga;exports.queryableAiExploreDimensions=Je;exports.queryableBasicExploreDimensions=ve;exports.queryableExploreDimensions=Ke;exports.queryableRequestDimensions=hr;exports.queryableRequestMetrics=pr;exports.queryableRequestWildcardDimensions=gr;exports.rand=it;exports.relativeTimeRangeValuesRequestV2=Ya;exports.relativeTimeRangeValuesV4=dr;exports.reportChartTypes=Na;exports.requestFilterTypeEmptyV2=lr;exports.requestFilterTypeEqualsV2=Pa;exports.requestFilterTypeMetricV2=Ia;exports.requestFilterTypeWildcardV2=Ra;exports.singleValueSchema=Pr;exports.slottableSchema=Mr;exports.stripUnknownFilters=Aa;exports.tileConfigSchema=Hr;exports.tileDefinitionSchema=Gr;exports.tileLayoutSchema=Ar;exports.timeRangeTypeV2=Ca;exports.timeframeToDatepickerSelection=js;exports.timeframeToDatepickerTimeperiod=Vs;exports.timeseriesChartSchema=Sr;exports.topNTableSchema=xr;exports.useAnalyticsRequestExport=Qs;exports.validDashboardQuery=Yr;
1
+ "use strict";var va=Object.defineProperty;var Ea=(e,t,r)=>t in e?va(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var T=(e,t,r)=>Ea(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const We=require("vue"),xa=30*1e3,or=250,ur="analytics-query-provider";var y=(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))(y||{});const Na=["horizontal_bar","vertical_bar","timeseries_line","choropleth_map","timeseries_bar","donut","single_value"],cr=["in","not_in","selector"],Pa=["=","!="],Ia=["=","!=","<",">","<=",">="],lr=["empty","not_empty"],Ra=["starts_with","ends_with"],Ca=["absolute","relative"],dr=["15m","1h","6h","12h","24h","7d","current_week","previous_week","30d","current_month","previous_month"],Qe=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],se=e=>e.filter(t=>t!=="time"),ve=["api","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],oe=se(ve),Ze=["active_services","request_count","request_per_minute","response_latency_average"],Ke=[...ve,"application","consumer","country_code","iso_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm"],ue=se(Ke),fr=[...Ze,"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"],Je=["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","realm","status_code","status_code_grouped","ai_plugin"],ce=se(Je),mr=["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"],hr=["api","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","portal","realm","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"],yr=se(hr),gr=["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"],ka=gr,pr=["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"],_r=se(pr),Ya=["15M","1H","6H","12H","24H","7D"],Ga=["basic","api_usage","llm_usage"],wr={basic:new Set(oe),api_usage:new Set(ue),llm_usage:new Set(ce)},Aa=(e,t)=>t.filter(r=>wr[e].has(r.field)),Tr=["AF","AX","AL","DZ","AS","AD","AO","AI","AQ","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY","BE","BZ","BJ","BM","BT","BO","BQ","BA","BW","BV","BR","IO","BN","BG","BF","BI","CV","KH","CM","CA","KY","CF","TD","CL","CN","CX","CC","CO","KM","CG","CD","CK","CR","CI","HR","CU","CW","CY","CZ","DK","DJ","DM","DO","EC","EG","SV","GQ","ER","EE","SZ","ET","FK","FO","FJ","FI","FR","GF","PF","TF","GA","GM","GE","DE","GH","GI","GR","GL","GD","GP","GU","GT","GG","GN","GW","GY","HT","HM","VA","HN","HK","HU","IS","IN","ID","IR","IQ","IE","IM","IL","IT","JM","JP","JE","JO","KZ","KE","KI","KP","KR","KW","KG","LA","LV","LB","LS","LR","LY","LI","LT","LU","MO","MG","MW","MY","MV","ML","MT","MH","MQ","MR","MU","YT","MX","FM","MD","MC","MN","ME","MS","MA","MZ","MM","NA","NR","NP","NL","NC","NZ","NI","NE","NG","NU","NF","MK","MP","NO","OM","PK","PW","PS","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","RE","RO","RU","RW","BL","SH","KN","LC","MF","PM","VC","WS","SM","ST","SA","SN","RS","SC","SL","SG","SX","SK","SI","SB","SO","ZA","GS","SS","ES","LK","SD","SR","SJ","SE","CH","SY","TW","TJ","TZ","TH","TL","TG","TK","TO","TT","TN","TR","TM","TC","TV","UG","UA","AE","GB","UM","US","UY","UZ","VU","VE","VN","VG","VI","WF","EH","YE","ZM","ZW"],Ha=["horizontal_bar","vertical_bar","gauge","donut","timeseries_line","timeseries_bar","golden_signals","top_n","slottable","single_value","choropleth_map"],le={type:"string"},q={type:"string"},br={type:"boolean"},Dr={type:["object","array"],items:{type:"string"},additionalProperties:{type:"string"}},Mr={type:"object",properties:{type:{type:"string",enum:["slottable"]},id:{type:"string"}},required:["type","id"],additionalProperties:!1},Or={type:"object",properties:{type:{type:"string",enum:["horizontal_bar","vertical_bar"]},stacked:{type:"boolean"},chart_dataset_colors:Dr,synthetics_data_key:le,chart_title:q,allow_csv_export:br},required:["type"],additionalProperties:!1},Sr={type:"object",properties:{type:{type:"string",enum:["timeseries_line","timeseries_bar"]},stacked:{type:"boolean"},threshold:{type:"object",additionalProperties:{type:"number"}},chart_dataset_colors:Dr,synthetics_data_key:le,chart_title:q,allow_csv_export:br},required:["type"],additionalProperties:!1},vr={type:"object",properties:{type:{type:"string",enum:["gauge"]},metric_display:{type:"string",enum:["hidden","single","full"]},reverse_dataset:{type:"boolean"},numerator:{type:"number"},synthetics_data_key:le,chart_title:q},required:["type"],additionalProperties:!1},Er={type:"object",properties:{type:{type:"string",enum:["donut"]},synthetics_data_key:le,chart_title:q},required:["type"],additionalProperties:!1},xr={type:"object",properties:{chart_title:q,synthetics_data_key:le,type:{type:"string",enum:["top_n"]},description:{type:"string"},entity_link:{type:"string"}},required:["type"],additionalProperties:!1},Nr={type:"object",properties:{chart_title:q,type:{type:"string",enum:["golden_signals"]},long_card_titles:{type:"boolean"},description:{type:"string"},percentile_latency:{type:"boolean"}},required:["type"],additionalProperties:!1},Pr={type:"object",properties:{type:{type:"string",enum:["single_value"]},decimal_points:{type:"number"},chart_title:q},required:["type"],additionalProperties:!1},Ir={type:"object",properties:{type:{type:"string",enum:["choropleth_map"]},chart_title:q,fit_to_country:{type:"string",enum:Tr},legend:{type:"boolean",default:!1},bounds:{type:"array",minItems:2,maxItems:2,items:{type:"array",minItems:2,maxItems:2,items:[{type:"number",minimum:-180,maximum:180},{type:"number",minimum:-90,maximum:90}]}}},required:["type"],additionalProperties:!1},Fa={type:"object",properties:{tz:{type:"string",default:"Etc/UTC"},type:{type:"string",enum:["relative"]},time_range:{type:"string",enum:dr,default:"1h"}},required:["type","time_range"],additionalProperties:!1},qa={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},et={granularity:{type:"string",description:'Force time grouping into buckets of this duration. Only has an effect if "time" is in the "dimensions" list.',enum:Qe},time_range:{type:"object",description:"The time range to query.",anyOf:[Fa,qa],default:{type:"relative",time_range:"1h"}},limit:{type:"number"},meta:{type:"object"}},tt=e=>({type:"array",description:"List of aggregated metrics to collect across the requested time span.",items:{type:"string",enum:e}}),rt=e=>({type:"array",description:"List of attributes or entity types to group by.",minItems:0,maxItems:2,items:{type:"string",enum:e}}),Ee=e=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:cr},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:lr}},required:["field","operator"],additionalProperties:!1}]}}),Rr={type:"object",description:"A query to launch at the advanced explore API",properties:{datasource:{type:"string",enum:["api_usage"]},metrics:tt(fr),dimensions:rt(Ke),filters:Ee(ue),...et},required:["datasource"],additionalProperties:!1},Cr={type:"object",description:"A query to launch at the basic explore API",properties:{datasource:{type:"string",enum:["basic"]},metrics:tt(Ze),dimensions:rt(ve),filters:Ee(oe),...et},required:["datasource"],additionalProperties:!1},kr={type:"object",description:"A query to launch at the AI explore API",properties:{datasource:{type:"string",enum:["llm_usage"]},metrics:tt(mr),dimensions:rt(Je),filters:Ee(ce),...et},required:["datasource"],additionalProperties:!1},Yr={anyOf:[Rr,Cr,kr]},Gr={type:"object",properties:{query:Yr,chart:{anyOf:[Or,vr,Er,Sr,Nr,xr,Mr,Pr,Ir]}},required:["query","chart"],additionalProperties:!1},Ar={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"},fit_to_content:{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},Hr={type:"object",properties:{type:{type:"string",enum:["chart"]},definition:Gr,layout:Ar,id:{type:"string",description:"Unique identifier for the tile. If not provided, one will be generated."}},required:["type","definition","layout"],additionalProperties:!1},Wa={type:"object",properties:{tiles:{type:"array",items:Hr},tile_height:{type:"number",description:"Height of each tile in pixels."},preset_filters:Ee([...new Set([...ue,...oe,...ce])]),template_id:{type:["string","null"],description:"Template id which was used to instantiate this dashboard."}},required:["tiles"],additionalProperties:!1},La=e=>{const t=[];return oe.includes(e)&&t.push("basic"),ue.includes(e)&&t.push("api_usage"),ce.includes(e)&&t.push("llm_usage"),(yr.includes(e)||_r.includes(e))&&t.push("requests"),t},Fr=6048e5,Ua=864e5,ja=60,Va=3600,Wt=Symbol.for("constructDateFrom");function R(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Wt in e?e[Wt](t):e instanceof Date?new e.constructor(t):new Date(t)}function M(e,t){return R(t||e,e)}function Lt(e,t,r){const n=M(e,r==null?void 0:r.in);return isNaN(t)?R(e,NaN):(n.setDate(n.getDate()+t),n)}function za(e,t,r){const n=M(e,r==null?void 0:r.in);if(isNaN(t))return R(e,NaN);const i=n.getDate(),s=R(e,n.getTime());s.setMonth(n.getMonth()+t+1,0);const c=s.getDate();return i>=c?s:(n.setFullYear(s.getFullYear(),s.getMonth(),i),n)}let Ba={};function de(){return Ba}function A(e,t){var d,m,f,p;const r=de(),n=(t==null?void 0:t.weekStartsOn)??((m=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:m.weekStartsOn)??r.weekStartsOn??((p=(f=r.locale)==null?void 0:f.options)==null?void 0:p.weekStartsOn)??0,i=M(e,t==null?void 0:t.in),s=i.getDay(),c=(s<n?7:0)+s-n;return i.setDate(i.getDate()-c),i.setHours(0,0,0,0),i}function be(e,t){return A(e,{...t,weekStartsOn:1})}function qr(e,t){const r=M(e,t==null?void 0:t.in),n=r.getFullYear(),i=R(r,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const s=be(i),c=R(r,0);c.setFullYear(n,0,4),c.setHours(0,0,0,0);const d=be(c);return r.getTime()>=s.getTime()?n+1:r.getTime()>=d.getTime()?n:n-1}function Ut(e){const t=M(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 Xa(e,...t){const r=R.bind(null,t.find(n=>typeof n=="object"));return t.map(r)}function De(e,t){const r=M(e,t==null?void 0:t.in);return r.setHours(0,0,0,0),r}function $a(e,t,r){const[n,i]=Xa(r==null?void 0:r.in,e,t),s=De(n),c=De(i),d=+s-Ut(s),m=+c-Ut(c);return Math.round((d-m)/Ua)}function Qa(e,t){const r=qr(e,t),n=R(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),be(n)}function Za(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Ka(e){return!(!Za(e)&&typeof e!="number"||isNaN(+M(e)))}function J(e,t){const r=M(e,t==null?void 0:t.in);return r.setDate(1),r.setHours(0,0,0,0),r}function Ja(e,t){const r=M(e,t==null?void 0:t.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}const ei={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"}},ti=(e,t,r)=>{let n;const i=ei[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 Le(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const ri={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ni={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ai={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ii={date:Le({formats:ri,defaultWidth:"full"}),time:Le({formats:ni,defaultWidth:"full"}),dateTime:Le({formats:ai,defaultWidth:"full"})},si={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},oi=(e,t,r,n)=>si[e];function ne(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let i;if(n==="formatting"&&e.formattingValues){const c=e.defaultFormattingWidth||e.defaultWidth,d=r!=null&&r.width?String(r.width):c;i=e.formattingValues[d]||e.formattingValues[c]}else{const c=e.defaultWidth,d=r!=null&&r.width?String(r.width):e.defaultWidth;i=e.values[d]||e.values[c]}const s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}const ui={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ci={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},li={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"]},di={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"]},fi={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"}},mi={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"}},hi=(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"},yi={ordinalNumber:hi,era:ne({values:ui,defaultWidth:"wide"}),quarter:ne({values:ci,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ne({values:li,defaultWidth:"wide"}),day:ne({values:di,defaultWidth:"wide"}),dayPeriod:ne({values:fi,defaultWidth:"wide",formattingValues:mi,defaultFormattingWidth:"wide"})};function ae(e){return(t,r={})=>{const n=r.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;const c=s[0],d=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],m=Array.isArray(d)?pi(d,h=>h.test(c)):gi(d,h=>h.test(c));let f;f=e.valueCallback?e.valueCallback(m):m,f=r.valueCallback?r.valueCallback(f):f;const p=t.slice(c.length);return{value:f,rest:p}}}function gi(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function pi(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function _i(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const i=n[0],s=t.match(e.parsePattern);if(!s)return null;let c=e.valueCallback?e.valueCallback(s[0]):s[0];c=r.valueCallback?r.valueCallback(c):c;const d=t.slice(i.length);return{value:c,rest:d}}}const wi=/^(\d+)(th|st|nd|rd)?/i,Ti=/\d+/i,bi={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},Di={any:[/^b/i,/^(a|c)/i]},Mi={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Oi={any:[/1/i,/2/i,/3/i,/4/i]},Si={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},vi={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]},Ei={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},xi={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]},Ni={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},Pi={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}},Ii={ordinalNumber:_i({matchPattern:wi,parsePattern:Ti,valueCallback:e=>parseInt(e,10)}),era:ae({matchPatterns:bi,defaultMatchWidth:"wide",parsePatterns:Di,defaultParseWidth:"any"}),quarter:ae({matchPatterns:Mi,defaultMatchWidth:"wide",parsePatterns:Oi,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ae({matchPatterns:Si,defaultMatchWidth:"wide",parsePatterns:vi,defaultParseWidth:"any"}),day:ae({matchPatterns:Ei,defaultMatchWidth:"wide",parsePatterns:xi,defaultParseWidth:"any"}),dayPeriod:ae({matchPatterns:Ni,defaultMatchWidth:"any",parsePatterns:Pi,defaultParseWidth:"any"})},Ri={code:"en-US",formatDistance:ti,formatLong:ii,formatRelative:oi,localize:yi,match:Ii,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Ci(e,t){const r=M(e,t==null?void 0:t.in);return $a(r,Ja(r))+1}function ki(e,t){const r=M(e,t==null?void 0:t.in),n=+be(r)-+Qa(r);return Math.round(n/Fr)+1}function Wr(e,t){var p,h,g,x;const r=M(e,t==null?void 0:t.in),n=r.getFullYear(),i=de(),s=(t==null?void 0:t.firstWeekContainsDate)??((h=(p=t==null?void 0:t.locale)==null?void 0:p.options)==null?void 0:h.firstWeekContainsDate)??i.firstWeekContainsDate??((x=(g=i.locale)==null?void 0:g.options)==null?void 0:x.firstWeekContainsDate)??1,c=R((t==null?void 0:t.in)||e,0);c.setFullYear(n+1,0,s),c.setHours(0,0,0,0);const d=A(c,t),m=R((t==null?void 0:t.in)||e,0);m.setFullYear(n,0,s),m.setHours(0,0,0,0);const f=A(m,t);return+r>=+d?n+1:+r>=+f?n:n-1}function Yi(e,t){var d,m,f,p;const r=de(),n=(t==null?void 0:t.firstWeekContainsDate)??((m=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:m.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(f=r.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,i=Wr(e,t),s=R((t==null?void 0:t.in)||e,0);return s.setFullYear(i,0,n),s.setHours(0,0,0,0),A(s,t)}function Gi(e,t){const r=M(e,t==null?void 0:t.in),n=+A(r,t)-+Yi(r,t);return Math.round(n/Fr)+1}function _(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 _(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):_(r+1,2)},d(e,t){return _(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 _(e.getHours()%12||12,t.length)},H(e,t){return _(e.getHours(),t.length)},m(e,t){return _(e.getMinutes(),t.length)},s(e,t){return _(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),i=Math.trunc(n*Math.pow(10,r-3));return _(i,t.length)}},Z={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},jt={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=Wr(e,n),s=i>0?i:1-i;if(t==="YY"){const c=s%100;return _(c,2)}return t==="Yo"?r.ordinalNumber(s,{unit:"year"}):_(s,t.length)},R:function(e,t){const r=qr(e);return _(r,t.length)},u:function(e,t){const r=e.getFullYear();return _(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 _(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 _(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 _(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=Gi(e,n);return t==="wo"?r.ordinalNumber(i,{unit:"week"}):_(i,t.length)},I:function(e,t,r){const n=ki(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):_(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=Ci(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):_(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(),s=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return _(s,2);case"eo":return r.ordinalNumber(s,{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(),s=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return _(s,t.length);case"co":return r.ordinalNumber(s,{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 _(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=Z.noon:n===0?i=Z.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=Z.evening:n>=12?i=Z.afternoon:n>=4?i=Z.morning:i=Z.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"}):_(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):_(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 zt(n);case"XXXX":case"XX":return z(n);case"XXXXX":case"XXX":default:return z(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return zt(n);case"xxxx":case"xx":return z(n);case"xxxxx":case"xxx":default:return z(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Vt(n,":");case"OOOO":default:return"GMT"+z(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Vt(n,":");case"zzzz":default:return"GMT"+z(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return _(n,t.length)},T:function(e,t,r){return _(+e,t.length)}};function Vt(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Math.trunc(n/60),s=n%60;return s===0?r+String(i):r+String(i)+t+_(s,2)}function zt(e,t){return e%60===0?(e>0?"-":"+")+_(Math.abs(e)/60,2):z(e,t)}function z(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=_(Math.trunc(n/60),2),s=_(n%60,2);return r+i+t+s}const Bt=(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"})}},Lr=(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"})}},Ai=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],i=r[2];if(!i)return Bt(e,t);let s;switch(n){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Bt(n,t)).replace("{{time}}",Lr(i,t))},Hi={p:Lr,P:Ai},Fi=/^D+$/,qi=/^Y+$/,Wi=["D","DD","YY","YYYY"];function Li(e){return Fi.test(e)}function Ui(e){return qi.test(e)}function ji(e,t,r){const n=Vi(e,t,r);if(console.warn(n),Wi.includes(e))throw new RangeError(n)}function Vi(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 zi=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Bi=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Xi=/^'([^]*?)'?$/,$i=/''/g,Qi=/[a-zA-Z]/;function Ur(e,t,r){var p,h,g,x,P,I,C,W;const n=de(),i=(r==null?void 0:r.locale)??n.locale??Ri,s=(r==null?void 0:r.firstWeekContainsDate)??((h=(p=r==null?void 0:r.locale)==null?void 0:p.options)==null?void 0:h.firstWeekContainsDate)??n.firstWeekContainsDate??((x=(g=n.locale)==null?void 0:g.options)==null?void 0:x.firstWeekContainsDate)??1,c=(r==null?void 0:r.weekStartsOn)??((I=(P=r==null?void 0:r.locale)==null?void 0:P.options)==null?void 0:I.weekStartsOn)??n.weekStartsOn??((W=(C=n.locale)==null?void 0:C.options)==null?void 0:W.weekStartsOn)??0,d=M(e,r==null?void 0:r.in);if(!Ka(d))throw new RangeError("Invalid time value");let m=t.match(Bi).map(O=>{const b=O[0];if(b==="p"||b==="P"){const L=Hi[b];return L(O,i.formatLong)}return O}).join("").match(zi).map(O=>{if(O==="''")return{isToken:!1,value:"'"};const b=O[0];if(b==="'")return{isToken:!1,value:Zi(O)};if(jt[b])return{isToken:!0,value:O};if(b.match(Qi))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:O}});i.localize.preprocessor&&(m=i.localize.preprocessor(d,m));const f={firstWeekContainsDate:s,weekStartsOn:c,locale:i};return m.map(O=>{if(!O.isToken)return O.value;const b=O.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&Ui(b)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&Li(b))&&ji(b,t,String(e));const L=jt[b[0]];return L(d,b,i.localize,f)}).join("")}function Zi(e){const t=e.match(Xi);return t?t[1].replace($i,"'"):e}function Ki(e,t){const r=M(e,t==null?void 0:t.in),n=r.getFullYear(),i=r.getMonth(),s=R(r,0);return s.setFullYear(n,i+1,0),s.setHours(0,0,0,0),s.getDate()}function Ji(){return Object.assign({},de())}function Xt(e){return+M(e)}function $t(e){return Math.trunc(+M(e)/1e3)}function es(e){return Math.trunc(e*Va)}function ts(e){const t=e/ja;return Math.trunc(t)}function jr(e,t,r){return za(e,-1,r)}function Qt(e,t,r){const n=Ji(),i=as(e,r.timeZone,r.locale??n.locale);return"formatToParts"in i?rs(i,t):ns(i,t)}function rs(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 ns(e,t){const r=e.format(t).replace(/\u200E/g,""),n=/ [\w-+ ]+$/.exec(r);return n?n[0].substr(1):""}function as(e,t,r){return new Intl.DateTimeFormat(r?[r.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function is(e,t){const r=ls(t);return"formatToParts"in r?os(r,e):us(r,e)}const ss={year:0,month:1,day:2,hour:3,minute:4,second:5};function os(e,t){try{const r=e.formatToParts(t),n=[];for(let i=0;i<r.length;i++){const s=ss[r[i].type];s!==void 0&&(n[s]=parseInt(r[i].value,10))}return n}catch(r){if(r instanceof RangeError)return[NaN];throw r}}function us(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 Ue={},Zt=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")),cs=Zt==="06/25/2014, 00:00:00"||Zt==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function ls(e){return Ue[e]||(Ue[e]=cs?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"})),Ue[e]}function nt(e,t,r,n,i,s,c){const d=new Date(0);return d.setUTCFullYear(e,t,r),d.setUTCHours(n,i,s,c),d}const Kt=36e5,ds=6e4,je={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function fe(e,t,r){if(!e)return 0;let n=je.timezoneZ.exec(e);if(n)return 0;let i,s;if(n=je.timezoneHH.exec(e),n)return i=parseInt(n[1],10),Jt(i)?-(i*Kt):NaN;if(n=je.timezoneHHMM.exec(e),n){i=parseInt(n[2],10);const c=parseInt(n[3],10);return Jt(i,c)?(s=Math.abs(i)*Kt+c*ds,n[1]==="+"?-s:s):NaN}if(hs(e)){t=new Date(t||Date.now());const c=r?t:fs(t),d=Xe(c,e);return-(r?d:ms(t,d,e))}return NaN}function fs(e){return nt(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function Xe(e,t){const r=is(e,t),n=nt(r[0],r[1]-1,r[2],r[3]%24,r[4],r[5],0).getTime();let i=e.getTime();const s=i%1e3;return i-=s>=0?s:1e3+s,n-i}function ms(e,t,r){let i=e.getTime()-t;const s=Xe(new Date(i),r);if(t===s)return t;i-=s-t;const c=Xe(new Date(i),r);return s===c?s:Math.max(s,c)}function Jt(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const er={};function hs(e){if(er[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),er[e]=!0,!0}catch{return!1}}const ys=60*1e3,gs={X:function(e,t,r){const n=Ve(r.timeZone,e);if(n===0)return"Z";switch(t){case"X":return tr(n);case"XXXX":case"XX":return K(n);case"XXXXX":case"XXX":default:return K(n,":")}},x:function(e,t,r){const n=Ve(r.timeZone,e);switch(t){case"x":return tr(n);case"xxxx":case"xx":return K(n);case"xxxxx":case"xxx":default:return K(n,":")}},O:function(e,t,r){const n=Ve(r.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+ps(n,":");case"OOOO":default:return"GMT"+K(n,":")}},z:function(e,t,r){switch(t){case"z":case"zz":case"zzz":return Qt("short",e,r);case"zzzz":default:return Qt("long",e,r)}}};function Ve(e,t){const r=e?fe(e,t,!0)/ys:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(r))throw new RangeError("Invalid time zone specified: "+e);return r}function Me(e,t){const r=e<0?"-":"";let n=Math.abs(e).toString();for(;n.length<t;)n="0"+n;return r+n}function K(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Me(Math.floor(n/60),2),s=Me(Math.floor(n%60),2);return r+i+t+s}function tr(e,t){return e%60===0?(e>0?"-":"+")+Me(Math.abs(e)/60,2):K(e,t)}function ps(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),s=n%60;return s===0?r+String(i):r+String(i)+t+Me(s,2)}function rr(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 Vr=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,ze=36e5,nr=6e4,_s=2,S={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,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:Vr};function Oe(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?_s: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=ws(e),{year:i,restDateString:s}=Ts(n.date,r),c=bs(s,i);if(c===null||isNaN(c.getTime()))return new Date(NaN);if(c){const d=c.getTime();let m=0,f;if(n.time&&(m=Ds(n.time),m===null||isNaN(m)))return new Date(NaN);if(n.timeZone||t.timeZone){if(f=fe(n.timeZone||t.timeZone,new Date(d+m)),isNaN(f))return new Date(NaN)}else f=rr(new Date(d+m)),f=rr(new Date(d+m+f));return new Date(d+m+f)}else return new Date(NaN)}function ws(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 Ts(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 s=i[1];return{year:parseInt(s,10),restDateString:e.slice(s.length)}}if(i=S.YY.exec(e)||r.exec(e),i){const s=i[1];return{year:parseInt(s,10)*100,restDateString:e.slice(s.length)}}}return{year:null}}function bs(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 s=S.MM.exec(e);if(s)return r=new Date(0),n=parseInt(s[1],10)-1,ir(t,n)?(r.setUTCFullYear(t,n),r):new Date(NaN);if(s=S.DDD.exec(e),s){r=new Date(0);const c=parseInt(s[1],10);return Ss(t,c)?(r.setUTCFullYear(t,0,c),r):new Date(NaN)}if(s=S.MMDD.exec(e),s){r=new Date(0),n=parseInt(s[1],10)-1;const c=parseInt(s[2],10);return ir(t,n,c)?(r.setUTCFullYear(t,n,c),r):new Date(NaN)}if(s=S.Www.exec(e),s)return i=parseInt(s[1],10)-1,sr(i)?ar(t,i):new Date(NaN);if(s=S.WwwD.exec(e),s){i=parseInt(s[1],10)-1;const c=parseInt(s[2],10)-1;return sr(i,c)?ar(t,i,c):new Date(NaN)}return null}function Ds(e){let t,r,n=S.HH.exec(e);if(n)return t=parseFloat(n[1].replace(",",".")),Be(t)?t%24*ze:NaN;if(n=S.HHMM.exec(e),n)return t=parseInt(n[1],10),r=parseFloat(n[2].replace(",",".")),Be(t,r)?t%24*ze+r*nr: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 Be(t,r,i)?t%24*ze+r*nr+i*1e3:NaN}return null}function ar(e,t,r){t=t||0,r=r||0;const n=new Date(0);n.setUTCFullYear(e,0,4);const i=n.getUTCDay()||7,s=t*7+r+1-i;return n.setUTCDate(n.getUTCDate()+s),n}const Ms=[31,28,31,30,31,30,31,31,30,31,30,31],Os=[31,29,31,30,31,30,31,31,30,31,30,31];function zr(e){return e%400===0||e%4===0&&e%100!==0}function ir(e,t,r){if(t<0||t>11)return!1;if(r!=null){if(r<1)return!1;const n=zr(e);if(n&&r>Os[t]||!n&&r>Ms[t])return!1}return!0}function Ss(e,t){if(t<1)return!1;const r=zr(e);return!(r&&t>366||!r&&t>365)}function sr(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Be(e,t,r){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||r!=null&&(r<0||r>=60))}const vs=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Es(e,t,r={}){t=String(t);const n=t.match(vs);if(n){const i=Oe(r.originalDate||e,r);t=n.reduce(function(s,c){if(c[0]==="'")return s;const d=s.indexOf(c),m=s[d-1]==="'",f=s.replace(c,"'"+gs[c[0]](i,c,r)+"'");return m?f.substring(0,d-1)+f.substring(d+1):f},t)}return Ur(e,t,r)}function Br(e,t,r){e=Oe(e,r);const n=fe(t,e,!0),i=new Date(e.getTime()-n),s=new Date(0);return s.setFullYear(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),s.setHours(i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()),s}function xs(e,t,r,n){return n={...n,timeZone:t,originalDate:e},Es(Br(e,t,{timeZone:n.timeZone}),r,n)}function Ns(e,t,r){if(typeof e=="string"&&!e.match(Vr))return Oe(e,{...r,timeZone:t});e=Oe(e,r);const n=nt(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),i=fe(t,new Date(n));return new Date(n+i)}function Xr(e,t){return-fe(e,t)}function Ps(e){return Ur(e,"yyyy-MM-dd'T'HH:mm:ss.SSSXXX")}function $e(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 xs(i,r,n)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}function Is(e,t){return`${$e(e.getTime())} - ${$e(t.getTime(),{includeTZ:!0})}`}const ie={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 Rs(e,t){return e.map(r=>({value:r,label:t.t(`configuration.vitals.reports.granularity.${r}`)}))}function $r(e,t){return{duration:e,type:"duration",origin:t}}function Cs(e){return e&&Qe.find(r=>e<=ie[r])||null}function Qr(e,t,r,n){const i=ie[r];let s=0;return i>=ie.daily&&(n?s=-Xr(n,t):s=t.getTimezoneOffset()*60*1e3),new Date(e((t.getTime()-s)/i)*i+s)}function Zr(e,t,r){return Qr(Math.floor,e,t,r)}function at(e,t,r){return Qr(Math.ceil,e,t,r)}class xe{constructor(t,r,n){T(this,"timeframe");T(this,"tz");T(this,"dataGranularity");if(this.constructor===xe)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(),s=this.timeframe.rawStart(this.tz),c=Zr(s,r,this.tz),m=(i.getTime()-c.getTime())*(n-1);return new Date(c.getTime()-m)}}granularitySeconds(){return Math.floor(this.granularityMs()/1e3)}granularityDruid(){return $r(this.granularityMs(),this.startDate().toISOString())}startSeconds(){return $t(this.startDate())}endSeconds(){return $t(this.endDate())}startMs(){return Xt(this.startDate())}endMs(){return Xt(this.endDate())}}class ks extends xe{constructor(r,n,i,s,c){super(r,i,s);T(this,"granularity");n&&r.allowedGranularities(c).has(n)?this.granularity=n:c?this.granularity=r.fineGrainedDefaultGranularity??r.defaultResponseGranularity:this.granularity=r.defaultResponseGranularity}startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.granularity)}endDate(){return at(this.timeframe.rawEnd(),this.granularity,this.tz)}granularityMs(){return ie[this.granularity]}}class Kr extends xe{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity)}endDate(){return at(this.timeframe.rawEnd(this.tz),this.dataGranularity,this.tz)}granularityMs(){return this.endDate().getTime()-this.startDate().getTime()}}class Ys extends Kr{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity,2)}granularityMs(){return this.endDate().getTime()-super.startDate().getTime()}}var Te=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Gs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Se={exports:{}};Se.exports;(function(e,t){var r=200,n="__lodash_hash_undefined__",i=9007199254740991,s="[object Arguments]",c="[object Array]",d="[object Boolean]",m="[object Date]",f="[object Error]",p="[object Function]",h="[object GeneratorFunction]",g="[object Map]",x="[object Number]",P="[object Object]",I="[object Promise]",C="[object RegExp]",W="[object Set]",O="[object String]",b="[object Symbol]",L="[object WeakMap]",st="[object ArrayBuffer]",me="[object DataView]",ot="[object Float32Array]",ut="[object Float64Array]",ct="[object Int8Array]",lt="[object Int16Array]",dt="[object Int32Array]",ft="[object Uint8Array]",mt="[object Uint8ClampedArray]",ht="[object Uint16Array]",yt="[object Uint32Array]",tn=/[\\^$.*+?()[\]{}|]/g,rn=/\w*$/,nn=/^\[object .+?Constructor\]$/,an=/^(?:0|[1-9]\d*)$/,w={};w[s]=w[c]=w[st]=w[me]=w[d]=w[m]=w[ot]=w[ut]=w[ct]=w[lt]=w[dt]=w[g]=w[x]=w[P]=w[C]=w[W]=w[O]=w[b]=w[ft]=w[mt]=w[ht]=w[yt]=!0,w[f]=w[p]=w[L]=!1;var sn=typeof Te=="object"&&Te&&Te.Object===Object&&Te,on=typeof self=="object"&&self&&self.Object===Object&&self,k=sn||on||Function("return this")(),gt=t&&!t.nodeType&&t,pt=gt&&!0&&e&&!e.nodeType&&e,un=pt&&pt.exports===gt;function cn(a,o){return a.set(o[0],o[1]),a}function ln(a,o){return a.add(o),a}function dn(a,o){for(var u=-1,l=a?a.length:0;++u<l&&o(a[u],u,a)!==!1;);return a}function fn(a,o){for(var u=-1,l=o.length,D=a.length;++u<l;)a[D+u]=o[u];return a}function _t(a,o,u,l){for(var D=-1,v=a?a.length:0;++D<v;)u=o(u,a[D],D,a);return u}function mn(a,o){for(var u=-1,l=Array(a);++u<a;)l[u]=o(u);return l}function hn(a,o){return a==null?void 0:a[o]}function wt(a){var o=!1;if(a!=null&&typeof a.toString!="function")try{o=!!(a+"")}catch{}return o}function Tt(a){var o=-1,u=Array(a.size);return a.forEach(function(l,D){u[++o]=[D,l]}),u}function Pe(a,o){return function(u){return a(o(u))}}function bt(a){var o=-1,u=Array(a.size);return a.forEach(function(l){u[++o]=l}),u}var yn=Array.prototype,gn=Function.prototype,he=Object.prototype,Ie=k["__core-js_shared__"],Dt=function(){var a=/[^.]+$/.exec(Ie&&Ie.keys&&Ie.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""}(),Mt=gn.toString,H=he.hasOwnProperty,ye=he.toString,pn=RegExp("^"+Mt.call(H).replace(tn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ot=un?k.Buffer:void 0,St=k.Symbol,vt=k.Uint8Array,_n=Pe(Object.getPrototypeOf,Object),wn=Object.create,Tn=he.propertyIsEnumerable,bn=yn.splice,Et=Object.getOwnPropertySymbols,Dn=Ot?Ot.isBuffer:void 0,Mn=Pe(Object.keys,Object),Re=$(k,"DataView"),te=$(k,"Map"),Ce=$(k,"Promise"),ke=$(k,"Set"),Ye=$(k,"WeakMap"),re=$(Object,"create"),On=V(Re),Sn=V(te),vn=V(Ce),En=V(ke),xn=V(Ye),xt=St?St.prototype:void 0,Nt=xt?xt.valueOf:void 0;function U(a){var o=-1,u=a?a.length:0;for(this.clear();++o<u;){var l=a[o];this.set(l[0],l[1])}}function Nn(){this.__data__=re?re(null):{}}function Pn(a){return this.has(a)&&delete this.__data__[a]}function In(a){var o=this.__data__;if(re){var u=o[a];return u===n?void 0:u}return H.call(o,a)?o[a]:void 0}function Rn(a){var o=this.__data__;return re?o[a]!==void 0:H.call(o,a)}function Cn(a,o){var u=this.__data__;return u[a]=re&&o===void 0?n:o,this}U.prototype.clear=Nn,U.prototype.delete=Pn,U.prototype.get=In,U.prototype.has=Rn,U.prototype.set=Cn;function Y(a){var o=-1,u=a?a.length:0;for(this.clear();++o<u;){var l=a[o];this.set(l[0],l[1])}}function kn(){this.__data__=[]}function Yn(a){var o=this.__data__,u=ge(o,a);if(u<0)return!1;var l=o.length-1;return u==l?o.pop():bn.call(o,u,1),!0}function Gn(a){var o=this.__data__,u=ge(o,a);return u<0?void 0:o[u][1]}function An(a){return ge(this.__data__,a)>-1}function Hn(a,o){var u=this.__data__,l=ge(u,a);return l<0?u.push([a,o]):u[l][1]=o,this}Y.prototype.clear=kn,Y.prototype.delete=Yn,Y.prototype.get=Gn,Y.prototype.has=An,Y.prototype.set=Hn;function B(a){var o=-1,u=a?a.length:0;for(this.clear();++o<u;){var l=a[o];this.set(l[0],l[1])}}function Fn(){this.__data__={hash:new U,map:new(te||Y),string:new U}}function qn(a){return pe(this,a).delete(a)}function Wn(a){return pe(this,a).get(a)}function Ln(a){return pe(this,a).has(a)}function Un(a,o){return pe(this,a).set(a,o),this}B.prototype.clear=Fn,B.prototype.delete=qn,B.prototype.get=Wn,B.prototype.has=Ln,B.prototype.set=Un;function X(a){this.__data__=new Y(a)}function jn(){this.__data__=new Y}function Vn(a){return this.__data__.delete(a)}function zn(a){return this.__data__.get(a)}function Bn(a){return this.__data__.has(a)}function Xn(a,o){var u=this.__data__;if(u instanceof Y){var l=u.__data__;if(!te||l.length<r-1)return l.push([a,o]),this;u=this.__data__=new B(l)}return u.set(a,o),this}X.prototype.clear=jn,X.prototype.delete=Vn,X.prototype.get=zn,X.prototype.has=Bn,X.prototype.set=Xn;function $n(a,o){var u=He(a)||wa(a)?mn(a.length,String):[],l=u.length,D=!!l;for(var v in a)H.call(a,v)&&!(D&&(v=="length"||ya(v,l)))&&u.push(v);return u}function Pt(a,o,u){var l=a[o];(!(H.call(a,o)&&kt(l,u))||u===void 0&&!(o in a))&&(a[o]=u)}function ge(a,o){for(var u=a.length;u--;)if(kt(a[u][0],o))return u;return-1}function Qn(a,o){return a&&It(o,Fe(o),a)}function Ge(a,o,u,l,D,v,G){var E;if(l&&(E=v?l(a,D,v,G):l(a)),E!==void 0)return E;if(!_e(a))return a;var At=He(a);if(At){if(E=fa(a),!o)return ca(a,E)}else{var Q=j(a),Ht=Q==p||Q==h;if(ba(a))return ra(a,o);if(Q==P||Q==s||Ht&&!v){if(wt(a))return v?a:{};if(E=ma(Ht?{}:a),!o)return la(a,Qn(E,a))}else{if(!w[Q])return v?a:{};E=ha(a,Q,Ge,o)}}G||(G=new X);var Ft=G.get(a);if(Ft)return Ft;if(G.set(a,E),!At)var qt=u?da(a):Fe(a);return dn(qt||a,function(qe,we){qt&&(we=qe,qe=a[we]),Pt(E,we,Ge(qe,o,u,l,we,a,G))}),E}function Zn(a){return _e(a)?wn(a):{}}function Kn(a,o,u){var l=o(a);return He(a)?l:fn(l,u(a))}function Jn(a){return ye.call(a)}function ea(a){if(!_e(a)||pa(a))return!1;var o=Gt(a)||wt(a)?pn:nn;return o.test(V(a))}function ta(a){if(!Ct(a))return Mn(a);var o=[];for(var u in Object(a))H.call(a,u)&&u!="constructor"&&o.push(u);return o}function ra(a,o){if(o)return a.slice();var u=new a.constructor(a.length);return a.copy(u),u}function Ae(a){var o=new a.constructor(a.byteLength);return new vt(o).set(new vt(a)),o}function na(a,o){var u=o?Ae(a.buffer):a.buffer;return new a.constructor(u,a.byteOffset,a.byteLength)}function aa(a,o,u){var l=o?u(Tt(a),!0):Tt(a);return _t(l,cn,new a.constructor)}function ia(a){var o=new a.constructor(a.source,rn.exec(a));return o.lastIndex=a.lastIndex,o}function sa(a,o,u){var l=o?u(bt(a),!0):bt(a);return _t(l,ln,new a.constructor)}function oa(a){return Nt?Object(Nt.call(a)):{}}function ua(a,o){var u=o?Ae(a.buffer):a.buffer;return new a.constructor(u,a.byteOffset,a.length)}function ca(a,o){var u=-1,l=a.length;for(o||(o=Array(l));++u<l;)o[u]=a[u];return o}function It(a,o,u,l){u||(u={});for(var D=-1,v=o.length;++D<v;){var G=o[D],E=void 0;Pt(u,G,E===void 0?a[G]:E)}return u}function la(a,o){return It(a,Rt(a),o)}function da(a){return Kn(a,Fe,Rt)}function pe(a,o){var u=a.__data__;return ga(o)?u[typeof o=="string"?"string":"hash"]:u.map}function $(a,o){var u=hn(a,o);return ea(u)?u:void 0}var Rt=Et?Pe(Et,Object):Oa,j=Jn;(Re&&j(new Re(new ArrayBuffer(1)))!=me||te&&j(new te)!=g||Ce&&j(Ce.resolve())!=I||ke&&j(new ke)!=W||Ye&&j(new Ye)!=L)&&(j=function(a){var o=ye.call(a),u=o==P?a.constructor:void 0,l=u?V(u):void 0;if(l)switch(l){case On:return me;case Sn:return g;case vn:return I;case En:return W;case xn:return L}return o});function fa(a){var o=a.length,u=a.constructor(o);return o&&typeof a[0]=="string"&&H.call(a,"index")&&(u.index=a.index,u.input=a.input),u}function ma(a){return typeof a.constructor=="function"&&!Ct(a)?Zn(_n(a)):{}}function ha(a,o,u,l){var D=a.constructor;switch(o){case st:return Ae(a);case d:case m:return new D(+a);case me:return na(a,l);case ot:case ut:case ct:case lt:case dt:case ft:case mt:case ht:case yt:return ua(a,l);case g:return aa(a,l,u);case x:case O:return new D(a);case C:return ia(a);case W:return sa(a,l,u);case b:return oa(a)}}function ya(a,o){return o=o??i,!!o&&(typeof a=="number"||an.test(a))&&a>-1&&a%1==0&&a<o}function ga(a){var o=typeof a;return o=="string"||o=="number"||o=="symbol"||o=="boolean"?a!=="__proto__":a===null}function pa(a){return!!Dt&&Dt in a}function Ct(a){var o=a&&a.constructor,u=typeof o=="function"&&o.prototype||he;return a===u}function V(a){if(a!=null){try{return Mt.call(a)}catch{}try{return a+""}catch{}}return""}function _a(a){return Ge(a,!0,!0)}function kt(a,o){return a===o||a!==a&&o!==o}function wa(a){return Ta(a)&&H.call(a,"callee")&&(!Tn.call(a,"callee")||ye.call(a)==s)}var He=Array.isArray;function Yt(a){return a!=null&&Da(a.length)&&!Gt(a)}function Ta(a){return Ma(a)&&Yt(a)}var ba=Dn||Sa;function Gt(a){var o=_e(a)?ye.call(a):"";return o==p||o==h}function Da(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=i}function _e(a){var o=typeof a;return!!a&&(o=="object"||o=="function")}function Ma(a){return!!a&&typeof a=="object"}function Fe(a){return Yt(a)?$n(a):ta(a)}function Oa(){return[]}function Sa(){return!1}e.exports=_a})(Se,Se.exports);var As=Se.exports;const Hs=Gs(As),ee=(e,t)=>new Date(e.getTime()-Xr(t,e));class N{constructor(t){T(this,"timeframeText");T(this,"key");T(this,"display");T(this,"timeframeLength");T(this,"allowedTiers");T(this,"defaultResponseGranularity");T(this,"dataGranularity");T(this,"isRelative");T(this,"fineGrainedDefaultGranularity");T(this,"_startCustom");T(this,"_endCustom");T(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=Ns(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Br(r,t)}}class Fs extends N{rawStart(t){let r=A(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(r=ee(r,t)),r}maximumTimeframeLength(){return 60*60*24*7}}class qs extends N{rawStart(t){let r=J(this.tzAdjustedDate(t));return t&&(r=ee(r,t)),r}maximumTimeframeLength(){return 60*60*24*31}}class Ws extends N{rawEnd(t){let r=A(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(r=ee(r,t)),r}rawStart(t){const r=this.tzAdjustedDate(t);let n=A(r.setDate(r.getDate()-7),{weekStartsOn:1});return t&&(n=ee(n,t)),n}}class Ls extends N{rawEnd(t){let r=J(this.tzAdjustedDate(t));return t&&(r=ee(r,t)),r}rawStart(t){let r=J(jr(this.tzAdjustedDate(t)));return t&&(r=ee(r,t)),r}}const Jr=new Map([[y.FIFTEEN_MIN,new N({key:y.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"]})],[y.ONE_HOUR,new N({key:y.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"]})],[y.SIX_HOUR,new N({key:y.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"]})],[y.TWELVE_HOUR,new N({key:y.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"]})],[y.ONE_DAY,new N({key:y.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"]})],[y.SEVEN_DAY,new N({key:y.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"]})],[y.THIRTY_DAY,new N({key:y.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"]})],[y.CURRENT_WEEK,new Fs({key:y.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const e=A(new Date,{weekStartsOn:1});return(De(Lt(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[y.CURRENT_MONTH,new qs({key:y.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const e=J(new Date);return(De(Lt(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})],[y.PREVIOUS_WEEK,new Ws({key:y.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"]})],[y.PREVIOUS_MONTH,new Ls({key:y.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=J(new Date),r=J(jr(new Date));return t.getTimezoneOffset()!==r.getTimezoneOffset()&&(e=en(t,r)),60*60*24*Ki(new Date().setMonth(new Date().getMonth()-1))+es(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})]]);function Us(e){const t=new Date(e.start),r=new Date(e.end),n=(r.getTime()-t.getTime())/1e3;return e.timePeriodsKey&&Hs(Jr.get(e.timePeriodsKey))||new N({key:"custom",timeframeText:"custom",display:"custom",startCustom:t,endCustom:r,timeframeLength:()=>n,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["free","plus","enterprise"]})}function js(e){return{...e.key!=="custom"&&{timePeriodsKey:e.key},start:e.rawStart(),end:e.rawEnd()}}function Vs(e){return{key:e.key,display:e.display,timeframeText:e.timeframeText,timeframeLength:()=>e.key,start:()=>e.rawStart(),end:()=>e.rawEnd()}}function en(e,t){return ts(e.getTimezoneOffset()-t.getTimezoneOffset())}const zs={"15M":y.FIFTEEN_MIN,"1H":y.ONE_HOUR,"6H":y.SIX_HOUR,"12H":y.TWELVE_HOUR,"24H":y.ONE_DAY,"7D":y.SEVEN_DAY,"15m":y.FIFTEEN_MIN,"1h":y.ONE_HOUR,"6h":y.SIX_HOUR,"12h":y.TWELVE_HOUR,"24h":y.ONE_DAY,"7d":y.SEVEN_DAY,"30d":y.THIRTY_DAY,current_week:y.CURRENT_WEEK,current_month:y.CURRENT_MONTH,previous_week:y.PREVIOUS_WEEK,previous_month:y.PREVIOUS_MONTH};class Ne{constructor(t){T(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 Bs=(e,t,r)=>{const n=it(10,1e4),i=new Ne(n),s=Date.now()-6*60*60*1e3,c=Date.now(),d=[];let m=0;for(let h=s;h<=c;h+=60*60*1e3)if(t)for(const g in t)t[g].forEach(x=>{m+=i.next(50,500);const P={[g]:x,[e.name]:m},I={version:"1.0",timestamp:new Date(h).toISOString(),event:P};d.push(I)});else{m+=i.next(50,500);const g={version:"1.0",timestamp:new Date(h).toISOString(),event:{[e.name]:m}};d.push(g)}const f={};if(t)for(const h in t)f[h]={},t[h].forEach(g=>{f[h][g]={name:g,deleted:!1}});const p={start_ms:s,end_ms:c,start:new Date(s).toISOString(),end:new Date(c).toISOString(),query_id:"12345",metric_names:[e.name],metric_units:{[e.name]:e.unit},granularity_ms:60*60*1e3,display:f,...r??{}};return{data:d,meta:p}},Xs=(e,t)=>{const r=it(10,1e4),n=new Ne(r),i=Date.now()-6*60*60*1e3,s=Date.now(),c=[],d={};e.forEach(f=>{d[f.name]=0});for(let f=i;f<=s;f+=60*60*1e3){const p={};e.forEach(g=>{d[g.name]+=n.next(50,500),p[g.name]=d[g.name]});const h={version:"1.0",timestamp:new Date(f).toISOString(),event:p};c.push(h)}const m={start_ms:i,end_ms:s,start:new Date(i).toISOString(),end:new Date(s).toISOString(),query_id:"12345",metric_names:e.map(f=>f.name),metric_units:e.reduce((f,p)=>(f[p.name]=p.unit,f),{}),granularity_ms:60*60*1e3,display:{},...t??{}};return{data:c,meta:m}},$s=(e,t,r)=>{const n=Math.floor(Math.random()*9991)+10,i=new Ne(n),s=Date.now()-6*60*60*1e3,c=Date.now(),d=new Date((s+c)/2).toISOString(),m=[];if(t){const h=Object.keys(t),g=Object.values(t),x=(P,I)=>{if(I===h.length){e.forEach(C=>{P[C.name]=i.next(1e3,5e7)}),m.push({version:"1.0",timestamp:new Date().toISOString(),event:{...P}});return}g[I].forEach(C=>{x({...P,[h[I]]:C},I+1)})};x({},0)}else{const h={};e.forEach(g=>{h[g.name]=i.next(50,500)}),m.push({version:"1.0",timestamp:d,event:h})}const f={};if(t)for(const h in t)f[h]={},t[h].forEach(g=>{f[h][g]={name:g,deleted:!1}});const p={start_ms:s,end_ms:c,start:new Date(s).toISOString(),end:new Date(c).toISOString(),query_id:"12345",metric_names:e.map(h=>h.name),metric_units:e.reduce((h,g)=>(h[g.name]=g.unit,h),{}),truncated:!1,limit:50,display:f,granularity_ms:c-s,...r??{}};return{data:m,meta:p}};function it(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1)+e)}function Qs({buildQuery:e,defaultLimit:t=or,injectKey:r}){const n=We.inject(r??ur);if(!(n!=null&&n.queryFn))throw new Error("useAnalyticsRequestExport: missing injected query bridge.");const i=We.ref({status:"loading"});let s=null;const c=()=>{s==null||s.abort(),s=null},d=()=>{i.value={status:"loading"}};We.onUnmounted(c);async function m(f=t){i.value={status:"loading"},s==null||s.abort(),s=new AbortController;try{if(n){const p=e(f),h=await n.queryFn(p,s);h&&(i.value={status:"success",chartData:h})}}catch(p){i.value={status:"error",error:p}}}return{exportState:i,requestExport:m,cancelExport:c,resetExport:d}}exports.DeltaQueryTime=Ys;exports.EXPORT_RECORD_LIMIT=or;exports.Granularities=ie;exports.INJECT_QUERY_PROVIDER=ur;exports.REFRESH_INTERVAL_MS=xa;exports.SeededRandom=Ne;exports.TIMEFRAME_LOOKUP=zs;exports.TimePeriods=Jr;exports.Timeframe=N;exports.TimeframeKeys=y;exports.TimeseriesQueryTime=ks;exports.UnaryQueryTime=Kr;exports.aiExploreAggregations=mr;exports.apiUsageQuerySchema=Rr;exports.barChartSchema=Or;exports.basicExploreAggregations=Ze;exports.basicQuerySchema=Cr;exports.ceilToNearestTimeGrain=at;exports.choroplethMapSchema=Ir;exports.countryISOA2=Tr;exports.dashboardConfigSchema=Wa;exports.dashboardTileTypes=Ha;exports.datasourceToFilterableDimensions=wr;exports.datePickerSelectionToTimeframe=Us;exports.donutChartSchema=Er;exports.dstOffsetHours=en;exports.exploreAggregations=fr;exports.exploreFilterTypesV2=cr;exports.filterableAiExploreDimensions=ce;exports.filterableBasicExploreDimensions=oe;exports.filterableExploreDimensions=ue;exports.filterableRequestDimensions=yr;exports.filterableRequestMetrics=_r;exports.filterableRequestWildcardDimensions=ka;exports.floorToNearestTimeGrain=Zr;exports.formatISOTimeWithTZ=Ps;exports.formatTime=$e;exports.formatTimeRange=Is;exports.gaugeChartSchema=vr;exports.generateCrossSectionalData=$s;exports.generateMultipleMetricTimeSeriesData=Xs;exports.generateSingleMetricTimeSeriesData=Bs;exports.getFieldDataSources=La;exports.granularitiesToOptions=Rs;exports.granularityMsToQuery=$r;exports.granularityValues=Qe;exports.llmUsageSchema=kr;exports.metricCardSchema=Nr;exports.msToGranularity=Cs;exports.queryDatasources=Ga;exports.queryableAiExploreDimensions=Je;exports.queryableBasicExploreDimensions=ve;exports.queryableExploreDimensions=Ke;exports.queryableRequestDimensions=hr;exports.queryableRequestMetrics=pr;exports.queryableRequestWildcardDimensions=gr;exports.rand=it;exports.relativeTimeRangeValuesRequestV2=Ya;exports.relativeTimeRangeValuesV4=dr;exports.reportChartTypes=Na;exports.requestFilterTypeEmptyV2=lr;exports.requestFilterTypeEqualsV2=Pa;exports.requestFilterTypeMetricV2=Ia;exports.requestFilterTypeWildcardV2=Ra;exports.singleValueSchema=Pr;exports.slottableSchema=Mr;exports.stripUnknownFilters=Aa;exports.tileConfigSchema=Hr;exports.tileDefinitionSchema=Gr;exports.tileLayoutSchema=Ar;exports.timeRangeTypeV2=Ca;exports.timeframeToDatepickerSelection=js;exports.timeframeToDatepickerTimeperiod=Vs;exports.timeseriesChartSchema=Sr;exports.topNTableSchema=xr;exports.useAnalyticsRequestExport=Qs;exports.validDashboardQuery=Yr;
2
2
  //# sourceMappingURL=vitals-utilities.cjs.map