@kong-ui-public/analytics-metric-provider 1.2.10 → 1.2.11
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/components/MetricsProviderInternal.vue.d.ts +3 -3
- package/dist/types/types/explore-types.d.ts +4 -1
- package/dist/types/types/explore-types.d.ts.map +1 -1
- package/dist/vitals-metric-provider.es.js +122 -122
- package/dist/vitals-metric-provider.es.js.map +1 -1
- package/dist/vitals-metric-provider.umd.js +1 -1
- package/dist/vitals-metric-provider.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(N,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("@kong-ui-public/i18n")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n"],n):(N=typeof globalThis<"u"?globalThis:N||self,n(N["kong-ui-public-vitals-metric-provider"]={},N.Vue,N["kong-ui-public-i18n"]))})(this,function(N,n,xe){"use strict";var mt=Object.defineProperty,gt=(e,t,r)=>t in e?mt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,b=(e,t,r)=>(gt(e,typeof t!="symbol"?t+"":t,r),r),g=(e=>(e.MINUTELY="Minutely",e.HOURLY="Hourly",e.DAILY="Daily",e.WEEKLY="Weekly",e))(g||{}),C=(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))(C||{});function W(e){"@babel/helpers - typeof";return W=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},W(e)}function _(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function D(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function U(e){D(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||W(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function re(e,t){D(2,arguments);var r=U(e),a=_(t);return isNaN(a)?new Date(NaN):(a&&r.setDate(r.getDate()+a),r)}function yt(e,t){D(2,arguments);var r=U(e),a=_(t);if(isNaN(a))return new Date(NaN);if(!a)return r;var o=r.getDate(),i=new Date(r.getTime());i.setMonth(r.getMonth()+a+1,0);var l=i.getDate();return o>=l?i:(r.setFullYear(i.getFullYear(),i.getMonth(),o),r)}var ht={};function vt(){return ht}function K(e,t){var r,a,o,i,l,c,f,s;D(1,arguments);var d=vt(),u=_((r=(a=(o=(i=t==null?void 0:t.weekStartsOn)!==null&&i!==void 0?i:t==null||(l=t.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&o!==void 0?o:d.weekStartsOn)!==null&&a!==void 0?a:(f=d.locale)===null||f===void 0||(s=f.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&r!==void 0?r:0);if(!(u>=0&&u<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=U(e),m=p.getDay(),y=(m<u?7:0)+m-u;return p.setDate(p.getDate()-y),p.setHours(0,0,0,0),p}function Me(e){D(1,arguments);var t=U(e);return t.setHours(0,0,0,0),t}var Ct=60,St=3600;function $(e){D(1,arguments);var t=U(e);return t.setDate(1),t.setHours(0,0,0,0),t}function Tt(e){D(1,arguments);var t=U(e),r=t.getFullYear(),a=t.getMonth(),o=new Date(0);return o.setFullYear(r,a+1,0),o.setHours(0,0,0,0),o.getDate()}function ne(e){D(1,arguments);var t=U(e),r=t.getTime();return r}function Ae(e){return D(1,arguments),Math.floor(ne(e)/1e3)}function wt(e){return D(1,arguments),Math.floor(e*St)}function Et(e,t){D(2,arguments);var r=_(t);return re(e,-r)}function Nt(e){D(1,arguments);var t=e/Ct;return Math.floor(t)}function ie(e,t){D(2,arguments);var r=_(t);return yt(e,-r)}function Dt(e,t){if(D(2,arguments),!t||W(t)!=="object")return new Date(NaN);var r=t.years?_(t.years):0,a=t.months?_(t.months):0,o=t.weeks?_(t.weeks):0,i=t.days?_(t.days):0,l=t.hours?_(t.hours):0,c=t.minutes?_(t.minutes):0,f=t.seconds?_(t.seconds):0,s=ie(e,a+r*12),d=Et(s,i+o*7),u=c+l*60,p=f+u*60,m=p*1e3,y=new Date(d.getTime()-m);return y}function ae(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Le={exports:{}};(function(e){function t(r){return r&&r.__esModule?r:{default:r}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Le);var Rt=Le.exports,oe={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;function r(a){if(a===null||a===!0||a===!1)return NaN;var o=Number(a);return isNaN(o)?o:o<0?Math.ceil(o):Math.floor(o)}e.exports=t.default})(oe,oe.exports);var bt=oe.exports;const _t=ae(bt);var se={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;function r(a){var o=new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()));return o.setUTCFullYear(a.getFullYear()),a.getTime()-o.getTime()}e.exports=t.default})(se,se.exports);var kt=se.exports;const Oe=ae(kt);function It(e,t){var r=Lt(t);return r.formatToParts?Mt(r,e):At(r,e)}var xt={year:0,month:1,day:2,hour:3,minute:4,second:5};function Mt(e,t){try{for(var r=e.formatToParts(t),a=[],o=0;o<r.length;o++){var i=xt[r[o].type];i>=0&&(a[i]=parseInt(r[o].value,10))}return a}catch(l){if(l instanceof RangeError)return[NaN];throw l}}function At(e,t){var r=e.format(t).replace(/\u200E/g,""),a=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(r);return[a[3],a[1],a[2],a[4],a[5],a[6]]}var le={};function Lt(e){if(!le[e]){var t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"America/New_York",year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),r=t==="06/25/2014, 00:00:00"||t==="06/25/2014 00:00:00";le[e]=r?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"}):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"})}return le[e]}function de(e,t,r,a,o,i,l){var c=new Date(0);return c.setUTCFullYear(e,t,r),c.setUTCHours(a,o,i,l),c}var ze=36e5,Ot=6e4,ce={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-]\d{2}):?(\d{2})$/};function Q(e,t,r){var a,o;if(!e||(a=ce.timezoneZ.exec(e),a))return 0;var i;if(a=ce.timezoneHH.exec(e),a)return i=parseInt(a[1],10),Ue(i)?-(i*ze):NaN;if(a=ce.timezoneHHMM.exec(e),a){i=parseInt(a[1],10);var l=parseInt(a[2],10);return Ue(i,l)?(o=Math.abs(i)*ze+l*Ot,i>0?-o:o):NaN}if(Vt(e)){t=new Date(t||Date.now());var c=r?t:zt(t),f=ue(c,e),s=r?f:Ut(t,f,e);return-s}return NaN}function zt(e){return de(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function ue(e,t){var r=It(e,t),a=de(r[0],r[1]-1,r[2],r[3]%24,r[4],r[5],0).getTime(),o=e.getTime(),i=o%1e3;return o-=i>=0?i:1e3+i,a-o}function Ut(e,t,r){var a=e.getTime(),o=a-t,i=ue(new Date(o),r);if(t===i)return t;o-=i-t;var l=ue(new Date(o),r);return i===l?i:Math.max(i,l)}function Ue(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}var Ve={};function Vt(e){if(Ve[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Ve[e]=!0,!0}catch{return!1}}var Bt=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/;const Be=Bt;var fe=36e5,Ye=6e4,Yt=2,E={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Be};function pe(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);var r=t||{},a=r.additionalDigits==null?Yt:_t(r.additionalDigits);if(a!==2&&a!==1&&a!==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(!(typeof e=="string"||Object.prototype.toString.call(e)==="[object String]"))return new Date(NaN);var o=$t(e),i=Ht(o.date,a),l=i.year,c=i.restDateString,f=qt(c,l);if(isNaN(f))return new Date(NaN);if(f){var s=f.getTime(),d=0,u;if(o.time&&(d=Ft(o.time),isNaN(d)))return new Date(NaN);if(o.timeZone||r.timeZone){if(u=Q(o.timeZone||r.timeZone,new Date(s+d)),isNaN(u))return new Date(NaN)}else u=Oe(new Date(s+d)),u=Oe(new Date(s+d+u));return new Date(s+d+u)}else return new Date(NaN)}function $t(e){var t={},r=E.dateTimePattern.exec(e),a;if(r?(t.date=r[1],a=r[3]):(r=E.datePattern.exec(e),r?(t.date=r[1],a=r[2]):(t.date=null,a=e)),a){var o=E.timeZone.exec(a);o?(t.time=a.replace(o[1],""),t.timeZone=o[1].trim()):t.time=a}return t}function Ht(e,t){var r=E.YYY[t],a=E.YYYYY[t],o;if(o=E.YYYY.exec(e)||a.exec(e),o){var i=o[1];return{year:parseInt(i,10),restDateString:e.slice(i.length)}}if(o=E.YY.exec(e)||r.exec(e),o){var l=o[1];return{year:parseInt(l,10)*100,restDateString:e.slice(l.length)}}return{year:null}}function qt(e,t){if(t===null)return null;var r,a,o,i;if(e.length===0)return a=new Date(0),a.setUTCFullYear(t),a;if(r=E.MM.exec(e),r)return a=new Date(0),o=parseInt(r[1],10)-1,qe(t,o)?(a.setUTCFullYear(t,o),a):new Date(NaN);if(r=E.DDD.exec(e),r){a=new Date(0);var l=parseInt(r[1],10);return jt(t,l)?(a.setUTCFullYear(t,0,l),a):new Date(NaN)}if(r=E.MMDD.exec(e),r){a=new Date(0),o=parseInt(r[1],10)-1;var c=parseInt(r[2],10);return qe(t,o,c)?(a.setUTCFullYear(t,o,c),a):new Date(NaN)}if(r=E.Www.exec(e),r)return i=parseInt(r[1],10)-1,Fe(t,i)?$e(t,i):new Date(NaN);if(r=E.WwwD.exec(e),r){i=parseInt(r[1],10)-1;var f=parseInt(r[2],10)-1;return Fe(t,i,f)?$e(t,i,f):new Date(NaN)}return null}function Ft(e){var t,r,a;if(t=E.HH.exec(e),t)return r=parseFloat(t[1].replace(",",".")),me(r)?r%24*fe:NaN;if(t=E.HHMM.exec(e),t)return r=parseInt(t[1],10),a=parseFloat(t[2].replace(",",".")),me(r,a)?r%24*fe+a*Ye:NaN;if(t=E.HHMMSS.exec(e),t){r=parseInt(t[1],10),a=parseInt(t[2],10);var o=parseFloat(t[3].replace(",","."));return me(r,a,o)?r%24*fe+a*Ye+o*1e3:NaN}return null}function $e(e,t,r){t=t||0,r=r||0;var a=new Date(0);a.setUTCFullYear(e,0,4);var o=a.getUTCDay()||7,i=t*7+r+1-o;return a.setUTCDate(a.getUTCDate()+i),a}var Pt=[31,28,31,30,31,30,31,31,30,31,30,31],Zt=[31,29,31,30,31,30,31,31,30,31,30,31];function He(e){return e%400===0||e%4===0&&e%100!==0}function qe(e,t,r){if(t<0||t>11)return!1;if(r!=null){if(r<1)return!1;var a=He(e);if(a&&r>Zt[t]||!a&&r>Pt[t])return!1}return!0}function jt(e,t){if(t<1)return!1;var r=He(e);return!(r&&t>366||!r&&t>365)}function Fe(e,t,r){return!(t<0||t>52||r!=null&&(r<0||r>6))}function me(e,t,r){return!(e!=null&&(e<0||e>=25)||t!=null&&(t<0||t>=60)||r!=null&&(r<0||r>=60))}var ge={exports:{}},ye={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;function r(a,o){if(a==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(a[i]=o[i]);return a}e.exports=t.default})(ye,ye.exports);var Gt=ye.exports;(function(e,t){var r=Rt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var a=r(Gt);function o(i){return(0,a.default)({},i)}e.exports=t.default})(ge,ge.exports);var Wt=ge.exports;const Kt=ae(Wt);function Qt(e,t,r){var a=pe(e,r),o=Q(t,a,!0),i=new Date(a.getTime()-o),l=new Date(0);return l.setFullYear(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),l.setHours(i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()),l}function Pe(e,t){return-Q(e,t)}function Jt(e,t,r){if(typeof e=="string"&&!e.match(Be)){var a=Kt(r);return a.timeZone=t,pe(e,a)}var o=pe(e,r),i=de(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),o.getSeconds(),o.getMilliseconds()).getTime(),l=Q(t,new Date(i));return new Date(i+l)}const Ze={[g.MINUTELY]:60*1e3,[g.HOURLY]:60*60*1e3,[g.DAILY]:60*60*24*1e3,[g.WEEKLY]:60*60*24*7*1e3};function Xt(e,t){return e?{duration:e,type:"duration",origin:t}:null}function je(e,t,r,a){const o=Ze[r];let i=0;return o>=Ze[g.DAILY]&&(a?i=-Pe(a,t):i=t.getTimezoneOffset()*60*1e3),new Date(e((t.getTime()-i)/o)*o+i)}function Ge(e,t,r){return je(Math.floor,e,t,r)}function er(e,t,r){return je(Math.ceil,e,t,r)}let tr=class pt{constructor(t,r){if(b(this,"timeframe"),b(this,"tz"),this.constructor===pt)throw new Error("BaseQueryTime is not meant to be used directly.");this.timeframe=t,this.tz=r}calculateStartDate(t,r,a=1){if(t)return new Date(this.endDate().getTime()-this.timeframe.timeframeLengthMs()*a);{const o=this.endDate(),i=this.timeframe.rawStart(this.tz),l=Ge(i,r,this.tz),c=(o.getTime()-l.getTime())*(a-1);return Ge(new Date(i.getTime()-c),r,this.tz)}}granularitySeconds(){return Math.floor(this.granularityMs()/1e3)}granularityDruid(){return Xt(this.granularityMs(),this.startDate().toISOString())}startSeconds(){return Ae(this.startDate())}endSeconds(){return Ae(this.endDate())}startMs(){return ne(this.startDate())}endMs(){return ne(this.endDate())}withinFreeTier(){return this.startDate()>=Dt(new Date,{days:1})}};class We extends tr{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.timeframe.dataGranularity)}endDate(){return er(this.timeframe.rawEnd(this.tz),this.timeframe.dataGranularity,this.tz)}granularityMs(){return this.endDate().getTime()-this.startDate().getTime()}}class rr extends We{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.timeframe.dataGranularity,2)}granularityMs(){return this.endDate().getTime()-super.startDate().getTime()}}const H=(e,t)=>new Date(e.getTime()-Pe(t,e));let I=class{constructor(t){b(this,"timeframeText"),b(this,"key"),b(this,"display"),b(this,"timeframeLength"),b(this,"allowedTiers"),b(this,"defaultResponseGranularity"),b(this,"dataGranularity"),b(this,"isRelative"),b(this,"_startCustom"),b(this,"_endCustom"),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}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(){const t=new Set,r=this.maximumTimeframeLength()/3600;return r<=6&&t.add(g.MINUTELY),r>=2&&r<=7*24&&t.add(g.HOURLY),r>=2*24&&t.add(g.DAILY),r>=2*24*14&&t.add(g.WEEKLY),t}tzAdjustedDate(t){if(!t)return new Date;const r=Jt(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Qt(r,t)}};class nr extends I{rawStart(t){let r=K(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(r=H(r,t)),r}maximumTimeframeLength(){return 60*60*24*7}}class ir extends I{rawStart(t){let r=$(this.tzAdjustedDate(t));return t&&(r=H(r,t)),r}maximumTimeframeLength(){return 60*60*24*31}}class ar extends I{rawEnd(t){let r=K(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(r=H(r,t)),r}rawStart(t){const r=this.tzAdjustedDate(t);let a=K(r.setDate(r.getDate()-7),{weekStartsOn:1});return t&&(a=H(a,t)),a}}class or extends I{rawEnd(t){let r=$(this.tzAdjustedDate(t));return t&&(r=H(r,t)),r}rawStart(t){let r=$(ie(this.tzAdjustedDate(t),1));return t&&(r=H(r,t)),r}}const he=new Map([[C.FIFTEEN_MIN,new I({key:C.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:g.MINUTELY,dataGranularity:g.MINUTELY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]})],[C.ONE_HOUR,new I({key:C.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:g.MINUTELY,dataGranularity:g.MINUTELY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]})],[C.SIX_HOUR,new I({key:C.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:g.HOURLY,dataGranularity:g.HOURLY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]})],[C.TWELVE_HOUR,new I({key:C.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:g.HOURLY,dataGranularity:g.HOURLY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]})],[C.ONE_DAY,new I({key:C.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:g.HOURLY,dataGranularity:g.HOURLY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]})],[C.SEVEN_DAY,new I({key:C.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:g.DAILY,dataGranularity:g.DAILY,isRelative:!0,allowedTiers:["trial","plus","enterprise"]})],[C.THIRTY_DAY,new I({key:C.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:g.DAILY,dataGranularity:g.DAILY,isRelative:!0,allowedTiers:["trial","plus","enterprise"]})],[C.CURRENT_WEEK,new nr({key:C.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const e=K(new Date,{weekStartsOn:1});return(Me(re(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:g.DAILY,dataGranularity:g.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]})],[C.CURRENT_MONTH,new ir({key:C.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const e=$(new Date);return(Me(re(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:g.DAILY,dataGranularity:g.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]})],[C.PREVIOUS_WEEK,new ar({key:C.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:g.DAILY,dataGranularity:g.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]})],[C.PREVIOUS_MONTH,new or({key:C.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=$(new Date),r=$(ie(new Date,1));return t.getTimezoneOffset()!==r.getTimezoneOffset()&&(e=sr(t,r)),60*60*24*Tt(new Date().setMonth(new Date().getMonth()-1))+wt(e)},defaultResponseGranularity:g.DAILY,dataGranularity:g.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]})]]);function sr(e,t){return Nt(e.getTimezoneOffset()-t.getTimezoneOffset())}const lr={general:{notAvailable:"N/A"},metricCard:{short:{traffic:"Requests",errorRate:"Error Rate",latency:"P99 Latency"},long:{traffic:"Number of Requests",errorRate:"Average Error Rate",latency:"P99 Latency"}},trendRange:{custom:"vs previous {numDays} days","15m":"vs previous 15 minutes","1h":"vs previous hour","6h":"vs previous 6 hours","12h":"vs previous 12 hours","24h":"vs previous 24 hours","7d":"vs previous 7 days","30d":"vs previous 30 days",current_week:"vs previous week",current_month:"vs previous month",current_quarter:"vs previous quarter",previous_week:"vs previous time period",previous_month:"vs previous time period",previous_quarter:"vs previous quarter"}};function dr(){const e=xe.createI18n("en-us",lr);return{i18n:e,i18nT:xe.i18nTComponent(e)}}var L=(e=>(e.API_PRODUCT="API_PRODUCT",e.API_PRODUCT_VERSION="API_PRODUCT_VERSION",e.RUNTIME_GROUP="RUNTIME_GROUP",e.GATEWAY_INSTANCE_ID="GATEWAY_INSTANCE_ID",e.GATEWAY_SERVICE="GATEWAY_SERVICE",e.ROUTE="ROUTE",e.APPLICATION="APPLICATION",e.STATUS_CODE="STATUS_CODE",e.STATUS_CODE_GROUPED="STATUS_CODE_GROUPED",e.TIME="TIME",e.ORGANIZATION="ORGANIZATION",e))(L||{}),J=(e=>(e.REQUEST_COUNT="REQUEST_COUNT",e.REQUEST_PER_MINUTE="REQUEST_PER_MINUTE",e.RESPONSE_LATENCY_P99="RESPONSE_LATENCY_P99",e.RESPONSE_LATENCY_P95="RESPONSE_LATENCY_P95",e.RESPONSE_LATENCY_P50="RESPONSE_LATENCY_P50",e.RESPONSE_SIZE_P99="RESPONSE_SIZE_P99",e.RESPONSE_SIZE_P95="RESPONSE_SIZE_P95",e.RESPONSE_SIZE_P50="RESPONSE_SIZE_P50",e.REQUEST_SIZE_P99="REQUEST_SIZE_P99",e.REQUEST_SIZE_P95="REQUEST_SIZE_P95",e.REQUEST_SIZE_P50="REQUEST_SIZE_P50",e))(J||{}),ve=(e=>(e.IN="IN",e.NOT_IN="NOT_IN",e))(ve||{});const cr=2,Z=["1XX","2XX","3XX","4XX","5XX"],Ke=["4XX","5XX"];var Qe=(e=>(e.VALIDATING="VALIDATING",e.VALIDATING_HAS_DATA="VALIDATING_HAS_DATA",e.PENDING="PENDING",e.SUCCESS="SUCCESS",e.SUCCESS_HAS_DATA="SUCCESS_HAS_DATA",e.ERROR="ERROR",e.STALE_IF_ERROR="STALE_IF_ERROR",e))(Qe||{});const ur=e=>{var t,r,a,o,i;return e?!!((t=Object.keys(e))!=null&&t.length||(r=e.data)!=null&&r.length||(o=(a=e.data)==null?void 0:a.data)!=null&&o.length||!((i=e.data)!=null&&i.data)&&typeof e.data=="object"&&Object.keys(e==null?void 0:e.data).length):!1};function fr(e=n.ref({}),t,r,a=ur){const o=n.ref("PENDING");return n.watchEffect(()=>{const i=a(e.value);if(e.value&&i&&r.value){o.value="VALIDATING_HAS_DATA";return}if(e.value&&r.value){o.value="VALIDATING";return}if(e.value&&t.value){o.value="STALE_IF_ERROR";return}if(e.value===void 0&&!t.value){o.value="PENDING";return}if(e.value&&!t.value&&i){o.value="SUCCESS_HAS_DATA";return}if(e.value&&!t.value){o.value="SUCCESS";return}e.value===void 0&&t&&(o.value="ERROR")}),{state:o,swrvState:Qe}}const O=Symbol("default"),Ce=L.STATUS_CODE_GROUPED,Je=(e,t,r,a,o)=>{e[t][r]||(e[t][r]={}),e[t][r][a]=o};function pr(e,t,r){var c;const a=((c=e.meta.metricNames)==null?void 0:c[0])||"",o=Object.keys(e.meta.dimensions||{}),i=!!o.find(f=>f===Ce),l=o.find(f=>f!==Ce);return o.length>2||o.length>1&&!i?(console.error("Don't know how to work with provided dimensions:",o),{previous:{[O]:{[O]:0}},current:{[O]:{[O]:0}}}):e.records.reduce((f,s)=>{const d=s.event[a],u=l?s.event[l]:O,p=i?s.event[Ce]:O;return new Date(s.timestamp).getTime()===t.startDate().getTime()&&r?Je(f,"previous",u,p,d):Je(f,"current",u,p,d),f},{previous:{},current:{}})}function mr(e){e.queryReady===void 0&&(e.queryReady=n.computed(()=>!0));const t=n.computed(()=>e.withTrend?new rr(e.timeframe.value):new We(e.timeframe.value)),r=n.computed(()=>{var u,p;return{metrics:e.metrics,dimensions:[...(u=e.dimensions)!=null&&u.length?[...e.dimensions]:[],...e.withTrend?[L.TIME]:[]],granularityMs:t.value.granularityMs(),...(p=e.filter.value)!=null&&p.length?{filter:e.filter.value}:{}}}),a=n.computed(()=>`${t.value.endDate().toString()}-${t.value.startDate().toString()}`),o=n.computed(()=>{var p,m,y,h;if(!((p=e.queryReady)!=null&&p.value)||e.featureFlags&&!e.featureFlags.every(T=>T))return null;const u=(m=e.filter)!=null&&m.value?JSON.stringify(e.filter.value):"";return`metric-fetcher-${a.value}-${(y=e.dimensions)==null?void 0:y.join("-")}-${(h=e.metrics)==null?void 0:h.join("-")}-${u}`}),{response:i,error:l,isValidating:c}=V.useRequest(()=>o.value,()=>e.dataFetcher(t.value,r.value),{refreshInterval:e.refreshInterval,revalidateOnFocus:!1,errorRetryCount:cr}),{state:f,swrvState:s}=fr(i,l,c),d=n.computed(()=>{var u,p,m,y,h,T,x,S,v,B;return!((m=(p=(u=i.value)==null?void 0:u.data)==null?void 0:p.records)!=null&&m.length)||!((T=(h=(y=i.value)==null?void 0:y.data)==null?void 0:h.meta)!=null&&T.dimensions)||!((B=(v=(S=(x=i.value)==null?void 0:x.data)==null?void 0:S.meta)==null?void 0:v.metricNames)!=null&&B.length)?{current:{},previous:{}}:pr(i.value.data,t.value,!!e.withTrend)});return{isLoading:n.computed(()=>s.PENDING===f.value),hasError:n.computed(()=>s.ERROR===f.value),raw:i,mapped:d}}const q=(e,t,r=O,a)=>(a??[O]).reduce((i,l)=>{const c=e[t][r];return c?i+(c[l]||0):i},0);function gr(e){const{cardType:t,title:r,description:a,record:o,hasError:i,increaseIsBad:l,formatValueFn:c,trendRange:f}=e;return n.computed(()=>{let s=0,d=0;if(o!=null&&o.value)try{s=q(o.value,"current",e.lookupKey,e.sumGroupedValues),d=q(o.value,"previous",e.lookupKey,e.sumGroupedValues)}catch(u){console.error("Metric card data doesn't have the expected structure:",u)}return{cardType:t,hasError:i.value,currentValue:s,previousValue:d,title:r.value,description:a,increaseIsBad:!!l,formatValueFn:c,trendRange:f==null?void 0:f.value}})}var Se=new WeakMap,Xe=0;function yr(e){if(!e.length)return"";for(var t="arg",r=0;r<e.length;++r){var a=void 0;e[r]===null||typeof e[r]!="object"&&typeof e[r]!="function"?typeof e[r]=="string"?a='"'+e[r]+'"':a=String(e[r]):Se.has(e[r])?a=Se.get(e[r]):(a=Xe,Se.set(e[r],Xe++)),t+="@"+a}return t}function hr(e){if(typeof e=="function")try{e=e()}catch{e=""}return Array.isArray(e)?e=yr(e):e=String(e||""),e}var Te=function(){function e(t){t===void 0&&(t=0),this.items=new Map,this.ttl=t}return e.prototype.serializeKey=function(t){return hr(t)},e.prototype.get=function(t){var r=this.serializeKey(t);return this.items.get(r)},e.prototype.set=function(t,r,a){var o=this.serializeKey(t),i=a||this.ttl,l=Date.now(),c={data:r,createdAt:l,expiresAt:i?l+i:1/0};this.dispatchExpire(i,c,o),this.items.set(o,c)},e.prototype.dispatchExpire=function(t,r,a){var o=this;t&&setTimeout(function(){var i=Date.now(),l=i>=r.expiresAt;l&&o.delete(a)},t)},e.prototype.delete=function(t){this.items.delete(t)},e}();function vr(){return typeof navigator.onLine<"u"?navigator.onLine:!0}function Cr(){return typeof document<"u"&&typeof document.visibilityState<"u"?document.visibilityState!=="hidden":!0}var Sr=function(e){return fetch(e).then(function(t){return t.json()})};const we={isOnline:vr,isDocumentVisible:Cr,fetcher:Sr};var M=globalThis&&globalThis.__assign||function(){return M=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},M.apply(this,arguments)},F=globalThis&&globalThis.__awaiter||function(e,t,r,a){function o(i){return i instanceof r?i:new r(function(l){l(i)})}return new(r||(r=Promise))(function(i,l){function c(d){try{s(a.next(d))}catch(u){l(u)}}function f(d){try{s(a.throw(d))}catch(u){l(u)}}function s(d){d.done?i(d.value):o(d.value).then(c,f)}s((a=a.apply(e,t||[])).next())})},P=globalThis&&globalThis.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,o,i,l;return l={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function c(s){return function(d){return f([s,d])}}function f(s){if(a)throw new TypeError("Generator is already executing.");for(;r;)try{if(a=1,o&&(i=s[0]&2?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[s[0]&2,i.value]),s[0]){case 0:case 1:i=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1],i=s;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(s);break}i[2]&&r.ops.pop(),r.trys.pop();continue}s=t.call(e,r)}catch(d){s=[6,d],o=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}},Tr=globalThis&&globalThis.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),o,i=[],l;try{for(;(t===void 0||t-- >0)&&!(o=a.next()).done;)i.push(o.value)}catch(c){l={error:c}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(l)throw l.error}}return i},wr=globalThis&&globalThis.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,o=t.length,i;a<o;a++)(i||!(a in t))&&(i||(i=Array.prototype.slice.call(t,0,a)),i[a]=t[a]);return e.concat(i||Array.prototype.slice.call(t))},et=new Te,X=new Te,Ee=new Te,tt={cache:et,refreshInterval:0,ttl:0,serverTTL:1e3,dedupingInterval:2e3,revalidateOnFocus:!0,revalidateDebounce:0,shouldRetryOnError:!0,errorRetryInterval:5e3,errorRetryCount:5,fetcher:we.fetcher,isOnline:we.isOnline,isDocumentVisible:we.isDocumentVisible};function Er(e,t,r){var a=X.get(e);if(a)a.data.push(t);else{var o=5e3;X.set(e,[t],r>0?r+o:r)}}function Nr(e,t,r){if(r.isDocumentVisible()&&!(r.errorRetryCount!==void 0&&t>r.errorRetryCount)){var a=Math.min(t||0,r.errorRetryCount),o=a*r.errorRetryInterval;setTimeout(function(){e(null,{errorRetryCount:a+1,shouldRetryOnError:!0})},o)}}var rt=function(e,t,r,a){return r===void 0&&(r=et),a===void 0&&(a=tt.ttl),F(void 0,void 0,void 0,function(){var o,i,l,c,f,s,d;return P(this,function(u){switch(u.label){case 0:if(!Rr(t))return[3,5];u.label=1;case 1:return u.trys.push([1,3,,4]),[4,t];case 2:return o=u.sent(),[3,4];case 3:return c=u.sent(),i=c,[3,4];case 4:return[3,6];case 5:o=t,u.label=6;case 6:if(l=!1,f={data:o,error:i,isValidating:l},typeof o<"u")try{r.set(e,f,a)}catch(p){console.error("swrv(mutate): failed to set cache",p)}return s=X.get(e),s&&s.data.length&&(d=s.data.filter(function(p){return p.key===e}),d.forEach(function(p,m){typeof f.data<"u"&&(p.data=f.data),p.error=f.error,p.isValidating=f.isValidating;var y=m===d.length-1;y||delete d[m]}),d=d.filter(Boolean)),[2,f]}})})};function Dr(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var a,o,i=M({},tt),l=!1,c=!1,f=n.getCurrentInstance(),s=(f==null?void 0:f.proxy)||f;if(!s)return console.error("Could not get current instance, check to make sure that `useSwrv` is declared in the top level of the setup function."),null;var d=(s==null?void 0:s.$isServer)||!1;t.length>=1&&(a=t[0]),t.length>=2&&(o=t[1]),t.length>2&&(i=M(M({},i),t[2]));var u=d?i.serverTTL:i.ttl,p=typeof a=="function"?a:n.ref(a);typeof o>"u"&&(o=i.fetcher);var m=null;m||(m=n.reactive({data:void 0,error:void 0,isValidating:!0,key:null}));var y=function(S,v){return F(e,void 0,void 0,function(){var B,R,j,G,be,dt,_e,ct=this;return P(this,function(ke){switch(ke.label){case 0:return B=m.data===void 0,R=p.value,R?(j=i.cache.get(R),G=j&&j.data,m.isValidating=!0,G&&(m.data=G.data,m.error=G.error),be=S||o,!be||!i.isDocumentVisible()&&!B||(v==null?void 0:v.forceRevalidate)!==void 0&&!(v!=null&&v.forceRevalidate)?(m.isValidating=!1,[2]):j&&(dt=!!(Date.now()-j.createdAt>=i.dedupingInterval||v!=null&&v.forceRevalidate),!dt)?(m.isValidating=!1,[2]):(_e=function(){return F(ct,void 0,void 0,function(){var Y,ut,Ie,ft;return P(this,function(te){switch(te.label){case 0:return Y=Ee.get(R),Y?[3,2]:(ut=Array.isArray(R)?R:[R],Ie=be.apply(void 0,wr([],Tr(ut),!1)),Ee.set(R,Ie,i.dedupingInterval),[4,rt(R,Ie,i.cache,u)]);case 1:return te.sent(),[3,4];case 2:return[4,rt(R,Y.data,i.cache,u)];case 3:te.sent(),te.label=4;case 4:return m.isValidating=!1,Ee.delete(R),m.error!==void 0&&(ft=!l&&i.shouldRetryOnError&&(v?v.shouldRetryOnError:!0),ft&&Nr(y,v?v.errorRetryCount:1,i)),[2]}})})},G&&i.revalidateDebounce?(setTimeout(function(){return F(ct,void 0,void 0,function(){return P(this,function(Y){switch(Y.label){case 0:return l?[3,2]:[4,_e()];case 1:Y.sent(),Y.label=2;case 2:return[2]}})})},i.revalidateDebounce),[3,3]):[3,1])):[2];case 1:return[4,_e()];case 2:ke.sent(),ke.label=3;case 3:return[2]}})})},h=function(){return F(e,void 0,void 0,function(){return P(this,function(S){return[2,y(null,{shouldRetryOnError:!1})]})})},T=null;n.onMounted(function(){var S=function(){return F(e,void 0,void 0,function(){return P(this,function(v){switch(v.label){case 0:return!m.error&&i.isOnline()?[4,y()]:[3,2];case 1:return v.sent(),[3,3];case 2:T&&clearTimeout(T),v.label=3;case 3:return i.refreshInterval&&!l&&(T=setTimeout(S,i.refreshInterval)),[2]}})})};i.refreshInterval&&(T=setTimeout(S,i.refreshInterval)),i.revalidateOnFocus&&(document.addEventListener("visibilitychange",h,!1),window.addEventListener("focus",h,!1))}),n.onUnmounted(function(){l=!0,T&&clearTimeout(T),i.revalidateOnFocus&&(document.removeEventListener("visibilitychange",h,!1),window.removeEventListener("focus",h,!1));var S=X.get(p.value);S&&(S.data=S.data.filter(function(v){return v!==m}))});try{n.watch(p,function(S){n.isReadonly(p)||(p.value=S),m.key=S,m.isValidating=!!S,Er(p.value,m,u),!d&&!c&&p.value&&y(),c=!1},{immediate:!0})}catch{}var x=M(M({},n.toRefs(m)),{mutate:function(S,v){return y(S,M(M({},v),{forceRevalidate:!0}))}});return x}function Rr(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}function br(e,t,r){const{data:a,error:o,isValidating:i,mutate:l}=Dr(e,t,{revalidateDebounce:500,revalidateOnFocus:!1,dedupingInterval:100,...r});return{data:n.computed(()=>{var f;return(f=a.value)==null?void 0:f.data}),response:a,error:o,isValidating:i,revalidate:l}}const V={useI18n:dr,useMetricCardBuilder:gr,useMetricFetcher:mr,useRequest:br},nt=Symbol("METRICS_PROVIDER_KEY"),_r=e=>{const{dimension:t,dimensionFilterValue:r,additionalFilter:a,queryReady:o,timeframe:i,hasTrendAccess:l,refreshInterval:c,dataFetcher:f}=e;if(r&&!t)throw new Error("Must provide a dimension if filtering by a value");const s=!!(t&&r),d=!!(t&&!r),u=n.computed(()=>{const T=[];return s&&T.push({dimension:t,type:ve.IN,values:[r]}),a.value&&T.push(...a.value),T}),p={metrics:[J.REQUEST_COUNT],dimensions:[...t&&!s?[t]:[],L.STATUS_CODE_GROUPED],filter:u,queryReady:o,timeframe:i,withTrend:l&&!d,refreshInterval:c,dataFetcher:f},m={metrics:[J.RESPONSE_LATENCY_P99],...t&&!s?{dimensions:[t]}:{},filter:u,queryReady:o,timeframe:i,withTrend:l&&!d,refreshInterval:c,dataFetcher:f},y=V.useMetricFetcher(p),h=V.useMetricFetcher(m);return{trafficData:y,latencyData:h}},kr=n.defineComponent({__name:"MetricsProviderInternal",props:{maxTimeframe:{default:C.THIRTY_DAY},overrideTimeframe:{default:void 0},dimension:{default:void 0},filterValue:{default:void 0},additionalFilter:{default:void 0},queryReady:{type:Boolean,default:!0},dataFetcher:{},hasTrendAccess:{type:Boolean},refreshInterval:{},longCardTitles:{type:Boolean,default:!1},description:{default:void 0}},setup(e){const t=e,{i18n:r}=V.useI18n();if(t.dimension&&!{}.hasOwnProperty.call(L,t.dimension))throw new Error(`Attempted to use MetricsProvider with an invalid dimension: ${t.dimension}`);const a=n.computed(()=>{if(t.overrideTimeframe)return t.overrideTimeframe;const c=t.hasTrendAccess?he.get(t.maxTimeframe):he.get(C.ONE_DAY);if(!c)throw new Error("Metrics provider failed to resolve fallback timeframe.");return c}),o=n.computed(()=>{var c;return a.value.key==="custom"?r.t("trendRange.custom",{numDays:Math.ceil(a.value.timeframeLength()/(1e3*60*24))}):t.hasTrendAccess?r.t(`trendRange.${a.value.key}`):r.t(`trendRange.${(c=he.get(C.ONE_DAY))==null?void 0:c.key}`)}),{trafficData:i,latencyData:l}=_r({dimension:t.dimension,dimensionFilterValue:t.filterValue,additionalFilter:n.toRef(t,"additionalFilter"),queryReady:n.toRef(t,"queryReady"),timeframe:a,hasTrendAccess:t.hasTrendAccess,refreshInterval:t.refreshInterval,dataFetcher:t.dataFetcher});return n.provide(nt,{data:{traffic:i,latency:l},description:t.description,hasTrendAccess:t.hasTrendAccess,longCardTitles:t.longCardTitles,trendRange:o}),(c,f)=>n.renderSlot(c.$slots,"default",{hasTrendAccess:t.hasTrendAccess,timeframe:a.value})}});function Ir(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var it={exports:{}};(function(e){(function(){function t(s,d){if(d.separator===!1||s<1e3)return s.toString();var u=typeof d.separator=="string"?d.separator:",",p=[],m=Math.round(s).toString().split("");return m.reverse().forEach(function(y,h){h&&h%3===0&&p.push(u),p.push(y)}),p.reverse().join("")}function r(s,d,u){var p=s/d,m=u.round?"round":"floor";return u.decimal===!1?(s=Math[m](p),s.toString()):(u.precision?s=p:s=p<10?Math[m](p*10)/10:Math[m](p),s=s.toString(),typeof u.decimal=="string"&&(s=s.replace(".",u.decimal)),s)}var a=1e3,o=1e4,i=1e6,l=1e9,c=1e12;function f(s,d){var u;d=d||{};var p=s<0;p&&(s=Math.abs(s)),d.precision&&(s=parseFloat(s.toPrecision(d.precision)));var m=d.min10k?o:a;return s<m||d.precision&&d.precision>Math.log10(s)?u=t(r(s,1,d),d):s<i?u=r(s,a,d)+"k":s<l?u=r(s,i,d)+"m":s<c?u=t(r(s,l,d),d)+"b":u=t(r(s,c,d),d)+"t",p&&(u="-"+u),d.capital&&(u=u.toUpperCase()),d.prefix&&(u=d.prefix+u),d.suffix&&(u=u+d.suffix),u}f.addCommas=t,e.exports=f})()})(it);var xr=it.exports;const Mr=Ir(xr);var k=(e=>(e.Small="sm",e.Medium="md",e.Large="lg",e.LargeCompact="lgc",e.ExtraLarge="xl",e))(k||{});const w="24px",z=(e,t)=>{const r=e.__vccOpts||e;for(const[a,o]of t)r[a]=o;return r},Ar=e=>(n.pushScopeId("data-v-f2dbb1b9"),e=e(),n.popScopeId(),e),Lr=["aria-hidden"],Or={key:0,"data-testid":"kui-icon-svg-title"},zr=Ar(()=>n.createElementVNode("path",{d:"M6.5 20C4.98333 20 3.6875 19.475 2.6125 18.425C1.5375 17.375 1 16.0917 1 14.575C1 13.275 1.39167 12.1167 2.175 11.1C2.95833 10.0833 3.98333 9.43333 5.25 9.15C5.66667 7.61667 6.5 6.375 7.75 5.425C9 4.475 10.4167 4 12 4C13.95 4 15.6042 4.67917 16.9625 6.0375C18.3208 7.39583 19 9.05 19 11C20.15 11.1333 21.1042 11.6292 21.8625 12.4875C22.6208 13.3458 23 14.35 23 15.5C23 16.75 22.5625 17.8125 21.6875 18.6875C20.8125 19.5625 19.75 20 18.5 20H13C12.45 20 11.9792 19.8042 11.5875 19.4125C11.1958 19.0208 11 18.55 11 18V12.85L9.4 14.4L8 13L12 9L16 13L14.6 14.4L13 12.85V18H18.5C19.2 18 19.7917 17.7583 20.275 17.275C20.7583 16.7917 21 16.2 21 15.5C21 14.8 20.7583 14.2083 20.275 13.725C19.7917 13.2417 19.2 13 18.5 13H17V11C17 9.61667 16.5125 8.4375 15.5375 7.4625C14.5625 6.4875 13.3833 6 12 6C10.6167 6 9.4375 6.4875 8.4625 7.4625C7.4875 8.4375 7 9.61667 7 11H6.5C5.53333 11 4.70833 11.3417 4.025 12.025C3.34167 12.7083 3 13.5333 3 14.5C3 15.4667 3.34167 16.2917 4.025 16.975C4.70833 17.6583 5.53333 18 6.5 18H9V20H6.5Z",fill:"currentColor"},null,-1)),Ur=n.defineComponent({__name:"CloudUploadIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:w,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),i=Number(o);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return w}),a=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,i)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon cloud-upload-icon","data-testid":"kui-icon-wrapper-cloud-upload-icon",style:n.normalizeStyle(a.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-cloud-upload-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",Or,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),zr],8,Lr))]),_:1},8,["aria-hidden","style"]))}}),Vr=z(Ur,[["__scopeId","data-v-f2dbb1b9"]]),Br=e=>(n.pushScopeId("data-v-04327805"),e=e(),n.popScopeId(),e),Yr=["aria-hidden"],$r={key:0,"data-testid":"kui-icon-svg-title"},Hr=Br(()=>n.createElementVNode("path",{d:"M4 17V14H20V17H4ZM4 10V7H20V10H4Z",fill:"currentColor"},null,-1)),qr=n.defineComponent({__name:"EqualIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:w,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),i=Number(o);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return w}),a=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,i)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon equal-icon","data-testid":"kui-icon-wrapper-equal-icon",style:n.normalizeStyle(a.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-equal-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",$r,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),Hr],8,Yr))]),_:1},8,["aria-hidden","style"]))}}),Fr=z(qr,[["__scopeId","data-v-04327805"]]),Pr=e=>(n.pushScopeId("data-v-951e2d7d"),e=e(),n.popScopeId(),e),Zr=["aria-hidden"],jr={key:0,"data-testid":"kui-icon-svg-title"},Gr=Pr(()=>n.createElementVNode("path",{d:"M5 11V9H15V11H5Z",fill:"currentColor"},null,-1)),Wr=n.defineComponent({__name:"IndeterminateSmallIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:w,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),i=Number(o);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return w}),a=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,i)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon indeterminate-small-icon","data-testid":"kui-icon-wrapper-indeterminate-small-icon",style:n.normalizeStyle(a.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-indeterminate-small-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",jr,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),Gr],8,Zr))]),_:1},8,["aria-hidden","style"]))}}),at=z(Wr,[["__scopeId","data-v-951e2d7d"]]),Kr=e=>(n.pushScopeId("data-v-6754ff4c"),e=e(),n.popScopeId(),e),Qr=["aria-hidden"],Jr={key:0,"data-testid":"kui-icon-svg-title"},Xr=Kr(()=>n.createElementVNode("path",{d:"M15.25 5C14.9 5 14.6042 4.87917 14.3625 4.6375C14.1208 4.39583 14 4.1 14 3.75C14 3.4 14.1208 3.10417 14.3625 2.8625C14.6042 2.62083 14.9 2.5 15.25 2.5C15.6 2.5 15.8958 2.62083 16.1375 2.8625C16.3792 3.10417 16.5 3.4 16.5 3.75C16.5 4.1 16.3792 4.39583 16.1375 4.6375C15.8958 4.87917 15.6 5 15.25 5ZM15.25 21.5C14.9 21.5 14.6042 21.3792 14.3625 21.1375C14.1208 20.8958 14 20.6 14 20.25C14 19.9 14.1208 19.6042 14.3625 19.3625C14.6042 19.1208 14.9 19 15.25 19C15.6 19 15.8958 19.1208 16.1375 19.3625C16.3792 19.6042 16.5 19.9 16.5 20.25C16.5 20.6 16.3792 20.8958 16.1375 21.1375C15.8958 21.3792 15.6 21.5 15.25 21.5ZM19.25 8.5C18.9 8.5 18.6042 8.37917 18.3625 8.1375C18.1208 7.89583 18 7.6 18 7.25C18 6.9 18.1208 6.60417 18.3625 6.3625C18.6042 6.12083 18.9 6 19.25 6C19.6 6 19.8958 6.12083 20.1375 6.3625C20.3792 6.60417 20.5 6.9 20.5 7.25C20.5 7.6 20.3792 7.89583 20.1375 8.1375C19.8958 8.37917 19.6 8.5 19.25 8.5ZM19.25 18C18.9 18 18.6042 17.8792 18.3625 17.6375C18.1208 17.3958 18 17.1 18 16.75C18 16.4 18.1208 16.1042 18.3625 15.8625C18.6042 15.6208 18.9 15.5 19.25 15.5C19.6 15.5 19.8958 15.6208 20.1375 15.8625C20.3792 16.1042 20.5 16.4 20.5 16.75C20.5 17.1 20.3792 17.3958 20.1375 17.6375C19.8958 17.8792 19.6 18 19.25 18ZM20.75 13.25C20.4 13.25 20.1042 13.1292 19.8625 12.8875C19.6208 12.6458 19.5 12.35 19.5 12C19.5 11.65 19.6208 11.3542 19.8625 11.1125C20.1042 10.8708 20.4 10.75 20.75 10.75C21.1 10.75 21.3958 10.8708 21.6375 11.1125C21.8792 11.3542 22 11.65 22 12C22 12.35 21.8792 12.6458 21.6375 12.8875C21.3958 13.1292 21.1 13.25 20.75 13.25ZM12 22C10.6167 22 9.31667 21.7375 8.1 21.2125C6.88333 20.6875 5.825 19.975 4.925 19.075C4.025 18.175 3.3125 17.1167 2.7875 15.9C2.2625 14.6833 2 13.3833 2 12C2 10.6167 2.2625 9.31667 2.7875 8.1C3.3125 6.88333 4.025 5.825 4.925 4.925C5.825 4.025 6.88333 3.3125 8.1 2.7875C9.31667 2.2625 10.6167 2 12 2V4C9.76667 4 7.875 4.775 6.325 6.325C4.775 7.875 4 9.76667 4 12C4 14.2333 4.775 16.125 6.325 17.675C7.875 19.225 9.76667 20 12 20V22ZM12 14C11.45 14 10.9792 13.8042 10.5875 13.4125C10.1958 13.0208 10 12.55 10 12C10 11.9167 10.0042 11.8292 10.0125 11.7375C10.0208 11.6458 10.0417 11.5583 10.075 11.475L8 9.4L9.4 8L11.475 10.075C11.5417 10.0583 11.7167 10.0333 12 10C12.55 10 13.0208 10.1958 13.4125 10.5875C13.8042 10.9792 14 11.45 14 12C14 12.55 13.8042 13.0208 13.4125 13.4125C13.0208 13.8042 12.55 14 12 14Z",fill:"currentColor"},null,-1)),en=n.defineComponent({__name:"ResponseIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:w,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),i=Number(o);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return w}),a=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,i)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon response-icon","data-testid":"kui-icon-wrapper-response-icon",style:n.normalizeStyle(a.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-response-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",Jr,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),Xr],8,Qr))]),_:1},8,["aria-hidden","style"]))}}),tn=z(en,[["__scopeId","data-v-6754ff4c"]]),rn=e=>(n.pushScopeId("data-v-2ee83e7f"),e=e(),n.popScopeId(),e),nn=["aria-hidden"],an={key:0,"data-testid":"kui-icon-svg-title"},on=rn(()=>n.createElementVNode("path",{d:"M16 18V16H18.6L13.4 10.85L9.4 14.85L2 7.4L3.4 6L9.4 12L13.4 8L20 14.6V12H22V18H16Z",fill:"currentColor"},null,-1)),sn=n.defineComponent({__name:"TrendDownIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:w,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),i=Number(o);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return w}),a=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,i)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon trend-down-icon","data-testid":"kui-icon-wrapper-trend-down-icon",style:n.normalizeStyle(a.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-trend-down-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",an,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),on],8,nn))]),_:1},8,["aria-hidden","style"]))}}),ln=z(sn,[["__scopeId","data-v-2ee83e7f"]]),dn=e=>(n.pushScopeId("data-v-fc79d138"),e=e(),n.popScopeId(),e),cn=["aria-hidden"],un={key:0,"data-testid":"kui-icon-svg-title"},fn=dn(()=>n.createElementVNode("path",{d:"M3.4 18L2 16.6L9.4 9.15L13.4 13.15L18.6 8H16V6H22V12H20V9.4L13.4 16L9.4 12L3.4 18Z",fill:"currentColor"},null,-1)),pn=n.defineComponent({__name:"TrendUpIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:w,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),i=Number(o);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return w}),a=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,i)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon trend-up-icon","data-testid":"kui-icon-wrapper-trend-up-icon",style:n.normalizeStyle(a.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-trend-up-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",un,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),fn],8,cn))]),_:1},8,["aria-hidden","style"]))}}),mn=z(pn,[["__scopeId","data-v-fc79d138"]]),gn=e=>(n.pushScopeId("data-v-87798997"),e=e(),n.popScopeId(),e),yn=["aria-hidden"],hn={key:0,"data-testid":"kui-icon-svg-title"},vn=gn(()=>n.createElementVNode("path",{d:"M9 20C8.68333 20 8.4 19.9083 8.15 19.725C7.9 19.5417 7.71667 19.3083 7.6 19.025L5.3 13H1V11H6.7L9 17.1L13.6 4.975C13.7167 4.69167 13.9 4.45833 14.15 4.275C14.4 4.09167 14.6833 4 15 4C15.3167 4 15.6 4.09167 15.85 4.275C16.1 4.45833 16.2833 4.69167 16.4 4.975L18.7 11H23V13H17.3L15 6.9L10.4 19.025C10.2833 19.3083 10.1 19.5417 9.85 19.725C9.6 19.9083 9.31667 20 9 20Z",fill:"currentColor"},null,-1)),Cn=n.defineComponent({__name:"VitalsIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:w,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),i=Number(o);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return w}),a=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,i)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon vitals-icon","data-testid":"kui-icon-wrapper-vitals-icon",style:n.normalizeStyle(a.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-vitals-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",hn,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),vn],8,yn))]),_:1},8,["aria-hidden","style"]))}}),Sn=z(Cn,[["__scopeId","data-v-87798997"]]),Tn=e=>(n.pushScopeId("data-v-81510183"),e=e(),n.popScopeId(),e),wn=["aria-hidden"],En={key:0,"data-testid":"kui-icon-svg-title"},Nn=Tn(()=>n.createElementVNode("path",{d:"M12.0001 22.025C11.7334 22.025 11.4793 21.975 11.2376 21.875C10.9959 21.775 10.7751 21.6333 10.5751 21.45L2.5501 13.425C2.36676 13.225 2.2251 13.0041 2.1251 12.7625C2.0251 12.5208 1.9751 12.2666 1.9751 12C1.9751 11.7333 2.0251 11.475 2.1251 11.225C2.2251 10.975 2.36676 10.7583 2.5501 10.575L10.5751 2.54998C10.7751 2.34998 10.9959 2.20414 11.2376 2.11248C11.4793 2.02081 11.7334 1.97498 12.0001 1.97498C12.2668 1.97498 12.5251 2.02081 12.7751 2.11248C13.0251 2.20414 13.2418 2.34998 13.4251 2.54998L21.4501 10.575C21.6501 10.7583 21.7959 10.975 21.8876 11.225C21.9793 11.475 22.0251 11.7333 22.0251 12C22.0251 12.2666 21.9793 12.5208 21.8876 12.7625C21.7959 13.0041 21.6501 13.225 21.4501 13.425L13.4251 21.45C13.2418 21.6333 13.0251 21.775 12.7751 21.875C12.5251 21.975 12.2668 22.025 12.0001 22.025ZM12.0001 20.025L20.0251 12L12.0001 3.97498L3.9751 12L12.0001 20.025ZM11.0001 13H13.0001V6.99998H11.0001V13ZM12.0001 16C12.2834 16 12.5209 15.9041 12.7126 15.7125C12.9043 15.5208 13.0001 15.2833 13.0001 15C13.0001 14.7166 12.9043 14.4791 12.7126 14.2875C12.5209 14.0958 12.2834 14 12.0001 14C11.7168 14 11.4793 14.0958 11.2876 14.2875C11.0959 14.4791 11.0001 14.7166 11.0001 15C11.0001 15.2833 11.0959 15.5208 11.2876 15.7125C11.4793 15.9041 11.7168 16 12.0001 16Z",fill:"currentColor"},null,-1)),Dn=n.defineComponent({__name:"WarningOutlineIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:w,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),i=Number(o);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return w}),a=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,i)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon warning-outline-icon","data-testid":"kui-icon-wrapper-warning-outline-icon",style:n.normalizeStyle(a.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-warning-outline-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",En,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),Nn],8,wn))]),_:1},8,["aria-hidden","style"]))}}),Rn=z(Dn,[["__scopeId","data-v-81510183"]]),Ne=2,ot=Ne+2,bn=(e,t,r=!1)=>{let a=!t||Number(e.toFixed(ot))===0?0:Number(e.toFixed(ot))>0?1:-1;return r&&(a*=-1),a},_n=(e,t,r)=>t?`${Math.abs(e*100).toFixed(Ne)}%`:r,kn=(e,t)=>t===0?0:e/t-1,In=(e,t=!1)=>(t&&(e*=-1),e>0?mn:e<0?ln:at),xn="#ad000e",Mn="#6c7489",st="#52596e",An="#007d60",De="16px",Ln="14px",On="48px";var A=(e=>(e.GENERIC_COUNT="GenericCount",e.TRAFFIC="Traffic",e.ERROR_RATE="ErrorRate",e.LATENCY="Latency",e))(A||{});const zn={class:"metricscard"},Un={key:0,class:"metricscard-description"},Vn={key:0,class:"metricscard-error"},Bn={key:2,class:"metricscard-trend"},Yn={"data-testid":"metric-trend-change"},$n={key:0,class:"metricscard-trend-range"},Hn=n.defineComponent({__name:"MetricsCard",props:{cardType:{type:String,required:!0,default:A.GENERIC_COUNT},title:{type:String,default:"0%",required:!0},description:{type:String,default:"",required:!1},tooltip:{type:String,required:!1,default:""},timeframe:{type:String,required:!1,default:""},metricValue:{type:String,default:""},metricChange:{type:String,required:!0},changePolarity:{type:Number,required:!0},trendIcon:{type:Object,default:at},trendRange:{type:String,default:""},hasError:{type:Boolean,default:!1},errorMessage:{type:String,default:"Vitals data error"},cardSize:{type:String,required:!1,default:()=>"lg"}},setup(e){const t=e,r=new Map([[A.GENERIC_COUNT,Sn],[A.TRAFFIC,Vr],[A.ERROR_RATE,Rn],[A.LATENCY,tn]]),a=s=>{const d={red:`var(--kong-ui-metric-card-trend-negative, ${xn})`,green:`var(--kong-ui-metric-card-trend-positive, ${An})`,grey:`var(--kong-ui-metric-card-trend-neutral, ${st})`};return s>0?d.green:s<0?d.red:d.grey},o=s=>s>0?"positive":s<0?"negative":"neutral",i=[k.Medium,k.Large,k.LargeCompact].includes(t.cardSize),l=t.cardSize===k.ExtraLarge?On:i?"22px":Ln,c=n.computed(()=>t.cardSize===k.LargeCompact),f=[k.Small,k.LargeCompact].includes(t.cardSize);return(s,d)=>{const u=n.resolveComponent("KIcon"),p=n.resolveComponent("KTooltip");return n.openBlock(),n.createElementBlock("div",zn,[n.createElementVNode("div",{class:n.normalizeClass(["metricscard-title",e.cardSize])},[n.unref(f)?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(r).get(e.cardType)),{key:0,class:"metricscard-icon",color:n.unref(Mn),size:n.unref(De)},null,8,["color","size"])),n.createElementVNode("span",null,n.toDisplayString(e.title),1),e.tooltip?(n.openBlock(),n.createBlock(p,{key:1,class:"metricscard-tooltip",label:e.tooltip,placement:"right"},{default:n.withCtx(()=>[n.createVNode(u,{icon:"info",size:"12"})]),_:1},8,["label"])):n.createCommentVNode("",!0)],2),e.description&&n.unref(i)&&!c.value?(n.openBlock(),n.createElementBlock("div",Un,[n.createElementVNode("span",null,n.toDisplayString(e.description),1)])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(["metricscard-valuetrend",{"is-compact":c.value}])},[e.hasError?(n.openBlock(),n.createElementBlock("div",Vn,[n.createVNode(u,{icon:"warning",size:"20"}),n.createElementVNode("div",null,n.toDisplayString(e.errorMessage),1)])):(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(["metricscard-value",e.cardSize]),"data-testid":"metric-value",style:n.normalizeStyle(`font-size:${n.unref(l)}`)},n.toDisplayString(e.metricValue),7)),n.unref(i)?(n.openBlock(),n.createElementBlock("div",Bn,[n.createElementVNode("div",{class:n.normalizeClass(["metricscard-trend-change",o(e.changePolarity)]),"data-testid":"metric-trend-parent"},[e.changePolarity!==0?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.trendIcon),{key:0,color:a(e.changePolarity),size:n.unref(De)},null,8,["color","size"])):(n.openBlock(),n.createBlock(n.unref(Fr),{key:1,color:n.unref(st),size:n.unref(De)},null,8,["color","size"])),n.createElementVNode("div",Yn,n.toDisplayString(e.metricChange),1)],2),e.trendRange&&e.cardSize!==n.unref(k).LargeCompact?(n.openBlock(),n.createElementBlock("div",$n,n.toDisplayString(e.trendRange),1)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)],2)])}}}),Re=(e,t)=>{const r=e.__vccOpts||e;for(const[a,o]of t)r[a]=o;return r},qn=Re(Hn,[["__scopeId","data-v-e3b3a4cb"]]),Fn={},Pn={class:"loading-tabs"};function Zn(e,t){const r=n.resolveComponent("KSkeletonBox");return n.openBlock(),n.createElementBlock("div",Pn,[n.createVNode(r,{width:"100"}),n.createVNode(r,{width:"75"})])}const jn=Re(Fn,[["render",Zn],["__scopeId","data-v-f7eb9c40"]]),Gn={key:0,class:"error-display"},Wn={key:0,class:"error-display-message"},Kn=Re(n.defineComponent({__name:"MetricCardContainer",props:{fallbackDisplayText:{type:String,required:!0},cards:{type:Array,required:!0},errorMessage:{type:String,required:!1,default:""},loading:{type:Boolean,required:!1,default:!1},hasTrendAccess:{type:Boolean,required:!1,default:!0},cardSize:{type:String,required:!1,default:()=>k.Large}},setup(e){const t=e,r=n.computed(()=>t.cards.every(o=>(o==null?void 0:o.hasError)===!0)),a=o=>{const i=kn(o.currentValue,o.previousValue)||0,l=bn(i,t.hasTrendAccess,o.increaseIsBad);return{metricValue:o.formatValueFn?o.formatValueFn(o.currentValue):Mr(o.currentValue,{capital:!0,round:!0})||"0",metricChange:o.formatChangeFn?o.formatChangeFn(i):_n(i,t.hasTrendAccess,t.fallbackDisplayText),changePolarity:l,trendIcon:In(l,o.increaseIsBad),cardSize:t.cardSize}};return(o,i)=>{const l=n.resolveComponent("KIcon");return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["kong-ui-public-metric-card-container",e.cardSize])},[r.value?(n.openBlock(),n.createElementBlock("div",Gn,[n.createVNode(l,{class:"error-display-icon",icon:"warning",size:"24"}),e.errorMessage?(n.openBlock(),n.createElementBlock("div",Wn,n.toDisplayString(e.errorMessage),1)):n.createCommentVNode("",!0)])):(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:1},n.renderList(e.cards,(c,f)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[e.loading?(n.openBlock(),n.createBlock(jn,{key:`skeleton-${f}`,class:n.normalizeClass(e.cardSize===n.unref(k).Small?"loading-tabs-small":"loading-tabs-large")},null,8,["class"])):(n.openBlock(),n.createBlock(qn,n.mergeProps({key:f},a(c),{"card-size":e.cardSize,"card-type":c.cardType,description:c.description,"error-message":e.errorMessage,"has-error":c.hasError,title:c.title,tooltip:c.tooltip,"trend-range":c.trendRange}),null,16,["card-size","card-type","description","error-message","has-error","title","tooltip","trend-range"]))],64))),256))],2)}}}),[["__scopeId","data-v-7c516677"]]),ni="",Qn=n.defineComponent({__name:"MetricsConsumer",props:{lookupKey:{default:void 0},cardSize:{default:k.Large},cardToDisplay:{default:void 0}},setup(e){const t=e,r=n.inject(nt);if(!r)throw new Error("MetricsConsumer must be nested inside a MetricsProvider instance.");const{traffic:a,latency:o}=r.data,{i18n:i}=V.useI18n(),l=V.useMetricCardBuilder({cardType:A.TRAFFIC,title:n.computed(()=>r.longCardTitles?i.t("metricCard.long.traffic"):i.t("metricCard.short.traffic")),description:r.description,record:a.mapped,hasError:a.hasError,lookupKey:t.lookupKey,sumGroupedValues:Z,trendRange:r.trendRange}),c=h=>`${h.toFixed(Ne)}%`,f=n.computed(()=>{const h=a.mapped.value,T=q(h,"current",t.lookupKey,Ke),x=q(h,"current",t.lookupKey,Z),S=T/x*100||0,v=q(h,"previous",t.lookupKey,Ke),B=q(h,"previous",t.lookupKey,Z),R=v/B*100||0;return{cardType:A.ERROR_RATE,hasError:a.hasError.value,currentValue:S,previousValue:R,formatValueFn:c,title:r.longCardTitles?i.t("metricCard.long.errorRate"):i.t("metricCard.short.errorRate"),description:r.description,increaseIsBad:!0,trendRange:r.trendRange.value}}),s=h=>`${h}ms`,d=V.useMetricCardBuilder({cardType:A.LATENCY,title:n.computed(()=>r.longCardTitles?i.t("metricCard.long.latency"):i.t("metricCard.short.latency")),description:r.description,hasError:o.hasError,record:o.mapped,lookupKey:t.lookupKey,increaseIsBad:!0,formatValueFn:s,trendRange:r.trendRange}),u=n.computed(()=>t.cardToDisplay==="TRAFFIC"?[l.value]:t.cardToDisplay==="ERROR_RATE"?[f.value]:t.cardToDisplay==="LATENCY"?[d.value]:[l.value,f.value,d.value]),p=n.computed(()=>t.cardToDisplay==="TRAFFIC"||t.cardToDisplay==="ERROR_RATE"?a.isLoading.value:t.cardToDisplay==="LATENCY"?o.isLoading.value:a.isLoading.value||o.isLoading.value),m=n.computed(()=>({cards:u.value,loading:p.value,hasTrendAccess:r.hasTrendAccess,fallbackDisplayText:i.t("general.notAvailable"),cardSize:t.cardSize,hideTitle:!0,trendRange:r.trendRange.value})),y=n.computed(()=>({loading:m.value.loading,trafficCard:l.value,errorRateCard:f.value,latencyCard:d.value,errorRateFormatted:c(f.value.currentValue),latencyFormatted:s(d.value.currentValue)}));return(h,T)=>n.renderSlot(h.$slots,"default",{cardValues:y.value},()=>[n.createVNode(n.unref(Kn),n.normalizeProps(n.guardReactiveProps(m.value)),null,16)])}}),ee=e=>new Date(e),Jn=(e,t)=>{const r=e.body,{startMs:a,endMs:o}=e.query,i=typeof a!="number"?parseInt(a,10):a,l=typeof o!="number"?parseInt(o,10):o;e.reply({statusCode:200,body:lt(r,i,l,t)})},lt=(e,t,r,a)=>{var u,p;const o=e.granularityMs||0,i=o?(r-t)/o:1;if(i!==1&&i!==2)throw new Error("Query did not request 1 or 2 records. Perhaps there's a chart query on the same page interfering with the stub?");if((e.dimensions??[]).length>2)throw new Error(`Explore only supports 0-2 dimensions; got: ${JSON.stringify(e.dimensions)}`);const l=(e.dimensions??[]).find(m=>m!=="TIME"),c=(a==null?void 0:a.dimensionNames)??[],f=Math.max(c.length,1),s=[];for(let m=0;m<i;m++)for(let y=0;y<f;y++){const h=l?{[l]:c[y]}:{};(u=e.dimensions)!=null&&u.includes(L.STATUS_CODE_GROUPED)?Z.forEach(T=>{const x=e.metrics.reduce((S,v)=>(S[v]=(i-m)*1e3+100*y+1,S),{...h,STATUS_CODE_GROUPED:T});s.push({version:"v1",timestamp:m===0?ee(t).toISOString():ee(t+o).toISOString(),event:x})}):s.push({version:"v1",timestamp:m===0?ee(t).toISOString():ee(t+o).toISOString(),event:e.metrics.reduce((T,x)=>(T[x]=(i-m)*1e3+100*y+1,T),{...h})})}const d={start:t,end:r,granularity:o,dimensions:l?{[l]:c,...(p=e.dimensions)!=null&&p.includes(L.STATUS_CODE_GROUPED)?{STATUS_CODE_GROUPED:Z}:{}}:{},metricNames:e.metrics};return{records:s,meta:d}};N.EXPLORE_V2_AGGREGATIONS=J,N.EXPLORE_V2_DIMENSIONS=L,N.EXPLORE_V2_FILTER_TYPES=ve,N.MetricsConsumer=Qn,N.MetricsProviderInternal=kr,N.mockExploreResponse=lt,N.mockExploreResponseFromCypress=Jn,Object.defineProperty(N,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(N,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("@kong-ui-public/i18n")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n"],n):(N=typeof globalThis<"u"?globalThis:N||self,n(N["kong-ui-public-vitals-metric-provider"]={},N.Vue,N["kong-ui-public-i18n"]))})(this,function(N,n,xe){"use strict";var mt=Object.defineProperty,gt=(e,t,r)=>t in e?mt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,b=(e,t,r)=>(gt(e,typeof t!="symbol"?t+"":t,r),r),g=(e=>(e.MINUTELY="Minutely",e.HOURLY="Hourly",e.DAILY="Daily",e.WEEKLY="Weekly",e))(g||{}),C=(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))(C||{});function W(e){"@babel/helpers - typeof";return W=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},W(e)}function _(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function D(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function U(e){D(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||W(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function re(e,t){D(2,arguments);var r=U(e),a=_(t);return isNaN(a)?new Date(NaN):(a&&r.setDate(r.getDate()+a),r)}function yt(e,t){D(2,arguments);var r=U(e),a=_(t);if(isNaN(a))return new Date(NaN);if(!a)return r;var o=r.getDate(),i=new Date(r.getTime());i.setMonth(r.getMonth()+a+1,0);var l=i.getDate();return o>=l?i:(r.setFullYear(i.getFullYear(),i.getMonth(),o),r)}var ht={};function vt(){return ht}function K(e,t){var r,a,o,i,l,c,f,s;D(1,arguments);var d=vt(),u=_((r=(a=(o=(i=t==null?void 0:t.weekStartsOn)!==null&&i!==void 0?i:t==null||(l=t.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&o!==void 0?o:d.weekStartsOn)!==null&&a!==void 0?a:(f=d.locale)===null||f===void 0||(s=f.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&r!==void 0?r:0);if(!(u>=0&&u<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=U(e),m=p.getDay(),y=(m<u?7:0)+m-u;return p.setDate(p.getDate()-y),p.setHours(0,0,0,0),p}function Ae(e){D(1,arguments);var t=U(e);return t.setHours(0,0,0,0),t}var Ct=60,Tt=3600;function $(e){D(1,arguments);var t=U(e);return t.setDate(1),t.setHours(0,0,0,0),t}function St(e){D(1,arguments);var t=U(e),r=t.getFullYear(),a=t.getMonth(),o=new Date(0);return o.setFullYear(r,a+1,0),o.setHours(0,0,0,0),o.getDate()}function ne(e){D(1,arguments);var t=U(e),r=t.getTime();return r}function Me(e){return D(1,arguments),Math.floor(ne(e)/1e3)}function wt(e){return D(1,arguments),Math.floor(e*Tt)}function Et(e,t){D(2,arguments);var r=_(t);return re(e,-r)}function Nt(e){D(1,arguments);var t=e/Ct;return Math.floor(t)}function ie(e,t){D(2,arguments);var r=_(t);return yt(e,-r)}function Dt(e,t){if(D(2,arguments),!t||W(t)!=="object")return new Date(NaN);var r=t.years?_(t.years):0,a=t.months?_(t.months):0,o=t.weeks?_(t.weeks):0,i=t.days?_(t.days):0,l=t.hours?_(t.hours):0,c=t.minutes?_(t.minutes):0,f=t.seconds?_(t.seconds):0,s=ie(e,a+r*12),d=Et(s,i+o*7),u=c+l*60,p=f+u*60,m=p*1e3,y=new Date(d.getTime()-m);return y}function ae(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Le={exports:{}};(function(e){function t(r){return r&&r.__esModule?r:{default:r}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Le);var Rt=Le.exports,oe={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;function r(a){if(a===null||a===!0||a===!1)return NaN;var o=Number(a);return isNaN(o)?o:o<0?Math.ceil(o):Math.floor(o)}e.exports=t.default})(oe,oe.exports);var bt=oe.exports;const _t=ae(bt);var se={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;function r(a){var o=new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()));return o.setUTCFullYear(a.getFullYear()),a.getTime()-o.getTime()}e.exports=t.default})(se,se.exports);var kt=se.exports;const Oe=ae(kt);function It(e,t){var r=Lt(t);return r.formatToParts?At(r,e):Mt(r,e)}var xt={year:0,month:1,day:2,hour:3,minute:4,second:5};function At(e,t){try{for(var r=e.formatToParts(t),a=[],o=0;o<r.length;o++){var i=xt[r[o].type];i>=0&&(a[i]=parseInt(r[o].value,10))}return a}catch(l){if(l instanceof RangeError)return[NaN];throw l}}function Mt(e,t){var r=e.format(t).replace(/\u200E/g,""),a=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(r);return[a[3],a[1],a[2],a[4],a[5],a[6]]}var le={};function Lt(e){if(!le[e]){var t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"America/New_York",year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),r=t==="06/25/2014, 00:00:00"||t==="06/25/2014 00:00:00";le[e]=r?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"}):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"})}return le[e]}function de(e,t,r,a,o,i,l){var c=new Date(0);return c.setUTCFullYear(e,t,r),c.setUTCHours(a,o,i,l),c}var ze=36e5,Ot=6e4,ce={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-]\d{2}):?(\d{2})$/};function Q(e,t,r){var a,o;if(!e||(a=ce.timezoneZ.exec(e),a))return 0;var i;if(a=ce.timezoneHH.exec(e),a)return i=parseInt(a[1],10),Ue(i)?-(i*ze):NaN;if(a=ce.timezoneHHMM.exec(e),a){i=parseInt(a[1],10);var l=parseInt(a[2],10);return Ue(i,l)?(o=Math.abs(i)*ze+l*Ot,i>0?-o:o):NaN}if(Vt(e)){t=new Date(t||Date.now());var c=r?t:zt(t),f=ue(c,e),s=r?f:Ut(t,f,e);return-s}return NaN}function zt(e){return de(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function ue(e,t){var r=It(e,t),a=de(r[0],r[1]-1,r[2],r[3]%24,r[4],r[5],0).getTime(),o=e.getTime(),i=o%1e3;return o-=i>=0?i:1e3+i,a-o}function Ut(e,t,r){var a=e.getTime(),o=a-t,i=ue(new Date(o),r);if(t===i)return t;o-=i-t;var l=ue(new Date(o),r);return i===l?i:Math.max(i,l)}function Ue(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}var Ve={};function Vt(e){if(Ve[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Ve[e]=!0,!0}catch{return!1}}var Bt=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/;const Be=Bt;var fe=36e5,Ye=6e4,Yt=2,E={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Be};function pe(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);var r=t||{},a=r.additionalDigits==null?Yt:_t(r.additionalDigits);if(a!==2&&a!==1&&a!==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(!(typeof e=="string"||Object.prototype.toString.call(e)==="[object String]"))return new Date(NaN);var o=$t(e),i=Ht(o.date,a),l=i.year,c=i.restDateString,f=qt(c,l);if(isNaN(f))return new Date(NaN);if(f){var s=f.getTime(),d=0,u;if(o.time&&(d=Pt(o.time),isNaN(d)))return new Date(NaN);if(o.timeZone||r.timeZone){if(u=Q(o.timeZone||r.timeZone,new Date(s+d)),isNaN(u))return new Date(NaN)}else u=Oe(new Date(s+d)),u=Oe(new Date(s+d+u));return new Date(s+d+u)}else return new Date(NaN)}function $t(e){var t={},r=E.dateTimePattern.exec(e),a;if(r?(t.date=r[1],a=r[3]):(r=E.datePattern.exec(e),r?(t.date=r[1],a=r[2]):(t.date=null,a=e)),a){var o=E.timeZone.exec(a);o?(t.time=a.replace(o[1],""),t.timeZone=o[1].trim()):t.time=a}return t}function Ht(e,t){var r=E.YYY[t],a=E.YYYYY[t],o;if(o=E.YYYY.exec(e)||a.exec(e),o){var i=o[1];return{year:parseInt(i,10),restDateString:e.slice(i.length)}}if(o=E.YY.exec(e)||r.exec(e),o){var l=o[1];return{year:parseInt(l,10)*100,restDateString:e.slice(l.length)}}return{year:null}}function qt(e,t){if(t===null)return null;var r,a,o,i;if(e.length===0)return a=new Date(0),a.setUTCFullYear(t),a;if(r=E.MM.exec(e),r)return a=new Date(0),o=parseInt(r[1],10)-1,qe(t,o)?(a.setUTCFullYear(t,o),a):new Date(NaN);if(r=E.DDD.exec(e),r){a=new Date(0);var l=parseInt(r[1],10);return jt(t,l)?(a.setUTCFullYear(t,0,l),a):new Date(NaN)}if(r=E.MMDD.exec(e),r){a=new Date(0),o=parseInt(r[1],10)-1;var c=parseInt(r[2],10);return qe(t,o,c)?(a.setUTCFullYear(t,o,c),a):new Date(NaN)}if(r=E.Www.exec(e),r)return i=parseInt(r[1],10)-1,Pe(t,i)?$e(t,i):new Date(NaN);if(r=E.WwwD.exec(e),r){i=parseInt(r[1],10)-1;var f=parseInt(r[2],10)-1;return Pe(t,i,f)?$e(t,i,f):new Date(NaN)}return null}function Pt(e){var t,r,a;if(t=E.HH.exec(e),t)return r=parseFloat(t[1].replace(",",".")),me(r)?r%24*fe:NaN;if(t=E.HHMM.exec(e),t)return r=parseInt(t[1],10),a=parseFloat(t[2].replace(",",".")),me(r,a)?r%24*fe+a*Ye:NaN;if(t=E.HHMMSS.exec(e),t){r=parseInt(t[1],10),a=parseInt(t[2],10);var o=parseFloat(t[3].replace(",","."));return me(r,a,o)?r%24*fe+a*Ye+o*1e3:NaN}return null}function $e(e,t,r){t=t||0,r=r||0;var a=new Date(0);a.setUTCFullYear(e,0,4);var o=a.getUTCDay()||7,i=t*7+r+1-o;return a.setUTCDate(a.getUTCDate()+i),a}var Ft=[31,28,31,30,31,30,31,31,30,31,30,31],Zt=[31,29,31,30,31,30,31,31,30,31,30,31];function He(e){return e%400===0||e%4===0&&e%100!==0}function qe(e,t,r){if(t<0||t>11)return!1;if(r!=null){if(r<1)return!1;var a=He(e);if(a&&r>Zt[t]||!a&&r>Ft[t])return!1}return!0}function jt(e,t){if(t<1)return!1;var r=He(e);return!(r&&t>366||!r&&t>365)}function Pe(e,t,r){return!(t<0||t>52||r!=null&&(r<0||r>6))}function me(e,t,r){return!(e!=null&&(e<0||e>=25)||t!=null&&(t<0||t>=60)||r!=null&&(r<0||r>=60))}var ge={exports:{}},ye={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;function r(a,o){if(a==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(a[i]=o[i]);return a}e.exports=t.default})(ye,ye.exports);var Gt=ye.exports;(function(e,t){var r=Rt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var a=r(Gt);function o(i){return(0,a.default)({},i)}e.exports=t.default})(ge,ge.exports);var Wt=ge.exports;const Kt=ae(Wt);function Qt(e,t,r){var a=pe(e,r),o=Q(t,a,!0),i=new Date(a.getTime()-o),l=new Date(0);return l.setFullYear(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),l.setHours(i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()),l}function Fe(e,t){return-Q(e,t)}function Jt(e,t,r){if(typeof e=="string"&&!e.match(Be)){var a=Kt(r);return a.timeZone=t,pe(e,a)}var o=pe(e,r),i=de(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),o.getSeconds(),o.getMilliseconds()).getTime(),l=Q(t,new Date(i));return new Date(i+l)}const Ze={[g.MINUTELY]:60*1e3,[g.HOURLY]:60*60*1e3,[g.DAILY]:60*60*24*1e3,[g.WEEKLY]:60*60*24*7*1e3};function Xt(e,t){return e?{duration:e,type:"duration",origin:t}:null}function je(e,t,r,a){const o=Ze[r];let i=0;return o>=Ze[g.DAILY]&&(a?i=-Fe(a,t):i=t.getTimezoneOffset()*60*1e3),new Date(e((t.getTime()-i)/o)*o+i)}function Ge(e,t,r){return je(Math.floor,e,t,r)}function er(e,t,r){return je(Math.ceil,e,t,r)}let tr=class pt{constructor(t,r){if(b(this,"timeframe"),b(this,"tz"),this.constructor===pt)throw new Error("BaseQueryTime is not meant to be used directly.");this.timeframe=t,this.tz=r}calculateStartDate(t,r,a=1){if(t)return new Date(this.endDate().getTime()-this.timeframe.timeframeLengthMs()*a);{const o=this.endDate(),i=this.timeframe.rawStart(this.tz),l=Ge(i,r,this.tz),c=(o.getTime()-l.getTime())*(a-1);return Ge(new Date(i.getTime()-c),r,this.tz)}}granularitySeconds(){return Math.floor(this.granularityMs()/1e3)}granularityDruid(){return Xt(this.granularityMs(),this.startDate().toISOString())}startSeconds(){return Me(this.startDate())}endSeconds(){return Me(this.endDate())}startMs(){return ne(this.startDate())}endMs(){return ne(this.endDate())}withinFreeTier(){return this.startDate()>=Dt(new Date,{days:1})}};class We extends tr{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.timeframe.dataGranularity)}endDate(){return er(this.timeframe.rawEnd(this.tz),this.timeframe.dataGranularity,this.tz)}granularityMs(){return this.endDate().getTime()-this.startDate().getTime()}}class rr extends We{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.timeframe.dataGranularity,2)}granularityMs(){return this.endDate().getTime()-super.startDate().getTime()}}const H=(e,t)=>new Date(e.getTime()-Fe(t,e));let I=class{constructor(t){b(this,"timeframeText"),b(this,"key"),b(this,"display"),b(this,"timeframeLength"),b(this,"allowedTiers"),b(this,"defaultResponseGranularity"),b(this,"dataGranularity"),b(this,"isRelative"),b(this,"_startCustom"),b(this,"_endCustom"),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}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(){const t=new Set,r=this.maximumTimeframeLength()/3600;return r<=6&&t.add(g.MINUTELY),r>=2&&r<=7*24&&t.add(g.HOURLY),r>=2*24&&t.add(g.DAILY),r>=2*24*14&&t.add(g.WEEKLY),t}tzAdjustedDate(t){if(!t)return new Date;const r=Jt(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Qt(r,t)}};class nr extends I{rawStart(t){let r=K(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(r=H(r,t)),r}maximumTimeframeLength(){return 60*60*24*7}}class ir extends I{rawStart(t){let r=$(this.tzAdjustedDate(t));return t&&(r=H(r,t)),r}maximumTimeframeLength(){return 60*60*24*31}}class ar extends I{rawEnd(t){let r=K(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(r=H(r,t)),r}rawStart(t){const r=this.tzAdjustedDate(t);let a=K(r.setDate(r.getDate()-7),{weekStartsOn:1});return t&&(a=H(a,t)),a}}class or extends I{rawEnd(t){let r=$(this.tzAdjustedDate(t));return t&&(r=H(r,t)),r}rawStart(t){let r=$(ie(this.tzAdjustedDate(t),1));return t&&(r=H(r,t)),r}}const he=new Map([[C.FIFTEEN_MIN,new I({key:C.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:g.MINUTELY,dataGranularity:g.MINUTELY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]})],[C.ONE_HOUR,new I({key:C.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:g.MINUTELY,dataGranularity:g.MINUTELY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]})],[C.SIX_HOUR,new I({key:C.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:g.HOURLY,dataGranularity:g.HOURLY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]})],[C.TWELVE_HOUR,new I({key:C.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:g.HOURLY,dataGranularity:g.HOURLY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]})],[C.ONE_DAY,new I({key:C.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:g.HOURLY,dataGranularity:g.HOURLY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]})],[C.SEVEN_DAY,new I({key:C.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:g.DAILY,dataGranularity:g.DAILY,isRelative:!0,allowedTiers:["trial","plus","enterprise"]})],[C.THIRTY_DAY,new I({key:C.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:g.DAILY,dataGranularity:g.DAILY,isRelative:!0,allowedTiers:["trial","plus","enterprise"]})],[C.CURRENT_WEEK,new nr({key:C.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const e=K(new Date,{weekStartsOn:1});return(Ae(re(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:g.DAILY,dataGranularity:g.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]})],[C.CURRENT_MONTH,new ir({key:C.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const e=$(new Date);return(Ae(re(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:g.DAILY,dataGranularity:g.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]})],[C.PREVIOUS_WEEK,new ar({key:C.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:g.DAILY,dataGranularity:g.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]})],[C.PREVIOUS_MONTH,new or({key:C.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=$(new Date),r=$(ie(new Date,1));return t.getTimezoneOffset()!==r.getTimezoneOffset()&&(e=sr(t,r)),60*60*24*St(new Date().setMonth(new Date().getMonth()-1))+wt(e)},defaultResponseGranularity:g.DAILY,dataGranularity:g.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]})]]);function sr(e,t){return Nt(e.getTimezoneOffset()-t.getTimezoneOffset())}const lr={general:{notAvailable:"N/A"},metricCard:{short:{traffic:"Requests",errorRate:"Error Rate",latency:"P99 Latency"},long:{traffic:"Number of Requests",errorRate:"Average Error Rate",latency:"P99 Latency"}},trendRange:{custom:"vs previous {numDays} days","15m":"vs previous 15 minutes","1h":"vs previous hour","6h":"vs previous 6 hours","12h":"vs previous 12 hours","24h":"vs previous 24 hours","7d":"vs previous 7 days","30d":"vs previous 30 days",current_week:"vs previous week",current_month:"vs previous month",current_quarter:"vs previous quarter",previous_week:"vs previous time period",previous_month:"vs previous time period",previous_quarter:"vs previous quarter"}};function dr(){const e=xe.createI18n("en-us",lr);return{i18n:e,i18nT:xe.i18nTComponent(e)}}var L=(e=>(e.API_PRODUCT="API_PRODUCT",e.API_PRODUCT_VERSION="API_PRODUCT_VERSION",e.RUNTIME_GROUP="RUNTIME_GROUP",e.GATEWAY_INSTANCE_ID="GATEWAY_INSTANCE_ID",e.GATEWAY_SERVICE="GATEWAY_SERVICE",e.ROUTE="ROUTE",e.APPLICATION="APPLICATION",e.STATUS_CODE="STATUS_CODE",e.STATUS_CODE_GROUPED="STATUS_CODE_GROUPED",e.TIME="TIME",e.ORGANIZATION="ORGANIZATION",e.CONTROL_PLANE="CONTROL_PLANE",e.CONTROL_PLANE_GROUP="CONTROL_PLANE_GROUP",e.DATA_PLANE_NODE="DATA_PLANE_NODE",e))(L||{}),J=(e=>(e.REQUEST_COUNT="REQUEST_COUNT",e.REQUEST_PER_MINUTE="REQUEST_PER_MINUTE",e.RESPONSE_LATENCY_P99="RESPONSE_LATENCY_P99",e.RESPONSE_LATENCY_P95="RESPONSE_LATENCY_P95",e.RESPONSE_LATENCY_P50="RESPONSE_LATENCY_P50",e.RESPONSE_SIZE_P99="RESPONSE_SIZE_P99",e.RESPONSE_SIZE_P95="RESPONSE_SIZE_P95",e.RESPONSE_SIZE_P50="RESPONSE_SIZE_P50",e.REQUEST_SIZE_P99="REQUEST_SIZE_P99",e.REQUEST_SIZE_P95="REQUEST_SIZE_P95",e.REQUEST_SIZE_P50="REQUEST_SIZE_P50",e))(J||{}),ve=(e=>(e.IN="IN",e.NOT_IN="NOT_IN",e))(ve||{});const cr=2,Z=["1XX","2XX","3XX","4XX","5XX"],Ke=["4XX","5XX"];var Qe=(e=>(e.VALIDATING="VALIDATING",e.VALIDATING_HAS_DATA="VALIDATING_HAS_DATA",e.PENDING="PENDING",e.SUCCESS="SUCCESS",e.SUCCESS_HAS_DATA="SUCCESS_HAS_DATA",e.ERROR="ERROR",e.STALE_IF_ERROR="STALE_IF_ERROR",e))(Qe||{});const ur=e=>{var t,r,a,o,i;return e?!!((t=Object.keys(e))!=null&&t.length||(r=e.data)!=null&&r.length||(o=(a=e.data)==null?void 0:a.data)!=null&&o.length||!((i=e.data)!=null&&i.data)&&typeof e.data=="object"&&Object.keys(e==null?void 0:e.data).length):!1};function fr(e=n.ref({}),t,r,a=ur){const o=n.ref("PENDING");return n.watchEffect(()=>{const i=a(e.value);if(e.value&&i&&r.value){o.value="VALIDATING_HAS_DATA";return}if(e.value&&r.value){o.value="VALIDATING";return}if(e.value&&t.value){o.value="STALE_IF_ERROR";return}if(e.value===void 0&&!t.value){o.value="PENDING";return}if(e.value&&!t.value&&i){o.value="SUCCESS_HAS_DATA";return}if(e.value&&!t.value){o.value="SUCCESS";return}e.value===void 0&&t&&(o.value="ERROR")}),{state:o,swrvState:Qe}}const O=Symbol("default"),Ce=L.STATUS_CODE_GROUPED,Je=(e,t,r,a,o)=>{e[t][r]||(e[t][r]={}),e[t][r][a]=o};function pr(e,t,r){var c;const a=((c=e.meta.metricNames)==null?void 0:c[0])||"",o=Object.keys(e.meta.dimensions||{}),i=!!o.find(f=>f===Ce),l=o.find(f=>f!==Ce);return o.length>2||o.length>1&&!i?(console.error("Don't know how to work with provided dimensions:",o),{previous:{[O]:{[O]:0}},current:{[O]:{[O]:0}}}):e.records.reduce((f,s)=>{const d=s.event[a],u=l?s.event[l]:O,p=i?s.event[Ce]:O;return new Date(s.timestamp).getTime()===t.startDate().getTime()&&r?Je(f,"previous",u,p,d):Je(f,"current",u,p,d),f},{previous:{},current:{}})}function mr(e){e.queryReady===void 0&&(e.queryReady=n.computed(()=>!0));const t=n.computed(()=>e.withTrend?new rr(e.timeframe.value):new We(e.timeframe.value)),r=n.computed(()=>{var u,p;return{metrics:e.metrics,dimensions:[...(u=e.dimensions)!=null&&u.length?[...e.dimensions]:[],...e.withTrend?[L.TIME]:[]],granularityMs:t.value.granularityMs(),...(p=e.filter.value)!=null&&p.length?{filter:e.filter.value}:{}}}),a=n.computed(()=>`${t.value.endDate().toString()}-${t.value.startDate().toString()}`),o=n.computed(()=>{var p,m,y,h;if(!((p=e.queryReady)!=null&&p.value)||e.featureFlags&&!e.featureFlags.every(S=>S))return null;const u=(m=e.filter)!=null&&m.value?JSON.stringify(e.filter.value):"";return`metric-fetcher-${a.value}-${(y=e.dimensions)==null?void 0:y.join("-")}-${(h=e.metrics)==null?void 0:h.join("-")}-${u}`}),{response:i,error:l,isValidating:c}=V.useRequest(()=>o.value,()=>e.dataFetcher(t.value,r.value),{refreshInterval:e.refreshInterval,revalidateOnFocus:!1,errorRetryCount:cr}),{state:f,swrvState:s}=fr(i,l,c),d=n.computed(()=>{var u,p,m,y,h,S,x,T,v,B;return!((m=(p=(u=i.value)==null?void 0:u.data)==null?void 0:p.records)!=null&&m.length)||!((S=(h=(y=i.value)==null?void 0:y.data)==null?void 0:h.meta)!=null&&S.dimensions)||!((B=(v=(T=(x=i.value)==null?void 0:x.data)==null?void 0:T.meta)==null?void 0:v.metricNames)!=null&&B.length)?{current:{},previous:{}}:pr(i.value.data,t.value,!!e.withTrend)});return{isLoading:n.computed(()=>s.PENDING===f.value),hasError:n.computed(()=>s.ERROR===f.value),raw:i,mapped:d}}const q=(e,t,r=O,a)=>(a??[O]).reduce((i,l)=>{const c=e[t][r];return c?i+(c[l]||0):i},0);function gr(e){const{cardType:t,title:r,description:a,record:o,hasError:i,increaseIsBad:l,formatValueFn:c,trendRange:f}=e;return n.computed(()=>{let s=0,d=0;if(o!=null&&o.value)try{s=q(o.value,"current",e.lookupKey,e.sumGroupedValues),d=q(o.value,"previous",e.lookupKey,e.sumGroupedValues)}catch(u){console.error("Metric card data doesn't have the expected structure:",u)}return{cardType:t,hasError:i.value,currentValue:s,previousValue:d,title:r.value,description:a,increaseIsBad:!!l,formatValueFn:c,trendRange:f==null?void 0:f.value}})}var Te=new WeakMap,Xe=0;function yr(e){if(!e.length)return"";for(var t="arg",r=0;r<e.length;++r){var a=void 0;e[r]===null||typeof e[r]!="object"&&typeof e[r]!="function"?typeof e[r]=="string"?a='"'+e[r]+'"':a=String(e[r]):Te.has(e[r])?a=Te.get(e[r]):(a=Xe,Te.set(e[r],Xe++)),t+="@"+a}return t}function hr(e){if(typeof e=="function")try{e=e()}catch{e=""}return Array.isArray(e)?e=yr(e):e=String(e||""),e}var Se=function(){function e(t){t===void 0&&(t=0),this.items=new Map,this.ttl=t}return e.prototype.serializeKey=function(t){return hr(t)},e.prototype.get=function(t){var r=this.serializeKey(t);return this.items.get(r)},e.prototype.set=function(t,r,a){var o=this.serializeKey(t),i=a||this.ttl,l=Date.now(),c={data:r,createdAt:l,expiresAt:i?l+i:1/0};this.dispatchExpire(i,c,o),this.items.set(o,c)},e.prototype.dispatchExpire=function(t,r,a){var o=this;t&&setTimeout(function(){var i=Date.now(),l=i>=r.expiresAt;l&&o.delete(a)},t)},e.prototype.delete=function(t){this.items.delete(t)},e}();function vr(){return typeof navigator.onLine<"u"?navigator.onLine:!0}function Cr(){return typeof document<"u"&&typeof document.visibilityState<"u"?document.visibilityState!=="hidden":!0}var Tr=function(e){return fetch(e).then(function(t){return t.json()})};const we={isOnline:vr,isDocumentVisible:Cr,fetcher:Tr};var A=globalThis&&globalThis.__assign||function(){return A=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},A.apply(this,arguments)},P=globalThis&&globalThis.__awaiter||function(e,t,r,a){function o(i){return i instanceof r?i:new r(function(l){l(i)})}return new(r||(r=Promise))(function(i,l){function c(d){try{s(a.next(d))}catch(u){l(u)}}function f(d){try{s(a.throw(d))}catch(u){l(u)}}function s(d){d.done?i(d.value):o(d.value).then(c,f)}s((a=a.apply(e,t||[])).next())})},F=globalThis&&globalThis.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,o,i,l;return l={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function c(s){return function(d){return f([s,d])}}function f(s){if(a)throw new TypeError("Generator is already executing.");for(;r;)try{if(a=1,o&&(i=s[0]&2?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[s[0]&2,i.value]),s[0]){case 0:case 1:i=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1],i=s;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(s);break}i[2]&&r.ops.pop(),r.trys.pop();continue}s=t.call(e,r)}catch(d){s=[6,d],o=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}},Sr=globalThis&&globalThis.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),o,i=[],l;try{for(;(t===void 0||t-- >0)&&!(o=a.next()).done;)i.push(o.value)}catch(c){l={error:c}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(l)throw l.error}}return i},wr=globalThis&&globalThis.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,o=t.length,i;a<o;a++)(i||!(a in t))&&(i||(i=Array.prototype.slice.call(t,0,a)),i[a]=t[a]);return e.concat(i||Array.prototype.slice.call(t))},et=new Se,X=new Se,Ee=new Se,tt={cache:et,refreshInterval:0,ttl:0,serverTTL:1e3,dedupingInterval:2e3,revalidateOnFocus:!0,revalidateDebounce:0,shouldRetryOnError:!0,errorRetryInterval:5e3,errorRetryCount:5,fetcher:we.fetcher,isOnline:we.isOnline,isDocumentVisible:we.isDocumentVisible};function Er(e,t,r){var a=X.get(e);if(a)a.data.push(t);else{var o=5e3;X.set(e,[t],r>0?r+o:r)}}function Nr(e,t,r){if(r.isDocumentVisible()&&!(r.errorRetryCount!==void 0&&t>r.errorRetryCount)){var a=Math.min(t||0,r.errorRetryCount),o=a*r.errorRetryInterval;setTimeout(function(){e(null,{errorRetryCount:a+1,shouldRetryOnError:!0})},o)}}var rt=function(e,t,r,a){return r===void 0&&(r=et),a===void 0&&(a=tt.ttl),P(void 0,void 0,void 0,function(){var o,i,l,c,f,s,d;return F(this,function(u){switch(u.label){case 0:if(!Rr(t))return[3,5];u.label=1;case 1:return u.trys.push([1,3,,4]),[4,t];case 2:return o=u.sent(),[3,4];case 3:return c=u.sent(),i=c,[3,4];case 4:return[3,6];case 5:o=t,u.label=6;case 6:if(l=!1,f={data:o,error:i,isValidating:l},typeof o<"u")try{r.set(e,f,a)}catch(p){console.error("swrv(mutate): failed to set cache",p)}return s=X.get(e),s&&s.data.length&&(d=s.data.filter(function(p){return p.key===e}),d.forEach(function(p,m){typeof f.data<"u"&&(p.data=f.data),p.error=f.error,p.isValidating=f.isValidating;var y=m===d.length-1;y||delete d[m]}),d=d.filter(Boolean)),[2,f]}})})};function Dr(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var a,o,i=A({},tt),l=!1,c=!1,f=n.getCurrentInstance(),s=(f==null?void 0:f.proxy)||f;if(!s)return console.error("Could not get current instance, check to make sure that `useSwrv` is declared in the top level of the setup function."),null;var d=(s==null?void 0:s.$isServer)||!1;t.length>=1&&(a=t[0]),t.length>=2&&(o=t[1]),t.length>2&&(i=A(A({},i),t[2]));var u=d?i.serverTTL:i.ttl,p=typeof a=="function"?a:n.ref(a);typeof o>"u"&&(o=i.fetcher);var m=null;m||(m=n.reactive({data:void 0,error:void 0,isValidating:!0,key:null}));var y=function(T,v){return P(e,void 0,void 0,function(){var B,R,j,G,be,dt,_e,ct=this;return F(this,function(ke){switch(ke.label){case 0:return B=m.data===void 0,R=p.value,R?(j=i.cache.get(R),G=j&&j.data,m.isValidating=!0,G&&(m.data=G.data,m.error=G.error),be=T||o,!be||!i.isDocumentVisible()&&!B||(v==null?void 0:v.forceRevalidate)!==void 0&&!(v!=null&&v.forceRevalidate)?(m.isValidating=!1,[2]):j&&(dt=!!(Date.now()-j.createdAt>=i.dedupingInterval||v!=null&&v.forceRevalidate),!dt)?(m.isValidating=!1,[2]):(_e=function(){return P(ct,void 0,void 0,function(){var Y,ut,Ie,ft;return F(this,function(te){switch(te.label){case 0:return Y=Ee.get(R),Y?[3,2]:(ut=Array.isArray(R)?R:[R],Ie=be.apply(void 0,wr([],Sr(ut),!1)),Ee.set(R,Ie,i.dedupingInterval),[4,rt(R,Ie,i.cache,u)]);case 1:return te.sent(),[3,4];case 2:return[4,rt(R,Y.data,i.cache,u)];case 3:te.sent(),te.label=4;case 4:return m.isValidating=!1,Ee.delete(R),m.error!==void 0&&(ft=!l&&i.shouldRetryOnError&&(v?v.shouldRetryOnError:!0),ft&&Nr(y,v?v.errorRetryCount:1,i)),[2]}})})},G&&i.revalidateDebounce?(setTimeout(function(){return P(ct,void 0,void 0,function(){return F(this,function(Y){switch(Y.label){case 0:return l?[3,2]:[4,_e()];case 1:Y.sent(),Y.label=2;case 2:return[2]}})})},i.revalidateDebounce),[3,3]):[3,1])):[2];case 1:return[4,_e()];case 2:ke.sent(),ke.label=3;case 3:return[2]}})})},h=function(){return P(e,void 0,void 0,function(){return F(this,function(T){return[2,y(null,{shouldRetryOnError:!1})]})})},S=null;n.onMounted(function(){var T=function(){return P(e,void 0,void 0,function(){return F(this,function(v){switch(v.label){case 0:return!m.error&&i.isOnline()?[4,y()]:[3,2];case 1:return v.sent(),[3,3];case 2:S&&clearTimeout(S),v.label=3;case 3:return i.refreshInterval&&!l&&(S=setTimeout(T,i.refreshInterval)),[2]}})})};i.refreshInterval&&(S=setTimeout(T,i.refreshInterval)),i.revalidateOnFocus&&(document.addEventListener("visibilitychange",h,!1),window.addEventListener("focus",h,!1))}),n.onUnmounted(function(){l=!0,S&&clearTimeout(S),i.revalidateOnFocus&&(document.removeEventListener("visibilitychange",h,!1),window.removeEventListener("focus",h,!1));var T=X.get(p.value);T&&(T.data=T.data.filter(function(v){return v!==m}))});try{n.watch(p,function(T){n.isReadonly(p)||(p.value=T),m.key=T,m.isValidating=!!T,Er(p.value,m,u),!d&&!c&&p.value&&y(),c=!1},{immediate:!0})}catch{}var x=A(A({},n.toRefs(m)),{mutate:function(T,v){return y(T,A(A({},v),{forceRevalidate:!0}))}});return x}function Rr(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}function br(e,t,r){const{data:a,error:o,isValidating:i,mutate:l}=Dr(e,t,{revalidateDebounce:500,revalidateOnFocus:!1,dedupingInterval:100,...r});return{data:n.computed(()=>{var f;return(f=a.value)==null?void 0:f.data}),response:a,error:o,isValidating:i,revalidate:l}}const V={useI18n:dr,useMetricCardBuilder:gr,useMetricFetcher:mr,useRequest:br},nt=Symbol("METRICS_PROVIDER_KEY"),_r=e=>{const{dimension:t,dimensionFilterValue:r,additionalFilter:a,queryReady:o,timeframe:i,hasTrendAccess:l,refreshInterval:c,dataFetcher:f}=e;if(r&&!t)throw new Error("Must provide a dimension if filtering by a value");const s=!!(t&&r),d=!!(t&&!r),u=n.computed(()=>{const S=[];return s&&S.push({dimension:t,type:ve.IN,values:[r]}),a.value&&S.push(...a.value),S}),p={metrics:[J.REQUEST_COUNT],dimensions:[...t&&!s?[t]:[],L.STATUS_CODE_GROUPED],filter:u,queryReady:o,timeframe:i,withTrend:l&&!d,refreshInterval:c,dataFetcher:f},m={metrics:[J.RESPONSE_LATENCY_P99],...t&&!s?{dimensions:[t]}:{},filter:u,queryReady:o,timeframe:i,withTrend:l&&!d,refreshInterval:c,dataFetcher:f},y=V.useMetricFetcher(p),h=V.useMetricFetcher(m);return{trafficData:y,latencyData:h}},kr=n.defineComponent({__name:"MetricsProviderInternal",props:{maxTimeframe:{default:C.THIRTY_DAY},overrideTimeframe:{default:void 0},dimension:{default:void 0},filterValue:{default:void 0},additionalFilter:{default:void 0},queryReady:{type:Boolean,default:!0},dataFetcher:{},hasTrendAccess:{type:Boolean},refreshInterval:{},longCardTitles:{type:Boolean,default:!1},description:{default:void 0}},setup(e){const t=e,{i18n:r}=V.useI18n();if(t.dimension&&!{}.hasOwnProperty.call(L,t.dimension))throw new Error(`Attempted to use MetricsProvider with an invalid dimension: ${t.dimension}`);const a=n.computed(()=>{if(t.overrideTimeframe)return t.overrideTimeframe;const c=t.hasTrendAccess?he.get(t.maxTimeframe):he.get(C.ONE_DAY);if(!c)throw new Error("Metrics provider failed to resolve fallback timeframe.");return c}),o=n.computed(()=>{var c;return a.value.key==="custom"?r.t("trendRange.custom",{numDays:Math.ceil(a.value.timeframeLength()/(1e3*60*24))}):t.hasTrendAccess?r.t(`trendRange.${a.value.key}`):r.t(`trendRange.${(c=he.get(C.ONE_DAY))==null?void 0:c.key}`)}),{trafficData:i,latencyData:l}=_r({dimension:t.dimension,dimensionFilterValue:t.filterValue,additionalFilter:n.toRef(t,"additionalFilter"),queryReady:n.toRef(t,"queryReady"),timeframe:a,hasTrendAccess:t.hasTrendAccess,refreshInterval:t.refreshInterval,dataFetcher:t.dataFetcher});return n.provide(nt,{data:{traffic:i,latency:l},description:t.description,hasTrendAccess:t.hasTrendAccess,longCardTitles:t.longCardTitles,trendRange:o}),(c,f)=>n.renderSlot(c.$slots,"default",{hasTrendAccess:t.hasTrendAccess,timeframe:a.value})}});function Ir(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var it={exports:{}};(function(e){(function(){function t(s,d){if(d.separator===!1||s<1e3)return s.toString();var u=typeof d.separator=="string"?d.separator:",",p=[],m=Math.round(s).toString().split("");return m.reverse().forEach(function(y,h){h&&h%3===0&&p.push(u),p.push(y)}),p.reverse().join("")}function r(s,d,u){var p=s/d,m=u.round?"round":"floor";return u.decimal===!1?(s=Math[m](p),s.toString()):(u.precision?s=p:s=p<10?Math[m](p*10)/10:Math[m](p),s=s.toString(),typeof u.decimal=="string"&&(s=s.replace(".",u.decimal)),s)}var a=1e3,o=1e4,i=1e6,l=1e9,c=1e12;function f(s,d){var u;d=d||{};var p=s<0;p&&(s=Math.abs(s)),d.precision&&(s=parseFloat(s.toPrecision(d.precision)));var m=d.min10k?o:a;return s<m||d.precision&&d.precision>Math.log10(s)?u=t(r(s,1,d),d):s<i?u=r(s,a,d)+"k":s<l?u=r(s,i,d)+"m":s<c?u=t(r(s,l,d),d)+"b":u=t(r(s,c,d),d)+"t",p&&(u="-"+u),d.capital&&(u=u.toUpperCase()),d.prefix&&(u=d.prefix+u),d.suffix&&(u=u+d.suffix),u}f.addCommas=t,e.exports=f})()})(it);var xr=it.exports;const Ar=Ir(xr);var k=(e=>(e.Small="sm",e.Medium="md",e.Large="lg",e.LargeCompact="lgc",e.ExtraLarge="xl",e))(k||{});const w="24px",z=(e,t)=>{const r=e.__vccOpts||e;for(const[a,o]of t)r[a]=o;return r},Mr=e=>(n.pushScopeId("data-v-f2dbb1b9"),e=e(),n.popScopeId(),e),Lr=["aria-hidden"],Or={key:0,"data-testid":"kui-icon-svg-title"},zr=Mr(()=>n.createElementVNode("path",{d:"M6.5 20C4.98333 20 3.6875 19.475 2.6125 18.425C1.5375 17.375 1 16.0917 1 14.575C1 13.275 1.39167 12.1167 2.175 11.1C2.95833 10.0833 3.98333 9.43333 5.25 9.15C5.66667 7.61667 6.5 6.375 7.75 5.425C9 4.475 10.4167 4 12 4C13.95 4 15.6042 4.67917 16.9625 6.0375C18.3208 7.39583 19 9.05 19 11C20.15 11.1333 21.1042 11.6292 21.8625 12.4875C22.6208 13.3458 23 14.35 23 15.5C23 16.75 22.5625 17.8125 21.6875 18.6875C20.8125 19.5625 19.75 20 18.5 20H13C12.45 20 11.9792 19.8042 11.5875 19.4125C11.1958 19.0208 11 18.55 11 18V12.85L9.4 14.4L8 13L12 9L16 13L14.6 14.4L13 12.85V18H18.5C19.2 18 19.7917 17.7583 20.275 17.275C20.7583 16.7917 21 16.2 21 15.5C21 14.8 20.7583 14.2083 20.275 13.725C19.7917 13.2417 19.2 13 18.5 13H17V11C17 9.61667 16.5125 8.4375 15.5375 7.4625C14.5625 6.4875 13.3833 6 12 6C10.6167 6 9.4375 6.4875 8.4625 7.4625C7.4875 8.4375 7 9.61667 7 11H6.5C5.53333 11 4.70833 11.3417 4.025 12.025C3.34167 12.7083 3 13.5333 3 14.5C3 15.4667 3.34167 16.2917 4.025 16.975C4.70833 17.6583 5.53333 18 6.5 18H9V20H6.5Z",fill:"currentColor"},null,-1)),Ur=n.defineComponent({__name:"CloudUploadIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:w,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),i=Number(o);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return w}),a=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,i)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon cloud-upload-icon","data-testid":"kui-icon-wrapper-cloud-upload-icon",style:n.normalizeStyle(a.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-cloud-upload-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",Or,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),zr],8,Lr))]),_:1},8,["aria-hidden","style"]))}}),Vr=z(Ur,[["__scopeId","data-v-f2dbb1b9"]]),Br=e=>(n.pushScopeId("data-v-04327805"),e=e(),n.popScopeId(),e),Yr=["aria-hidden"],$r={key:0,"data-testid":"kui-icon-svg-title"},Hr=Br(()=>n.createElementVNode("path",{d:"M4 17V14H20V17H4ZM4 10V7H20V10H4Z",fill:"currentColor"},null,-1)),qr=n.defineComponent({__name:"EqualIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:w,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),i=Number(o);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return w}),a=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,i)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon equal-icon","data-testid":"kui-icon-wrapper-equal-icon",style:n.normalizeStyle(a.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-equal-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",$r,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),Hr],8,Yr))]),_:1},8,["aria-hidden","style"]))}}),Pr=z(qr,[["__scopeId","data-v-04327805"]]),Fr=e=>(n.pushScopeId("data-v-951e2d7d"),e=e(),n.popScopeId(),e),Zr=["aria-hidden"],jr={key:0,"data-testid":"kui-icon-svg-title"},Gr=Fr(()=>n.createElementVNode("path",{d:"M5 11V9H15V11H5Z",fill:"currentColor"},null,-1)),Wr=n.defineComponent({__name:"IndeterminateSmallIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:w,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),i=Number(o);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return w}),a=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,i)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon indeterminate-small-icon","data-testid":"kui-icon-wrapper-indeterminate-small-icon",style:n.normalizeStyle(a.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-indeterminate-small-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",jr,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),Gr],8,Zr))]),_:1},8,["aria-hidden","style"]))}}),at=z(Wr,[["__scopeId","data-v-951e2d7d"]]),Kr=e=>(n.pushScopeId("data-v-6754ff4c"),e=e(),n.popScopeId(),e),Qr=["aria-hidden"],Jr={key:0,"data-testid":"kui-icon-svg-title"},Xr=Kr(()=>n.createElementVNode("path",{d:"M15.25 5C14.9 5 14.6042 4.87917 14.3625 4.6375C14.1208 4.39583 14 4.1 14 3.75C14 3.4 14.1208 3.10417 14.3625 2.8625C14.6042 2.62083 14.9 2.5 15.25 2.5C15.6 2.5 15.8958 2.62083 16.1375 2.8625C16.3792 3.10417 16.5 3.4 16.5 3.75C16.5 4.1 16.3792 4.39583 16.1375 4.6375C15.8958 4.87917 15.6 5 15.25 5ZM15.25 21.5C14.9 21.5 14.6042 21.3792 14.3625 21.1375C14.1208 20.8958 14 20.6 14 20.25C14 19.9 14.1208 19.6042 14.3625 19.3625C14.6042 19.1208 14.9 19 15.25 19C15.6 19 15.8958 19.1208 16.1375 19.3625C16.3792 19.6042 16.5 19.9 16.5 20.25C16.5 20.6 16.3792 20.8958 16.1375 21.1375C15.8958 21.3792 15.6 21.5 15.25 21.5ZM19.25 8.5C18.9 8.5 18.6042 8.37917 18.3625 8.1375C18.1208 7.89583 18 7.6 18 7.25C18 6.9 18.1208 6.60417 18.3625 6.3625C18.6042 6.12083 18.9 6 19.25 6C19.6 6 19.8958 6.12083 20.1375 6.3625C20.3792 6.60417 20.5 6.9 20.5 7.25C20.5 7.6 20.3792 7.89583 20.1375 8.1375C19.8958 8.37917 19.6 8.5 19.25 8.5ZM19.25 18C18.9 18 18.6042 17.8792 18.3625 17.6375C18.1208 17.3958 18 17.1 18 16.75C18 16.4 18.1208 16.1042 18.3625 15.8625C18.6042 15.6208 18.9 15.5 19.25 15.5C19.6 15.5 19.8958 15.6208 20.1375 15.8625C20.3792 16.1042 20.5 16.4 20.5 16.75C20.5 17.1 20.3792 17.3958 20.1375 17.6375C19.8958 17.8792 19.6 18 19.25 18ZM20.75 13.25C20.4 13.25 20.1042 13.1292 19.8625 12.8875C19.6208 12.6458 19.5 12.35 19.5 12C19.5 11.65 19.6208 11.3542 19.8625 11.1125C20.1042 10.8708 20.4 10.75 20.75 10.75C21.1 10.75 21.3958 10.8708 21.6375 11.1125C21.8792 11.3542 22 11.65 22 12C22 12.35 21.8792 12.6458 21.6375 12.8875C21.3958 13.1292 21.1 13.25 20.75 13.25ZM12 22C10.6167 22 9.31667 21.7375 8.1 21.2125C6.88333 20.6875 5.825 19.975 4.925 19.075C4.025 18.175 3.3125 17.1167 2.7875 15.9C2.2625 14.6833 2 13.3833 2 12C2 10.6167 2.2625 9.31667 2.7875 8.1C3.3125 6.88333 4.025 5.825 4.925 4.925C5.825 4.025 6.88333 3.3125 8.1 2.7875C9.31667 2.2625 10.6167 2 12 2V4C9.76667 4 7.875 4.775 6.325 6.325C4.775 7.875 4 9.76667 4 12C4 14.2333 4.775 16.125 6.325 17.675C7.875 19.225 9.76667 20 12 20V22ZM12 14C11.45 14 10.9792 13.8042 10.5875 13.4125C10.1958 13.0208 10 12.55 10 12C10 11.9167 10.0042 11.8292 10.0125 11.7375C10.0208 11.6458 10.0417 11.5583 10.075 11.475L8 9.4L9.4 8L11.475 10.075C11.5417 10.0583 11.7167 10.0333 12 10C12.55 10 13.0208 10.1958 13.4125 10.5875C13.8042 10.9792 14 11.45 14 12C14 12.55 13.8042 13.0208 13.4125 13.4125C13.0208 13.8042 12.55 14 12 14Z",fill:"currentColor"},null,-1)),en=n.defineComponent({__name:"ResponseIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:w,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),i=Number(o);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return w}),a=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,i)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon response-icon","data-testid":"kui-icon-wrapper-response-icon",style:n.normalizeStyle(a.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-response-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",Jr,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),Xr],8,Qr))]),_:1},8,["aria-hidden","style"]))}}),tn=z(en,[["__scopeId","data-v-6754ff4c"]]),rn=e=>(n.pushScopeId("data-v-2ee83e7f"),e=e(),n.popScopeId(),e),nn=["aria-hidden"],an={key:0,"data-testid":"kui-icon-svg-title"},on=rn(()=>n.createElementVNode("path",{d:"M16 18V16H18.6L13.4 10.85L9.4 14.85L2 7.4L3.4 6L9.4 12L13.4 8L20 14.6V12H22V18H16Z",fill:"currentColor"},null,-1)),sn=n.defineComponent({__name:"TrendDownIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:w,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),i=Number(o);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return w}),a=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,i)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon trend-down-icon","data-testid":"kui-icon-wrapper-trend-down-icon",style:n.normalizeStyle(a.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-trend-down-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",an,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),on],8,nn))]),_:1},8,["aria-hidden","style"]))}}),ln=z(sn,[["__scopeId","data-v-2ee83e7f"]]),dn=e=>(n.pushScopeId("data-v-fc79d138"),e=e(),n.popScopeId(),e),cn=["aria-hidden"],un={key:0,"data-testid":"kui-icon-svg-title"},fn=dn(()=>n.createElementVNode("path",{d:"M3.4 18L2 16.6L9.4 9.15L13.4 13.15L18.6 8H16V6H22V12H20V9.4L13.4 16L9.4 12L3.4 18Z",fill:"currentColor"},null,-1)),pn=n.defineComponent({__name:"TrendUpIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:w,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),i=Number(o);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return w}),a=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,i)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon trend-up-icon","data-testid":"kui-icon-wrapper-trend-up-icon",style:n.normalizeStyle(a.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-trend-up-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",un,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),fn],8,cn))]),_:1},8,["aria-hidden","style"]))}}),mn=z(pn,[["__scopeId","data-v-fc79d138"]]),gn=e=>(n.pushScopeId("data-v-87798997"),e=e(),n.popScopeId(),e),yn=["aria-hidden"],hn={key:0,"data-testid":"kui-icon-svg-title"},vn=gn(()=>n.createElementVNode("path",{d:"M9 20C8.68333 20 8.4 19.9083 8.15 19.725C7.9 19.5417 7.71667 19.3083 7.6 19.025L5.3 13H1V11H6.7L9 17.1L13.6 4.975C13.7167 4.69167 13.9 4.45833 14.15 4.275C14.4 4.09167 14.6833 4 15 4C15.3167 4 15.6 4.09167 15.85 4.275C16.1 4.45833 16.2833 4.69167 16.4 4.975L18.7 11H23V13H17.3L15 6.9L10.4 19.025C10.2833 19.3083 10.1 19.5417 9.85 19.725C9.6 19.9083 9.31667 20 9 20Z",fill:"currentColor"},null,-1)),Cn=n.defineComponent({__name:"VitalsIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:w,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),i=Number(o);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return w}),a=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,i)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon vitals-icon","data-testid":"kui-icon-wrapper-vitals-icon",style:n.normalizeStyle(a.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-vitals-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",hn,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),vn],8,yn))]),_:1},8,["aria-hidden","style"]))}}),Tn=z(Cn,[["__scopeId","data-v-87798997"]]),Sn=e=>(n.pushScopeId("data-v-81510183"),e=e(),n.popScopeId(),e),wn=["aria-hidden"],En={key:0,"data-testid":"kui-icon-svg-title"},Nn=Sn(()=>n.createElementVNode("path",{d:"M12.0001 22.025C11.7334 22.025 11.4793 21.975 11.2376 21.875C10.9959 21.775 10.7751 21.6333 10.5751 21.45L2.5501 13.425C2.36676 13.225 2.2251 13.0041 2.1251 12.7625C2.0251 12.5208 1.9751 12.2666 1.9751 12C1.9751 11.7333 2.0251 11.475 2.1251 11.225C2.2251 10.975 2.36676 10.7583 2.5501 10.575L10.5751 2.54998C10.7751 2.34998 10.9959 2.20414 11.2376 2.11248C11.4793 2.02081 11.7334 1.97498 12.0001 1.97498C12.2668 1.97498 12.5251 2.02081 12.7751 2.11248C13.0251 2.20414 13.2418 2.34998 13.4251 2.54998L21.4501 10.575C21.6501 10.7583 21.7959 10.975 21.8876 11.225C21.9793 11.475 22.0251 11.7333 22.0251 12C22.0251 12.2666 21.9793 12.5208 21.8876 12.7625C21.7959 13.0041 21.6501 13.225 21.4501 13.425L13.4251 21.45C13.2418 21.6333 13.0251 21.775 12.7751 21.875C12.5251 21.975 12.2668 22.025 12.0001 22.025ZM12.0001 20.025L20.0251 12L12.0001 3.97498L3.9751 12L12.0001 20.025ZM11.0001 13H13.0001V6.99998H11.0001V13ZM12.0001 16C12.2834 16 12.5209 15.9041 12.7126 15.7125C12.9043 15.5208 13.0001 15.2833 13.0001 15C13.0001 14.7166 12.9043 14.4791 12.7126 14.2875C12.5209 14.0958 12.2834 14 12.0001 14C11.7168 14 11.4793 14.0958 11.2876 14.2875C11.0959 14.4791 11.0001 14.7166 11.0001 15C11.0001 15.2833 11.0959 15.5208 11.2876 15.7125C11.4793 15.9041 11.7168 16 12.0001 16Z",fill:"currentColor"},null,-1)),Dn=n.defineComponent({__name:"WarningOutlineIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:w,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),i=Number(o);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return w}),a=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,i)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon warning-outline-icon","data-testid":"kui-icon-wrapper-warning-outline-icon",style:n.normalizeStyle(a.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-warning-outline-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",En,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),Nn],8,wn))]),_:1},8,["aria-hidden","style"]))}}),Rn=z(Dn,[["__scopeId","data-v-81510183"]]),Ne=2,ot=Ne+2,bn=(e,t,r=!1)=>{let a=!t||Number(e.toFixed(ot))===0?0:Number(e.toFixed(ot))>0?1:-1;return r&&(a*=-1),a},_n=(e,t,r)=>t?`${Math.abs(e*100).toFixed(Ne)}%`:r,kn=(e,t)=>t===0?0:e/t-1,In=(e,t=!1)=>(t&&(e*=-1),e>0?mn:e<0?ln:at),xn="#ad000e",An="#6c7489",st="#52596e",Mn="#007d60",De="16px",Ln="14px",On="48px";var M=(e=>(e.GENERIC_COUNT="GenericCount",e.TRAFFIC="Traffic",e.ERROR_RATE="ErrorRate",e.LATENCY="Latency",e))(M||{});const zn={class:"metricscard"},Un={key:0,class:"metricscard-description"},Vn={key:0,class:"metricscard-error"},Bn={key:2,class:"metricscard-trend"},Yn={"data-testid":"metric-trend-change"},$n={key:0,class:"metricscard-trend-range"},Hn=n.defineComponent({__name:"MetricsCard",props:{cardType:{type:String,required:!0,default:M.GENERIC_COUNT},title:{type:String,default:"0%",required:!0},description:{type:String,default:"",required:!1},tooltip:{type:String,required:!1,default:""},timeframe:{type:String,required:!1,default:""},metricValue:{type:String,default:""},metricChange:{type:String,required:!0},changePolarity:{type:Number,required:!0},trendIcon:{type:Object,default:at},trendRange:{type:String,default:""},hasError:{type:Boolean,default:!1},errorMessage:{type:String,default:"Vitals data error"},cardSize:{type:String,required:!1,default:()=>"lg"}},setup(e){const t=e,r=new Map([[M.GENERIC_COUNT,Tn],[M.TRAFFIC,Vr],[M.ERROR_RATE,Rn],[M.LATENCY,tn]]),a=s=>{const d={red:`var(--kong-ui-metric-card-trend-negative, ${xn})`,green:`var(--kong-ui-metric-card-trend-positive, ${Mn})`,grey:`var(--kong-ui-metric-card-trend-neutral, ${st})`};return s>0?d.green:s<0?d.red:d.grey},o=s=>s>0?"positive":s<0?"negative":"neutral",i=[k.Medium,k.Large,k.LargeCompact].includes(t.cardSize),l=t.cardSize===k.ExtraLarge?On:i?"22px":Ln,c=n.computed(()=>t.cardSize===k.LargeCompact),f=[k.Small,k.LargeCompact].includes(t.cardSize);return(s,d)=>{const u=n.resolveComponent("KIcon"),p=n.resolveComponent("KTooltip");return n.openBlock(),n.createElementBlock("div",zn,[n.createElementVNode("div",{class:n.normalizeClass(["metricscard-title",e.cardSize])},[n.unref(f)?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(r).get(e.cardType)),{key:0,class:"metricscard-icon",color:n.unref(An),size:n.unref(De)},null,8,["color","size"])),n.createElementVNode("span",null,n.toDisplayString(e.title),1),e.tooltip?(n.openBlock(),n.createBlock(p,{key:1,class:"metricscard-tooltip",label:e.tooltip,placement:"right"},{default:n.withCtx(()=>[n.createVNode(u,{icon:"info",size:"12"})]),_:1},8,["label"])):n.createCommentVNode("",!0)],2),e.description&&n.unref(i)&&!c.value?(n.openBlock(),n.createElementBlock("div",Un,[n.createElementVNode("span",null,n.toDisplayString(e.description),1)])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(["metricscard-valuetrend",{"is-compact":c.value}])},[e.hasError?(n.openBlock(),n.createElementBlock("div",Vn,[n.createVNode(u,{icon:"warning",size:"20"}),n.createElementVNode("div",null,n.toDisplayString(e.errorMessage),1)])):(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(["metricscard-value",e.cardSize]),"data-testid":"metric-value",style:n.normalizeStyle(`font-size:${n.unref(l)}`)},n.toDisplayString(e.metricValue),7)),n.unref(i)?(n.openBlock(),n.createElementBlock("div",Bn,[n.createElementVNode("div",{class:n.normalizeClass(["metricscard-trend-change",o(e.changePolarity)]),"data-testid":"metric-trend-parent"},[e.changePolarity!==0?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.trendIcon),{key:0,color:a(e.changePolarity),size:n.unref(De)},null,8,["color","size"])):(n.openBlock(),n.createBlock(n.unref(Pr),{key:1,color:n.unref(st),size:n.unref(De)},null,8,["color","size"])),n.createElementVNode("div",Yn,n.toDisplayString(e.metricChange),1)],2),e.trendRange&&e.cardSize!==n.unref(k).LargeCompact?(n.openBlock(),n.createElementBlock("div",$n,n.toDisplayString(e.trendRange),1)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)],2)])}}}),Re=(e,t)=>{const r=e.__vccOpts||e;for(const[a,o]of t)r[a]=o;return r},qn=Re(Hn,[["__scopeId","data-v-e3b3a4cb"]]),Pn={},Fn={class:"loading-tabs"};function Zn(e,t){const r=n.resolveComponent("KSkeletonBox");return n.openBlock(),n.createElementBlock("div",Fn,[n.createVNode(r,{width:"100"}),n.createVNode(r,{width:"75"})])}const jn=Re(Pn,[["render",Zn],["__scopeId","data-v-f7eb9c40"]]),Gn={key:0,class:"error-display"},Wn={key:0,class:"error-display-message"},Kn=Re(n.defineComponent({__name:"MetricCardContainer",props:{fallbackDisplayText:{type:String,required:!0},cards:{type:Array,required:!0},errorMessage:{type:String,required:!1,default:""},loading:{type:Boolean,required:!1,default:!1},hasTrendAccess:{type:Boolean,required:!1,default:!0},cardSize:{type:String,required:!1,default:()=>k.Large}},setup(e){const t=e,r=n.computed(()=>t.cards.every(o=>(o==null?void 0:o.hasError)===!0)),a=o=>{const i=kn(o.currentValue,o.previousValue)||0,l=bn(i,t.hasTrendAccess,o.increaseIsBad);return{metricValue:o.formatValueFn?o.formatValueFn(o.currentValue):Ar(o.currentValue,{capital:!0,round:!0})||"0",metricChange:o.formatChangeFn?o.formatChangeFn(i):_n(i,t.hasTrendAccess,t.fallbackDisplayText),changePolarity:l,trendIcon:In(l,o.increaseIsBad),cardSize:t.cardSize}};return(o,i)=>{const l=n.resolveComponent("KIcon");return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["kong-ui-public-metric-card-container",e.cardSize])},[r.value?(n.openBlock(),n.createElementBlock("div",Gn,[n.createVNode(l,{class:"error-display-icon",icon:"warning",size:"24"}),e.errorMessage?(n.openBlock(),n.createElementBlock("div",Wn,n.toDisplayString(e.errorMessage),1)):n.createCommentVNode("",!0)])):(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:1},n.renderList(e.cards,(c,f)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[e.loading?(n.openBlock(),n.createBlock(jn,{key:`skeleton-${f}`,class:n.normalizeClass(e.cardSize===n.unref(k).Small?"loading-tabs-small":"loading-tabs-large")},null,8,["class"])):(n.openBlock(),n.createBlock(qn,n.mergeProps({key:f},a(c),{"card-size":e.cardSize,"card-type":c.cardType,description:c.description,"error-message":e.errorMessage,"has-error":c.hasError,title:c.title,tooltip:c.tooltip,"trend-range":c.trendRange}),null,16,["card-size","card-type","description","error-message","has-error","title","tooltip","trend-range"]))],64))),256))],2)}}}),[["__scopeId","data-v-7c516677"]]),ni="",Qn=n.defineComponent({__name:"MetricsConsumer",props:{lookupKey:{default:void 0},cardSize:{default:k.Large},cardToDisplay:{default:void 0}},setup(e){const t=e,r=n.inject(nt);if(!r)throw new Error("MetricsConsumer must be nested inside a MetricsProvider instance.");const{traffic:a,latency:o}=r.data,{i18n:i}=V.useI18n(),l=V.useMetricCardBuilder({cardType:M.TRAFFIC,title:n.computed(()=>r.longCardTitles?i.t("metricCard.long.traffic"):i.t("metricCard.short.traffic")),description:r.description,record:a.mapped,hasError:a.hasError,lookupKey:t.lookupKey,sumGroupedValues:Z,trendRange:r.trendRange}),c=h=>`${h.toFixed(Ne)}%`,f=n.computed(()=>{const h=a.mapped.value,S=q(h,"current",t.lookupKey,Ke),x=q(h,"current",t.lookupKey,Z),T=S/x*100||0,v=q(h,"previous",t.lookupKey,Ke),B=q(h,"previous",t.lookupKey,Z),R=v/B*100||0;return{cardType:M.ERROR_RATE,hasError:a.hasError.value,currentValue:T,previousValue:R,formatValueFn:c,title:r.longCardTitles?i.t("metricCard.long.errorRate"):i.t("metricCard.short.errorRate"),description:r.description,increaseIsBad:!0,trendRange:r.trendRange.value}}),s=h=>`${h}ms`,d=V.useMetricCardBuilder({cardType:M.LATENCY,title:n.computed(()=>r.longCardTitles?i.t("metricCard.long.latency"):i.t("metricCard.short.latency")),description:r.description,hasError:o.hasError,record:o.mapped,lookupKey:t.lookupKey,increaseIsBad:!0,formatValueFn:s,trendRange:r.trendRange}),u=n.computed(()=>t.cardToDisplay==="TRAFFIC"?[l.value]:t.cardToDisplay==="ERROR_RATE"?[f.value]:t.cardToDisplay==="LATENCY"?[d.value]:[l.value,f.value,d.value]),p=n.computed(()=>t.cardToDisplay==="TRAFFIC"||t.cardToDisplay==="ERROR_RATE"?a.isLoading.value:t.cardToDisplay==="LATENCY"?o.isLoading.value:a.isLoading.value||o.isLoading.value),m=n.computed(()=>({cards:u.value,loading:p.value,hasTrendAccess:r.hasTrendAccess,fallbackDisplayText:i.t("general.notAvailable"),cardSize:t.cardSize,hideTitle:!0,trendRange:r.trendRange.value})),y=n.computed(()=>({loading:m.value.loading,trafficCard:l.value,errorRateCard:f.value,latencyCard:d.value,errorRateFormatted:c(f.value.currentValue),latencyFormatted:s(d.value.currentValue)}));return(h,S)=>n.renderSlot(h.$slots,"default",{cardValues:y.value},()=>[n.createVNode(n.unref(Kn),n.normalizeProps(n.guardReactiveProps(m.value)),null,16)])}}),ee=e=>new Date(e),Jn=(e,t)=>{const r=e.body,{startMs:a,endMs:o}=e.query,i=typeof a!="number"?parseInt(a,10):a,l=typeof o!="number"?parseInt(o,10):o;e.reply({statusCode:200,body:lt(r,i,l,t)})},lt=(e,t,r,a)=>{var u,p;const o=e.granularityMs||0,i=o?(r-t)/o:1;if(i!==1&&i!==2)throw new Error("Query did not request 1 or 2 records. Perhaps there's a chart query on the same page interfering with the stub?");if((e.dimensions??[]).length>2)throw new Error(`Explore only supports 0-2 dimensions; got: ${JSON.stringify(e.dimensions)}`);const l=(e.dimensions??[]).find(m=>m!=="TIME"),c=(a==null?void 0:a.dimensionNames)??[],f=Math.max(c.length,1),s=[];for(let m=0;m<i;m++)for(let y=0;y<f;y++){const h=l?{[l]:c[y]}:{};(u=e.dimensions)!=null&&u.includes(L.STATUS_CODE_GROUPED)?Z.forEach(S=>{const x=e.metrics.reduce((T,v)=>(T[v]=(i-m)*1e3+100*y+1,T),{...h,STATUS_CODE_GROUPED:S});s.push({version:"v1",timestamp:m===0?ee(t).toISOString():ee(t+o).toISOString(),event:x})}):s.push({version:"v1",timestamp:m===0?ee(t).toISOString():ee(t+o).toISOString(),event:e.metrics.reduce((S,x)=>(S[x]=(i-m)*1e3+100*y+1,S),{...h})})}const d={start:t,end:r,granularity:o,dimensions:l?{[l]:c,...(p=e.dimensions)!=null&&p.includes(L.STATUS_CODE_GROUPED)?{STATUS_CODE_GROUPED:Z}:{}}:{},metricNames:e.metrics};return{records:s,meta:d}};N.EXPLORE_V2_AGGREGATIONS=J,N.EXPLORE_V2_DIMENSIONS=L,N.EXPLORE_V2_FILTER_TYPES=ve,N.MetricsConsumer=Qn,N.MetricsProviderInternal=kr,N.mockExploreResponse=lt,N.mockExploreResponseFromCypress=Jn,Object.defineProperty(N,Symbol.toStringTag,{value:"Module"})});
|
|
2
2
|
//# sourceMappingURL=vitals-metric-provider.umd.js.map
|