@kong-ui-public/analytics-utilities 10.1.4 → 10.1.6-pr.2346.6852d85bd.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.
- package/dist/types/dashboardSchemaZod.v2.d.ts +1962 -0
- package/dist/types/dashboardSchemaZod.v2.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/vitals-utilities.cjs +18 -1
- package/dist/vitals-utilities.cjs.map +1 -1
- package/dist/vitals-utilities.es.js +3914 -1905
- package/dist/vitals-utilities.es.js.map +1 -1
- package/dist/vitals-utilities.umd.js +18 -1
- package/dist/vitals-utilities.umd.js.map +1 -1
- package/package.json +5 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboardSchemaZod.v2.d.ts","sourceRoot":"","sources":["../../src/dashboardSchemaZod.v2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAiBvB,eAAO,MAAM,kBAAkB,4JAWrB,CAAA;AACV,MAAM,MAAM,iBAAiB,GAAG,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAA;AAWjE,eAAO,MAAM,gBAAgB;;;kBAGlB,CAAA;AACX,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAE/D,eAAO,MAAM,eAAe;;;;;;;;;;kBAOjB,CAAA;AACX,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA;AAE7D,eAAO,MAAM,sBAAsB;;;;;;;;;;;kBAQxB,CAAA;AACX,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAE3E,eAAO,MAAM,iBAAiB;;;;;;;;;;;kBAOnB,CAAA;AACX,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAEjE,eAAO,MAAM,iBAAiB;;;;kBAInB,CAAA;AACX,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAEjE,eAAO,MAAM,gBAAgB;;;;;;kBAMlB,CAAA;AACX,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAE/D,eAAO,MAAM,iBAAiB;;;;;;kBAMnB,CAAA;AACX,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAEjE,eAAO,MAAM,kBAAkB;;;;kBAIpB,CAAA;AACX,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAkDnE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAKhB,CAAA;AACX,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAKb,CAAA;AACX,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAKhB,CAAA;AAEX,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAAyD,CAAA;AAC1F,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAGtE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAYjB,CAAA;AACX,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA;AAE5D,eAAO,MAAM,WAAW;;;;;;;;;;kBAUb,CAAA;AACX,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA;AAEpD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAKb,CAAA;AACX,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA;AAEpD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBASlB,CAAA;AACX,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAE9D,eAAO,MAAM,oBAAoB,GAAI,OAAO,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAkC,CAAA"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,OAAO,KAAK,kBAAkB,MAAM,mBAAmB,CAAA;AACvD,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,OAAO,KAAK,kBAAkB,MAAM,mBAAmB,CAAA;AACvD,cAAc,yBAAyB,CAAA;AACvC,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA"}
|
|
@@ -1,2 +1,19 @@
|
|
|
1
|
-
"use strict";var Ua=Object.defineProperty;var za=(e,t,r)=>t in e?Ua(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var b=(e,t,r)=>za(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $a=30*1e3;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 Va=["horizontal_bar","vertical_bar","timeseries_line","choropleth_map","timeseries_bar","donut","single_value"],rt=["in","not_in","selector"],Qa=["=","!="],Xa=["=","!=","<",">","<=",">="],nt=["empty","not_empty"],Za=["starts_with","ends_with"],Ba=["absolute","relative"],at=["15m","1h","6h","12h","24h","7d","current_week","previous_week","30d","current_month","previous_month"],Pe=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],le=e=>e.filter(t=>t!=="time"),de=["api","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],$=le(de),Ce=["active_services","request_count","request_per_minute","response_latency_average"],Ne=[...de,"application","consumer","country_code","iso_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm"],V=le(Ne),it=[...Ce,"response_latency_p99","response_latency_p95","response_latency_p50","upstream_latency_p99","upstream_latency_p95","upstream_latency_p50","upstream_latency_average","kong_latency_p99","kong_latency_p95","kong_latency_p50","kong_latency_average","response_size_p99","response_size_p95","response_size_p50","response_size_average","response_size_sum","request_size_p99","request_size_p95","request_size_p50","request_size_average","request_size_sum"],Ie=["control_plane","control_plane_group","gateway_service","consumer","application","route","ai_provider","ai_response_model","ai_request_model","llm_cache_status","llm_embeddings_provider","llm_embeddings_model","time","realm","status_code","status_code_grouped","ai_plugin"],Q=le(Ie),st=["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"],gr=["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"],_r=le(gr),wr=["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=wr,br=["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"],Tr=le(br),Ja=["15M","1H","6H","12H","24H","7D"],ei=["basic","api_usage","llm_usage"],Dr={basic:new Set($),api_usage:new Set(V),llm_usage:new Set(Q)},ti=(e,t)=>t.filter(r=>Dr[e].has(r.field)),ri=["horizontal_bar","vertical_bar","gauge","donut","timeseries_line","timeseries_bar","golden_signals","top_n","slottable","single_value"],fe={type:"string"},X={type:"string"},Sr={type:"boolean"},Or={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},vr={type:"object",properties:{type:{type:"string",enum:["horizontal_bar","vertical_bar"]},stacked:{type:"boolean"},chartDatasetColors:Or,syntheticsDataKey:fe,chartTitle:X,allowCsvExport:Sr},required:["type"],additionalProperties:!1},xr={type:"object",properties:{type:{type:"string",enum:["timeseries_line","timeseries_bar"]},stacked:{type:"boolean"},threshold:{type:"object",additionalProperties:{type:"number"}},chartDatasetColors:Or,syntheticsDataKey:fe,chartTitle:X,allowCsvExport:Sr},required:["type"],additionalProperties:!1},Er={type:"object",properties:{type:{type:"string",enum:["gauge"]},metricDisplay:{type:"string",enum:["hidden","single","full"]},reverseDataset:{type:"boolean"},numerator:{type:"number"},syntheticsDataKey:fe,chartTitle:X},required:["type"],additionalProperties:!1},Pr={type:"object",properties:{type:{type:"string",enum:["donut"]},syntheticsDataKey:fe,chartTitle:X},required:["type"],additionalProperties:!1},Cr={type:"object",properties:{chartTitle:X,syntheticsDataKey:fe,type:{type:"string",enum:["top_n"]},description:{type:"string"},entityLink:{type:"string"}},required:["type"],additionalProperties:!1},Nr={type:"object",properties:{chartTitle:X,type:{type:"string",enum:["golden_signals"]},longCardTitles:{type:"boolean"},description:{type:"string"},percentileLatency:{type:"boolean"}},required:["type"],additionalProperties:!1},Ir={type:"object",properties:{type:{type:"string",enum:["single_value"]},decimalPoints:{type:"number"},chartTitle:X},required:["type"],additionalProperties:!1},ni={type:"object",properties:{tz:{type:"string",default:"Etc/UTC"},type:{type:"string",enum:["relative"]},time_range:{type:"string",enum:at,default:"1h"}},required:["type","time_range"],additionalProperties:!1},ai={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},ot={granularity:{type:"string",description:'Force time grouping into buckets of this duration. Only has an effect if "time" is in the "dimensions" list.',enum:Pe},time_range:{type:"object",description:"The time range to query.",anyOf:[ni,ai],default:{type:"relative",time_range:"1h"}},limit:{type:"number"},meta:{type:"object"}},ut=e=>({type:"array",description:"List of aggregated metrics to collect across the requested time span.",items:{type:"string",enum:e}}),ct=e=>({type:"array",description:"List of attributes or entity types to group by.",minItems:0,maxItems:2,items:{type:"string",enum:e}}),ke=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:rt},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:nt}},required:["field","operator"],additionalProperties:!1}]}}),kr={type:"object",description:"A query to launch at the advanced explore API",properties:{datasource:{type:"string",enum:["advanced"]},metrics:ut(it),dimensions:ct(Ne),filters:ke(V),...ot},required:["datasource"],additionalProperties:!1},qr={type:"object",description:"A query to launch at the basic explore API",properties:{datasource:{type:"string",enum:["basic"]},metrics:ut(Ce),dimensions:ct(de),filters:ke($),...ot},required:["datasource"],additionalProperties:!1},Rr={type:"object",description:"A query to launch at the AI explore API",properties:{datasource:{type:"string",enum:["ai"]},metrics:ut(st),dimensions:ct(Ie),filters:ke(Q),...ot},required:["datasource"],additionalProperties:!1},Yr={anyOf:[kr,qr,Rr]},Ar={type:"object",properties:{query:Yr,chart:{anyOf:[vr,Er,Pr,xr,Nr,Cr,Mr,Ir]}},required:["query","chart"],additionalProperties:!1},Hr={type:"object",properties:{position:{type:"object",properties:{col:{type:"number"},row:{type:"number"}},description:"Position of the tile in the grid.",required:["col","row"],additionalProperties:!1},size:{type:"object",properties:{cols:{type:"number"},rows:{type:"number"},fitToContent:{type:"boolean"}},description:"Number of columns and rows the tile occupies. If fitToContent is true for every tile in a row, and each tile only occupies 1 row, then the row will auto-fit to its content.",required:["cols","rows"],additionalProperties:!1}},required:["position","size"],additionalProperties:!1},Fr={type:"object",properties:{definition:Ar,layout:Hr,id:{type:"string",description:"Unique identifier for the tile. If not provided, one will be generated."}},required:["definition","layout"],additionalProperties:!1},ii={type:"object",properties:{tiles:{type:"array",items:Fr},tileHeight:{type:"number",description:"Height of each tile in pixels."},gridSize:{type:"object",properties:{cols:{type:"number"},rows:{type:"number"}},description:"Number of columns and rows in the grid.",required:["cols","rows"],additionalProperties:!1},global_filters:ke([...new Set([...V,...$,...Q])])},required:["tiles"],additionalProperties:!1},si=Object.freeze(Object.defineProperty({__proto__:null,aiQuerySchema:Rr,barChartSchema:vr,basicQuerySchema:qr,dashboardConfigSchema:ii,dashboardTileTypes:ri,donutChartSchema:Pr,exploreV4QuerySchema:kr,gaugeChartSchema:Er,metricCardSchema:Nr,singleValueSchema:Ir,slottableSchema:Mr,tileConfigSchema:Fr,tileDefinitionSchema:Ar,tileLayoutSchema:Hr,timeseriesChartSchema:xr,topNTableSchema:Cr,validDashboardQuery:Yr},Symbol.toStringTag,{value:"Module"})),oi=["horizontal_bar","vertical_bar","gauge","donut","timeseries_line","timeseries_bar","golden_signals","top_n","slottable","single_value"],me={type:"string"},Z={type:"string"},jr={type:"boolean"},Gr={type:["object","array"],items:{type:"string"},additionalProperties:{type:"string"}},Wr={type:"object",properties:{type:{type:"string",enum:["slottable"]},id:{type:"string"}},required:["type","id"],additionalProperties:!1},Lr={type:"object",properties:{type:{type:"string",enum:["horizontal_bar","vertical_bar"]},stacked:{type:"boolean"},chart_dataset_colors:Gr,synthetics_data_key:me,chart_title:Z,allow_csv_export:jr},required:["type"],additionalProperties:!1},Ur={type:"object",properties:{type:{type:"string",enum:["timeseries_line","timeseries_bar"]},stacked:{type:"boolean"},threshold:{type:"object",additionalProperties:{type:"number"}},chart_dataset_colors:Gr,synthetics_data_key:me,chart_title:Z,allow_csv_export:jr},required:["type"],additionalProperties:!1},zr={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:me,chart_title:Z},required:["type"],additionalProperties:!1},$r={type:"object",properties:{type:{type:"string",enum:["donut"]},synthetics_data_key:me,chart_title:Z},required:["type"],additionalProperties:!1},Vr={type:"object",properties:{chart_title:Z,synthetics_data_key:me,type:{type:"string",enum:["top_n"]},description:{type:"string"},entity_link:{type:"string"}},required:["type"],additionalProperties:!1},Qr={type:"object",properties:{chart_title:Z,type:{type:"string",enum:["golden_signals"]},long_card_titles:{type:"boolean"},description:{type:"string"},percentile_latency:{type:"boolean"}},required:["type"],additionalProperties:!1},Xr={type:"object",properties:{type:{type:"string",enum:["single_value"]},decimal_points:{type:"number"},chart_title:Z},required:["type"],additionalProperties:!1},ui={type:"object",properties:{tz:{type:"string",default:"Etc/UTC"},type:{type:"string",enum:["relative"]},time_range:{type:"string",enum:at,default:"1h"}},required:["type","time_range"],additionalProperties:!1},ci={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},lt={granularity:{type:"string",description:'Force time grouping into buckets of this duration. Only has an effect if "time" is in the "dimensions" list.',enum:Pe},time_range:{type:"object",description:"The time range to query.",anyOf:[ui,ci],default:{type:"relative",time_range:"1h"}},limit:{type:"number"},meta:{type:"object"}},dt=e=>({type:"array",description:"List of aggregated metrics to collect across the requested time span.",items:{type:"string",enum:e}}),ft=e=>({type:"array",description:"List of attributes or entity types to group by.",minItems:0,maxItems:2,items:{type:"string",enum:e}}),qe=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:rt},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:nt}},required:["field","operator"],additionalProperties:!1}]}}),Zr={type:"object",description:"A query to launch at the advanced explore API",properties:{datasource:{type:"string",enum:["api_usage"]},metrics:dt(it),dimensions:ft(Ne),filters:qe(V),...lt},required:["datasource"],additionalProperties:!1},Br={type:"object",description:"A query to launch at the basic explore API",properties:{datasource:{type:"string",enum:["basic"]},metrics:dt(Ce),dimensions:ft(de),filters:qe($),...lt},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:dt(st),dimensions:ft(Ie),filters:qe(Q),...lt},required:["datasource"],additionalProperties:!1},Jr={anyOf:[Zr,Br,Kr]},en={type:"object",properties:{query:Jr,chart:{anyOf:[Lr,zr,$r,Ur,Qr,Vr,Wr,Xr]}},required:["query","chart"],additionalProperties:!1},tn={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},rn={type:"object",properties:{type:{type:"string",enum:["chart"]},definition:en,layout:tn,id:{type:"string",description:"Unique identifier for the tile. If not provided, one will be generated."}},required:["type","definition","layout"],additionalProperties:!1},li={type:"object",properties:{tiles:{type:"array",items:rn},tile_height:{type:"number",description:"Height of each tile in pixels."},preset_filters:qe([...new Set([...V,...$,...Q])]),template_id:{type:["string","null"],description:"Template id which was used to instantiate this dashboard."}},required:["tiles"],additionalProperties:!1},di=e=>{const t=[];return $.includes(e)&&t.push("basic"),V.includes(e)&&t.push("api_usage"),Q.includes(e)&&t.push("llm_usage"),(_r.includes(e)||Tr.includes(e))&&t.push("requests"),t},nn=6048e5,fi=864e5,mi=60,hi=3600,Bt=Symbol.for("constructDateFrom");function I(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Bt in e?e[Bt](t):e instanceof Date?new e.constructor(t):new Date(t)}function S(e,t){return I(t||e,e)}function Kt(e,t,r){const n=S(e,r==null?void 0:r.in);return isNaN(t)?I(e,NaN):(n.setDate(n.getDate()+t),n)}function yi(e,t,r){const n=S(e,r==null?void 0:r.in);if(isNaN(t))return I(e,NaN);const i=n.getDate(),o=I(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 pi={};function he(){return pi}function A(e,t){var d,m,f,_;const r=he(),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??((_=(f=r.locale)==null?void 0:f.options)==null?void 0:_.weekStartsOn)??0,i=S(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 Oe(e,t){return A(e,{...t,weekStartsOn:1})}function an(e,t){const r=S(e,t==null?void 0:t.in),n=r.getFullYear(),i=I(r,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const o=Oe(i),c=I(r,0);c.setFullYear(n,0,4),c.setHours(0,0,0,0);const d=Oe(c);return r.getTime()>=o.getTime()?n+1:r.getTime()>=d.getTime()?n:n-1}function Jt(e){const t=S(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 gi(e,...t){const r=I.bind(null,t.find(n=>typeof n=="object"));return t.map(r)}function Me(e,t){const r=S(e,t==null?void 0:t.in);return r.setHours(0,0,0,0),r}function _i(e,t,r){const[n,i]=gi(r==null?void 0:r.in,e,t),o=Me(n),c=Me(i),d=+o-Jt(o),m=+c-Jt(c);return Math.round((d-m)/fi)}function wi(e,t){const r=an(e,t),n=I(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),Oe(n)}function bi(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Ti(e){return!(!bi(e)&&typeof e!="number"||isNaN(+S(e)))}function ne(e,t){const r=S(e,t==null?void 0:t.in);return r.setDate(1),r.setHours(0,0,0,0),r}function Di(e,t){const r=S(e,t==null?void 0:t.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}const Si={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"}},Oi=(e,t,r)=>{let n;const i=Si[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 Qe(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const Mi={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},vi={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},xi={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ei={date:Qe({formats:Mi,defaultWidth:"full"}),time:Qe({formats:vi,defaultWidth:"full"}),dateTime:Qe({formats:xi,defaultWidth:"full"})},Pi={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ci=(e,t,r,n)=>Pi[e];function oe(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 Ni={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ii={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ki={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"]},qi={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"]},Ri={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"}},Yi={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"}},Ai=(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"},Hi={ordinalNumber:Ai,era:oe({values:Ni,defaultWidth:"wide"}),quarter:oe({values:Ii,defaultWidth:"wide",argumentCallback:e=>e-1}),month:oe({values:ki,defaultWidth:"wide"}),day:oe({values:qi,defaultWidth:"wide"}),dayPeriod:oe({values:Ri,defaultWidth:"wide",formattingValues:Yi,defaultFormattingWidth:"wide"})};function ue(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)?ji(d,y=>y.test(c)):Fi(d,y=>y.test(c));let f;f=e.valueCallback?e.valueCallback(m):m,f=r.valueCallback?r.valueCallback(f):f;const _=t.slice(c.length);return{value:f,rest:_}}}function Fi(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function ji(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function Gi(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,Li=/\d+/i,Ui={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},zi={any:[/^b/i,/^(a|c)/i]},$i={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Vi={any:[/1/i,/2/i,/3/i,/4/i]},Qi={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},Xi={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]},Zi={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},Bi={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]},Ki={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},Ji={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}},es={ordinalNumber:Gi({matchPattern:Wi,parsePattern:Li,valueCallback:e=>parseInt(e,10)}),era:ue({matchPatterns:Ui,defaultMatchWidth:"wide",parsePatterns:zi,defaultParseWidth:"any"}),quarter:ue({matchPatterns:$i,defaultMatchWidth:"wide",parsePatterns:Vi,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ue({matchPatterns:Qi,defaultMatchWidth:"wide",parsePatterns:Xi,defaultParseWidth:"any"}),day:ue({matchPatterns:Zi,defaultMatchWidth:"wide",parsePatterns:Bi,defaultParseWidth:"any"}),dayPeriod:ue({matchPatterns:Ki,defaultMatchWidth:"any",parsePatterns:Ji,defaultParseWidth:"any"})},ts={code:"en-US",formatDistance:Oi,formatLong:Ei,formatRelative:Ci,localize:Hi,match:es,options:{weekStartsOn:0,firstWeekContainsDate:1}};function rs(e,t){const r=S(e,t==null?void 0:t.in);return _i(r,Di(r))+1}function ns(e,t){const r=S(e,t==null?void 0:t.in),n=+Oe(r)-+wi(r);return Math.round(n/nn)+1}function sn(e,t){var _,y,p,E;const r=S(e,t==null?void 0:t.in),n=r.getFullYear(),i=he(),o=(t==null?void 0:t.firstWeekContainsDate)??((y=(_=t==null?void 0:t.locale)==null?void 0:_.options)==null?void 0:y.firstWeekContainsDate)??i.firstWeekContainsDate??((E=(p=i.locale)==null?void 0:p.options)==null?void 0:E.firstWeekContainsDate)??1,c=I((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=I((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 as(e,t){var d,m,f,_;const r=he(),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??((_=(f=r.locale)==null?void 0:f.options)==null?void 0:_.firstWeekContainsDate)??1,i=sn(e,t),o=I((t==null?void 0:t.in)||e,0);return o.setFullYear(i,0,n),o.setHours(0,0,0,0),A(o,t)}function is(e,t){const r=S(e,t==null?void 0:t.in),n=+A(r,t)-+as(r,t);return Math.round(n/nn)+1}function g(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 g(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):g(r+1,2)},d(e,t){return g(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 g(e.getHours()%12||12,t.length)},H(e,t){return g(e.getHours(),t.length)},m(e,t){return g(e.getMinutes(),t.length)},s(e,t){return g(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),i=Math.trunc(n*Math.pow(10,r-3));return g(i,t.length)}},te={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},er={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=sn(e,n),o=i>0?i:1-i;if(t==="YY"){const c=o%100;return g(c,2)}return t==="Yo"?r.ordinalNumber(o,{unit:"year"}):g(o,t.length)},R:function(e,t){const r=an(e);return g(r,t.length)},u:function(e,t){const r=e.getFullYear();return g(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 g(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 g(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 g(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=is(e,n);return t==="wo"?r.ordinalNumber(i,{unit:"week"}):g(i,t.length)},I:function(e,t,r){const n=ns(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):g(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=rs(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):g(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 g(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 g(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 g(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=te.noon:n===0?i=te.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=te.evening:n>=12?i=te.afternoon:n>=4?i=te.morning:i=te.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"}):g(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):g(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 rr(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 rr(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"+tr(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"+tr(n,":");case"zzzz":default:return"GMT"+z(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return g(n,t.length)},T:function(e,t,r){return g(+e,t.length)}};function tr(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+g(o,2)}function rr(e,t){return e%60===0?(e>0?"-":"+")+g(Math.abs(e)/60,2):z(e,t)}function z(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=g(Math.trunc(n/60),2),o=g(n%60,2);return r+i+t+o}const nr=(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"})}},on=(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"})}},ss=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],i=r[2];if(!i)return nr(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}}",nr(n,t)).replace("{{time}}",on(i,t))},os={p:on,P:ss},us=/^D+$/,cs=/^Y+$/,ls=["D","DD","YY","YYYY"];function ds(e){return us.test(e)}function fs(e){return cs.test(e)}function ms(e,t,r){const n=hs(e,t,r);if(console.warn(n),ls.includes(e))throw new RangeError(n)}function hs(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 ys=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ps=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,gs=/^'([^]*?)'?$/,_s=/''/g,ws=/[a-zA-Z]/;function un(e,t,r){var _,y,p,E,C,N,k,j;const n=he(),i=(r==null?void 0:r.locale)??n.locale??ts,o=(r==null?void 0:r.firstWeekContainsDate)??((y=(_=r==null?void 0:r.locale)==null?void 0:_.options)==null?void 0:y.firstWeekContainsDate)??n.firstWeekContainsDate??((E=(p=n.locale)==null?void 0:p.options)==null?void 0:E.firstWeekContainsDate)??1,c=(r==null?void 0:r.weekStartsOn)??((N=(C=r==null?void 0:r.locale)==null?void 0:C.options)==null?void 0:N.weekStartsOn)??n.weekStartsOn??((j=(k=n.locale)==null?void 0:k.options)==null?void 0:j.weekStartsOn)??0,d=S(e,r==null?void 0:r.in);if(!Ti(d))throw new RangeError("Invalid time value");let m=t.match(ps).map(O=>{const T=O[0];if(T==="p"||T==="P"){const G=os[T];return G(O,i.formatLong)}return O}).join("").match(ys).map(O=>{if(O==="''")return{isToken:!1,value:"'"};const T=O[0];if(T==="'")return{isToken:!1,value:bs(O)};if(er[T])return{isToken:!0,value:O};if(T.match(ws))throw new RangeError("Format string contains an unescaped latin alphabet character `"+T+"`");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 T=O.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&fs(T)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&ds(T))&&ms(T,t,String(e));const G=er[T[0]];return G(d,T,i.localize,f)}).join("")}function bs(e){const t=e.match(gs);return t?t[1].replace(_s,"'"):e}function Ts(e,t){const r=S(e,t==null?void 0:t.in),n=r.getFullYear(),i=r.getMonth(),o=I(r,0);return o.setFullYear(n,i+1,0),o.setHours(0,0,0,0),o.getDate()}function Ds(){return Object.assign({},he())}function ar(e){return+S(e)}function ir(e){return Math.trunc(+S(e)/1e3)}function Ss(e){return Math.trunc(e*hi)}function Os(e){const t=e/mi;return Math.trunc(t)}function cn(e,t,r){return yi(e,-1,r)}function sr(e,t,r){const n=Ds(),i=xs(e,r.timeZone,r.locale??n.locale);return"formatToParts"in i?Ms(i,t):vs(i,t)}function Ms(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 vs(e,t){const r=e.format(t).replace(/\u200E/g,""),n=/ [\w-+ ]+$/.exec(r);return n?n[0].substr(1):""}function xs(e,t,r){return new Intl.DateTimeFormat(r?[r.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function Es(e,t){const r=ks(t);return"formatToParts"in r?Cs(r,e):Ns(r,e)}const Ps={year:0,month:1,day:2,hour:3,minute:4,second:5};function Cs(e,t){try{const r=e.formatToParts(t),n=[];for(let i=0;i<r.length;i++){const o=Ps[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 Ns(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 Xe={},or=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")),Is=or==="06/25/2014, 00:00:00"||or==="06/25/2014 00:00:00";function ks(e){return Xe[e]||(Xe[e]=Is?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"})),Xe[e]}function mt(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 ur=36e5,qs=6e4,Ze={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function ye(e,t,r){if(!e)return 0;let n=Ze.timezoneZ.exec(e);if(n)return 0;let i,o;if(n=Ze.timezoneHH.exec(e),n)return i=parseInt(n[1],10),cr(i)?-(i*ur):NaN;if(n=Ze.timezoneHHMM.exec(e),n){i=parseInt(n[2],10);const c=parseInt(n[3],10);return cr(i,c)?(o=Math.abs(i)*ur+c*qs,n[1]==="+"?-o:o):NaN}if(As(e)){t=new Date(t||Date.now());const c=r?t:Rs(t),d=et(c,e);return-(r?d:Ys(t,d,e))}return NaN}function Rs(e){return mt(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function et(e,t){const r=Es(e,t),n=mt(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 Ys(e,t,r){let i=e.getTime()-t;const o=et(new Date(i),r);if(t===o)return t;i-=o-t;const c=et(new Date(i),r);return o===c?o:Math.max(o,c)}function cr(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const lr={};function As(e){if(lr[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),lr[e]=!0,!0}catch{return!1}}const Hs=60*1e3,Fs={X:function(e,t,r){const n=Be(r.timeZone,e);if(n===0)return"Z";switch(t){case"X":return dr(n);case"XXXX":case"XX":return re(n);case"XXXXX":case"XXX":default:return re(n,":")}},x:function(e,t,r){const n=Be(r.timeZone,e);switch(t){case"x":return dr(n);case"xxxx":case"xx":return re(n);case"xxxxx":case"xxx":default:return re(n,":")}},O:function(e,t,r){const n=Be(r.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+js(n,":");case"OOOO":default:return"GMT"+re(n,":")}},z:function(e,t,r){switch(t){case"z":case"zz":case"zzz":return sr("short",e,r);case"zzzz":default:return sr("long",e,r)}}};function Be(e,t){const r=e?ye(e,t,!0)/Hs:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(r))throw new RangeError("Invalid time zone specified: "+e);return r}function ve(e,t){const r=e<0?"-":"";let n=Math.abs(e).toString();for(;n.length<t;)n="0"+n;return r+n}function re(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=ve(Math.floor(n/60),2),o=ve(Math.floor(n%60),2);return r+i+t+o}function dr(e,t){return e%60===0?(e>0?"-":"+")+ve(Math.abs(e)/60,2):re(e,t)}function js(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+ve(o,2)}function fr(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 ln=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Ke=36e5,mr=6e4,Gs=2,M={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:ln};function xe(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?Gs: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}=Ls(n.date,r),c=Us(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=zs(n.time),m===null||isNaN(m)))return new Date(NaN);if(n.timeZone||t.timeZone){if(f=ye(n.timeZone||t.timeZone,new Date(d+m)),isNaN(f))return new Date(NaN)}else f=fr(new Date(d+m)),f=fr(new Date(d+m+f));return new Date(d+m+f)}else return new Date(NaN)}function Ws(e){const t={};let r=M.dateTimePattern.exec(e),n;if(r?(t.date=r[1],n=r[3]):(r=M.datePattern.exec(e),r?(t.date=r[1],n=r[2]):(t.date=null,n=e)),n){const i=M.timeZone.exec(n);i?(t.time=n.replace(i[1],""),t.timeZone=i[1].trim()):t.time=n}return t}function Ls(e,t){if(e){const r=M.YYY[t],n=M.YYYYY[t];let i=M.YYYY.exec(e)||n.exec(e);if(i){const o=i[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(i=M.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 Us(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=M.MM.exec(e);if(o)return r=new Date(0),n=parseInt(o[1],10)-1,yr(t,n)?(r.setUTCFullYear(t,n),r):new Date(NaN);if(o=M.DDD.exec(e),o){r=new Date(0);const c=parseInt(o[1],10);return Qs(t,c)?(r.setUTCFullYear(t,0,c),r):new Date(NaN)}if(o=M.MMDD.exec(e),o){r=new Date(0),n=parseInt(o[1],10)-1;const c=parseInt(o[2],10);return yr(t,n,c)?(r.setUTCFullYear(t,n,c),r):new Date(NaN)}if(o=M.Www.exec(e),o)return i=parseInt(o[1],10)-1,pr(i)?hr(t,i):new Date(NaN);if(o=M.WwwD.exec(e),o){i=parseInt(o[1],10)-1;const c=parseInt(o[2],10)-1;return pr(i,c)?hr(t,i,c):new Date(NaN)}return null}function zs(e){let t,r,n=M.HH.exec(e);if(n)return t=parseFloat(n[1].replace(",",".")),Je(t)?t%24*Ke:NaN;if(n=M.HHMM.exec(e),n)return t=parseInt(n[1],10),r=parseFloat(n[2].replace(",",".")),Je(t,r)?t%24*Ke+r*mr:NaN;if(n=M.HHMMSS.exec(e),n){t=parseInt(n[1],10),r=parseInt(n[2],10);const i=parseFloat(n[3].replace(",","."));return Je(t,r,i)?t%24*Ke+r*mr+i*1e3:NaN}return null}function hr(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 $s=[31,28,31,30,31,30,31,31,30,31,30,31],Vs=[31,29,31,30,31,30,31,31,30,31,30,31];function dn(e){return e%400===0||e%4===0&&e%100!==0}function yr(e,t,r){if(t<0||t>11)return!1;if(r!=null){if(r<1)return!1;const n=dn(e);if(n&&r>Vs[t]||!n&&r>$s[t])return!1}return!0}function Qs(e,t){if(t<1)return!1;const r=dn(e);return!(r&&t>366||!r&&t>365)}function pr(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Je(e,t,r){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||r!=null&&(r<0||r>=60))}const Xs=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Zs(e,t,r={}){t=String(t);const n=t.match(Xs);if(n){const i=xe(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,"'"+Fs[c[0]](i,c,r)+"'");return m?f.substring(0,d-1)+f.substring(d+1):f},t)}return un(e,t,r)}function fn(e,t,r){e=xe(e,r);const n=ye(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 Bs(e,t,r,n){return n={...n,timeZone:t,originalDate:e},Zs(fn(e,t,{timeZone:n.timeZone}),r,n)}function Ks(e,t,r){if(typeof e=="string"&&!e.match(ln))return xe(e,{...r,timeZone:t});e=xe(e,r);const n=mt(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),i=ye(t,new Date(n));return new Date(n+i)}function mn(e,t){return-ye(e,t)}function Js(e){return un(e,"yyyy-MM-dd'T'HH:mm:ss.SSSXXX")}function tt(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 Bs(i,r,n)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}function eo(e,t){return`${tt(e.getTime())} - ${tt(t.getTime(),{includeTZ:!0})}`}const ce={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 to(e,t){return e.map(r=>({value:r,label:t.t(`configuration.vitals.reports.granularity.${r}`)}))}function hn(e,t){return{duration:e,type:"duration",origin:t}}function ro(e){return e&&Pe.find(r=>e<=ce[r])||null}function yn(e,t,r,n){const i=ce[r];let o=0;return i>=ce.daily&&(n?o=-mn(n,t):o=t.getTimezoneOffset()*60*1e3),new Date(e((t.getTime()-o)/i)*i+o)}function pn(e,t,r){return yn(Math.floor,e,t,r)}function ht(e,t,r){return yn(Math.ceil,e,t,r)}class Re{constructor(t,r,n){b(this,"timeframe");b(this,"tz");b(this,"dataGranularity");if(this.constructor===Re)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=pn(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 hn(this.granularityMs(),this.startDate().toISOString())}startSeconds(){return ir(this.startDate())}endSeconds(){return ir(this.endDate())}startMs(){return ar(this.startDate())}endMs(){return ar(this.endDate())}}class no extends Re{constructor(r,n,i,o,c){super(r,i,o);b(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 ht(this.timeframe.rawEnd(),this.granularity,this.tz)}granularityMs(){return ce[this.granularity]}}class gn extends Re{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity)}endDate(){return ht(this.timeframe.rawEnd(this.tz),this.dataGranularity,this.tz)}granularityMs(){return this.endDate().getTime()-this.startDate().getTime()}}class ao extends gn{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity,2)}granularityMs(){return this.endDate().getTime()-super.startDate().getTime()}}var Se=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function io(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ee={exports:{}};Ee.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]",_="[object Function]",y="[object GeneratorFunction]",p="[object Map]",E="[object Number]",C="[object Object]",N="[object Promise]",k="[object RegExp]",j="[object Set]",O="[object String]",T="[object Symbol]",G="[object WeakMap]",pt="[object ArrayBuffer]",pe="[object DataView]",gt="[object Float32Array]",_t="[object Float64Array]",wt="[object Int8Array]",bt="[object Int16Array]",Tt="[object Int32Array]",Dt="[object Uint8Array]",St="[object Uint8ClampedArray]",Ot="[object Uint16Array]",Mt="[object Uint32Array]",bn=/[\\^$.*+?()[\]{}|]/g,Tn=/\w*$/,Dn=/^\[object .+?Constructor\]$/,Sn=/^(?:0|[1-9]\d*)$/,w={};w[o]=w[c]=w[pt]=w[pe]=w[d]=w[m]=w[gt]=w[_t]=w[wt]=w[bt]=w[Tt]=w[p]=w[E]=w[C]=w[k]=w[j]=w[O]=w[T]=w[Dt]=w[St]=w[Ot]=w[Mt]=!0,w[f]=w[_]=w[G]=!1;var On=typeof Se=="object"&&Se&&Se.Object===Object&&Se,Mn=typeof self=="object"&&self&&self.Object===Object&&self,q=On||Mn||Function("return this")(),vt=t&&!t.nodeType&&t,xt=vt&&!0&&e&&!e.nodeType&&e,vn=xt&&xt.exports===vt;function xn(a,s){return a.set(s[0],s[1]),a}function En(a,s){return a.add(s),a}function Pn(a,s){for(var u=-1,l=a?a.length:0;++u<l&&s(a[u],u,a)!==!1;);return a}function Cn(a,s){for(var u=-1,l=s.length,D=a.length;++u<l;)a[D+u]=s[u];return a}function Et(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 Nn(a,s){for(var u=-1,l=Array(a);++u<a;)l[u]=s(u);return l}function In(a,s){return a==null?void 0:a[s]}function Pt(a){var s=!1;if(a!=null&&typeof a.toString!="function")try{s=!!(a+"")}catch{}return s}function Ct(a){var s=-1,u=Array(a.size);return a.forEach(function(l,D){u[++s]=[D,l]}),u}function Ae(a,s){return function(u){return a(s(u))}}function Nt(a){var s=-1,u=Array(a.size);return a.forEach(function(l){u[++s]=l}),u}var kn=Array.prototype,qn=Function.prototype,ge=Object.prototype,He=q["__core-js_shared__"],It=function(){var a=/[^.]+$/.exec(He&&He.keys&&He.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""}(),kt=qn.toString,H=ge.hasOwnProperty,_e=ge.toString,Rn=RegExp("^"+kt.call(H).replace(bn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qt=vn?q.Buffer:void 0,Rt=q.Symbol,Yt=q.Uint8Array,Yn=Ae(Object.getPrototypeOf,Object),An=Object.create,Hn=ge.propertyIsEnumerable,Fn=kn.splice,At=Object.getOwnPropertySymbols,jn=qt?qt.isBuffer:void 0,Gn=Ae(Object.keys,Object),Fe=J(q,"DataView"),ie=J(q,"Map"),je=J(q,"Promise"),Ge=J(q,"Set"),We=J(q,"WeakMap"),se=J(Object,"create"),Wn=U(Fe),Ln=U(ie),Un=U(je),zn=U(Ge),$n=U(We),Ht=Rt?Rt.prototype:void 0,Ft=Ht?Ht.valueOf:void 0;function W(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 Vn(){this.__data__=se?se(null):{}}function Qn(a){return this.has(a)&&delete this.__data__[a]}function Xn(a){var s=this.__data__;if(se){var u=s[a];return u===n?void 0:u}return H.call(s,a)?s[a]:void 0}function Zn(a){var s=this.__data__;return se?s[a]!==void 0:H.call(s,a)}function Bn(a,s){var u=this.__data__;return u[a]=se&&s===void 0?n:s,this}W.prototype.clear=Vn,W.prototype.delete=Qn,W.prototype.get=Xn,W.prototype.has=Zn,W.prototype.set=Bn;function R(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 Jn(a){var s=this.__data__,u=we(s,a);if(u<0)return!1;var l=s.length-1;return u==l?s.pop():Fn.call(s,u,1),!0}function ea(a){var s=this.__data__,u=we(s,a);return u<0?void 0:s[u][1]}function ta(a){return we(this.__data__,a)>-1}function ra(a,s){var u=this.__data__,l=we(u,a);return l<0?u.push([a,s]):u[l][1]=s,this}R.prototype.clear=Kn,R.prototype.delete=Jn,R.prototype.get=ea,R.prototype.has=ta,R.prototype.set=ra;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 na(){this.__data__={hash:new W,map:new(ie||R),string:new W}}function aa(a){return be(this,a).delete(a)}function ia(a){return be(this,a).get(a)}function sa(a){return be(this,a).has(a)}function oa(a,s){return be(this,a).set(a,s),this}B.prototype.clear=na,B.prototype.delete=aa,B.prototype.get=ia,B.prototype.has=sa,B.prototype.set=oa;function K(a){this.__data__=new R(a)}function ua(){this.__data__=new R}function ca(a){return this.__data__.delete(a)}function la(a){return this.__data__.get(a)}function da(a){return this.__data__.has(a)}function fa(a,s){var u=this.__data__;if(u instanceof R){var l=u.__data__;if(!ie||l.length<r-1)return l.push([a,s]),this;u=this.__data__=new B(l)}return u.set(a,s),this}K.prototype.clear=ua,K.prototype.delete=ca,K.prototype.get=la,K.prototype.has=da,K.prototype.set=fa;function ma(a,s){var u=ze(a)||Aa(a)?Nn(a.length,String):[],l=u.length,D=!!l;for(var v in a)H.call(a,v)&&!(D&&(v=="length"||ka(v,l)))&&u.push(v);return u}function jt(a,s,u){var l=a[s];(!(H.call(a,s)&&Ut(l,u))||u===void 0&&!(s in a))&&(a[s]=u)}function we(a,s){for(var u=a.length;u--;)if(Ut(a[u][0],s))return u;return-1}function ha(a,s){return a&&Gt(s,$e(s),a)}function Le(a,s,u,l,D,v,Y){var x;if(l&&(x=v?l(a,D,v,Y):l(a)),x!==void 0)return x;if(!Te(a))return a;var Vt=ze(a);if(Vt){if(x=Ca(a),!s)return xa(a,x)}else{var ee=L(a),Qt=ee==_||ee==y;if(Fa(a))return ba(a,s);if(ee==C||ee==o||Qt&&!v){if(Pt(a))return v?a:{};if(x=Na(Qt?{}:a),!s)return Ea(a,ha(x,a))}else{if(!w[ee])return v?a:{};x=Ia(a,ee,Le,s)}}Y||(Y=new K);var Xt=Y.get(a);if(Xt)return Xt;if(Y.set(a,x),!Vt)var Zt=u?Pa(a):$e(a);return Pn(Zt||a,function(Ve,De){Zt&&(De=Ve,Ve=a[De]),jt(x,De,Le(Ve,s,u,l,De,a,Y))}),x}function ya(a){return Te(a)?An(a):{}}function pa(a,s,u){var l=s(a);return ze(a)?l:Cn(l,u(a))}function ga(a){return _e.call(a)}function _a(a){if(!Te(a)||Ra(a))return!1;var s=$t(a)||Pt(a)?Rn:Dn;return s.test(U(a))}function wa(a){if(!Lt(a))return Gn(a);var s=[];for(var u in Object(a))H.call(a,u)&&u!="constructor"&&s.push(u);return s}function ba(a,s){if(s)return a.slice();var u=new a.constructor(a.length);return a.copy(u),u}function Ue(a){var s=new a.constructor(a.byteLength);return new Yt(s).set(new Yt(a)),s}function Ta(a,s){var u=s?Ue(a.buffer):a.buffer;return new a.constructor(u,a.byteOffset,a.byteLength)}function Da(a,s,u){var l=s?u(Ct(a),!0):Ct(a);return Et(l,xn,new a.constructor)}function Sa(a){var s=new a.constructor(a.source,Tn.exec(a));return s.lastIndex=a.lastIndex,s}function Oa(a,s,u){var l=s?u(Nt(a),!0):Nt(a);return Et(l,En,new a.constructor)}function Ma(a){return Ft?Object(Ft.call(a)):{}}function va(a,s){var u=s?Ue(a.buffer):a.buffer;return new a.constructor(u,a.byteOffset,a.length)}function xa(a,s){var u=-1,l=a.length;for(s||(s=Array(l));++u<l;)s[u]=a[u];return s}function Gt(a,s,u,l){u||(u={});for(var D=-1,v=s.length;++D<v;){var Y=s[D],x=void 0;jt(u,Y,x===void 0?a[Y]:x)}return u}function Ea(a,s){return Gt(a,Wt(a),s)}function Pa(a){return pa(a,$e,Wt)}function be(a,s){var u=a.__data__;return qa(s)?u[typeof s=="string"?"string":"hash"]:u.map}function J(a,s){var u=In(a,s);return _a(u)?u:void 0}var Wt=At?Ae(At,Object):Wa,L=ga;(Fe&&L(new Fe(new ArrayBuffer(1)))!=pe||ie&&L(new ie)!=p||je&&L(je.resolve())!=N||Ge&&L(new Ge)!=j||We&&L(new We)!=G)&&(L=function(a){var s=_e.call(a),u=s==C?a.constructor:void 0,l=u?U(u):void 0;if(l)switch(l){case Wn:return pe;case Ln:return p;case Un:return N;case zn:return j;case $n:return G}return s});function Ca(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 Na(a){return typeof a.constructor=="function"&&!Lt(a)?ya(Yn(a)):{}}function Ia(a,s,u,l){var D=a.constructor;switch(s){case pt:return Ue(a);case d:case m:return new D(+a);case pe:return Ta(a,l);case gt:case _t:case wt:case bt:case Tt:case Dt:case St:case Ot:case Mt:return va(a,l);case p:return Da(a,l,u);case E:case O:return new D(a);case k:return Sa(a);case j:return Oa(a,l,u);case T:return Ma(a)}}function ka(a,s){return s=s??i,!!s&&(typeof a=="number"||Sn.test(a))&&a>-1&&a%1==0&&a<s}function qa(a){var s=typeof a;return s=="string"||s=="number"||s=="symbol"||s=="boolean"?a!=="__proto__":a===null}function Ra(a){return!!It&&It in a}function Lt(a){var s=a&&a.constructor,u=typeof s=="function"&&s.prototype||ge;return a===u}function U(a){if(a!=null){try{return kt.call(a)}catch{}try{return a+""}catch{}}return""}function Ya(a){return Le(a,!0,!0)}function Ut(a,s){return a===s||a!==a&&s!==s}function Aa(a){return Ha(a)&&H.call(a,"callee")&&(!Hn.call(a,"callee")||_e.call(a)==o)}var ze=Array.isArray;function zt(a){return a!=null&&ja(a.length)&&!$t(a)}function Ha(a){return Ga(a)&&zt(a)}var Fa=jn||La;function $t(a){var s=Te(a)?_e.call(a):"";return s==_||s==y}function ja(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=i}function Te(a){var s=typeof a;return!!a&&(s=="object"||s=="function")}function Ga(a){return!!a&&typeof a=="object"}function $e(a){return zt(a)?ma(a):wa(a)}function Wa(){return[]}function La(){return!1}e.exports=Ya})(Ee,Ee.exports);var so=Ee.exports;const oo=io(so),ae=(e,t)=>new Date(e.getTime()-mn(t,e));class P{constructor(t){b(this,"timeframeText");b(this,"key");b(this,"display");b(this,"timeframeLength");b(this,"allowedTiers");b(this,"defaultResponseGranularity");b(this,"dataGranularity");b(this,"isRelative");b(this,"fineGrainedDefaultGranularity");b(this,"_startCustom");b(this,"_endCustom");b(this,"_allowedGranularitiesOverride");this.display=t.display,this.timeframeText=t.timeframeText,this.key=t.key,this.timeframeLength=t.timeframeLength,this.allowedTiers=t.allowedTiers,this.defaultResponseGranularity=t.defaultResponseGranularity,this.dataGranularity=t.dataGranularity,this.isRelative=t.isRelative,this._startCustom=t.startCustom,this._endCustom=t.endCustom,this._allowedGranularitiesOverride=t.allowedGranularitiesOverride,this.fineGrainedDefaultGranularity=t.fineGrainedDefaultGranularity}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(t){if(this._allowedGranularitiesOverride&&t)return new Set(this._allowedGranularitiesOverride);const r=new Set,n=this.maximumTimeframeLength()/3600;return n<=6&&r.add("minutely"),n>=2&&n<=7*24&&r.add("hourly"),n>=2*24&&r.add("daily"),n>=2*24*14&&r.add("weekly"),r}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const r=Ks(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return fn(r,t)}}class uo extends P{rawStart(t){let r=A(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(r=ae(r,t)),r}maximumTimeframeLength(){return 60*60*24*7}}class co extends P{rawStart(t){let r=ne(this.tzAdjustedDate(t));return t&&(r=ae(r,t)),r}maximumTimeframeLength(){return 60*60*24*31}}class lo extends P{rawEnd(t){let r=A(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(r=ae(r,t)),r}rawStart(t){const r=this.tzAdjustedDate(t);let n=A(r.setDate(r.getDate()-7),{weekStartsOn:1});return t&&(n=ae(n,t)),n}}class fo extends P{rawEnd(t){let r=ne(this.tzAdjustedDate(t));return t&&(r=ae(r,t)),r}rawStart(t){let r=ne(cn(this.tzAdjustedDate(t)));return t&&(r=ae(r,t)),r}}const _n=new Map([[h.FIFTEEN_MIN,new P({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 P({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 P({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 P({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 P({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 P({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 P({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 uo({key:h.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const e=A(new Date,{weekStartsOn:1});return(Me(Kt(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 co({key:h.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const e=ne(new Date);return(Me(Kt(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})],[h.PREVIOUS_WEEK,new lo({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 fo({key:h.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=ne(new Date),r=ne(cn(new Date));return t.getTimezoneOffset()!==r.getTimezoneOffset()&&(e=wn(t,r)),60*60*24*Ts(new Date().setMonth(new Date().getMonth()-1))+Ss(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})]]);function mo(e){const t=new Date(e.start),r=new Date(e.end),n=(r.getTime()-t.getTime())/1e3;return e.timePeriodsKey&&oo(_n.get(e.timePeriodsKey))||new P({key:"custom",timeframeText:"custom",display:"custom",startCustom:t,endCustom:r,timeframeLength:()=>n,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["free","plus","enterprise"]})}function ho(e){return{...e.key!=="custom"&&{timePeriodsKey:e.key},start:e.rawStart(),end:e.rawEnd()}}function yo(e){return{key:e.key,display:e.display,timeframeText:e.timeframeText,timeframeLength:()=>e.key,start:()=>e.rawStart(),end:()=>e.rawEnd()}}function wn(e,t){return Os(e.getTimezoneOffset()-t.getTimezoneOffset())}const po={"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 Ye{constructor(t){b(this,"_seed");this._seed=t}next(t,r){const n=Math.sin(this._seed++)*1e4,i=n-Math.floor(n);return Math.floor(i*(r-t+1))+t}}const go=(e,t,r)=>{const n=yt(10,1e4),i=new Ye(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 p in t)t[p].forEach(E=>{m+=i.next(50,500);const C={[p]:E,[e.name]:m},N={version:"1.0",timestamp:new Date(y).toISOString(),event:C};d.push(N)});else{m+=i.next(50,500);const p={version:"1.0",timestamp:new Date(y).toISOString(),event:{[e.name]:m}};d.push(p)}const f={};if(t)for(const y in t)f[y]={},t[y].forEach(p=>{f[y][p]={name:p,deleted:!1}});const _={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:_}},_o=(e,t)=>{const r=yt(10,1e4),n=new Ye(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 _={};e.forEach(p=>{d[p.name]+=n.next(50,500),_[p.name]=d[p.name]});const y={version:"1.0",timestamp:new Date(f).toISOString(),event:_};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,_)=>(f[_.name]=_.unit,f),{}),granularity_ms:60*60*1e3,display:{},...t??{}};return{data:c,meta:m}},wo=(e,t,r)=>{const n=Math.floor(Math.random()*9991)+10,i=new Ye(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),p=Object.values(t),E=(C,N)=>{if(N===y.length){e.forEach(k=>{C[k.name]=i.next(1e3,5e7)}),m.push({version:"1.0",timestamp:new Date().toISOString(),event:{...C}});return}p[N].forEach(k=>{E({...C,[y[N]]:k},N+1)})};E({},0)}else{const y={};e.forEach(p=>{y[p.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(p=>{f[y][p]={name:p,deleted:!1}});const _={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,p)=>(y[p.name]=p.unit,y),{}),truncated:!1,limit:50,display:f,granularity_ms:c-o,...r??{}};return{data:m,meta:_}};function yt(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1)+e)}exports.DeltaQueryTime=ao;exports.Granularities=ce;exports.REFRESH_INTERVAL_MS=$a;exports.SeededRandom=Ye;exports.TIMEFRAME_LOOKUP=po;exports.TimePeriods=_n;exports.Timeframe=P;exports.TimeframeKeys=h;exports.TimeseriesQueryTime=no;exports.UnaryQueryTime=gn;exports.aiExploreAggregations=st;exports.apiUsageQuerySchema=Zr;exports.barChartSchema=Lr;exports.basicExploreAggregations=Ce;exports.basicQuerySchema=Br;exports.ceilToNearestTimeGrain=ht;exports.dashboardConfigSchema=li;exports.dashboardTileTypes=oi;exports.dashboardsSchemaV1=si;exports.datasourceToFilterableDimensions=Dr;exports.datePickerSelectionToTimeframe=mo;exports.donutChartSchema=$r;exports.dstOffsetHours=wn;exports.exploreAggregations=it;exports.exploreFilterTypesV2=rt;exports.filterableAiExploreDimensions=Q;exports.filterableBasicExploreDimensions=$;exports.filterableExploreDimensions=V;exports.filterableRequestDimensions=_r;exports.filterableRequestMetrics=Tr;exports.filterableRequestWildcardDimensions=Ka;exports.floorToNearestTimeGrain=pn;exports.formatISOTimeWithTZ=Js;exports.formatTime=tt;exports.formatTimeRange=eo;exports.gaugeChartSchema=zr;exports.generateCrossSectionalData=wo;exports.generateMultipleMetricTimeSeriesData=_o;exports.generateSingleMetricTimeSeriesData=go;exports.getFieldDataSources=di;exports.granularitiesToOptions=to;exports.granularityMsToQuery=hn;exports.granularityValues=Pe;exports.llmUsageSchema=Kr;exports.metricCardSchema=Qr;exports.msToGranularity=ro;exports.queryDatasources=ei;exports.queryableAiExploreDimensions=Ie;exports.queryableBasicExploreDimensions=de;exports.queryableExploreDimensions=Ne;exports.queryableRequestDimensions=gr;exports.queryableRequestMetrics=br;exports.queryableRequestWildcardDimensions=wr;exports.rand=yt;exports.relativeTimeRangeValuesRequestV2=Ja;exports.relativeTimeRangeValuesV4=at;exports.reportChartTypes=Va;exports.requestFilterTypeEmptyV2=nt;exports.requestFilterTypeEqualsV2=Qa;exports.requestFilterTypeMetricV2=Xa;exports.requestFilterTypeWildcardV2=Za;exports.singleValueSchema=Xr;exports.slottableSchema=Wr;exports.stripUnknownFilters=ti;exports.tileConfigSchema=rn;exports.tileDefinitionSchema=en;exports.tileLayoutSchema=tn;exports.timeRangeTypeV2=Ba;exports.timeframeToDatepickerSelection=ho;exports.timeframeToDatepickerTimeperiod=yo;exports.timeseriesChartSchema=Ur;exports.topNTableSchema=Vr;exports.validDashboardQuery=Jr;
|
|
1
|
+
"use strict";var Ma=Object.defineProperty;var xa=(e,t,n)=>t in e?Ma(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var P=(e,t,n)=>xa(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ia=30*1e3;var w=(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))(w||{});const Za=["horizontal_bar","vertical_bar","timeseries_line","choropleth_map","timeseries_bar","donut","single_value"],Wt=["in","not_in","selector"],$a=["=","!="],Pa=["=","!=","<",">","<=",">="],qt=["empty","not_empty"],Na=["starts_with","ends_with"],Ca=["absolute","relative"],Ht=["15m","1h","6h","12h","24h","7d","current_week","previous_week","30d","current_month","previous_month"],lt=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],je=e=>e.filter(t=>t!=="time"),Fe=["api","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],de=je(Fe),dt=["active_services","request_count","request_per_minute","response_latency_average"],ft=[...Fe,"application","consumer","country_code","iso_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm"],fe=je(ft),Vt=[...dt,"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"],ht=["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"],he=je(ht),Bt=["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"],Ir=["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"],Zr=je(Ir),$r=["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"],Ra=$r,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"],Nr=je(Pr),Aa=["15M","1H","6H","12H","24H","7D"],ja=["basic","api_usage","llm_usage"],Cr={basic:new Set(de),api_usage:new Set(fe),llm_usage:new Set(he)},Fa=(e,t)=>t.filter(n=>Cr[e].has(n.field)),Ua=["horizontal_bar","vertical_bar","gauge","donut","timeseries_line","timeseries_bar","golden_signals","top_n","slottable","single_value"],Ue={type:"string"},me={type:"string"},Rr={type:"boolean"},Ar={type:["object","array"],items:{type:"string"},additionalProperties:{type:"string"}},jr={type:"object",properties:{type:{type:"string",enum:["slottable"]},id:{type:"string"}},required:["type","id"],additionalProperties:!1},Fr={type:"object",properties:{type:{type:"string",enum:["horizontal_bar","vertical_bar"]},stacked:{type:"boolean"},chartDatasetColors:Ar,syntheticsDataKey:Ue,chartTitle:me,allowCsvExport:Rr},required:["type"],additionalProperties:!1},Ur={type:"object",properties:{type:{type:"string",enum:["timeseries_line","timeseries_bar"]},stacked:{type:"boolean"},threshold:{type:"object",additionalProperties:{type:"number"}},chartDatasetColors:Ar,syntheticsDataKey:Ue,chartTitle:me,allowCsvExport:Rr},required:["type"],additionalProperties:!1},Yr={type:"object",properties:{type:{type:"string",enum:["gauge"]},metricDisplay:{type:"string",enum:["hidden","single","full"]},reverseDataset:{type:"boolean"},numerator:{type:"number"},syntheticsDataKey:Ue,chartTitle:me},required:["type"],additionalProperties:!1},Lr={type:"object",properties:{type:{type:"string",enum:["donut"]},syntheticsDataKey:Ue,chartTitle:me},required:["type"],additionalProperties:!1},Gr={type:"object",properties:{chartTitle:me,syntheticsDataKey:Ue,type:{type:"string",enum:["top_n"]},description:{type:"string"},entityLink:{type:"string"}},required:["type"],additionalProperties:!1},Wr={type:"object",properties:{chartTitle:me,type:{type:"string",enum:["golden_signals"]},longCardTitles:{type:"boolean"},description:{type:"string"},percentileLatency:{type:"boolean"}},required:["type"],additionalProperties:!1},qr={type:"object",properties:{type:{type:"string",enum:["single_value"]},decimalPoints:{type:"number"},chartTitle:me},required:["type"],additionalProperties:!1},Ya={type:"object",properties:{tz:{type:"string",default:"Etc/UTC"},type:{type:"string",enum:["relative"]},time_range:{type:"string",enum:Ht,default:"1h"}},required:["type","time_range"],additionalProperties:!1},La={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},Xt={granularity:{type:"string",description:'Force time grouping into buckets of this duration. Only has an effect if "time" is in the "dimensions" list.',enum:lt},time_range:{type:"object",description:"The time range to query.",anyOf:[Ya,La],default:{type:"relative",time_range:"1h"}},limit:{type:"number"},meta:{type:"object"}},Qt=e=>({type:"array",description:"List of aggregated metrics to collect across the requested time span.",items:{type:"string",enum:e}}),Kt=e=>({type:"array",description:"List of attributes or entity types to group by.",minItems:0,maxItems:2,items:{type:"string",enum:e}}),mt=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:Wt},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:qt}},required:["field","operator"],additionalProperties:!1}]}}),Hr={type:"object",description:"A query to launch at the advanced explore API",properties:{datasource:{type:"string",enum:["advanced"]},metrics:Qt(Vt),dimensions:Kt(ft),filters:mt(fe),...Xt},required:["datasource"],additionalProperties:!1},Vr={type:"object",description:"A query to launch at the basic explore API",properties:{datasource:{type:"string",enum:["basic"]},metrics:Qt(dt),dimensions:Kt(Fe),filters:mt(de),...Xt},required:["datasource"],additionalProperties:!1},Br={type:"object",description:"A query to launch at the AI explore API",properties:{datasource:{type:"string",enum:["ai"]},metrics:Qt(Bt),dimensions:Kt(ht),filters:mt(he),...Xt},required:["datasource"],additionalProperties:!1},Xr={anyOf:[Hr,Vr,Br]},Qr={type:"object",properties:{query:Xr,chart:{anyOf:[Fr,Yr,Lr,Ur,Wr,Gr,jr,qr]}},required:["query","chart"],additionalProperties:!1},Kr={type:"object",properties:{position:{type:"object",properties:{col:{type:"number"},row:{type:"number"}},description:"Position of the tile in the grid.",required:["col","row"],additionalProperties:!1},size:{type:"object",properties:{cols:{type:"number"},rows:{type:"number"},fitToContent:{type:"boolean"}},description:"Number of columns and rows the tile occupies. If fitToContent is true for every tile in a row, and each tile only occupies 1 row, then the row will auto-fit to its content.",required:["cols","rows"],additionalProperties:!1}},required:["position","size"],additionalProperties:!1},Jr={type:"object",properties:{definition:Qr,layout:Kr,id:{type:"string",description:"Unique identifier for the tile. If not provided, one will be generated."}},required:["definition","layout"],additionalProperties:!1},Ga={type:"object",properties:{tiles:{type:"array",items:Jr},tileHeight:{type:"number",description:"Height of each tile in pixels."},gridSize:{type:"object",properties:{cols:{type:"number"},rows:{type:"number"}},description:"Number of columns and rows in the grid.",required:["cols","rows"],additionalProperties:!1},global_filters:mt([...new Set([...fe,...de,...he])])},required:["tiles"],additionalProperties:!1},Wa=Object.freeze(Object.defineProperty({__proto__:null,aiQuerySchema:Br,barChartSchema:Fr,basicQuerySchema:Vr,dashboardConfigSchema:Ga,dashboardTileTypes:Ua,donutChartSchema:Lr,exploreV4QuerySchema:Hr,gaugeChartSchema:Yr,metricCardSchema:Wr,singleValueSchema:qr,slottableSchema:jr,tileConfigSchema:Jr,tileDefinitionSchema:Qr,tileLayoutSchema:Kr,timeseriesChartSchema:Ur,topNTableSchema:Gr,validDashboardQuery:Xr},Symbol.toStringTag,{value:"Module"}));function d(e,t,n){function r(c,l){var h;Object.defineProperty(c,"_zod",{value:c._zod??{},enumerable:!1}),(h=c._zod).traits??(h.traits=new Set),c._zod.traits.add(e),t(c,l);for(const y in s.prototype)y in c||Object.defineProperty(c,y,{value:s.prototype[y].bind(c)});c._zod.constr=s,c._zod.def=l}const o=(n==null?void 0:n.Parent)??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(c){var l;const h=n!=null&&n.Parent?new i:this;r(h,c),(l=h._zod).deferred??(l.deferred=[]);for(const y of h._zod.deferred)y();return h}return Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:c=>{var l,h;return n!=null&&n.Parent&&c instanceof n.Parent?!0:(h=(l=c==null?void 0:c._zod)==null?void 0:l.traits)==null?void 0:h.has(e)}}),Object.defineProperty(s,"name",{value:e}),s}class Ne extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const eo={};function ne(e){return eo}function qa(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function jt(e,t){return typeof t=="bigint"?t.toString():t}function to(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Jt(e){return e==null}function en(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Ha(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let o=(r.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(r)){const l=r.match(/\d?e-(\d?)/);l!=null&&l[1]&&(o=Number.parseInt(l[1]))}const i=n>o?n:o,s=Number.parseInt(e.toFixed(i).replace(".","")),c=Number.parseInt(t.toFixed(i).replace(".",""));return s%c/10**i}const Ln=Symbol("evaluating");function O(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ln)return r===void 0&&(r=Ln,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Va(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function pe(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ee(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function Gn(e){return JSON.stringify(e)}const no="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ft(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Ba=to(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Ce(e){if(Ft(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(Ft(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function ro(e){return Ce(e)?{...e}:e}const Xa=new Set(["string","number","symbol"]);function Oe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ge(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function _(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Qa(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Ka={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ja(e,t){const n=e._zod.def,r=Ee(e._zod.def,{get shape(){const o={};for(const i in t){if(!(i in n.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(o[i]=n.shape[i])}return pe(this,"shape",o),o},checks:[]});return ge(e,r)}function es(e,t){const n=e._zod.def,r=Ee(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const i in t){if(!(i in n.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&delete o[i]}return pe(this,"shape",o),o},checks:[]});return ge(e,r)}function ts(e,t){if(!Ce(t))throw new Error("Invalid input to extend: expected a plain object");const n=Ee(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return pe(this,"shape",r),r},checks:[]});return ge(e,n)}function ns(e,t){const n=Ee(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return pe(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return ge(e,n)}function rs(e,t,n){const r=Ee(t._zod.def,{get shape(){const o=t._zod.def.shape,i={...o};if(n)for(const s in n){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(i[s]=e?new e({type:"optional",innerType:o[s]}):o[s])}else for(const s in o)i[s]=e?new e({type:"optional",innerType:o[s]}):o[s];return pe(this,"shape",i),i},checks:[]});return ge(t,r)}function os(e,t,n){const r=Ee(t._zod.def,{get shape(){const o=t._zod.def.shape,i={...o};if(n)for(const s in n){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(i[s]=new e({type:"nonoptional",innerType:o[s]}))}else for(const s in o)i[s]=new e({type:"nonoptional",innerType:o[s]});return pe(this,"shape",i),i},checks:[]});return ge(t,r)}function Pe(e,t=0){var n;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function De(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Je(e){return typeof e=="string"?e:e==null?void 0:e.message}function re(e,t,n){var o,i,s,c,l,h;const r={...e,path:e.path??[]};if(!e.message){const y=Je((s=(i=(o=e.inst)==null?void 0:o._zod.def)==null?void 0:i.error)==null?void 0:s.call(i,e))??Je((c=t==null?void 0:t.error)==null?void 0:c.call(t,e))??Je((l=n.customError)==null?void 0:l.call(n,e))??Je((h=n.localeError)==null?void 0:h.call(n,e))??"Invalid input";r.message=y}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}function tn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Re(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const oo=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,jt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},io=d("$ZodError",oo),ao=d("$ZodError",oo,{Parent:Error});function is(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function as(e,t){const n=t||function(i){return i.message},r={_errors:[]},o=i=>{for(const s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(c=>o({issues:c}));else if(s.code==="invalid_key")o({issues:s.issues});else if(s.code==="invalid_element")o({issues:s.issues});else if(s.path.length===0)r._errors.push(n(s));else{let c=r,l=0;for(;l<s.path.length;){const h=s.path[l];l===s.path.length-1?(c[h]=c[h]||{_errors:[]},c[h]._errors.push(n(s))):c[h]=c[h]||{_errors:[]},c=c[h],l++}}};return o(e),r}const ss=e=>(t,n,r,o)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new Ne;if(s.issues.length){const c=new((o==null?void 0:o.Err)??e)(s.issues.map(l=>re(l,i,ne())));throw no(c,o==null?void 0:o.callee),c}return s.value},us=e=>async(t,n,r,o)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const c=new((o==null?void 0:o.Err)??e)(s.issues.map(l=>re(l,i,ne())));throw no(c,o==null?void 0:o.callee),c}return s.value},so=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new Ne;return i.issues.length?{success:!1,error:new(e??io)(i.issues.map(s=>re(s,o,ne())))}:{success:!0,data:i.value}},cs=so(ao),uo=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>re(s,o,ne())))}:{success:!0,data:i.value}},ls=uo(ao),ds=/^[cC][^\s-]{8,}$/,fs=/^[0-9a-z]+$/,hs=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ms=/^[0-9a-vA-V]{20}$/,ps=/^[A-Za-z0-9]{27}$/,gs=/^[a-zA-Z0-9_-]{21}$/,_s=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ys=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Wn=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,ws=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,vs="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function bs(){return new RegExp(vs,"u")}const Ts=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,zs=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Ds=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ks=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Os=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,co=/^[A-Za-z0-9_-]*$/,Ss=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Es=/^\+(?:[0-9]){6,14}[0-9]$/,lo="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Ms=new RegExp(`^${lo}$`);function fo(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function xs(e){return new RegExp(`^${fo(e)}$`)}function Is(e){const t=fo({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${lo}T(?:${r})$`)}const Zs=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},$s=/^\d+$/,Ps=/^-?\d+(?:\.\d+)?/i,Ns=/true|false/i,Cs=/null/i,Rs=/^[^A-Z]*$/,As=/^[^a-z]*$/,U=d("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ho={number:"number",bigint:"bigint",object:"date"},mo=d("$ZodCheckLessThan",(e,t)=>{U.init(e,t);const n=ho[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,i=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),po=d("$ZodCheckGreaterThan",(e,t)=>{U.init(e,t);const n=ho[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),js=d("$ZodCheckMultipleOf",(e,t)=>{U.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Ha(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Fs=d("$ZodCheckNumberFormat",(e,t)=>{var s;U.init(e,t),t.format=t.format||"float64";const n=(s=t.format)==null?void 0:s.includes("int"),r=n?"int":"number",[o,i]=Ka[t.format];e._zod.onattach.push(c=>{const l=c._zod.bag;l.format=t.format,l.minimum=o,l.maximum=i,n&&(l.pattern=$s)}),e._zod.check=c=>{const l=c.value;if(n){if(!Number.isInteger(l)){c.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?c.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort}):c.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort});return}}l<o&&c.issues.push({origin:"number",input:l,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),l>i&&c.issues.push({origin:"number",input:l,code:"too_big",maximum:i,inst:e})}}),Us=d("$ZodCheckMaxLength",(e,t)=>{var n;U.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Jt(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const s=tn(o);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Ys=d("$ZodCheckMinLength",(e,t)=>{var n;U.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Jt(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const s=tn(o);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Ls=d("$ZodCheckLengthEquals",(e,t)=>{var n;U.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Jt(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,i=o.length;if(i===t.length)return;const s=tn(o),c=i>t.length;r.issues.push({origin:s,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),pt=d("$ZodCheckStringFormat",(e,t)=>{var n,r;U.init(e,t),e._zod.onattach.push(o=>{const i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Gs=d("$ZodCheckRegex",(e,t)=>{pt.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ws=d("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Rs),pt.init(e,t)}),qs=d("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=As),pt.init(e,t)}),Hs=d("$ZodCheckIncludes",(e,t)=>{U.init(e,t);const n=Oe(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Vs=d("$ZodCheckStartsWith",(e,t)=>{U.init(e,t);const n=new RegExp(`^${Oe(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),Bs=d("$ZodCheckEndsWith",(e,t)=>{U.init(e,t);const n=new RegExp(`.*${Oe(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),Xs=d("$ZodCheckOverwrite",(e,t)=>{U.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class Qs{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
2
|
+
`).filter(s=>s),o=Math.min(...r.map(s=>s.length-s.trimStart().length)),i=r.map(s=>s.slice(o)).map(s=>" ".repeat(this.indent*2)+s);for(const s of i)this.content.push(s)}compile(){const t=Function,n=this==null?void 0:this.args,o=[...((this==null?void 0:this.content)??[""]).map(i=>` ${i}`)];return new t(...n,o.join(`
|
|
3
|
+
`))}}const Ks={major:4,minor:0,patch:17},S=d("$ZodType",(e,t)=>{var o;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ks;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const s of i._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),(o=e._zod.deferred)==null||o.push(()=>{e._zod.run=e._zod.parse});else{const i=(s,c,l)=>{let h=Pe(s),y;for(const m of c){if(m._zod.def.when){if(!m._zod.def.when(s))continue}else if(h)continue;const p=s.issues.length,v=m._zod.check(s);if(v instanceof Promise&&(l==null?void 0:l.async)===!1)throw new Ne;if(y||v instanceof Promise)y=(y??Promise.resolve()).then(async()=>{await v,s.issues.length!==p&&(h||(h=Pe(s,p)))});else{if(s.issues.length===p)continue;h||(h=Pe(s,p))}}return y?y.then(()=>s):s};e._zod.run=(s,c)=>{const l=e._zod.parse(s,c);if(l instanceof Promise){if(c.async===!1)throw new Ne;return l.then(h=>i(h,r,c))}return i(l,r,c)}}e["~standard"]={validate:i=>{var s;try{const c=cs(e,i);return c.success?{value:c.data}:{issues:(s=c.error)==null?void 0:s.issues}}catch{return ls(e,i).then(l=>{var h;return l.success?{value:l.data}:{issues:(h=l.error)==null?void 0:h.issues}})}},vendor:"zod",version:1}}),nn=d("$ZodString",(e,t)=>{var n;S.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??Zs(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),E=d("$ZodStringFormat",(e,t)=>{pt.init(e,t),nn.init(e,t)}),Js=d("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ys),E.init(e,t)}),eu=d("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Wn(r))}else t.pattern??(t.pattern=Wn());E.init(e,t)}),tu=d("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=ws),E.init(e,t)}),nu=d("$ZodURL",(e,t)=>{E.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),o=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Ss.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),ru=d("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=bs()),E.init(e,t)}),ou=d("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=gs),E.init(e,t)}),iu=d("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=ds),E.init(e,t)}),au=d("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=fs),E.init(e,t)}),su=d("$ZodULID",(e,t)=>{t.pattern??(t.pattern=hs),E.init(e,t)}),uu=d("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ms),E.init(e,t)}),cu=d("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=ps),E.init(e,t)}),lu=d("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Is(t)),E.init(e,t)}),du=d("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Ms),E.init(e,t)}),fu=d("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=xs(t)),E.init(e,t)}),hu=d("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=_s),E.init(e,t)}),mu=d("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ts),E.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv4"})}),pu=d("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=zs),E.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),gu=d("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ds),E.init(e,t)}),_u=d("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ks),E.init(e,t),e._zod.check=n=>{const[r,o]=n.value.split("/");try{if(!o)throw new Error;const i=Number(o);if(`${i}`!==o)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function go(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const yu=d("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Os),E.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{go(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function wu(e){if(!co.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return go(n)}const vu=d("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=co),E.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{wu(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),bu=d("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Es),E.init(e,t)});function Tu(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const zu=d("$ZodJWT",(e,t)=>{E.init(e,t),e._zod.check=n=>{Tu(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),_o=d("$ZodNumber",(e,t)=>{S.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ps,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),n}}),Du=d("$ZodNumber",(e,t)=>{Fs.init(e,t),_o.init(e,t)}),ku=d("$ZodBoolean",(e,t)=>{S.init(e,t),e._zod.pattern=Ns,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),Ou=d("$ZodNull",(e,t)=>{S.init(e,t),e._zod.pattern=Cs,e._zod.values=new Set([null]),e._zod.parse=(n,r)=>{const o=n.value;return o===null||n.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),n}}),Su=d("$ZodUnknown",(e,t)=>{S.init(e,t),e._zod.parse=n=>n}),Eu=d("$ZodNever",(e,t)=>{S.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function qn(e,t,n){e.issues.length&&t.issues.push(...De(n,e.issues)),t.value[n]=e.value}const Mu=d("$ZodArray",(e,t)=>{S.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const i=[];for(let s=0;s<o.length;s++){const c=o[s],l=t.element._zod.run({value:c,issues:[]},r);l instanceof Promise?i.push(l.then(h=>qn(h,n,s))):qn(l,n,s)}return i.length?Promise.all(i).then(()=>n):n}});function et(e,t,n,r){e.issues.length&&t.issues.push(...De(n,e.issues)),e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}const xu=d("$ZodObject",(e,t)=>{S.init(e,t);const n=to(()=>{const m=Object.keys(t.shape);for(const v of m)if(!t.shape[v]._zod.traits.has("$ZodType"))throw new Error(`Invalid element at key "${v}": expected a Zod schema`);const p=Qa(t.shape);return{shape:t.shape,keys:m,keySet:new Set(m),numKeys:m.length,optionalKeys:new Set(p)}});O(e._zod,"propValues",()=>{const m=t.shape,p={};for(const v in m){const D=m[v]._zod;if(D.values){p[v]??(p[v]=new Set);for(const Z of D.values)p[v].add(Z)}}return p});const r=m=>{const p=new Qs(["shape","payload","ctx"]),v=n.value,D=z=>{const b=Gn(z);return`shape[${b}]._zod.run({ value: input[${b}], issues: [] }, ctx)`};p.write("const input = payload.value;");const Z=Object.create(null);let Y=0;for(const z of v.keys)Z[z]=`key_${Y++}`;p.write("const newResult = {}");for(const z of v.keys){const b=Z[z],I=Gn(z);p.write(`const ${b} = ${D(z)};`),p.write(`
|
|
4
|
+
if (${b}.issues.length) {
|
|
5
|
+
payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
|
|
6
|
+
...iss,
|
|
7
|
+
path: iss.path ? [${I}, ...iss.path] : [${I}]
|
|
8
|
+
})));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (${b}.value === undefined) {
|
|
12
|
+
if (${I} in input) {
|
|
13
|
+
newResult[${I}] = undefined;
|
|
14
|
+
}
|
|
15
|
+
} else {
|
|
16
|
+
newResult[${I}] = ${b}.value;
|
|
17
|
+
}
|
|
18
|
+
`)}p.write("payload.value = newResult;"),p.write("return payload;");const W=p.compile();return(z,b)=>W(m,z,b)};let o;const i=Ft,s=!eo.jitless,l=s&&Ba.value,h=t.catchall;let y;e._zod.parse=(m,p)=>{y??(y=n.value);const v=m.value;if(!i(v))return m.issues.push({expected:"object",code:"invalid_type",input:v,inst:e}),m;const D=[];if(s&&l&&(p==null?void 0:p.async)===!1&&p.jitless!==!0)o||(o=r(t.shape)),m=o(m,p);else{m.value={};const b=y.shape;for(const I of y.keys){const J=b[I]._zod.run({value:v[I],issues:[]},p);J instanceof Promise?D.push(J.then(qe=>et(qe,m,I,v))):et(J,m,I,v)}}if(!h)return D.length?Promise.all(D).then(()=>m):m;const Z=[],Y=y.keySet,W=h._zod,z=W.def.type;for(const b of Object.keys(v)){if(Y.has(b))continue;if(z==="never"){Z.push(b);continue}const I=W.run({value:v[b],issues:[]},p);I instanceof Promise?D.push(I.then(Me=>et(Me,m,b,v))):et(I,m,b,v)}return Z.length&&m.issues.push({code:"unrecognized_keys",keys:Z,input:v,inst:e}),D.length?Promise.all(D).then(()=>m):m}});function Hn(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const o=e.filter(i=>!Pe(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(s=>re(s,r,ne())))}),t)}const Iu=d("$ZodUnion",(e,t)=>{S.init(e,t),O(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),O(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),O(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),O(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>en(i.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(n)return r(o,i);let s=!1;const c=[];for(const l of t.options){const h=l._zod.run({value:o.value,issues:[]},i);if(h instanceof Promise)c.push(h),s=!0;else{if(h.issues.length===0)return h;c.push(h)}}return s?Promise.all(c).then(l=>Hn(l,o,e,i)):Hn(c,o,e,i)}}),Zu=d("$ZodIntersection",(e,t)=>{S.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,i=t.left._zod.run({value:o,issues:[]},r),s=t.right._zod.run({value:o,issues:[]},r);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([l,h])=>Vn(n,l,h)):Vn(n,i,s)}});function Ut(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ce(e)&&Ce(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),o={...e,...t};for(const i of r){const s=Ut(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],i=t[r],s=Ut(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Vn(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Pe(e))return e;const r=Ut(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const $u=d("$ZodRecord",(e,t)=>{S.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Ce(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const i=[];if(t.keyType._zod.values){const s=t.keyType._zod.values;n.value={};for(const l of s)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){const h=t.valueType._zod.run({value:o[l],issues:[]},r);h instanceof Promise?i.push(h.then(y=>{y.issues.length&&n.issues.push(...De(l,y.issues)),n.value[l]=y.value})):(h.issues.length&&n.issues.push(...De(l,h.issues)),n.value[l]=h.value)}let c;for(const l in o)s.has(l)||(c=c??[],c.push(l));c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:c})}else{n.value={};for(const s of Reflect.ownKeys(o)){if(s==="__proto__")continue;const c=t.keyType._zod.run({value:s,issues:[]},r);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(c.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(h=>re(h,r,ne())),input:s,path:[s],inst:e}),n.value[c.value]=c.value;continue}const l=t.valueType._zod.run({value:o[s],issues:[]},r);l instanceof Promise?i.push(l.then(h=>{h.issues.length&&n.issues.push(...De(s,h.issues)),n.value[c.value]=h.value})):(l.issues.length&&n.issues.push(...De(s,l.issues)),n.value[c.value]=l.value)}}return i.length?Promise.all(i).then(()=>n):n}}),Pu=d("$ZodEnum",(e,t)=>{S.init(e,t);const n=qa(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>Xa.has(typeof o)).map(o=>typeof o=="string"?Oe(o):o.toString()).join("|")})$`),e._zod.parse=(o,i)=>{const s=o.value;return r.has(s)||o.issues.push({code:"invalid_value",values:n,input:s,inst:e}),o}}),Nu=d("$ZodLiteral",(e,t)=>{if(S.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Oe(n):n?Oe(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,r)=>{const o=n.value;return e._zod.values.has(o)||n.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),n}}),Cu=d("$ZodTransform",(e,t)=>{S.init(e,t),e._zod.parse=(n,r)=>{const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(n.value=s,n));if(o instanceof Promise)throw new Ne;return n.value=o,n}});function Bn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Ru=d("$ZodOptional",(e,t)=>{S.init(e,t),e._zod.optin="optional",e._zod.optout="optional",O(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),O(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${en(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>Bn(i,n.value)):Bn(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),Au=d("$ZodNullable",(e,t)=>{S.init(e,t),O(e._zod,"optin",()=>t.innerType._zod.optin),O(e._zod,"optout",()=>t.innerType._zod.optout),O(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${en(n.source)}|null)$`):void 0}),O(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),ju=d("$ZodDefault",(e,t)=>{S.init(e,t),e._zod.optin="optional",O(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>Xn(i,t)):Xn(o,t)}});function Xn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Fu=d("$ZodPrefault",(e,t)=>{S.init(e,t),e._zod.optin="optional",O(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),Uu=d("$ZodNonOptional",(e,t)=>{S.init(e,t),O(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>Qn(i,e)):Qn(o,e)}});function Qn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Yu=d("$ZodCatch",(e,t)=>{S.init(e,t),O(e._zod,"optin",()=>t.innerType._zod.optin),O(e._zod,"optout",()=>t.innerType._zod.optout),O(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(s=>re(s,r,ne()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(i=>re(i,r,ne()))},input:n.value}),n.issues=[]),n)}}),Lu=d("$ZodPipe",(e,t)=>{S.init(e,t),O(e._zod,"values",()=>t.in._zod.values),O(e._zod,"optin",()=>t.in._zod.optin),O(e._zod,"optout",()=>t.out._zod.optout),O(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(i=>Kn(i,t,r)):Kn(o,t,r)}});function Kn(e,t,n){return e.issues.length?e:t.out._zod.run({value:e.value,issues:e.issues},n)}const Gu=d("$ZodReadonly",(e,t)=>{S.init(e,t),O(e._zod,"propValues",()=>t.innerType._zod.propValues),O(e._zod,"values",()=>t.innerType._zod.values),O(e._zod,"optin",()=>t.innerType._zod.optin),O(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(Jn):Jn(o)}});function Jn(e){return e.value=Object.freeze(e.value),e}const Wu=d("$ZodCustom",(e,t)=>{U.init(e,t),S.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(i=>er(i,n,r,e));er(o,n,r,e)}});function er(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(Re(o))}}class qu{constructor(){this._map=new Map,this._idmap=new Map}add(t,...n){const r=n[0];if(this._map.set(t,r),r&&typeof r=="object"&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,t)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Hu(){return new qu}const tt=Hu();function Vu(e,t){return new e({type:"string",..._(t)})}function Bu(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,..._(t)})}function tr(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,..._(t)})}function Xu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,..._(t)})}function Qu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",..._(t)})}function Ku(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",..._(t)})}function Ju(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",..._(t)})}function ec(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,..._(t)})}function tc(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,..._(t)})}function nc(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,..._(t)})}function rc(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,..._(t)})}function oc(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,..._(t)})}function ic(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,..._(t)})}function ac(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,..._(t)})}function sc(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,..._(t)})}function uc(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,..._(t)})}function cc(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,..._(t)})}function lc(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,..._(t)})}function dc(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,..._(t)})}function fc(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,..._(t)})}function hc(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,..._(t)})}function mc(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,..._(t)})}function pc(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,..._(t)})}function gc(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,..._(t)})}function _c(e,t){return new e({type:"string",format:"date",check:"string_format",..._(t)})}function yc(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,..._(t)})}function wc(e,t){return new e({type:"string",format:"duration",check:"string_format",..._(t)})}function vc(e,t){return new e({type:"number",checks:[],..._(t)})}function bc(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",..._(t)})}function Tc(e,t){return new e({type:"boolean",..._(t)})}function zc(e,t){return new e({type:"null",..._(t)})}function Dc(e){return new e({type:"unknown"})}function kc(e,t){return new e({type:"never",..._(t)})}function nr(e,t){return new mo({check:"less_than",..._(t),value:e,inclusive:!1})}function It(e,t){return new mo({check:"less_than",..._(t),value:e,inclusive:!0})}function rr(e,t){return new po({check:"greater_than",..._(t),value:e,inclusive:!1})}function Zt(e,t){return new po({check:"greater_than",..._(t),value:e,inclusive:!0})}function or(e,t){return new js({check:"multiple_of",..._(t),value:e})}function yo(e,t){return new Us({check:"max_length",..._(t),maximum:e})}function ot(e,t){return new Ys({check:"min_length",..._(t),minimum:e})}function wo(e,t){return new Ls({check:"length_equals",..._(t),length:e})}function Oc(e,t){return new Gs({check:"string_format",format:"regex",..._(t),pattern:e})}function Sc(e){return new Ws({check:"string_format",format:"lowercase",..._(e)})}function Ec(e){return new qs({check:"string_format",format:"uppercase",..._(e)})}function Mc(e,t){return new Hs({check:"string_format",format:"includes",..._(t),includes:e})}function xc(e,t){return new Vs({check:"string_format",format:"starts_with",..._(t),prefix:e})}function Ic(e,t){return new Bs({check:"string_format",format:"ends_with",..._(t),suffix:e})}function Ye(e){return new Xs({check:"overwrite",tx:e})}function Zc(e){return Ye(t=>t.normalize(e))}function $c(){return Ye(e=>e.trim())}function Pc(){return Ye(e=>e.toLowerCase())}function Nc(){return Ye(e=>e.toUpperCase())}function Cc(e,t,n){return new e({type:"array",element:t,..._(n)})}function Rc(e,t,n){return new e({type:"custom",check:"custom",fn:t,..._(n)})}function Ac(e){const t=jc(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Re(r,n.value,t._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(Re(o))}},e(n.value,n)));return t}function jc(e,t){const n=new U({check:"custom",..._(t)});return n._zod.check=e,n}const Fc=d("ZodISODateTime",(e,t)=>{lu.init(e,t),x.init(e,t)});function Uc(e){return gc(Fc,e)}const Yc=d("ZodISODate",(e,t)=>{du.init(e,t),x.init(e,t)});function Lc(e){return _c(Yc,e)}const Gc=d("ZodISOTime",(e,t)=>{fu.init(e,t),x.init(e,t)});function Wc(e){return yc(Gc,e)}const qc=d("ZodISODuration",(e,t)=>{hu.init(e,t),x.init(e,t)});function Hc(e){return wc(qc,e)}const Vc=(e,t)=>{io.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>as(e,n)},flatten:{value:n=>is(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,jt,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,jt,2)}},isEmpty:{get(){return e.issues.length===0}}})},gt=d("ZodError",Vc,{Parent:Error}),Bc=ss(gt),Xc=us(gt),Qc=so(gt),Kc=uo(gt),M=d("ZodType",(e,t)=>(S.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),e.clone=(n,r)=>ge(e,n,r),e.brand=()=>e,e.register=(n,r)=>(n.add(e,r),e),e.parse=(n,r)=>Bc(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>Qc(e,n,r),e.parseAsync=async(n,r)=>Xc(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>Kc(e,n,r),e.spa=e.safeParseAsync,e.refine=(n,r)=>e.check(Wl(n,r)),e.superRefine=n=>e.check(ql(n)),e.overwrite=n=>e.check(Ye(n)),e.optional=()=>ur(e),e.nullable=()=>cr(e),e.nullish=()=>ur(cr(e)),e.nonoptional=n=>Al(e,n),e.array=()=>ce(e),e.or=n=>le([e,n]),e.and=n=>El(e,n),e.transform=n=>lr(e,Zl(n)),e.default=n=>Nl(e,n),e.prefault=n=>Rl(e,n),e.catch=n=>Fl(e,n),e.pipe=n=>lr(e,n),e.readonly=()=>Ll(e),e.describe=n=>{const r=e.clone();return tt.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){var n;return(n=tt.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return tt.get(e);const r=e.clone();return tt.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),vo=d("_ZodString",(e,t)=>{nn.init(e,t),M.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(Oc(...r)),e.includes=(...r)=>e.check(Mc(...r)),e.startsWith=(...r)=>e.check(xc(...r)),e.endsWith=(...r)=>e.check(Ic(...r)),e.min=(...r)=>e.check(ot(...r)),e.max=(...r)=>e.check(yo(...r)),e.length=(...r)=>e.check(wo(...r)),e.nonempty=(...r)=>e.check(ot(1,...r)),e.lowercase=r=>e.check(Sc(r)),e.uppercase=r=>e.check(Ec(r)),e.trim=()=>e.check($c()),e.normalize=(...r)=>e.check(Zc(...r)),e.toLowerCase=()=>e.check(Pc()),e.toUpperCase=()=>e.check(Nc())}),Jc=d("ZodString",(e,t)=>{nn.init(e,t),vo.init(e,t),e.email=n=>e.check(Bu(el,n)),e.url=n=>e.check(ec(tl,n)),e.jwt=n=>e.check(pc(gl,n)),e.emoji=n=>e.check(tc(nl,n)),e.guid=n=>e.check(tr(ir,n)),e.uuid=n=>e.check(Xu(nt,n)),e.uuidv4=n=>e.check(Qu(nt,n)),e.uuidv6=n=>e.check(Ku(nt,n)),e.uuidv7=n=>e.check(Ju(nt,n)),e.nanoid=n=>e.check(nc(rl,n)),e.guid=n=>e.check(tr(ir,n)),e.cuid=n=>e.check(rc(ol,n)),e.cuid2=n=>e.check(oc(il,n)),e.ulid=n=>e.check(ic(al,n)),e.base64=n=>e.check(fc(hl,n)),e.base64url=n=>e.check(hc(ml,n)),e.xid=n=>e.check(ac(sl,n)),e.ksuid=n=>e.check(sc(ul,n)),e.ipv4=n=>e.check(uc(cl,n)),e.ipv6=n=>e.check(cc(ll,n)),e.cidrv4=n=>e.check(lc(dl,n)),e.cidrv6=n=>e.check(dc(fl,n)),e.e164=n=>e.check(mc(pl,n)),e.datetime=n=>e.check(Uc(n)),e.date=n=>e.check(Lc(n)),e.time=n=>e.check(Wc(n)),e.duration=n=>e.check(Hc(n))});function C(e){return Vu(Jc,e)}const x=d("ZodStringFormat",(e,t)=>{E.init(e,t),vo.init(e,t)}),el=d("ZodEmail",(e,t)=>{tu.init(e,t),x.init(e,t)}),ir=d("ZodGUID",(e,t)=>{Js.init(e,t),x.init(e,t)}),nt=d("ZodUUID",(e,t)=>{eu.init(e,t),x.init(e,t)}),tl=d("ZodURL",(e,t)=>{nu.init(e,t),x.init(e,t)}),nl=d("ZodEmoji",(e,t)=>{ru.init(e,t),x.init(e,t)}),rl=d("ZodNanoID",(e,t)=>{ou.init(e,t),x.init(e,t)}),ol=d("ZodCUID",(e,t)=>{iu.init(e,t),x.init(e,t)}),il=d("ZodCUID2",(e,t)=>{au.init(e,t),x.init(e,t)}),al=d("ZodULID",(e,t)=>{su.init(e,t),x.init(e,t)}),sl=d("ZodXID",(e,t)=>{uu.init(e,t),x.init(e,t)}),ul=d("ZodKSUID",(e,t)=>{cu.init(e,t),x.init(e,t)}),cl=d("ZodIPv4",(e,t)=>{mu.init(e,t),x.init(e,t)}),ll=d("ZodIPv6",(e,t)=>{pu.init(e,t),x.init(e,t)}),dl=d("ZodCIDRv4",(e,t)=>{gu.init(e,t),x.init(e,t)}),fl=d("ZodCIDRv6",(e,t)=>{_u.init(e,t),x.init(e,t)}),hl=d("ZodBase64",(e,t)=>{yu.init(e,t),x.init(e,t)}),ml=d("ZodBase64URL",(e,t)=>{vu.init(e,t),x.init(e,t)}),pl=d("ZodE164",(e,t)=>{bu.init(e,t),x.init(e,t)}),gl=d("ZodJWT",(e,t)=>{zu.init(e,t),x.init(e,t)}),bo=d("ZodNumber",(e,t)=>{_o.init(e,t),M.init(e,t),e.gt=(r,o)=>e.check(rr(r,o)),e.gte=(r,o)=>e.check(Zt(r,o)),e.min=(r,o)=>e.check(Zt(r,o)),e.lt=(r,o)=>e.check(nr(r,o)),e.lte=(r,o)=>e.check(It(r,o)),e.max=(r,o)=>e.check(It(r,o)),e.int=r=>e.check(ar(r)),e.safe=r=>e.check(ar(r)),e.positive=r=>e.check(rr(0,r)),e.nonnegative=r=>e.check(Zt(0,r)),e.negative=r=>e.check(nr(0,r)),e.nonpositive=r=>e.check(It(0,r)),e.multipleOf=(r,o)=>e.check(or(r,o)),e.step=(r,o)=>e.check(or(r,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function V(e){return vc(bo,e)}const _l=d("ZodNumberFormat",(e,t)=>{Du.init(e,t),bo.init(e,t)});function ar(e){return bc(_l,e)}const yl=d("ZodBoolean",(e,t)=>{ku.init(e,t),M.init(e,t)});function ue(e){return Tc(yl,e)}const wl=d("ZodNull",(e,t)=>{Ou.init(e,t),M.init(e,t)});function vl(e){return zc(wl,e)}const bl=d("ZodUnknown",(e,t)=>{Su.init(e,t),M.init(e,t)});function sr(){return Dc(bl)}const Tl=d("ZodNever",(e,t)=>{Eu.init(e,t),M.init(e,t)});function zl(e){return kc(Tl,e)}const Dl=d("ZodArray",(e,t)=>{Mu.init(e,t),M.init(e,t),e.element=t.element,e.min=(n,r)=>e.check(ot(n,r)),e.nonempty=n=>e.check(ot(1,n)),e.max=(n,r)=>e.check(yo(n,r)),e.length=(n,r)=>e.check(wo(n,r)),e.unwrap=()=>e.element});function ce(e,t){return Cc(Dl,e,t)}const kl=d("ZodObject",(e,t)=>{xu.init(e,t),M.init(e,t),O(e,"shape",()=>t.shape),e.keyof=()=>G(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:sr()}),e.loose=()=>e.clone({...e._zod.def,catchall:sr()}),e.strict=()=>e.clone({...e._zod.def,catchall:zl()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>ts(e,n),e.merge=n=>ns(e,n),e.pick=n=>Ja(e,n),e.omit=n=>es(e,n),e.partial=(...n)=>rs(zo,e,n[0]),e.required=(...n)=>os(Do,e,n[0])});function $(e,t){const n={type:"object",get shape(){return pe(this,"shape",e?Va(e):{}),this.shape},..._(t)};return new kl(n)}const Ol=d("ZodUnion",(e,t)=>{Iu.init(e,t),M.init(e,t),e.options=t.options});function le(e,t){return new Ol({type:"union",options:e,..._(t)})}const Sl=d("ZodIntersection",(e,t)=>{Zu.init(e,t),M.init(e,t)});function El(e,t){return new Sl({type:"intersection",left:e,right:t})}const Ml=d("ZodRecord",(e,t)=>{$u.init(e,t),M.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function To(e,t,n){return new Ml({type:"record",keyType:e,valueType:t,..._(n)})}const Yt=d("ZodEnum",(e,t)=>{Pu.init(e,t),M.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const i={};for(const s of r)if(n.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Yt({...t,checks:[],..._(o),entries:i})},e.exclude=(r,o)=>{const i={...t.entries};for(const s of r)if(n.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new Yt({...t,checks:[],..._(o),entries:i})}});function G(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Yt({type:"enum",entries:n,..._(t)})}const xl=d("ZodLiteral",(e,t)=>{Nu.init(e,t),M.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function H(e,t){return new xl({type:"literal",values:Array.isArray(e)?e:[e],..._(t)})}const Il=d("ZodTransform",(e,t)=>{Cu.init(e,t),M.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=i=>{if(typeof i=="string")n.issues.push(Re(i,n.value,t));else{const s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=e),n.issues.push(Re(s))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n)):(n.value=o,n)}});function Zl(e){return new Il({type:"transform",transform:e})}const zo=d("ZodOptional",(e,t)=>{Ru.init(e,t),M.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ur(e){return new zo({type:"optional",innerType:e})}const $l=d("ZodNullable",(e,t)=>{Au.init(e,t),M.init(e,t),e.unwrap=()=>e._zod.def.innerType});function cr(e){return new $l({type:"nullable",innerType:e})}const Pl=d("ZodDefault",(e,t)=>{ju.init(e,t),M.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Nl(e,t){return new Pl({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():ro(t)}})}const Cl=d("ZodPrefault",(e,t)=>{Fu.init(e,t),M.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Rl(e,t){return new Cl({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():ro(t)}})}const Do=d("ZodNonOptional",(e,t)=>{Uu.init(e,t),M.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Al(e,t){return new Do({type:"nonoptional",innerType:e,..._(t)})}const jl=d("ZodCatch",(e,t)=>{Yu.init(e,t),M.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Fl(e,t){return new jl({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Ul=d("ZodPipe",(e,t)=>{Lu.init(e,t),M.init(e,t),e.in=t.in,e.out=t.out});function lr(e,t){return new Ul({type:"pipe",in:e,out:t})}const Yl=d("ZodReadonly",(e,t)=>{Gu.init(e,t),M.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ll(e){return new Yl({type:"readonly",innerType:e})}const Gl=d("ZodCustom",(e,t)=>{Wu.init(e,t),M.init(e,t)});function Wl(e,t={}){return Rc(Gl,e,t)}function ql(e){return Ac(e)}const Hl=["horizontal_bar","vertical_bar","gauge","donut","timeseries_line","timeseries_bar","golden_signals","top_n","slottable","single_value"],Le=C(),_e=C(),ko=ue(),Oo=le([ce(C()),To(C(),C())]),So=$({type:H("slottable"),id:C()}).strict(),Eo=$({type:G(["horizontal_bar","vertical_bar"]),stacked:ue().optional(),chart_dataset_colors:Oo.optional(),synthetics_data_key:Le.optional(),chart_title:_e.optional(),allow_csv_export:ko.optional()}).strict(),Mo=$({type:G(["timeseries_line","timeseries_bar"]),stacked:ue().optional(),threshold:To(C(),V()).optional(),chart_dataset_colors:Oo.optional(),synthetics_data_key:Le.optional(),chart_title:_e.optional(),allow_csv_export:ko.optional()}).strict(),xo=$({type:H("gauge"),metric_display:G(["hidden","single","full"]).optional(),reverse_dataset:ue().optional(),numerator:V().optional(),synthetics_data_key:Le.optional(),chart_title:_e.optional()}).strict(),Io=$({type:H("donut"),synthetics_data_key:Le.optional(),chart_title:_e.optional()}).strict(),Zo=$({type:H("top_n"),chart_title:_e.optional(),synthetics_data_key:Le.optional(),description:C().optional(),entity_link:C().optional()}).strict(),$o=$({type:H("golden_signals"),chart_title:_e.optional(),long_card_titles:ue().optional(),description:C().optional(),percentile_latency:ue().optional()}).strict(),Po=$({type:H("single_value"),decimal_points:V().optional(),chart_title:_e.optional()}).strict(),Vl=$({tz:C().optional().default("Etc/UTC"),type:H("relative"),time_range:G(Ht).optional().default("1h")}).strict(),Bl=$({tz:C().optional(),type:H("absolute"),start:C(),end:C()}).strict(),Xl=le([Vl,Bl]).optional().default({tz:Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC",type:"relative",time_range:"1h"}),rn=$({granularity:G(lt).optional(),time_range:Xl,limit:V().optional(),meta:$().optional()}),on=e=>ce(G(e)).optional(),an=e=>ce(G(e)).max(2).optional(),_t=e=>{const t=$({field:G(e),operator:G(Wt),value:ce(le([C(),V(),vl()]))}).strict(),n=$({field:G(e),operator:G(qt)}).strict();return ce(le([t,n])).optional()},No=rn.extend({datasource:H("api_usage"),metrics:on(Vt),dimensions:an(ft),filters:_t(fe)}).strict(),Co=rn.extend({datasource:H("basic"),metrics:on(dt),dimensions:an(Fe),filters:_t(de)}).strict(),Ro=rn.extend({datasource:H("llm_usage"),metrics:on(Bt),dimensions:an(ht),filters:_t(he)}).strict(),Ao=le([No,Co,Ro]),jo=$({query:Ao,chart:le([Eo,xo,Io,Mo,$o,Zo,So,Po])}).strict(),Fo=$({position:$({col:V(),row:V()}).strict(),size:$({cols:V(),rows:V(),fit_to_content:ue().optional()}).strict()}).strict(),Uo=$({type:G(["chart"]),definition:jo,layout:Fo,id:C().optional()}).strict(),Yo=$({tiles:ce(Uo),tile_height:V().optional(),preset_filters:_t([...fe,...de,...he]),template_id:C().nullable().optional()}).strict(),Ql=e=>Yo.parse(e),Kl=e=>{const t=[];return de.includes(e)&&t.push("basic"),fe.includes(e)&&t.push("api_usage"),he.includes(e)&&t.push("llm_usage"),(Zr.includes(e)||Nr.includes(e))&&t.push("requests"),t},Lo=6048e5,Jl=864e5,ed=60,td=3600,dr=Symbol.for("constructDateFrom");function q(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&dr in e?e[dr](t):e instanceof Date?new e.constructor(t):new Date(t)}function R(e,t){return q(t||e,e)}function fr(e,t,n){const r=R(e,n==null?void 0:n.in);return isNaN(t)?q(e,NaN):(r.setDate(r.getDate()+t),r)}function nd(e,t,n){const r=R(e,n==null?void 0:n.in);if(isNaN(t))return q(e,NaN);const o=r.getDate(),i=q(e,r.getTime());i.setMonth(r.getMonth()+t+1,0);const s=i.getDate();return o>=s?i:(r.setFullYear(i.getFullYear(),i.getMonth(),o),r)}let rd={};function Ge(){return rd}function K(e,t){var c,l,h,y;const n=Ge(),r=(t==null?void 0:t.weekStartsOn)??((l=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((y=(h=n.locale)==null?void 0:h.options)==null?void 0:y.weekStartsOn)??0,o=R(e,t==null?void 0:t.in),i=o.getDay(),s=(i<r?7:0)+i-r;return o.setDate(o.getDate()-s),o.setHours(0,0,0,0),o}function it(e,t){return K(e,{...t,weekStartsOn:1})}function Go(e,t){const n=R(e,t==null?void 0:t.in),r=n.getFullYear(),o=q(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const i=it(o),s=q(n,0);s.setFullYear(r,0,4),s.setHours(0,0,0,0);const c=it(s);return n.getTime()>=i.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function hr(e){const t=R(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function od(e,...t){const n=q.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function at(e,t){const n=R(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function id(e,t,n){const[r,o]=od(n==null?void 0:n.in,e,t),i=at(r),s=at(o),c=+i-hr(i),l=+s-hr(s);return Math.round((c-l)/Jl)}function ad(e,t){const n=Go(e,t),r=q(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),it(r)}function sd(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ud(e){return!(!sd(e)&&typeof e!="number"||isNaN(+R(e)))}function ke(e,t){const n=R(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function cd(e,t){const n=R(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const ld={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"}},dd=(e,t,n)=>{let r;const o=ld[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function $t(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const fd={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},hd={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},md={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},pd={date:$t({formats:fd,defaultWidth:"full"}),time:$t({formats:hd,defaultWidth:"full"}),dateTime:$t({formats:md,defaultWidth:"full"})},gd={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},_d=(e,t,n,r)=>gd[e];function Ze(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,c=n!=null&&n.width?String(n.width):s;o=e.formattingValues[c]||e.formattingValues[s]}else{const s=e.defaultWidth,c=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[c]||e.values[s]}const i=e.argumentCallback?e.argumentCallback(t):t;return o[i]}}const yd={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},wd={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},vd={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"]},bd={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"]},Td={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"}},zd={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"}},Dd=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},kd={ordinalNumber:Dd,era:Ze({values:yd,defaultWidth:"wide"}),quarter:Ze({values:wd,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ze({values:vd,defaultWidth:"wide"}),day:Ze({values:bd,defaultWidth:"wide"}),dayPeriod:Ze({values:Td,defaultWidth:"wide",formattingValues:zd,defaultFormattingWidth:"wide"})};function $e(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;const s=i[0],c=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(c)?Sd(c,m=>m.test(s)):Od(c,m=>m.test(s));let h;h=e.valueCallback?e.valueCallback(l):l,h=n.valueCallback?n.valueCallback(h):h;const y=t.slice(s.length);return{value:h,rest:y}}}function Od(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Sd(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Ed(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],i=t.match(e.parsePattern);if(!i)return null;let s=e.valueCallback?e.valueCallback(i[0]):i[0];s=n.valueCallback?n.valueCallback(s):s;const c=t.slice(o.length);return{value:s,rest:c}}}const Md=/^(\d+)(th|st|nd|rd)?/i,xd=/\d+/i,Id={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},Zd={any:[/^b/i,/^(a|c)/i]},$d={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Pd={any:[/1/i,/2/i,/3/i,/4/i]},Nd={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},Cd={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]},Rd={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},Ad={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]},jd={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},Fd={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}},Ud={ordinalNumber:Ed({matchPattern:Md,parsePattern:xd,valueCallback:e=>parseInt(e,10)}),era:$e({matchPatterns:Id,defaultMatchWidth:"wide",parsePatterns:Zd,defaultParseWidth:"any"}),quarter:$e({matchPatterns:$d,defaultMatchWidth:"wide",parsePatterns:Pd,defaultParseWidth:"any",valueCallback:e=>e+1}),month:$e({matchPatterns:Nd,defaultMatchWidth:"wide",parsePatterns:Cd,defaultParseWidth:"any"}),day:$e({matchPatterns:Rd,defaultMatchWidth:"wide",parsePatterns:Ad,defaultParseWidth:"any"}),dayPeriod:$e({matchPatterns:jd,defaultMatchWidth:"any",parsePatterns:Fd,defaultParseWidth:"any"})},Yd={code:"en-US",formatDistance:dd,formatLong:pd,formatRelative:_d,localize:kd,match:Ud,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Ld(e,t){const n=R(e,t==null?void 0:t.in);return id(n,cd(n))+1}function Gd(e,t){const n=R(e,t==null?void 0:t.in),r=+it(n)-+ad(n);return Math.round(r/Lo)+1}function Wo(e,t){var y,m,p,v;const n=R(e,t==null?void 0:t.in),r=n.getFullYear(),o=Ge(),i=(t==null?void 0:t.firstWeekContainsDate)??((m=(y=t==null?void 0:t.locale)==null?void 0:y.options)==null?void 0:m.firstWeekContainsDate)??o.firstWeekContainsDate??((v=(p=o.locale)==null?void 0:p.options)==null?void 0:v.firstWeekContainsDate)??1,s=q((t==null?void 0:t.in)||e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const c=K(s,t),l=q((t==null?void 0:t.in)||e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const h=K(l,t);return+n>=+c?r+1:+n>=+h?r:r-1}function Wd(e,t){var c,l,h,y;const n=Ge(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((y=(h=n.locale)==null?void 0:h.options)==null?void 0:y.firstWeekContainsDate)??1,o=Wo(e,t),i=q((t==null?void 0:t.in)||e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),K(i,t)}function qd(e,t){const n=R(e,t==null?void 0:t.in),r=+K(n,t)-+Wd(n,t);return Math.round(r/Lo)+1}function T(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const te={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return T(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):T(n+1,2)},d(e,t){return T(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return T(e.getHours()%12||12,t.length)},H(e,t){return T(e.getHours(),t.length)},m(e,t){return T(e.getMinutes(),t.length)},s(e,t){return T(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return T(o,t.length)}},Te={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},mr={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return te.y(e,t)},Y:function(e,t,n,r){const o=Wo(e,r),i=o>0?o:1-o;if(t==="YY"){const s=i%100;return T(s,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):T(i,t.length)},R:function(e,t){const n=Go(e);return T(n,t.length)},u:function(e,t){const n=e.getFullYear();return T(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return T(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return T(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return te.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return T(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=qd(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):T(o,t.length)},I:function(e,t,n){const r=Gd(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):T(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):te.d(e,t)},D:function(e,t,n){const r=Ld(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):T(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return T(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return T(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return T(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=Te.noon:r===0?o=Te.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=Te.evening:r>=12?o=Te.afternoon:r>=4?o=Te.morning:o=Te.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return te.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):te.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):T(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):T(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):te.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):te.s(e,t)},S:function(e,t){return te.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return gr(r);case"XXXX":case"XX":return se(r);case"XXXXX":case"XXX":default:return se(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return gr(r);case"xxxx":case"xx":return se(r);case"xxxxx":case"xxx":default:return se(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+pr(r,":");case"OOOO":default:return"GMT"+se(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+pr(r,":");case"zzzz":default:return"GMT"+se(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return T(r,t.length)},T:function(e,t,n){return T(+e,t.length)}};function pr(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),i=r%60;return i===0?n+String(o):n+String(o)+t+T(i,2)}function gr(e,t){return e%60===0?(e>0?"-":"+")+T(Math.abs(e)/60,2):se(e,t)}function se(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=T(Math.trunc(r/60),2),i=T(r%60,2);return n+o+t+i}const _r=(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"})}},qo=(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"})}},Hd=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return _r(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",_r(r,t)).replace("{{time}}",qo(o,t))},Vd={p:qo,P:Hd},Bd=/^D+$/,Xd=/^Y+$/,Qd=["D","DD","YY","YYYY"];function Kd(e){return Bd.test(e)}function Jd(e){return Xd.test(e)}function ef(e,t,n){const r=tf(e,t,n);if(console.warn(r),Qd.includes(e))throw new RangeError(r)}function tf(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const nf=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rf=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,of=/^'([^]*?)'?$/,af=/''/g,sf=/[a-zA-Z]/;function Ho(e,t,n){var y,m,p,v,D,Z,Y,W;const r=Ge(),o=(n==null?void 0:n.locale)??r.locale??Yd,i=(n==null?void 0:n.firstWeekContainsDate)??((m=(y=n==null?void 0:n.locale)==null?void 0:y.options)==null?void 0:m.firstWeekContainsDate)??r.firstWeekContainsDate??((v=(p=r.locale)==null?void 0:p.options)==null?void 0:v.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((Z=(D=n==null?void 0:n.locale)==null?void 0:D.options)==null?void 0:Z.weekStartsOn)??r.weekStartsOn??((W=(Y=r.locale)==null?void 0:Y.options)==null?void 0:W.weekStartsOn)??0,c=R(e,n==null?void 0:n.in);if(!ud(c))throw new RangeError("Invalid time value");let l=t.match(rf).map(z=>{const b=z[0];if(b==="p"||b==="P"){const I=Vd[b];return I(z,o.formatLong)}return z}).join("").match(nf).map(z=>{if(z==="''")return{isToken:!1,value:"'"};const b=z[0];if(b==="'")return{isToken:!1,value:uf(z)};if(mr[b])return{isToken:!0,value:z};if(b.match(sf))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:z}});o.localize.preprocessor&&(l=o.localize.preprocessor(c,l));const h={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return l.map(z=>{if(!z.isToken)return z.value;const b=z.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Jd(b)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&Kd(b))&&ef(b,t,String(e));const I=mr[b[0]];return I(c,b,o.localize,h)}).join("")}function uf(e){const t=e.match(of);return t?t[1].replace(af,"'"):e}function cf(e,t){const n=R(e,t==null?void 0:t.in),r=n.getFullYear(),o=n.getMonth(),i=q(n,0);return i.setFullYear(r,o+1,0),i.setHours(0,0,0,0),i.getDate()}function lf(){return Object.assign({},Ge())}function yr(e){return+R(e)}function wr(e){return Math.trunc(+R(e)/1e3)}function df(e){return Math.trunc(e*td)}function ff(e){const t=e/ed;return Math.trunc(t)}function Vo(e,t,n){return nd(e,-1,n)}function vr(e,t,n){const r=lf(),o=pf(e,n.timeZone,n.locale??r.locale);return"formatToParts"in o?hf(o,t):mf(o,t)}function hf(e,t){const n=e.formatToParts(t);for(let r=n.length-1;r>=0;--r)if(n[r].type==="timeZoneName")return n[r].value}function mf(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/ [\w-+ ]+$/.exec(n);return r?r[0].substr(1):""}function pf(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function gf(e,t){const n=bf(t);return"formatToParts"in n?yf(n,e):wf(n,e)}const _f={year:0,month:1,day:2,hour:3,minute:4,second:5};function yf(e,t){try{const n=e.formatToParts(t),r=[];for(let o=0;o<n.length;o++){const i=_f[n[o].type];i!==void 0&&(r[i]=parseInt(n[o].value,10))}return r}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function wf(e,t){const n=e.format(t),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[parseInt(r[3],10),parseInt(r[1],10),parseInt(r[2],10),parseInt(r[4],10),parseInt(r[5],10),parseInt(r[6],10)]}const Pt={},br=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")),vf=br==="06/25/2014, 00:00:00"||br==="06/25/2014 00:00:00";function bf(e){return Pt[e]||(Pt[e]=vf?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"})),Pt[e]}function sn(e,t,n,r,o,i,s){const c=new Date(0);return c.setUTCFullYear(e,t,n),c.setUTCHours(r,o,i,s),c}const Tr=36e5,Tf=6e4,Nt={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function We(e,t,n){if(!e)return 0;let r=Nt.timezoneZ.exec(e);if(r)return 0;let o,i;if(r=Nt.timezoneHH.exec(e),r)return o=parseInt(r[1],10),zr(o)?-(o*Tr):NaN;if(r=Nt.timezoneHHMM.exec(e),r){o=parseInt(r[2],10);const s=parseInt(r[3],10);return zr(o,s)?(i=Math.abs(o)*Tr+s*Tf,r[1]==="+"?-i:i):NaN}if(kf(e)){t=new Date(t||Date.now());const s=n?t:zf(t),c=Lt(s,e);return-(n?c:Df(t,c,e))}return NaN}function zf(e){return sn(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function Lt(e,t){const n=gf(e,t),r=sn(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let o=e.getTime();const i=o%1e3;return o-=i>=0?i:1e3+i,r-o}function Df(e,t,n){let o=e.getTime()-t;const i=Lt(new Date(o),n);if(t===i)return t;o-=i-t;const s=Lt(new Date(o),n);return i===s?i:Math.max(i,s)}function zr(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const Dr={};function kf(e){if(Dr[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Dr[e]=!0,!0}catch{return!1}}const Of=60*1e3,Sf={X:function(e,t,n){const r=Ct(n.timeZone,e);if(r===0)return"Z";switch(t){case"X":return kr(r);case"XXXX":case"XX":return ze(r);case"XXXXX":case"XXX":default:return ze(r,":")}},x:function(e,t,n){const r=Ct(n.timeZone,e);switch(t){case"x":return kr(r);case"xxxx":case"xx":return ze(r);case"xxxxx":case"xxx":default:return ze(r,":")}},O:function(e,t,n){const r=Ct(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+Ef(r,":");case"OOOO":default:return"GMT"+ze(r,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return vr("short",e,n);case"zzzz":default:return vr("long",e,n)}}};function Ct(e,t){const n=e?We(e,t,!0)/Of:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function st(e,t){const n=e<0?"-":"";let r=Math.abs(e).toString();for(;r.length<t;)r="0"+r;return n+r}function ze(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=st(Math.floor(r/60),2),i=st(Math.floor(r%60),2);return n+o+t+i}function kr(e,t){return e%60===0?(e>0?"-":"+")+st(Math.abs(e)/60,2):ze(e,t)}function Ef(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),i=r%60;return i===0?n+String(o):n+String(o)+t+st(i,2)}function Or(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 Bo=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Rt=36e5,Sr=6e4,Mf=2,A={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:Bo};function ut(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 n=t.additionalDigits==null?Mf:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==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 r=xf(e),{year:o,restDateString:i}=If(r.date,n),s=Zf(i,o);if(s===null||isNaN(s.getTime()))return new Date(NaN);if(s){const c=s.getTime();let l=0,h;if(r.time&&(l=$f(r.time),l===null||isNaN(l)))return new Date(NaN);if(r.timeZone||t.timeZone){if(h=We(r.timeZone||t.timeZone,new Date(c+l)),isNaN(h))return new Date(NaN)}else h=Or(new Date(c+l)),h=Or(new Date(c+l+h));return new Date(c+l+h)}else return new Date(NaN)}function xf(e){const t={};let n=A.dateTimePattern.exec(e),r;if(n?(t.date=n[1],r=n[3]):(n=A.datePattern.exec(e),n?(t.date=n[1],r=n[2]):(t.date=null,r=e)),r){const o=A.timeZone.exec(r);o?(t.time=r.replace(o[1],""),t.timeZone=o[1].trim()):t.time=r}return t}function If(e,t){if(e){const n=A.YYY[t],r=A.YYYYY[t];let o=A.YYYY.exec(e)||r.exec(e);if(o){const i=o[1];return{year:parseInt(i,10),restDateString:e.slice(i.length)}}if(o=A.YY.exec(e)||n.exec(e),o){const i=o[1];return{year:parseInt(i,10)*100,restDateString:e.slice(i.length)}}}return{year:null}}function Zf(e,t){if(t===null)return null;let n,r,o;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let i=A.MM.exec(e);if(i)return n=new Date(0),r=parseInt(i[1],10)-1,Mr(t,r)?(n.setUTCFullYear(t,r),n):new Date(NaN);if(i=A.DDD.exec(e),i){n=new Date(0);const s=parseInt(i[1],10);return Cf(t,s)?(n.setUTCFullYear(t,0,s),n):new Date(NaN)}if(i=A.MMDD.exec(e),i){n=new Date(0),r=parseInt(i[1],10)-1;const s=parseInt(i[2],10);return Mr(t,r,s)?(n.setUTCFullYear(t,r,s),n):new Date(NaN)}if(i=A.Www.exec(e),i)return o=parseInt(i[1],10)-1,xr(o)?Er(t,o):new Date(NaN);if(i=A.WwwD.exec(e),i){o=parseInt(i[1],10)-1;const s=parseInt(i[2],10)-1;return xr(o,s)?Er(t,o,s):new Date(NaN)}return null}function $f(e){let t,n,r=A.HH.exec(e);if(r)return t=parseFloat(r[1].replace(",",".")),At(t)?t%24*Rt:NaN;if(r=A.HHMM.exec(e),r)return t=parseInt(r[1],10),n=parseFloat(r[2].replace(",",".")),At(t,n)?t%24*Rt+n*Sr:NaN;if(r=A.HHMMSS.exec(e),r){t=parseInt(r[1],10),n=parseInt(r[2],10);const o=parseFloat(r[3].replace(",","."));return At(t,n,o)?t%24*Rt+n*Sr+o*1e3:NaN}return null}function Er(e,t,n){t=t||0,n=n||0;const r=new Date(0);r.setUTCFullYear(e,0,4);const o=r.getUTCDay()||7,i=t*7+n+1-o;return r.setUTCDate(r.getUTCDate()+i),r}const Pf=[31,28,31,30,31,30,31,31,30,31,30,31],Nf=[31,29,31,30,31,30,31,31,30,31,30,31];function Xo(e){return e%400===0||e%4===0&&e%100!==0}function Mr(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const r=Xo(e);if(r&&n>Nf[t]||!r&&n>Pf[t])return!1}return!0}function Cf(e,t){if(t<1)return!1;const n=Xo(e);return!(n&&t>366||!n&&t>365)}function xr(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function At(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const Rf=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Af(e,t,n={}){t=String(t);const r=t.match(Rf);if(r){const o=ut(n.originalDate||e,n);t=r.reduce(function(i,s){if(s[0]==="'")return i;const c=i.indexOf(s),l=i[c-1]==="'",h=i.replace(s,"'"+Sf[s[0]](o,s,n)+"'");return l?h.substring(0,c-1)+h.substring(c+1):h},t)}return Ho(e,t,n)}function Qo(e,t,n){e=ut(e,n);const r=We(t,e,!0),o=new Date(e.getTime()-r),i=new Date(0);return i.setFullYear(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()),i.setHours(o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.getUTCMilliseconds()),i}function jf(e,t,n,r){return r={...r,timeZone:t,originalDate:e},Af(Qo(e,t,{timeZone:r.timeZone}),n,r)}function Ff(e,t,n){if(typeof e=="string"&&!e.match(Bo))return ut(e,{...n,timeZone:t});e=ut(e,n);const r=sn(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),o=We(t,new Date(r));return new Date(r+o)}function Ko(e,t){return-We(e,t)}function Uf(e){return Ho(e,"yyyy-MM-dd'T'HH:mm:ss.SSSXXX")}function Gt(e,t={}){if(!e)return e;const n=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let r="MMM dd, yyy hh:mm a";t.short&&(r="MMM dd, yyy"),t.includeTZ&&(r+=" (z)");const o=new Date(e);return jf(o,n,r)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}function Yf(e,t){return`${Gt(e.getTime())} - ${Gt(t.getTime(),{includeTZ:!0})}`}const Ae={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 Lf(e,t){return e.map(n=>({value:n,label:t.t(`configuration.vitals.reports.granularity.${n}`)}))}function Jo(e,t){return{duration:e,type:"duration",origin:t}}function Gf(e){return e&<.find(n=>e<=Ae[n])||null}function ei(e,t,n,r){const o=Ae[n];let i=0;return o>=Ae.daily&&(r?i=-Ko(r,t):i=t.getTimezoneOffset()*60*1e3),new Date(e((t.getTime()-i)/o)*o+i)}function ti(e,t,n){return ei(Math.floor,e,t,n)}function un(e,t,n){return ei(Math.ceil,e,t,n)}class yt{constructor(t,n,r){P(this,"timeframe");P(this,"tz");P(this,"dataGranularity");if(this.constructor===yt)throw new Error("BaseQueryTime is not meant to be used directly.");this.timeframe=t,this.tz=n,this.dataGranularity=r??t.dataGranularity}calculateStartDate(t,n,r=1){if(t)return new Date(this.endDate().getTime()-this.timeframe.timeframeLengthMs()*r);{const o=this.endDate(),i=this.timeframe.rawStart(this.tz),s=ti(i,n,this.tz),l=(o.getTime()-s.getTime())*(r-1);return new Date(s.getTime()-l)}}granularitySeconds(){return Math.floor(this.granularityMs()/1e3)}granularityDruid(){return Jo(this.granularityMs(),this.startDate().toISOString())}startSeconds(){return wr(this.startDate())}endSeconds(){return wr(this.endDate())}startMs(){return yr(this.startDate())}endMs(){return yr(this.endDate())}}class Wf extends yt{constructor(n,r,o,i,s){super(n,o,i);P(this,"granularity");r&&n.allowedGranularities(s).has(r)?this.granularity=r:s?this.granularity=n.fineGrainedDefaultGranularity??n.defaultResponseGranularity:this.granularity=n.defaultResponseGranularity}startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.granularity)}endDate(){return un(this.timeframe.rawEnd(),this.granularity,this.tz)}granularityMs(){return Ae[this.granularity]}}class ni extends yt{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity)}endDate(){return un(this.timeframe.rawEnd(this.tz),this.dataGranularity,this.tz)}granularityMs(){return this.endDate().getTime()-this.startDate().getTime()}}class qf extends ni{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity,2)}granularityMs(){return this.endDate().getTime()-super.startDate().getTime()}}var rt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Hf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ct={exports:{}};ct.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",s="[object Array]",c="[object Boolean]",l="[object Date]",h="[object Error]",y="[object Function]",m="[object GeneratorFunction]",p="[object Map]",v="[object Number]",D="[object Object]",Z="[object Promise]",Y="[object RegExp]",W="[object Set]",z="[object String]",b="[object Symbol]",I="[object WeakMap]",Me="[object ArrayBuffer]",J="[object DataView]",qe="[object Float32Array]",ln="[object Float64Array]",dn="[object Int8Array]",fn="[object Int16Array]",hn="[object Int32Array]",mn="[object Uint8Array]",pn="[object Uint8ClampedArray]",gn="[object Uint16Array]",_n="[object Uint32Array]",ii=/[\\^$.*+?()[\]{}|]/g,ai=/\w*$/,si=/^\[object .+?Constructor\]$/,ui=/^(?:0|[1-9]\d*)$/,k={};k[i]=k[s]=k[Me]=k[J]=k[c]=k[l]=k[qe]=k[ln]=k[dn]=k[fn]=k[hn]=k[p]=k[v]=k[D]=k[Y]=k[W]=k[z]=k[b]=k[mn]=k[pn]=k[gn]=k[_n]=!0,k[h]=k[y]=k[I]=!1;var ci=typeof rt=="object"&&rt&&rt.Object===Object&&rt,li=typeof self=="object"&&self&&self.Object===Object&&self,B=ci||li||Function("return this")(),yn=t&&!t.nodeType&&t,wn=yn&&!0&&e&&!e.nodeType&&e,di=wn&&wn.exports===yn;function fi(a,u){return a.set(u[0],u[1]),a}function hi(a,u){return a.add(u),a}function mi(a,u){for(var f=-1,g=a?a.length:0;++f<g&&u(a[f],f,a)!==!1;);return a}function pi(a,u){for(var f=-1,g=u.length,N=a.length;++f<g;)a[N+f]=u[f];return a}function vn(a,u,f,g){for(var N=-1,j=a?a.length:0;++N<j;)f=u(f,a[N],N,a);return f}function gi(a,u){for(var f=-1,g=Array(a);++f<a;)g[f]=u(f);return g}function _i(a,u){return a==null?void 0:a[u]}function bn(a){var u=!1;if(a!=null&&typeof a.toString!="function")try{u=!!(a+"")}catch{}return u}function Tn(a){var u=-1,f=Array(a.size);return a.forEach(function(g,N){f[++u]=[N,g]}),f}function vt(a,u){return function(f){return a(u(f))}}function zn(a){var u=-1,f=Array(a.size);return a.forEach(function(g){f[++u]=g}),f}var yi=Array.prototype,wi=Function.prototype,He=Object.prototype,bt=B["__core-js_shared__"],Dn=function(){var a=/[^.]+$/.exec(bt&&bt.keys&&bt.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""}(),kn=wi.toString,ee=He.hasOwnProperty,Ve=He.toString,vi=RegExp("^"+kn.call(ee).replace(ii,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),On=di?B.Buffer:void 0,Sn=B.Symbol,En=B.Uint8Array,bi=vt(Object.getPrototypeOf,Object),Ti=Object.create,zi=He.propertyIsEnumerable,Di=yi.splice,Mn=Object.getOwnPropertySymbols,ki=On?On.isBuffer:void 0,Oi=vt(Object.keys,Object),Tt=ve(B,"DataView"),xe=ve(B,"Map"),zt=ve(B,"Promise"),Dt=ve(B,"Set"),kt=ve(B,"WeakMap"),Ie=ve(Object,"create"),Si=ae(Tt),Ei=ae(xe),Mi=ae(zt),xi=ae(Dt),Ii=ae(kt),xn=Sn?Sn.prototype:void 0,In=xn?xn.valueOf:void 0;function oe(a){var u=-1,f=a?a.length:0;for(this.clear();++u<f;){var g=a[u];this.set(g[0],g[1])}}function Zi(){this.__data__=Ie?Ie(null):{}}function $i(a){return this.has(a)&&delete this.__data__[a]}function Pi(a){var u=this.__data__;if(Ie){var f=u[a];return f===r?void 0:f}return ee.call(u,a)?u[a]:void 0}function Ni(a){var u=this.__data__;return Ie?u[a]!==void 0:ee.call(u,a)}function Ci(a,u){var f=this.__data__;return f[a]=Ie&&u===void 0?r:u,this}oe.prototype.clear=Zi,oe.prototype.delete=$i,oe.prototype.get=Pi,oe.prototype.has=Ni,oe.prototype.set=Ci;function X(a){var u=-1,f=a?a.length:0;for(this.clear();++u<f;){var g=a[u];this.set(g[0],g[1])}}function Ri(){this.__data__=[]}function Ai(a){var u=this.__data__,f=Be(u,a);if(f<0)return!1;var g=u.length-1;return f==g?u.pop():Di.call(u,f,1),!0}function ji(a){var u=this.__data__,f=Be(u,a);return f<0?void 0:u[f][1]}function Fi(a){return Be(this.__data__,a)>-1}function Ui(a,u){var f=this.__data__,g=Be(f,a);return g<0?f.push([a,u]):f[g][1]=u,this}X.prototype.clear=Ri,X.prototype.delete=Ai,X.prototype.get=ji,X.prototype.has=Fi,X.prototype.set=Ui;function ye(a){var u=-1,f=a?a.length:0;for(this.clear();++u<f;){var g=a[u];this.set(g[0],g[1])}}function Yi(){this.__data__={hash:new oe,map:new(xe||X),string:new oe}}function Li(a){return Xe(this,a).delete(a)}function Gi(a){return Xe(this,a).get(a)}function Wi(a){return Xe(this,a).has(a)}function qi(a,u){return Xe(this,a).set(a,u),this}ye.prototype.clear=Yi,ye.prototype.delete=Li,ye.prototype.get=Gi,ye.prototype.has=Wi,ye.prototype.set=qi;function we(a){this.__data__=new X(a)}function Hi(){this.__data__=new X}function Vi(a){return this.__data__.delete(a)}function Bi(a){return this.__data__.get(a)}function Xi(a){return this.__data__.has(a)}function Qi(a,u){var f=this.__data__;if(f instanceof X){var g=f.__data__;if(!xe||g.length<n-1)return g.push([a,u]),this;f=this.__data__=new ye(g)}return f.set(a,u),this}we.prototype.clear=Hi,we.prototype.delete=Vi,we.prototype.get=Bi,we.prototype.has=Xi,we.prototype.set=Qi;function Ki(a,u){var f=Et(a)||Ta(a)?gi(a.length,String):[],g=f.length,N=!!g;for(var j in a)ee.call(a,j)&&!(N&&(j=="length"||ya(j,g)))&&f.push(j);return f}function Zn(a,u,f){var g=a[u];(!(ee.call(a,u)&&Cn(g,f))||f===void 0&&!(u in a))&&(a[u]=f)}function Be(a,u){for(var f=a.length;f--;)if(Cn(a[f][0],u))return f;return-1}function Ji(a,u){return a&&$n(u,Mt(u),a)}function Ot(a,u,f,g,N,j,Q){var F;if(g&&(F=j?g(a,N,j,Q):g(a)),F!==void 0)return F;if(!Qe(a))return a;var jn=Et(a);if(jn){if(F=pa(a),!u)return fa(a,F)}else{var be=ie(a),Fn=be==y||be==m;if(Da(a))return ia(a,u);if(be==D||be==i||Fn&&!j){if(bn(a))return j?a:{};if(F=ga(Fn?{}:a),!u)return ha(a,Ji(F,a))}else{if(!k[be])return j?a:{};F=_a(a,be,Ot,u)}}Q||(Q=new we);var Un=Q.get(a);if(Un)return Un;if(Q.set(a,F),!jn)var Yn=f?ma(a):Mt(a);return mi(Yn||a,function(xt,Ke){Yn&&(Ke=xt,xt=a[Ke]),Zn(F,Ke,Ot(xt,u,f,g,Ke,a,Q))}),F}function ea(a){return Qe(a)?Ti(a):{}}function ta(a,u,f){var g=u(a);return Et(a)?g:pi(g,f(a))}function na(a){return Ve.call(a)}function ra(a){if(!Qe(a)||va(a))return!1;var u=An(a)||bn(a)?vi:si;return u.test(ae(a))}function oa(a){if(!Nn(a))return Oi(a);var u=[];for(var f in Object(a))ee.call(a,f)&&f!="constructor"&&u.push(f);return u}function ia(a,u){if(u)return a.slice();var f=new a.constructor(a.length);return a.copy(f),f}function St(a){var u=new a.constructor(a.byteLength);return new En(u).set(new En(a)),u}function aa(a,u){var f=u?St(a.buffer):a.buffer;return new a.constructor(f,a.byteOffset,a.byteLength)}function sa(a,u,f){var g=u?f(Tn(a),!0):Tn(a);return vn(g,fi,new a.constructor)}function ua(a){var u=new a.constructor(a.source,ai.exec(a));return u.lastIndex=a.lastIndex,u}function ca(a,u,f){var g=u?f(zn(a),!0):zn(a);return vn(g,hi,new a.constructor)}function la(a){return In?Object(In.call(a)):{}}function da(a,u){var f=u?St(a.buffer):a.buffer;return new a.constructor(f,a.byteOffset,a.length)}function fa(a,u){var f=-1,g=a.length;for(u||(u=Array(g));++f<g;)u[f]=a[f];return u}function $n(a,u,f,g){f||(f={});for(var N=-1,j=u.length;++N<j;){var Q=u[N],F=void 0;Zn(f,Q,F===void 0?a[Q]:F)}return f}function ha(a,u){return $n(a,Pn(a),u)}function ma(a){return ta(a,Mt,Pn)}function Xe(a,u){var f=a.__data__;return wa(u)?f[typeof u=="string"?"string":"hash"]:f.map}function ve(a,u){var f=_i(a,u);return ra(f)?f:void 0}var Pn=Mn?vt(Mn,Object):Sa,ie=na;(Tt&&ie(new Tt(new ArrayBuffer(1)))!=J||xe&&ie(new xe)!=p||zt&&ie(zt.resolve())!=Z||Dt&&ie(new Dt)!=W||kt&&ie(new kt)!=I)&&(ie=function(a){var u=Ve.call(a),f=u==D?a.constructor:void 0,g=f?ae(f):void 0;if(g)switch(g){case Si:return J;case Ei:return p;case Mi:return Z;case xi:return W;case Ii:return I}return u});function pa(a){var u=a.length,f=a.constructor(u);return u&&typeof a[0]=="string"&&ee.call(a,"index")&&(f.index=a.index,f.input=a.input),f}function ga(a){return typeof a.constructor=="function"&&!Nn(a)?ea(bi(a)):{}}function _a(a,u,f,g){var N=a.constructor;switch(u){case Me:return St(a);case c:case l:return new N(+a);case J:return aa(a,g);case qe:case ln:case dn:case fn:case hn:case mn:case pn:case gn:case _n:return da(a,g);case p:return sa(a,g,f);case v:case z:return new N(a);case Y:return ua(a);case W:return ca(a,g,f);case b:return la(a)}}function ya(a,u){return u=u??o,!!u&&(typeof a=="number"||ui.test(a))&&a>-1&&a%1==0&&a<u}function wa(a){var u=typeof a;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?a!=="__proto__":a===null}function va(a){return!!Dn&&Dn in a}function Nn(a){var u=a&&a.constructor,f=typeof u=="function"&&u.prototype||He;return a===f}function ae(a){if(a!=null){try{return kn.call(a)}catch{}try{return a+""}catch{}}return""}function ba(a){return Ot(a,!0,!0)}function Cn(a,u){return a===u||a!==a&&u!==u}function Ta(a){return za(a)&&ee.call(a,"callee")&&(!zi.call(a,"callee")||Ve.call(a)==i)}var Et=Array.isArray;function Rn(a){return a!=null&&ka(a.length)&&!An(a)}function za(a){return Oa(a)&&Rn(a)}var Da=ki||Ea;function An(a){var u=Qe(a)?Ve.call(a):"";return u==y||u==m}function ka(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=o}function Qe(a){var u=typeof a;return!!a&&(u=="object"||u=="function")}function Oa(a){return!!a&&typeof a=="object"}function Mt(a){return Rn(a)?Ki(a):oa(a)}function Sa(){return[]}function Ea(){return!1}e.exports=ba})(ct,ct.exports);var Vf=ct.exports;const Bf=Hf(Vf),Se=(e,t)=>new Date(e.getTime()-Ko(t,e));class L{constructor(t){P(this,"timeframeText");P(this,"key");P(this,"display");P(this,"timeframeLength");P(this,"allowedTiers");P(this,"defaultResponseGranularity");P(this,"dataGranularity");P(this,"isRelative");P(this,"fineGrainedDefaultGranularity");P(this,"_startCustom");P(this,"_endCustom");P(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 n=new Set,r=this.maximumTimeframeLength()/3600;return r<=6&&n.add("minutely"),r>=2&&r<=7*24&&n.add("hourly"),r>=2*24&&n.add("daily"),r>=2*24*14&&n.add("weekly"),n}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 n=Ff(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Qo(n,t)}}class Xf extends L{rawStart(t){let n=K(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=Se(n,t)),n}maximumTimeframeLength(){return 60*60*24*7}}class Qf extends L{rawStart(t){let n=ke(this.tzAdjustedDate(t));return t&&(n=Se(n,t)),n}maximumTimeframeLength(){return 60*60*24*31}}class Kf extends L{rawEnd(t){let n=K(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=Se(n,t)),n}rawStart(t){const n=this.tzAdjustedDate(t);let r=K(n.setDate(n.getDate()-7),{weekStartsOn:1});return t&&(r=Se(r,t)),r}}class Jf extends L{rawEnd(t){let n=ke(this.tzAdjustedDate(t));return t&&(n=Se(n,t)),n}rawStart(t){let n=ke(Vo(this.tzAdjustedDate(t)));return t&&(n=Se(n,t)),n}}const ri=new Map([[w.FIFTEEN_MIN,new L({key:w.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"]})],[w.ONE_HOUR,new L({key:w.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"]})],[w.SIX_HOUR,new L({key:w.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"]})],[w.TWELVE_HOUR,new L({key:w.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"]})],[w.ONE_DAY,new L({key:w.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"]})],[w.SEVEN_DAY,new L({key:w.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"]})],[w.THIRTY_DAY,new L({key:w.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"]})],[w.CURRENT_WEEK,new Xf({key:w.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const e=K(new Date,{weekStartsOn:1});return(at(fr(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[w.CURRENT_MONTH,new Qf({key:w.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const e=ke(new Date);return(at(fr(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})],[w.PREVIOUS_WEEK,new Kf({key:w.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"]})],[w.PREVIOUS_MONTH,new Jf({key:w.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=ke(new Date),n=ke(Vo(new Date));return t.getTimezoneOffset()!==n.getTimezoneOffset()&&(e=oi(t,n)),60*60*24*cf(new Date().setMonth(new Date().getMonth()-1))+df(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})]]);function eh(e){const t=new Date(e.start),n=new Date(e.end),r=(n.getTime()-t.getTime())/1e3;return e.timePeriodsKey&&Bf(ri.get(e.timePeriodsKey))||new L({key:"custom",timeframeText:"custom",display:"custom",startCustom:t,endCustom:n,timeframeLength:()=>r,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["free","plus","enterprise"]})}function th(e){return{...e.key!=="custom"&&{timePeriodsKey:e.key},start:e.rawStart(),end:e.rawEnd()}}function nh(e){return{key:e.key,display:e.display,timeframeText:e.timeframeText,timeframeLength:()=>e.key,start:()=>e.rawStart(),end:()=>e.rawEnd()}}function oi(e,t){return ff(e.getTimezoneOffset()-t.getTimezoneOffset())}const rh={"15M":w.FIFTEEN_MIN,"1H":w.ONE_HOUR,"6H":w.SIX_HOUR,"12H":w.TWELVE_HOUR,"24H":w.ONE_DAY,"7D":w.SEVEN_DAY,"15m":w.FIFTEEN_MIN,"1h":w.ONE_HOUR,"6h":w.SIX_HOUR,"12h":w.TWELVE_HOUR,"24h":w.ONE_DAY,"7d":w.SEVEN_DAY,"30d":w.THIRTY_DAY,current_week:w.CURRENT_WEEK,current_month:w.CURRENT_MONTH,previous_week:w.PREVIOUS_WEEK,previous_month:w.PREVIOUS_MONTH};class wt{constructor(t){P(this,"_seed");this._seed=t}next(t,n){const r=Math.sin(this._seed++)*1e4,o=r-Math.floor(r);return Math.floor(o*(n-t+1))+t}}const oh=(e,t,n)=>{const r=cn(10,1e4),o=new wt(r),i=Date.now()-6*60*60*1e3,s=Date.now(),c=[];let l=0;for(let m=i;m<=s;m+=60*60*1e3)if(t)for(const p in t)t[p].forEach(v=>{l+=o.next(50,500);const D={[p]:v,[e.name]:l},Z={version:"1.0",timestamp:new Date(m).toISOString(),event:D};c.push(Z)});else{l+=o.next(50,500);const p={version:"1.0",timestamp:new Date(m).toISOString(),event:{[e.name]:l}};c.push(p)}const h={};if(t)for(const m in t)h[m]={},t[m].forEach(p=>{h[m][p]={name:p,deleted:!1}});const y={start_ms:i,end_ms:s,start:new Date(i).toISOString(),end:new Date(s).toISOString(),query_id:"12345",metric_names:[e.name],metric_units:{[e.name]:e.unit},granularity_ms:60*60*1e3,display:h,...n??{}};return{data:c,meta:y}},ih=(e,t)=>{const n=cn(10,1e4),r=new wt(n),o=Date.now()-6*60*60*1e3,i=Date.now(),s=[],c={};e.forEach(h=>{c[h.name]=0});for(let h=o;h<=i;h+=60*60*1e3){const y={};e.forEach(p=>{c[p.name]+=r.next(50,500),y[p.name]=c[p.name]});const m={version:"1.0",timestamp:new Date(h).toISOString(),event:y};s.push(m)}const l={start_ms:o,end_ms:i,start:new Date(o).toISOString(),end:new Date(i).toISOString(),query_id:"12345",metric_names:e.map(h=>h.name),metric_units:e.reduce((h,y)=>(h[y.name]=y.unit,h),{}),granularity_ms:60*60*1e3,display:{},...t??{}};return{data:s,meta:l}},ah=(e,t,n)=>{const r=Math.floor(Math.random()*9991)+10,o=new wt(r),i=Date.now()-6*60*60*1e3,s=Date.now(),c=new Date((i+s)/2).toISOString(),l=[];if(t){const m=Object.keys(t),p=Object.values(t),v=(D,Z)=>{if(Z===m.length){e.forEach(Y=>{D[Y.name]=o.next(1e3,5e7)}),l.push({version:"1.0",timestamp:new Date().toISOString(),event:{...D}});return}p[Z].forEach(Y=>{v({...D,[m[Z]]:Y},Z+1)})};v({},0)}else{const m={};e.forEach(p=>{m[p.name]=o.next(50,500)}),l.push({version:"1.0",timestamp:c,event:m})}const h={};if(t)for(const m in t)h[m]={},t[m].forEach(p=>{h[m][p]={name:p,deleted:!1}});const y={start_ms:i,end_ms:s,start:new Date(i).toISOString(),end:new Date(s).toISOString(),query_id:"12345",metric_names:e.map(m=>m.name),metric_units:e.reduce((m,p)=>(m[p.name]=p.unit,m),{}),truncated:!1,limit:50,display:h,granularity_ms:s-i,...n??{}};return{data:l,meta:y}};function cn(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1)+e)}exports.DeltaQueryTime=qf;exports.Granularities=Ae;exports.REFRESH_INTERVAL_MS=Ia;exports.SeededRandom=wt;exports.TIMEFRAME_LOOKUP=rh;exports.TimePeriods=ri;exports.Timeframe=L;exports.TimeframeKeys=w;exports.TimeseriesQueryTime=Wf;exports.UnaryQueryTime=ni;exports.aiExploreAggregations=Bt;exports.basicExploreAggregations=dt;exports.ceilToNearestTimeGrain=un;exports.dashboardTileTypes=Hl;exports.dashboardsSchemaV1=Wa;exports.datasourceToFilterableDimensions=Cr;exports.datePickerSelectionToTimeframe=eh;exports.dstOffsetHours=oi;exports.exploreAggregations=Vt;exports.exploreFilterTypesV2=Wt;exports.filterableAiExploreDimensions=he;exports.filterableBasicExploreDimensions=de;exports.filterableExploreDimensions=fe;exports.filterableRequestDimensions=Zr;exports.filterableRequestMetrics=Nr;exports.filterableRequestWildcardDimensions=Ra;exports.floorToNearestTimeGrain=ti;exports.formatISOTimeWithTZ=Uf;exports.formatTime=Gt;exports.formatTimeRange=Yf;exports.generateCrossSectionalData=ah;exports.generateMultipleMetricTimeSeriesData=ih;exports.generateSingleMetricTimeSeriesData=oh;exports.getFieldDataSources=Kl;exports.granularitiesToOptions=Lf;exports.granularityMsToQuery=Jo;exports.granularityValues=lt;exports.msToGranularity=Gf;exports.parseDashboardConfig=Ql;exports.queryDatasources=ja;exports.queryableAiExploreDimensions=ht;exports.queryableBasicExploreDimensions=Fe;exports.queryableExploreDimensions=ft;exports.queryableRequestDimensions=Ir;exports.queryableRequestMetrics=Pr;exports.queryableRequestWildcardDimensions=$r;exports.rand=cn;exports.relativeTimeRangeValuesRequestV2=Aa;exports.relativeTimeRangeValuesV4=Ht;exports.reportChartTypes=Za;exports.requestFilterTypeEmptyV2=qt;exports.requestFilterTypeEqualsV2=$a;exports.requestFilterTypeMetricV2=Pa;exports.requestFilterTypeWildcardV2=Na;exports.stripUnknownFilters=Fa;exports.timeRangeTypeV2=Ca;exports.timeframeToDatepickerSelection=th;exports.timeframeToDatepickerTimeperiod=nh;exports.zApiUsageQuery=No;exports.zBarChartSchema=Eo;exports.zBasicQuery=Co;exports.zDashboardConfig=Yo;exports.zDonutChartSchema=Io;exports.zGaugeChartSchema=xo;exports.zLlmUsageQuery=Ro;exports.zMetricCardSchema=$o;exports.zSingleValueSchema=Po;exports.zSlottableSchema=So;exports.zTileConfig=Uo;exports.zTileDefinition=jo;exports.zTileLayout=Fo;exports.zTimeseriesChartSchema=Mo;exports.zTopNTableSchema=Zo;exports.zValidDashboardQuery=Ao;
|
|
2
19
|
//# sourceMappingURL=vitals-utilities.cjs.map
|