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