@unblind/react 0.1.0-alpha.14 → 0.1.0-alpha.15

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/index.css CHANGED
@@ -1,2 +1,2 @@
1
- .ub-default{display:flex;height:100%;align-items:center;justify-content:center;color:var(--ub-muted-foreground)}.ub-loading-text:before{content:attr(data-text)}.ub-empty-content{text-align:center}.ub-empty-icon-wrapper{margin:0 auto;display:flex;height:2.5rem;width:2.5rem;align-items:center;justify-content:center;border-radius:9999px;background-color:var(--ub-muted)}.ub-icon{width:1.25rem;height:1.25rem;color:var(--ub-muted-foreground)}.ub-empty-text{margin-top:.5rem;font-size:.875rem;color:var(--ub-muted-foreground)}.ub-empty-text:before{content:attr(data-text)}.uplot,.uplot *,.uplot *:before,.uplot *:after{box-sizing:border-box}.uplot{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5;width:-moz-min-content;width:min-content}.u-title{text-align:center;font-size:18px;font-weight:700}.u-wrap{position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.u-over,.u-under{position:absolute}.u-under{overflow:hidden}.uplot canvas{display:block;position:relative;width:100%;height:100%}.u-axis{position:absolute}.u-legend{font-size:14px;margin:auto;text-align:center}.u-inline{display:block}.u-inline *{display:inline-block}.u-inline tr{margin-right:16px}.u-legend th{font-weight:600}.u-legend th>*{vertical-align:middle;display:inline-block}.u-legend .u-marker{width:1em;height:1em;margin-right:4px;background-clip:padding-box!important}.u-inline.u-live th:after{content:":";vertical-align:middle}.u-inline:not(.u-live) .u-value{display:none}.u-series>*{padding:4px}.u-series th{cursor:pointer}.u-legend .u-off>*{opacity:.3}.u-select{background:#00000012;position:absolute;pointer-events:none}.u-cursor-x,.u-cursor-y{position:absolute;left:0;top:0;pointer-events:none;will-change:transform}.u-hz .u-cursor-x,.u-vt .u-cursor-y{height:100%;border-right:1px dashed #607D8B}.u-hz .u-cursor-y,.u-vt .u-cursor-x{width:100%;border-bottom:1px dashed #607D8B}.u-cursor-pt{position:absolute;top:0;left:0;border-radius:50%;border:0 solid;pointer-events:none;will-change:transform;background-clip:padding-box!important}.u-axis.u-off,.u-select.u-off,.u-cursor-x.u-off,.u-cursor-y.u-off,.u-cursor-pt.u-off{display:none}:root{--ub-radius: var(--radius, .5rem);--ub-background: var(--background, oklch(1 0 0));--ub-primary: var(--primary, oklch(.208 .042 264.541));--ub-primary-foreground: var(--primary-foreground, oklch(1 0 0));--ub-secondary: var(--secondary, oklch(.985 .002 264.542));--ub-secondary-foreground: var( --secondary-foreground, oklch(.208 .042 264.541) );--ub-muted: var(--muted, oklch(.967 .001 286.375));--ub-muted-foreground: var(--muted-foreground, oklch(.552 .016 285.938));--ub-popover: var(--popover, oklch(1 0 0));--ub-border: var( --border, oklch(.922 .005 264.542 / .8) );--ub-ring: var(--ring, oklch(.208 .042 264.541));--ub-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .05);--ub-shadow-lg: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--ub-shadow-ring: 0 0 0 1px oklch(.922 .005 264.542 / .4);--ub-shadow-ring-sm: 0 0 0 1px rgb(0 0 0 / .05);--ub-backdrop-blur: blur(12px);--ub-opacity-subtle: .7;--ub-chart-font-size: 11px;--ub-chart-font-color: var(--ub-muted-foreground);--ub-chart-grid-color: oklch(from var(--ub-muted-foreground) l c h / .15);--ub-chart-threshold-error: oklch(60% .2 30);--ub-chart-threshold-warning: oklch(75% .18 90);--ub-chart-threshold-ok: oklch(65% .15 145);--ub-chart-threshold-info: oklch(85% .005 240);--ub-chart-threshold-default: oklch(65% .01 0);--ub-chart-threshold-error-fill: oklch( from var(--ub-chart-threshold-error) l c h / .15 );--ub-chart-threshold-warning-fill: oklch( from var(--ub-chart-threshold-warning) l c h / .15 );--ub-chart-threshold-ok-fill: oklch( from var(--ub-chart-threshold-ok) l c h / .15 );--ub-chart-threshold-info-fill: oklch( from var(--ub-chart-threshold-info) l c h / .15 );--ub-chart-threshold-default-fill: oklch( from var(--ub-chart-threshold-default) l c h / .1 );--ub-chart-serie-color-1: var(--chart-1, oklch(.68 .214 293.418));--ub-chart-serie-color-2: var(--chart-2, oklch(.84 .151 94.621));--ub-chart-serie-color-3: var(--chart-3, oklch(.68 .2 255.485));--ub-chart-serie-color-4: var(--chart-4, oklch(.7 .245 27.325));--ub-chart-serie-color-5: var(--chart-5, oklch(.68 .18 149.579));--ub-chart-serie-color-6: var(--chart-6, oklch(.75 .159 50.554));--ub-chart-serie-color-7: var(--chart-7, oklch(.7 .14 215.355));--ub-chart-serie-color-8: var(--chart-8, oklch(.68 .25 301.364));--ub-chart-serie-color-9: var(--chart-9, oklch(.72 .16 89.872));--ub-chart-serie-color-10: var(--chart-10, oklch(.65 .2 276.652));--ub-chart-serie-color-11: var(--chart-11, oklch(.68 .14 192.803));--ub-chart-serie-color-12: var(--chart-12, oklch(.65 .22 3.555));--ub-chart-serie-fill-color-1: oklch( from var(--ub-chart-serie-color-1) l c h / .4 );--ub-chart-serie-fill-color-2: oklch( from var(--ub-chart-serie-color-2) l c h / .4 );--ub-chart-serie-fill-color-3: oklch( from var(--ub-chart-serie-color-3) l c h / .4 );--ub-chart-serie-fill-color-4: oklch( from var(--ub-chart-serie-color-4) l c h / .4 );--ub-chart-serie-fill-color-5: oklch( from var(--ub-chart-serie-color-5) l c h / .4 );--ub-chart-serie-fill-color-6: oklch( from var(--ub-chart-serie-color-6) l c h / .4 );--ub-chart-serie-fill-color-7: oklch( from var(--ub-chart-serie-color-7) l c h / .4 );--ub-chart-serie-fill-color-8: oklch( from var(--ub-chart-serie-color-8) l c h / .4 );--ub-chart-serie-fill-color-9: oklch( from var(--ub-chart-serie-color-9) l c h / .4 );--ub-chart-serie-fill-color-10: oklch( from var(--ub-chart-serie-color-10) l c h / .4 );--ub-chart-serie-fill-color-11: oklch( from var(--ub-chart-serie-color-11) l c h / .4 );--ub-chart-serie-fill-color-12: oklch( from var(--ub-chart-serie-color-12) l c h / .4 );-webkit-font-smoothing:antialiased}.dark{--ub-background: var(--background, oklch(.236 .013 265.755));--ub-primary: var(--primary, oklch(1 0 0));--ub-primary-foreground: var( --primary-foreground, oklch(.236 .013 265.755) );--ub-secondary: var(--secondary, oklch(1 0 0 / .05));--ub-secondary-foreground: var(--secondary-foreground, oklch(1 0 0));--ub-muted: var(--muted, oklch(1 0 0 / .05));--ub-muted-foreground: var(--muted-foreground, oklch(.665 .032 252.894));--ub-popover: var(--popover, oklch(.236 .013 265.755));--ub-border: var(--border, oklch(1 0 0 / .1));--ub-ring: var(--ring, oklch(1 0 0));--ub-shadow-ring: 0 0 0 1px oklch(.274 .014 265.755 / .4);--ub-shadow-ring-sm: 0 0 0 1px oklch(1 0 0 / .1)}@media(prefers-color-scheme:dark){.root{--ub-background: var( --background, oklch(.236 .013 265.755) );--ub-primary: var(--primary, oklch(1 0 0));--ub-primary-foreground: var( --primary-foreground, oklch(.236 .013 265.755) );--ub-secondary: var(--secondary, oklch(1 0 0 / .05));--ub-secondary-foreground: var(--secondary-foreground, oklch(1 0 0));--ub-muted: var(--muted, oklch(1 0 0 / .05));--ub-muted-foreground: var(--muted-foreground, oklch(.665 .032 252.894));--ub-popover: var(--popover, oklch(.236 .013 265.755));--ub-border: var(--border, oklch(1 0 0 / .1));--ub-ring: var(--ring, oklch(1 0 0));--ub-shadow-ring: 0 0 0 1px oklch(.274 .014 265.755 / .4);--ub-shadow-ring-sm: 0 0 0 1px oklch(1 0 0 / .1)}}@layer ub-chart{:where(.ub-chart-container){width:100%;height:100%;min-height:0;flex-grow:1}}.ub-tooltip{display:flex;min-width:340px;max-width:520px;width:auto;flex-direction:column;font-size:.875rem;gap:.5rem;border-radius:var(--ub-radius);border:1px solid var(--ub-border);padding:.5rem .625rem;background-color:var(--ub-popover)}.ub-tooltip-datetime{font-weight:500;padding-left:.3rem;padding-right:.3rem}.ub-tooltip-divider{height:1px;width:100%;border:none;background:var(--ub-border);margin:0}.ub-tooltip-content{display:flex;flex-direction:column;padding-left:.35rem;padding-right:.35rem;gap:.2rem}.ub-tooltip-group{display:flex;flex-direction:column;gap:.25rem}.ub-tooltip-group-header{position:sticky;top:0;z-index:10;color:var(--ub-primary);--opacity: 50%}.ub-tooltip-group-header--separator{margin-top:.25rem}.ub-tooltip-items{display:flex;flex-direction:column;gap:.5rem}.ub-tooltip-item{display:flex;flex-direction:column;transition:background-color .15s ease}.ub-tooltip-item-row{display:flex;align-items:center;justify-content:space-between;gap:1rem}.ub-tooltip-item-left{display:flex;flex-direction:column;--gap: .625rem;min-width:0;overflow:hidden}.ub-tooltip-item-heading{display:flex;gap:.25rem;align-items:center}.ub-tooltip-item-metric-name{opacity:100%}.ub-tooltip-item-metric-name-label{--opacity: 50%}.ub-tooltip-item-dot{width:3px;height:14px;flex-shrink:0;border-radius:9999px}.ub-tooltip-item-attributes{display:flex;gap:.25rem;margin-right:auto}.ub-tooltip-item-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ub-tooltip-item-value{font-weight:500;--tw-font-weight: 500;font-variant-numeric:tabular-nums;font-size:.8rem;white-space:nowrap;margin-left:3rem}.ub-tooltip-item-value--empty{font-weight:400;color:var(--ub-text-disabled)}.ub-tooltip-attributes{margin-top:.125rem;display:flex;flex-wrap:wrap;-moz-column-gap:.75rem;column-gap:.75rem;row-gap:.125rem;padding-left:.75rem;line-height:1rem}.ub-tooltip-attribute{display:flex;align-items:center;gap:.25rem}.ub-tooltip-item-attribute-container{display:flex}.ub-tooltip-item-attribute-key{opacity:var(--ub-opacity-subtle);font-size:12px}.ub-tooltip-item-attribute{background:var(--ub-muted);border-radius:var(--ub-radius);padding:0 .25rem}.ub-tooltip-item-attribute{.ub-tooltip-item-attribute-value{color:var(--primary-foreground)}}.ub-tooltip-item-attribute-value{color:var(--ub-muted-foreground);font-weight:500;font-size:12px}.ub-tooltip-item-hidden-metric .ub-tooltip-item-attribute-value{color:var(--ub-foreground);font-size:14px}.ub-tooltip-item-hidden-metric .ub-tooltip-item-hidden-attribute-key .ub-tooltip-item-attribute-value{font-weight:400}.ub-tooltip-item-hidden-metric .ub-tooltip-item-attribute-key{font-size:14px}.ub-tooltip-item-attribute-divider:before{content:attr(data-text);color:var(--ub-muted-foreground)}.ub-tooltip-no-data{padding:0 .3rem;font-style:italic;color:var(--ub-placeholder);line-height:1rem}
1
+ .ub-default{display:flex;height:100%;align-items:center;justify-content:center;color:var(--ub-muted-foreground)}.ub-loading-text:before{content:attr(data-text)}.ub-empty-content{text-align:center}.ub-empty-icon-wrapper{margin:0 auto;display:flex;height:2.5rem;width:2.5rem;align-items:center;justify-content:center;border-radius:9999px;background-color:var(--ub-muted)}.ub-icon{width:1.25rem;height:1.25rem;color:var(--ub-muted-foreground)}.ub-empty-text{margin-top:.5rem;font-size:.875rem;color:var(--ub-muted-foreground)}.ub-empty-text:before{content:attr(data-text)}.uplot,.uplot *,.uplot *:before,.uplot *:after{box-sizing:border-box}.uplot{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5;width:min-content}.u-title{text-align:center;font-size:18px;font-weight:700}.u-wrap{position:relative;user-select:none}.u-over,.u-under{position:absolute}.u-under{overflow:hidden}.uplot canvas{display:block;position:relative;width:100%;height:100%}.u-axis{position:absolute}.u-legend{font-size:14px;margin:auto;text-align:center}.u-inline{display:block}.u-inline *{display:inline-block}.u-inline tr{margin-right:16px}.u-legend th{font-weight:600}.u-legend th>*{vertical-align:middle;display:inline-block}.u-legend .u-marker{width:1em;height:1em;margin-right:4px;background-clip:padding-box!important}.u-inline.u-live th:after{content:":";vertical-align:middle}.u-inline:not(.u-live) .u-value{display:none}.u-series>*{padding:4px}.u-series th{cursor:pointer}.u-legend .u-off>*{opacity:.3}.u-select{background:#00000012;position:absolute;pointer-events:none}.u-cursor-x,.u-cursor-y{position:absolute;left:0;top:0;pointer-events:none;will-change:transform}.u-hz .u-cursor-x,.u-vt .u-cursor-y{height:100%;border-right:1px dashed #607D8B}.u-hz .u-cursor-y,.u-vt .u-cursor-x{width:100%;border-bottom:1px dashed #607D8B}.u-cursor-pt{position:absolute;top:0;left:0;border-radius:50%;border:0 solid;pointer-events:none;will-change:transform;background-clip:padding-box!important}.u-axis.u-off,.u-select.u-off,.u-cursor-x.u-off,.u-cursor-y.u-off,.u-cursor-pt.u-off{display:none}:root{--ub-radius: var(--radius, .5rem);--ub-background: var(--background, oklch(1 0 0));--ub-primary: var(--primary, oklch(.208 .042 264.541));--ub-primary-foreground: var(--primary-foreground, oklch(1 0 0));--ub-secondary: var(--secondary, oklch(.985 .002 264.542));--ub-secondary-foreground: var( --secondary-foreground, oklch(.208 .042 264.541) );--ub-muted: var(--muted, oklch(.967 .001 286.375));--ub-muted-foreground: var(--muted-foreground, oklch(.552 .016 285.938));--ub-popover: var(--popover, oklch(1 0 0));--ub-border: var( --border, oklch(.922 .005 264.542 / .8) );--ub-ring: var(--ring, oklch(.208 .042 264.541));--ub-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .05);--ub-shadow-lg: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--ub-shadow-ring: 0 0 0 1px oklch(.922 .005 264.542 / .4);--ub-shadow-ring-sm: 0 0 0 1px rgb(0 0 0 / .05);--ub-backdrop-blur: blur(12px);--ub-opacity-subtle: .7;--ub-chart-font-size: 11px;--ub-chart-font-color: var(--ub-muted-foreground);--ub-chart-grid-color: oklch(from var(--ub-muted-foreground) l c h / .15);--ub-chart-threshold-error: oklch(60% .2 30);--ub-chart-threshold-warning: oklch(75% .18 90);--ub-chart-threshold-ok: oklch(65% .15 145);--ub-chart-threshold-info: oklch(85% .005 240);--ub-chart-threshold-default: oklch(65% .01 0);--ub-chart-threshold-error-fill: oklch( from var(--ub-chart-threshold-error) l c h / .15 );--ub-chart-threshold-warning-fill: oklch( from var(--ub-chart-threshold-warning) l c h / .15 );--ub-chart-threshold-ok-fill: oklch( from var(--ub-chart-threshold-ok) l c h / .15 );--ub-chart-threshold-info-fill: oklch( from var(--ub-chart-threshold-info) l c h / .15 );--ub-chart-threshold-default-fill: oklch( from var(--ub-chart-threshold-default) l c h / .1 );--ub-chart-serie-color-1: var(--chart-1, oklch(.68 .214 293.418));--ub-chart-serie-color-2: var(--chart-2, oklch(.84 .151 94.621));--ub-chart-serie-color-3: var(--chart-3, oklch(.68 .2 255.485));--ub-chart-serie-color-4: var(--chart-4, oklch(.7 .245 27.325));--ub-chart-serie-color-5: var(--chart-5, oklch(.68 .18 149.579));--ub-chart-serie-color-6: var(--chart-6, oklch(.75 .159 50.554));--ub-chart-serie-color-7: var(--chart-7, oklch(.7 .14 215.355));--ub-chart-serie-color-8: var(--chart-8, oklch(.68 .25 301.364));--ub-chart-serie-color-9: var(--chart-9, oklch(.72 .16 89.872));--ub-chart-serie-color-10: var(--chart-10, oklch(.65 .2 276.652));--ub-chart-serie-color-11: var(--chart-11, oklch(.68 .14 192.803));--ub-chart-serie-color-12: var(--chart-12, oklch(.65 .22 3.555));--ub-chart-serie-fill-color-1: oklch( from var(--ub-chart-serie-color-1) l c h / .4 );--ub-chart-serie-fill-color-2: oklch( from var(--ub-chart-serie-color-2) l c h / .4 );--ub-chart-serie-fill-color-3: oklch( from var(--ub-chart-serie-color-3) l c h / .4 );--ub-chart-serie-fill-color-4: oklch( from var(--ub-chart-serie-color-4) l c h / .4 );--ub-chart-serie-fill-color-5: oklch( from var(--ub-chart-serie-color-5) l c h / .4 );--ub-chart-serie-fill-color-6: oklch( from var(--ub-chart-serie-color-6) l c h / .4 );--ub-chart-serie-fill-color-7: oklch( from var(--ub-chart-serie-color-7) l c h / .4 );--ub-chart-serie-fill-color-8: oklch( from var(--ub-chart-serie-color-8) l c h / .4 );--ub-chart-serie-fill-color-9: oklch( from var(--ub-chart-serie-color-9) l c h / .4 );--ub-chart-serie-fill-color-10: oklch( from var(--ub-chart-serie-color-10) l c h / .4 );--ub-chart-serie-fill-color-11: oklch( from var(--ub-chart-serie-color-11) l c h / .4 );--ub-chart-serie-fill-color-12: oklch( from var(--ub-chart-serie-color-12) l c h / .4 );-webkit-font-smoothing:antialiased}.dark{--ub-background: var(--background, oklch(.236 .013 265.755));--ub-primary: var(--primary, oklch(1 0 0));--ub-primary-foreground: var( --primary-foreground, oklch(.236 .013 265.755) );--ub-secondary: var(--secondary, oklch(1 0 0 / .05));--ub-secondary-foreground: var(--secondary-foreground, oklch(1 0 0));--ub-muted: var(--muted, oklch(1 0 0 / .05));--ub-muted-foreground: var(--muted-foreground, oklch(.665 .032 252.894));--ub-popover: var(--popover, oklch(.236 .013 265.755));--ub-border: var(--border, oklch(1 0 0 / .1));--ub-ring: var(--ring, oklch(1 0 0));--ub-shadow-ring: 0 0 0 1px oklch(.274 .014 265.755 / .4);--ub-shadow-ring-sm: 0 0 0 1px oklch(1 0 0 / .1)}@media(prefers-color-scheme:dark){.root{--ub-background: var( --background, oklch(.236 .013 265.755) );--ub-primary: var(--primary, oklch(1 0 0));--ub-primary-foreground: var( --primary-foreground, oklch(.236 .013 265.755) );--ub-secondary: var(--secondary, oklch(1 0 0 / .05));--ub-secondary-foreground: var(--secondary-foreground, oklch(1 0 0));--ub-muted: var(--muted, oklch(1 0 0 / .05));--ub-muted-foreground: var(--muted-foreground, oklch(.665 .032 252.894));--ub-popover: var(--popover, oklch(.236 .013 265.755));--ub-border: var(--border, oklch(1 0 0 / .1));--ub-ring: var(--ring, oklch(1 0 0));--ub-shadow-ring: 0 0 0 1px oklch(.274 .014 265.755 / .4);--ub-shadow-ring-sm: 0 0 0 1px oklch(1 0 0 / .1)}}@layer ub-chart{:where(.ub-chart-container){width:100%;height:100%;min-height:0;flex-grow:1}}.ub-tooltip{display:flex;min-width:340px;max-width:520px;width:auto;flex-direction:column;font-size:.875rem;gap:.5rem;border-radius:var(--ub-radius);border:1px solid var(--ub-border);padding:.5rem .625rem;background-color:var(--ub-popover)}.ub-tooltip-datetime{font-weight:500;padding-left:.3rem;padding-right:.3rem}.ub-tooltip-divider{height:1px;width:100%;border:none;background:var(--ub-border);margin:0}.ub-tooltip-content{display:flex;flex-direction:column;padding-left:.35rem;padding-right:.35rem;gap:.2rem}.ub-tooltip-group{display:flex;flex-direction:column;gap:.25rem}.ub-tooltip-group-header{position:sticky;top:0;z-index:10;color:var(--ub-primary);--opacity: 50%}.ub-tooltip-group-header--separator{margin-top:.25rem}.ub-tooltip-items{display:flex;flex-direction:column;gap:.5rem}.ub-tooltip-item{display:flex;flex-direction:column;transition:background-color .15s ease}.ub-tooltip-item-row{display:flex;align-items:center;justify-content:space-between;gap:1rem}.ub-tooltip-item-left{display:flex;flex-direction:column;--gap: .625rem;min-width:0;overflow:hidden}.ub-tooltip-item-heading{display:flex;gap:.25rem;align-items:center}.ub-tooltip-item-metric-name{opacity:100%}.ub-tooltip-item-metric-name-label{--opacity: 50%}.ub-tooltip-item-dot{width:3px;height:14px;flex-shrink:0;border-radius:9999px}.ub-tooltip-item-attributes{display:flex;gap:.25rem;margin-right:auto}.ub-tooltip-item-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ub-tooltip-item-value{font-weight:500;--tw-font-weight: 500;font-variant-numeric:tabular-nums;font-size:.8rem;white-space:nowrap;margin-left:3rem}.ub-tooltip-item-value--empty{font-weight:400;color:var(--ub-text-disabled)}.ub-tooltip-attributes{margin-top:.125rem;display:flex;flex-wrap:wrap;column-gap:.75rem;row-gap:.125rem;padding-left:.75rem;line-height:1rem}.ub-tooltip-attribute{display:flex;align-items:center;gap:.25rem}.ub-tooltip-item-attribute-container{display:flex}.ub-tooltip-item-attribute-key{opacity:var(--ub-opacity-subtle);font-size:12px}.ub-tooltip-item-attribute{background:var(--ub-muted);border-radius:var(--ub-radius);padding:0 .25rem}.ub-tooltip-item-attribute{.ub-tooltip-item-attribute-value{color:var(--primary-foreground)}}.ub-tooltip-item-attribute-value{color:var(--ub-muted-foreground);font-weight:500;font-size:12px}.ub-tooltip-item-hidden-metric .ub-tooltip-item-attribute-value{color:var(--ub-foreground);font-size:14px}.ub-tooltip-item-hidden-metric .ub-tooltip-item-hidden-attribute-key .ub-tooltip-item-attribute-value{font-weight:400}.ub-tooltip-item-hidden-metric .ub-tooltip-item-attribute-key{font-size:14px}.ub-tooltip-item-attribute-divider:before{content:attr(data-text);color:var(--ub-muted-foreground)}.ub-tooltip-no-data{padding:0 .3rem;font-style:italic;color:var(--ub-placeholder);line-height:1rem}
2
2
  /*# sourceMappingURL=index.css.map */
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Defaults/Defaults.css","../../../node_modules/.pnpm/uplot@1.6.32/node_modules/uplot/dist/uPlot.min.css","../src/styles.css","../src/components/Tooltip/Tooltip.css"],"sourcesContent":[".ub-default {\n display: flex;\n height: 100%;\n align-items: center;\n justify-content: center;\n color: var(--ub-muted-foreground);\n}\n\n.ub-loading-text::before {\n content: attr(data-text);\n}\n\n.ub-empty-content {\n text-align: center;\n}\n\n.ub-empty-icon-wrapper {\n margin: 0 auto;\n display: flex;\n height: 2.5rem;\n width: 2.5rem;\n align-items: center;\n justify-content: center;\n border-radius: 9999px;\n background-color: var(--ub-muted);\n}\n\n.ub-icon {\n width: 1.25rem;\n height: 1.25rem;\n color: var(--ub-muted-foreground);\n}\n\n.ub-empty-text {\n margin-top: 0.5rem;\n font-size: 0.875rem;\n color: var(--ub-muted-foreground);\n}\n\n.ub-empty-text::before {\n content: attr(data-text);\n}\n",".uplot, .uplot *, .uplot *::before, .uplot *::after {box-sizing: border-box;}.uplot {font-family: system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\";line-height: 1.5;width: -moz-min-content;width: min-content;}.u-title {text-align: center;font-size: 18px;font-weight: bold;}.u-wrap {position: relative;-webkit-user-select: none;-moz-user-select: none;user-select: none;}.u-over, .u-under {position: absolute;}.u-under {overflow: hidden;}.uplot canvas {display: block;position: relative;width: 100%;height: 100%;}.u-axis {position: absolute;}.u-legend {font-size: 14px;margin: auto;text-align: center;}.u-inline {display: block;}.u-inline * {display: inline-block;}.u-inline tr {margin-right: 16px;}.u-legend th {font-weight: 600;}.u-legend th > * {vertical-align: middle;display: inline-block;}.u-legend .u-marker {width: 1em;height: 1em;margin-right: 4px;background-clip: padding-box !important;}.u-inline.u-live th::after {content: \":\";vertical-align: middle;}.u-inline:not(.u-live) .u-value {display: none;}.u-series > * {padding: 4px;}.u-series th {cursor: pointer;}.u-legend .u-off > * {opacity: 0.3;}.u-select {background: rgba(0,0,0,0.07);position: absolute;pointer-events: none;}.u-cursor-x, .u-cursor-y {position: absolute;left: 0;top: 0;pointer-events: none;will-change: transform;}.u-hz .u-cursor-x, .u-vt .u-cursor-y {height: 100%;border-right: 1px dashed #607D8B;}.u-hz .u-cursor-y, .u-vt .u-cursor-x {width: 100%;border-bottom: 1px dashed #607D8B;}.u-cursor-pt {position: absolute;top: 0;left: 0;border-radius: 50%;border: 0 solid;pointer-events: none;will-change: transform;/*this has to be !important since we set inline \"background\" shorthand */background-clip: padding-box !important;}.u-axis.u-off, .u-select.u-off, .u-cursor-x.u-off, .u-cursor-y.u-off, .u-cursor-pt.u-off {display: none;}","@import \"uplot/dist/uPlot.min.css\";\n\n:root {\n --ub-radius: var(--radius, 0.5rem);\n --ub-background: var(--background, oklch(1 0 0));\n --ub-primary: var(--primary, oklch(0.208 0.042 264.541));\n --ub-primary-foreground: var(--primary-foreground, oklch(1 0 0));\n --ub-secondary: var(--secondary, oklch(0.985 0.002 264.542));\n --ub-secondary-foreground: var(\n --secondary-foreground,\n oklch(0.208 0.042 264.541)\n );\n --ub-muted: var(--muted, oklch(0.967 0.001 286.375));\n --ub-muted-foreground: var(--muted-foreground, oklch(0.552 0.016 285.938));\n --ub-popover: var(--popover, oklch(1 0 0));\n --ub-border: var(\n --border,\n oklch(0.922 0.005 264.542 / 0.8)\n ); /* gray-200/80 */\n --ub-ring: var(--ring, oklch(0.208 0.042 264.541));\n\n /* Custom extensions */\n /* Shadows */\n --ub-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);\n --ub-shadow-lg:\n 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);\n --ub-shadow-ring: 0 0 0 1px oklch(0.922 0.005 264.542 / 0.4);\n --ub-shadow-ring-sm: 0 0 0 1px rgb(0 0 0 / 0.05);\n\n /* Effects */\n --ub-backdrop-blur: blur(12px);\n --ub-opacity-subtle: 0.7;\n\n /* Chart */\n --ub-chart-font-size: 11px;\n --ub-chart-font-color: var(--ub-muted-foreground);\n --ub-chart-grid-color: oklch(from var(--ub-muted-foreground) l c h / 0.15);\n\n /* Threshold colors */\n --ub-chart-threshold-error: oklch(60% 0.2 30);\n --ub-chart-threshold-warning: oklch(75% 0.18 90);\n --ub-chart-threshold-ok: oklch(65% 0.15 145);\n --ub-chart-threshold-info: oklch(85% 0.005 240);\n --ub-chart-threshold-default: oklch(65% 0.01 0);\n\n --ub-chart-threshold-error-fill: oklch(\n from var(--ub-chart-threshold-error) l c h / 0.15\n );\n --ub-chart-threshold-warning-fill: oklch(\n from var(--ub-chart-threshold-warning) l c h / 0.15\n );\n --ub-chart-threshold-ok-fill: oklch(\n from var(--ub-chart-threshold-ok) l c h / 0.15\n );\n --ub-chart-threshold-info-fill: oklch(\n from var(--ub-chart-threshold-info) l c h / 0.15\n );\n --ub-chart-threshold-default-fill: oklch(\n from var(--ub-chart-threshold-default) l c h / 0.1\n );\n\n --ub-chart-serie-color-1: var(--chart-1, oklch(0.68 0.214 293.418));\n --ub-chart-serie-color-2: var(--chart-2, oklch(0.84 0.151 94.621));\n --ub-chart-serie-color-3: var(--chart-3, oklch(0.68 0.2 255.485));\n --ub-chart-serie-color-4: var(--chart-4, oklch(0.7 0.245 27.325));\n --ub-chart-serie-color-5: var(--chart-5, oklch(0.68 0.18 149.579));\n --ub-chart-serie-color-6: var(--chart-6, oklch(0.75 0.159 50.554));\n --ub-chart-serie-color-7: var(--chart-7, oklch(0.7 0.14 215.355));\n --ub-chart-serie-color-8: var(--chart-8, oklch(0.68 0.25 301.364));\n --ub-chart-serie-color-9: var(--chart-9, oklch(0.72 0.16 89.872));\n --ub-chart-serie-color-10: var(--chart-10, oklch(0.65 0.2 276.652));\n --ub-chart-serie-color-11: var(--chart-11, oklch(0.68 0.14 192.803));\n --ub-chart-serie-color-12: var(--chart-12, oklch(0.65 0.22 3.555));\n\n --ub-chart-serie-fill-color-1: oklch(\n from var(--ub-chart-serie-color-1) l c h / 0.4\n );\n --ub-chart-serie-fill-color-2: oklch(\n from var(--ub-chart-serie-color-2) l c h / 0.4\n );\n --ub-chart-serie-fill-color-3: oklch(\n from var(--ub-chart-serie-color-3) l c h / 0.4\n );\n --ub-chart-serie-fill-color-4: oklch(\n from var(--ub-chart-serie-color-4) l c h / 0.4\n );\n --ub-chart-serie-fill-color-5: oklch(\n from var(--ub-chart-serie-color-5) l c h / 0.4\n );\n --ub-chart-serie-fill-color-6: oklch(\n from var(--ub-chart-serie-color-6) l c h / 0.4\n );\n --ub-chart-serie-fill-color-7: oklch(\n from var(--ub-chart-serie-color-7) l c h / 0.4\n );\n --ub-chart-serie-fill-color-8: oklch(\n from var(--ub-chart-serie-color-8) l c h / 0.4\n );\n --ub-chart-serie-fill-color-9: oklch(\n from var(--ub-chart-serie-color-9) l c h / 0.4\n );\n --ub-chart-serie-fill-color-10: oklch(\n from var(--ub-chart-serie-color-10) l c h / 0.4\n );\n --ub-chart-serie-fill-color-11: oklch(\n from var(--ub-chart-serie-color-11) l c h / 0.4\n );\n --ub-chart-serie-fill-color-12: oklch(\n from var(--ub-chart-serie-color-12) l c h / 0.4\n );\n\n -webkit-font-smoothing: antialiased;\n}\n\n/* Explicit, compatibility with shadcn */\n.dark {\n --ub-background: var(--background, oklch(0.236 0.013 265.755)); /* zinc-900 */\n --ub-primary: var(--primary, oklch(1 0 0));\n --ub-primary-foreground: var(\n --primary-foreground,\n oklch(0.236 0.013 265.755)\n ); /* zinc-900 */\n --ub-secondary: var(--secondary, oklch(1 0 0 / 0.05));\n --ub-secondary-foreground: var(--secondary-foreground, oklch(1 0 0));\n --ub-muted: var(--muted, oklch(1 0 0 / 0.05));\n --ub-muted-foreground: var(--muted-foreground, oklch(0.665 0.032 252.894));\n --ub-popover: var(--popover, oklch(0.236 0.013 265.755)); /* zinc-900 */\n --ub-border: var(--border, oklch(1 0 0 / 0.1));\n --ub-ring: var(--ring, oklch(1 0 0));\n\n /* Custom extensions */\n --ub-shadow-ring: 0 0 0 1px oklch(0.274 0.014 265.755 / 0.4); /* zinc-800/40 */\n --ub-shadow-ring-sm: 0 0 0 1px oklch(1 0 0 / 0.1);\n}\n\n@media (prefers-color-scheme: dark) {\n .root {\n --ub-background: var(\n --background,\n oklch(0.236 0.013 265.755)\n ); /* zinc-900 */\n --ub-primary: var(--primary, oklch(1 0 0));\n --ub-primary-foreground: var(\n --primary-foreground,\n oklch(0.236 0.013 265.755)\n ); /* zinc-900 */\n --ub-secondary: var(--secondary, oklch(1 0 0 / 0.05));\n --ub-secondary-foreground: var(--secondary-foreground, oklch(1 0 0));\n --ub-muted: var(--muted, oklch(1 0 0 / 0.05));\n --ub-muted-foreground: var(--muted-foreground, oklch(0.665 0.032 252.894));\n --ub-popover: var(--popover, oklch(0.236 0.013 265.755)); /* zinc-900 */\n --ub-border: var(--border, oklch(1 0 0 / 0.1));\n --ub-ring: var(--ring, oklch(1 0 0));\n\n /* Custom extensions */\n --ub-shadow-ring: 0 0 0 1px oklch(0.274 0.014 265.755 / 0.4); /* zinc-800/40 */\n --ub-shadow-ring-sm: 0 0 0 1px oklch(1 0 0 / 0.1);\n }\n}\n\n@layer ub-chart {\n :where(.ub-chart-container) {\n width: 100%;\n height: 100%;\n min-height: 0;\n flex-grow: 1;\n }\n}\n","/* Container */\n.ub-tooltip {\n display: flex;\n min-width: 340px;\n max-width: 520px;\n width: auto;\n flex-direction: column;\n font-size: 0.875rem;\n gap: 0.5rem;\n border-radius: var(--ub-radius);\n border: 1px solid var(--ub-border);\n padding: 0.5rem 0.625rem 0.5rem 0.625rem;\n background-color: var(--ub-popover);\n}\n\n.ub-tooltip-datetime {\n font-weight: 500;\n padding-left: 0.3rem;\n padding-right: 0.3rem;\n}\n\n.ub-tooltip-divider {\n height: 1px;\n width: 100%;\n border: none;\n background: var(--ub-border);\n margin: 0;\n}\n\n.ub-tooltip-content {\n display: flex;\n flex-direction: column;\n padding-left: 0.35rem;\n padding-right: 0.35rem;\n gap: 0.2rem;\n}\n\n.ub-tooltip-group {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n}\n\n.ub-tooltip-group-header {\n position: sticky;\n top: 0;\n z-index: 10;\n color: var(--ub-primary);\n --opacity: 50%;\n}\n\n.ub-tooltip-group-header--separator {\n margin-top: 0.25rem;\n}\n\n.ub-tooltip-items {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n}\n\n.ub-tooltip-item {\n display: flex;\n flex-direction: column;\n transition: background-color 0.15s ease;\n}\n\n.ub-tooltip-item-row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 1rem;\n}\n\n.ub-tooltip-item-left {\n display: flex;\n flex-direction: column;\n --gap: 0.625rem;\n min-width: 0;\n overflow: hidden;\n}\n\n.ub-tooltip-item-heading {\n display: flex;\n gap: 0.25rem;\n align-items: center;\n}\n\n.ub-tooltip-item-metric-name {\n opacity: 100%;\n}\n\n.ub-tooltip-item-metric-name-label {\n --opacity: 50%;\n}\n\n.ub-tooltip-item-dot {\n width: 3px;\n height: 14px;\n flex-shrink: 0;\n border-radius: 9999px;\n}\n\n.ub-tooltip-item-attributes {\n display: flex;\n gap: 0.25rem;\n margin-right: auto;\n}\n\n.ub-tooltip-item-label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.ub-tooltip-item-value {\n font-weight: 500;\n --tw-font-weight: 500;\n font-variant-numeric: tabular-nums;\n font-size: 0.8rem;\n white-space: nowrap;\n margin-left: 3rem;\n}\n\n.ub-tooltip-item-value--empty {\n font-weight: 400;\n color: var(--ub-text-disabled);\n}\n\n/* Attributes Container */\n.ub-tooltip-attributes {\n margin-top: 0.125rem;\n display: flex;\n flex-wrap: wrap;\n -moz-column-gap: 0.75rem;\n column-gap: 0.75rem;\n row-gap: 0.125rem;\n padding-left: 0.75rem;\n line-height: 1rem;\n}\n\n/* Attribute Item */\n.ub-tooltip-attribute {\n display: flex;\n align-items: center;\n gap: 0.25rem;\n}\n\n.ub-tooltip-item-attribute-container {\n display: flex;\n}\n\n.ub-tooltip-item-attribute-key {\n opacity: var(--ub-opacity-subtle);\n font-size: 12px;\n}\n\n.ub-tooltip-item-attribute {\n background: var(--ub-muted);\n border-radius: var(--ub-radius);\n padding: 0 0.25rem 0 0.25rem;\n}\n\n.ub-tooltip-item-attribute {\n .ub-tooltip-item-attribute-value {\n color: var(--primary-foreground);\n }\n}\n\n.ub-tooltip-item-attribute-value {\n color: var(--ub-muted-foreground);\n font-weight: 500;\n font-size: 12px;\n}\n\n.ub-tooltip-item-hidden-metric .ub-tooltip-item-attribute-value {\n color: var(--ub-foreground);\n font-size: 14px;\n}\n\n.ub-tooltip-item-hidden-metric\n .ub-tooltip-item-hidden-attribute-key\n .ub-tooltip-item-attribute-value {\n font-weight: 400;\n}\n\n.ub-tooltip-item-hidden-metric .ub-tooltip-item-attribute-key {\n font-size: 14px;\n}\n\n.ub-tooltip-item-attribute-divider::before {\n content: attr(data-text);\n color: var(--ub-muted-foreground);\n}\n\n.ub-tooltip-no-data {\n padding: 0 0.3rem 0 0.3rem;\n font-style: italic;\n color: var(--ub-placeholder);\n line-height: 1rem;\n}\n"],"mappings":"AAAA,CAAC,WACC,QAAS,KACT,OAAQ,KACR,YAAa,OACb,gBAAiB,OAC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AAC,iCAAiC,QAChC,QAAS,KAAK,WACd,MAAO,IAAI,sBACb,CAEA,CAAC,mBAnMD,QAoMW,EAAE,MACX,WAAY,OACZ,MAAO,IAAI,kBACX,YAAa,IACf","names":[]}
1
+ {"version":3,"sources":["../src/components/Defaults/Defaults.css","../../../node_modules/.pnpm/uplot@1.6.32/node_modules/uplot/dist/uPlot.min.css","../src/styles.css","../src/components/Tooltip/Tooltip.css"],"sourcesContent":[".ub-default {\n display: flex;\n height: 100%;\n align-items: center;\n justify-content: center;\n color: var(--ub-muted-foreground);\n}\n\n.ub-loading-text::before {\n content: attr(data-text);\n}\n\n.ub-empty-content {\n text-align: center;\n}\n\n.ub-empty-icon-wrapper {\n margin: 0 auto;\n display: flex;\n height: 2.5rem;\n width: 2.5rem;\n align-items: center;\n justify-content: center;\n border-radius: 9999px;\n background-color: var(--ub-muted);\n}\n\n.ub-icon {\n width: 1.25rem;\n height: 1.25rem;\n color: var(--ub-muted-foreground);\n}\n\n.ub-empty-text {\n margin-top: 0.5rem;\n font-size: 0.875rem;\n color: var(--ub-muted-foreground);\n}\n\n.ub-empty-text::before {\n content: attr(data-text);\n}\n",".uplot, .uplot *, .uplot *::before, .uplot *::after {box-sizing: border-box;}.uplot {font-family: system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\";line-height: 1.5;width: min-content;}.u-title {text-align: center;font-size: 18px;font-weight: bold;}.u-wrap {position: relative;user-select: none;}.u-over, .u-under {position: absolute;}.u-under {overflow: hidden;}.uplot canvas {display: block;position: relative;width: 100%;height: 100%;}.u-axis {position: absolute;}.u-legend {font-size: 14px;margin: auto;text-align: center;}.u-inline {display: block;}.u-inline * {display: inline-block;}.u-inline tr {margin-right: 16px;}.u-legend th {font-weight: 600;}.u-legend th > * {vertical-align: middle;display: inline-block;}.u-legend .u-marker {width: 1em;height: 1em;margin-right: 4px;background-clip: padding-box !important;}.u-inline.u-live th::after {content: \":\";vertical-align: middle;}.u-inline:not(.u-live) .u-value {display: none;}.u-series > * {padding: 4px;}.u-series th {cursor: pointer;}.u-legend .u-off > * {opacity: 0.3;}.u-select {background: rgba(0,0,0,0.07);position: absolute;pointer-events: none;}.u-cursor-x, .u-cursor-y {position: absolute;left: 0;top: 0;pointer-events: none;will-change: transform;}.u-hz .u-cursor-x, .u-vt .u-cursor-y {height: 100%;border-right: 1px dashed #607D8B;}.u-hz .u-cursor-y, .u-vt .u-cursor-x {width: 100%;border-bottom: 1px dashed #607D8B;}.u-cursor-pt {position: absolute;top: 0;left: 0;border-radius: 50%;border: 0 solid;pointer-events: none;will-change: transform;/*this has to be !important since we set inline \"background\" shorthand */background-clip: padding-box !important;}.u-axis.u-off, .u-select.u-off, .u-cursor-x.u-off, .u-cursor-y.u-off, .u-cursor-pt.u-off {display: none;}","@import \"uplot/dist/uPlot.min.css\";\n\n:root {\n --ub-radius: var(--radius, 0.5rem);\n --ub-background: var(--background, oklch(1 0 0));\n --ub-primary: var(--primary, oklch(0.208 0.042 264.541));\n --ub-primary-foreground: var(--primary-foreground, oklch(1 0 0));\n --ub-secondary: var(--secondary, oklch(0.985 0.002 264.542));\n --ub-secondary-foreground: var(\n --secondary-foreground,\n oklch(0.208 0.042 264.541)\n );\n --ub-muted: var(--muted, oklch(0.967 0.001 286.375));\n --ub-muted-foreground: var(--muted-foreground, oklch(0.552 0.016 285.938));\n --ub-popover: var(--popover, oklch(1 0 0));\n --ub-border: var(\n --border,\n oklch(0.922 0.005 264.542 / 0.8)\n ); /* gray-200/80 */\n --ub-ring: var(--ring, oklch(0.208 0.042 264.541));\n\n /* Custom extensions */\n /* Shadows */\n --ub-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);\n --ub-shadow-lg:\n 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);\n --ub-shadow-ring: 0 0 0 1px oklch(0.922 0.005 264.542 / 0.4);\n --ub-shadow-ring-sm: 0 0 0 1px rgb(0 0 0 / 0.05);\n\n /* Effects */\n --ub-backdrop-blur: blur(12px);\n --ub-opacity-subtle: 0.7;\n\n /* Chart */\n --ub-chart-font-size: 11px;\n --ub-chart-font-color: var(--ub-muted-foreground);\n --ub-chart-grid-color: oklch(from var(--ub-muted-foreground) l c h / 0.15);\n\n /* Threshold colors */\n --ub-chart-threshold-error: oklch(60% 0.2 30);\n --ub-chart-threshold-warning: oklch(75% 0.18 90);\n --ub-chart-threshold-ok: oklch(65% 0.15 145);\n --ub-chart-threshold-info: oklch(85% 0.005 240);\n --ub-chart-threshold-default: oklch(65% 0.01 0);\n\n --ub-chart-threshold-error-fill: oklch(\n from var(--ub-chart-threshold-error) l c h / 0.15\n );\n --ub-chart-threshold-warning-fill: oklch(\n from var(--ub-chart-threshold-warning) l c h / 0.15\n );\n --ub-chart-threshold-ok-fill: oklch(\n from var(--ub-chart-threshold-ok) l c h / 0.15\n );\n --ub-chart-threshold-info-fill: oklch(\n from var(--ub-chart-threshold-info) l c h / 0.15\n );\n --ub-chart-threshold-default-fill: oklch(\n from var(--ub-chart-threshold-default) l c h / 0.1\n );\n\n --ub-chart-serie-color-1: var(--chart-1, oklch(0.68 0.214 293.418));\n --ub-chart-serie-color-2: var(--chart-2, oklch(0.84 0.151 94.621));\n --ub-chart-serie-color-3: var(--chart-3, oklch(0.68 0.2 255.485));\n --ub-chart-serie-color-4: var(--chart-4, oklch(0.7 0.245 27.325));\n --ub-chart-serie-color-5: var(--chart-5, oklch(0.68 0.18 149.579));\n --ub-chart-serie-color-6: var(--chart-6, oklch(0.75 0.159 50.554));\n --ub-chart-serie-color-7: var(--chart-7, oklch(0.7 0.14 215.355));\n --ub-chart-serie-color-8: var(--chart-8, oklch(0.68 0.25 301.364));\n --ub-chart-serie-color-9: var(--chart-9, oklch(0.72 0.16 89.872));\n --ub-chart-serie-color-10: var(--chart-10, oklch(0.65 0.2 276.652));\n --ub-chart-serie-color-11: var(--chart-11, oklch(0.68 0.14 192.803));\n --ub-chart-serie-color-12: var(--chart-12, oklch(0.65 0.22 3.555));\n\n --ub-chart-serie-fill-color-1: oklch(\n from var(--ub-chart-serie-color-1) l c h / 0.4\n );\n --ub-chart-serie-fill-color-2: oklch(\n from var(--ub-chart-serie-color-2) l c h / 0.4\n );\n --ub-chart-serie-fill-color-3: oklch(\n from var(--ub-chart-serie-color-3) l c h / 0.4\n );\n --ub-chart-serie-fill-color-4: oklch(\n from var(--ub-chart-serie-color-4) l c h / 0.4\n );\n --ub-chart-serie-fill-color-5: oklch(\n from var(--ub-chart-serie-color-5) l c h / 0.4\n );\n --ub-chart-serie-fill-color-6: oklch(\n from var(--ub-chart-serie-color-6) l c h / 0.4\n );\n --ub-chart-serie-fill-color-7: oklch(\n from var(--ub-chart-serie-color-7) l c h / 0.4\n );\n --ub-chart-serie-fill-color-8: oklch(\n from var(--ub-chart-serie-color-8) l c h / 0.4\n );\n --ub-chart-serie-fill-color-9: oklch(\n from var(--ub-chart-serie-color-9) l c h / 0.4\n );\n --ub-chart-serie-fill-color-10: oklch(\n from var(--ub-chart-serie-color-10) l c h / 0.4\n );\n --ub-chart-serie-fill-color-11: oklch(\n from var(--ub-chart-serie-color-11) l c h / 0.4\n );\n --ub-chart-serie-fill-color-12: oklch(\n from var(--ub-chart-serie-color-12) l c h / 0.4\n );\n\n -webkit-font-smoothing: antialiased;\n}\n\n/* Explicit, compatibility with shadcn */\n.dark {\n --ub-background: var(--background, oklch(0.236 0.013 265.755)); /* zinc-900 */\n --ub-primary: var(--primary, oklch(1 0 0));\n --ub-primary-foreground: var(\n --primary-foreground,\n oklch(0.236 0.013 265.755)\n ); /* zinc-900 */\n --ub-secondary: var(--secondary, oklch(1 0 0 / 0.05));\n --ub-secondary-foreground: var(--secondary-foreground, oklch(1 0 0));\n --ub-muted: var(--muted, oklch(1 0 0 / 0.05));\n --ub-muted-foreground: var(--muted-foreground, oklch(0.665 0.032 252.894));\n --ub-popover: var(--popover, oklch(0.236 0.013 265.755)); /* zinc-900 */\n --ub-border: var(--border, oklch(1 0 0 / 0.1));\n --ub-ring: var(--ring, oklch(1 0 0));\n\n /* Custom extensions */\n --ub-shadow-ring: 0 0 0 1px oklch(0.274 0.014 265.755 / 0.4); /* zinc-800/40 */\n --ub-shadow-ring-sm: 0 0 0 1px oklch(1 0 0 / 0.1);\n}\n\n@media (prefers-color-scheme: dark) {\n .root {\n --ub-background: var(\n --background,\n oklch(0.236 0.013 265.755)\n ); /* zinc-900 */\n --ub-primary: var(--primary, oklch(1 0 0));\n --ub-primary-foreground: var(\n --primary-foreground,\n oklch(0.236 0.013 265.755)\n ); /* zinc-900 */\n --ub-secondary: var(--secondary, oklch(1 0 0 / 0.05));\n --ub-secondary-foreground: var(--secondary-foreground, oklch(1 0 0));\n --ub-muted: var(--muted, oklch(1 0 0 / 0.05));\n --ub-muted-foreground: var(--muted-foreground, oklch(0.665 0.032 252.894));\n --ub-popover: var(--popover, oklch(0.236 0.013 265.755)); /* zinc-900 */\n --ub-border: var(--border, oklch(1 0 0 / 0.1));\n --ub-ring: var(--ring, oklch(1 0 0));\n\n /* Custom extensions */\n --ub-shadow-ring: 0 0 0 1px oklch(0.274 0.014 265.755 / 0.4); /* zinc-800/40 */\n --ub-shadow-ring-sm: 0 0 0 1px oklch(1 0 0 / 0.1);\n }\n}\n\n@layer ub-chart {\n :where(.ub-chart-container) {\n width: 100%;\n height: 100%;\n min-height: 0;\n flex-grow: 1;\n }\n}\n","/* Container */\n.ub-tooltip {\n display: flex;\n min-width: 340px;\n max-width: 520px;\n width: auto;\n flex-direction: column;\n font-size: 0.875rem;\n gap: 0.5rem;\n border-radius: var(--ub-radius);\n border: 1px solid var(--ub-border);\n padding: 0.5rem 0.625rem 0.5rem 0.625rem;\n background-color: var(--ub-popover);\n}\n\n.ub-tooltip-datetime {\n font-weight: 500;\n padding-left: 0.3rem;\n padding-right: 0.3rem;\n}\n\n.ub-tooltip-divider {\n height: 1px;\n width: 100%;\n border: none;\n background: var(--ub-border);\n margin: 0;\n}\n\n.ub-tooltip-content {\n display: flex;\n flex-direction: column;\n padding-left: 0.35rem;\n padding-right: 0.35rem;\n gap: 0.2rem;\n}\n\n.ub-tooltip-group {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n}\n\n.ub-tooltip-group-header {\n position: sticky;\n top: 0;\n z-index: 10;\n color: var(--ub-primary);\n --opacity: 50%;\n}\n\n.ub-tooltip-group-header--separator {\n margin-top: 0.25rem;\n}\n\n.ub-tooltip-items {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n}\n\n.ub-tooltip-item {\n display: flex;\n flex-direction: column;\n transition: background-color 0.15s ease;\n}\n\n.ub-tooltip-item-row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 1rem;\n}\n\n.ub-tooltip-item-left {\n display: flex;\n flex-direction: column;\n --gap: 0.625rem;\n min-width: 0;\n overflow: hidden;\n}\n\n.ub-tooltip-item-heading {\n display: flex;\n gap: 0.25rem;\n align-items: center;\n}\n\n.ub-tooltip-item-metric-name {\n opacity: 100%;\n}\n\n.ub-tooltip-item-metric-name-label {\n --opacity: 50%;\n}\n\n.ub-tooltip-item-dot {\n width: 3px;\n height: 14px;\n flex-shrink: 0;\n border-radius: 9999px;\n}\n\n.ub-tooltip-item-attributes {\n display: flex;\n gap: 0.25rem;\n margin-right: auto;\n}\n\n.ub-tooltip-item-label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.ub-tooltip-item-value {\n font-weight: 500;\n --tw-font-weight: 500;\n font-variant-numeric: tabular-nums;\n font-size: 0.8rem;\n white-space: nowrap;\n margin-left: 3rem;\n}\n\n.ub-tooltip-item-value--empty {\n font-weight: 400;\n color: var(--ub-text-disabled);\n}\n\n/* Attributes Container */\n.ub-tooltip-attributes {\n margin-top: 0.125rem;\n display: flex;\n flex-wrap: wrap;\n column-gap: 0.75rem;\n row-gap: 0.125rem;\n padding-left: 0.75rem;\n line-height: 1rem;\n}\n\n/* Attribute Item */\n.ub-tooltip-attribute {\n display: flex;\n align-items: center;\n gap: 0.25rem;\n}\n\n.ub-tooltip-item-attribute-container {\n display: flex;\n}\n\n.ub-tooltip-item-attribute-key {\n opacity: var(--ub-opacity-subtle);\n font-size: 12px;\n}\n\n.ub-tooltip-item-attribute {\n background: var(--ub-muted);\n border-radius: var(--ub-radius);\n padding: 0 0.25rem 0 0.25rem;\n}\n\n.ub-tooltip-item-attribute {\n .ub-tooltip-item-attribute-value {\n color: var(--primary-foreground);\n }\n}\n\n.ub-tooltip-item-attribute-value {\n color: var(--ub-muted-foreground);\n font-weight: 500;\n font-size: 12px;\n}\n\n.ub-tooltip-item-hidden-metric .ub-tooltip-item-attribute-value {\n color: var(--ub-foreground);\n font-size: 14px;\n}\n\n.ub-tooltip-item-hidden-metric\n .ub-tooltip-item-hidden-attribute-key\n .ub-tooltip-item-attribute-value {\n font-weight: 400;\n}\n\n.ub-tooltip-item-hidden-metric .ub-tooltip-item-attribute-key {\n font-size: 14px;\n}\n\n.ub-tooltip-item-attribute-divider::before {\n content: attr(data-text);\n color: var(--ub-muted-foreground);\n}\n\n.ub-tooltip-no-data {\n padding: 0 0.3rem 0 0.3rem;\n font-style: italic;\n color: var(--ub-placeholder);\n line-height: 1rem;\n}\n"],"mappings":"AAAA,CAAC,WACC,QAAS,KACT,OAAQ,KACR,YAAa,OACb,gBAAiB,OACjB,MAAO,IAAI,sBACb,CAEA,CAAC,eAAe,QACd,QAAS,KAAK,UAChB,CAEA,CAAC,iBACC,WAAY,MACd,CAEA,CAAC,sBAhBD,OAiBU,EAAE,KACV,QAAS,KACT,OAAQ,OACR,MAAO,OACP,YAAa,OACb,gBAAiB,OAtBnB,cAuBiB,OACf,iBAAkB,IAAI,WACxB,CAEA,CAAC,QACC,MAAO,QACP,OAAQ,QACR,MAAO,IAAI,sBACb,CAEA,CAAC,cACC,WAAY,MACZ,UAAW,QACX,MAAO,IAAI,sBACb,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ACjB,CAEA,CAAC,2BACC,QAAS,KACT,IAAK,OACL,aAAc,IAChB,CAEA,CAAC,sBACC,SAAU,OACV,cAAe,SACf,YAAa,MACf,CAEA,CAAC,sBACC,YAAa,IACb,kBAAkB,IAClB,qBAAsB,aACtB,UAAW,MACX,YAAa,OACb,YAAa,IACf,CAEA,CAAC,6BACC,YAAa,IACb,MAAO,IAAI,mBACb,CAGA,CAAC,sBACC,WAAY,QACZ,QAAS,KACT,UAAW,KACX,WAAY,OACZ,QAAS,QACT,aAAc,OACd,YAAa,IACf,CAGA,CAAC,qBACC,QAAS,KACT,YAAa,OACb,IAAK,MACP,CAEA,CAAC,oCACC,QAAS,IACX,CAEA,CAAC,8BACC,QAAS,IAAI,qBACb,UAAW,IACb,CAEA,CAAC,0BACC,WAAY,IAAI,YAChB,cAAe,IAAI,aA9JrB,QA+JW,EAAE,MACb,CAEA,CANC,0BAOC,CAAC,gCACC,MAAO,IAAI,qBACb,CACF,CAEA,CALG,gCAMD,MAAO,IAAI,uBACX,YAAa,IACb,UAAW,IACb,CAEA,CAAC,8BAA8B,CAX5B,gCAYD,MAAO,IAAI,iBACX,UAAW,IACb,CAEA,CALC,8BAMC,CAAC,qCACD,CAlBC,gCAmBD,YAAa,GACf,CAEA,CAXC,8BAW8B,CAlC9B,8BAmCC,UAAW,IACb,CAEA,CAAC,iCAAiC,QAChC,QAAS,KAAK,WACd,MAAO,IAAI,sBACb,CAEA,CAAC,mBAlMD,QAmMW,EAAE,MACX,WAAY,OACZ,MAAO,IAAI,kBACX,YAAa,IACf","names":[]}
package/dist/index.d.mts CHANGED
@@ -345,7 +345,7 @@ type ScopeProps = ScopeConfig & {
345
345
  * }
346
346
  * ```
347
347
  */
348
- declare function Scope({ children, timeRange, startTime, endTime, interval, attributes, groupBy, operator, appearance, tooltip, }: ScopeProps): react_jsx_runtime.JSX.Element;
348
+ declare function Scope({ children, timeRange, startTime, endTime, interval, attributes, groupBy, operator, appearance, tooltip, colors, fill, sortByValues, }: ScopeProps): react_jsx_runtime.JSX.Element;
349
349
  type UseScopeReturn = TimeseriesQueryConfig & ChartVisualConfig & {
350
350
  timeRange: TimeRange;
351
351
  appearance: {
package/dist/index.d.ts CHANGED
@@ -345,7 +345,7 @@ type ScopeProps = ScopeConfig & {
345
345
  * }
346
346
  * ```
347
347
  */
348
- declare function Scope({ children, timeRange, startTime, endTime, interval, attributes, groupBy, operator, appearance, tooltip, }: ScopeProps): react_jsx_runtime.JSX.Element;
348
+ declare function Scope({ children, timeRange, startTime, endTime, interval, attributes, groupBy, operator, appearance, tooltip, colors, fill, sortByValues, }: ScopeProps): react_jsx_runtime.JSX.Element;
349
349
  type UseScopeReturn = TimeseriesQueryConfig & ChartVisualConfig & {
350
350
  timeRange: TimeRange;
351
351
  appearance: {
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var at=Object.create;var Z=Object.defineProperty;var st=Object.getOwnPropertyDescriptor;var lt=Object.getOwnPropertyNames;var ut=Object.getPrototypeOf,ct=Object.prototype.hasOwnProperty;var pt=(e,t)=>{for(var r in t)Z(e,r,{get:t[r],enumerable:!0})},ve=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of lt(t))!ct.call(e,o)&&o!==r&&Z(e,o,{get:()=>t[o],enumerable:!(i=st(t,o))||i.enumerable});return e};var ee=(e,t,r)=>(r=e!=null?at(ut(e)):{},ve(t||!e||!e.__esModule?Z(r,"default",{value:e,enumerable:!0}):r,e)),mt=e=>ve(Z({},"__esModule",{value:!0}),e);var _t={};pt(_t,{Chart:()=>ce,Empty:()=>te,Error:()=>re,Loading:()=>oe,Scope:()=>ie,Timeseries:()=>nt,UnblindProvider:()=>ke,useLogs:()=>Ie,useMetrics:()=>Ae,useRefresh:()=>de,useScope:()=>H,useTimeseries:()=>ne,useUsage:()=>Me});module.exports=mt(_t);var G=require("@tanstack/react-query"),D=require("react"),me=require("react/jsx-runtime"),xe=(0,D.createContext)(void 0);function Ce({children:e,queryClient:t,queryClientConfig:r,apiBaseUrl:i="/api/unblind",fetchImpl:o}){let s=(0,D.useMemo)(()=>{if(t)return t;let a={refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchOnMount:!1},l={defaultOptions:{queries:a}};return r?new G.QueryClient({...r,defaultOptions:{...r.defaultOptions,queries:{...a,...r.defaultOptions?.queries}}}):new G.QueryClient(l)},[t,r]),n=(0,D.useMemo)(()=>({apiBaseUrl:i,fetchImpl:o}),[i,o]);return(0,me.jsx)(G.QueryClientProvider,{client:s,children:(0,me.jsx)(xe.Provider,{value:n,children:e})})}function O(){let e=(0,D.useContext)(xe);if(!e)throw new Error("useUnblindConfig must be used within an UnblindClientProvider. Please wrap your app or component tree with <UnblindClientProvider>.");return e}function de(){let e=(0,G.useQueryClient)();return(0,D.useCallback)(async()=>{await e.refetchQueries({queryKey:["unblind","timeseries"]})},[e])}var K=require("react");var N=require("react/jsx-runtime");function te(){return(0,N.jsx)("div",{className:"ub-default",children:(0,N.jsxs)("div",{className:"ub-empty-content",children:[(0,N.jsx)("div",{className:"ub-empty-icon-wrapper",children:(0,N.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"ub-icon",children:(0,N.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})})}),(0,N.jsx)("p",{className:"ub-empty-text","data-text":"No data available for this time range"})]})})}function re(){return(0,N.jsx)("div",{className:"ub-error"})}function oe(){return(0,N.jsx)("div",{className:"ub-default","data-text":"Loading"})}var Pe=require("react/jsx-runtime"),he=(0,K.createContext)(void 0);function ie({children:e,timeRange:t,startTime:r,endTime:i,interval:o,attributes:s,groupBy:n,operator:a,appearance:l,tooltip:c}){let m=(0,K.useContext)(he),h=l?.components?.Loading,d=l?.components?.Error,u=l?.components?.Tooltip,f=c?.layout,b=c?.format,p=c?.hideAttributes,g=c?.hideAttributeKey,v=c?.hideMetric,T=(0,K.useMemo)(()=>({components:{...h&&{Loading:h},...d&&{Error:d},...u&&{Tooltip:u}},tooltip:{layout:f,format:b,hideAttributes:p,hideAttributeKey:g,hideMetric:v}}),[h,d,u,f,b,p,g,v]),x=(0,K.useMemo)(()=>({timeRange:t??m?.timeRange,startTime:r??m?.startTime,endTime:i??m?.endTime,interval:o??m?.interval,attributes:s??m?.attributes,groupBy:n??m?.groupBy,operator:a??m?.operator,appearance:T??m?.appearance}),[t,r,i,o,s,n,a,T,m]);return(0,Pe.jsx)(he.Provider,{value:x,children:e})}var dt="6h";function H(){let e=(0,K.useContext)(he);return{timeRange:e?.timeRange||dt,startTime:e?.startTime,endTime:e?.endTime,interval:e?.interval,attributes:e?.attributes,groupBy:e?.groupBy,operator:e?.operator,colors:e?.colors,sortByValues:e?.sortByValues,fill:e?.fill,tooltip:e?.tooltip,appearance:{components:{Loading:e?.appearance?.components?.Loading??oe,Error:e?.appearance?.components?.Error??re,Empty:e?.appearance?.components?.Empty??te,Tooltip:e?.appearance?.components?.Tooltip}}}}var fe=require("react/jsx-runtime");function ke({children:e,queryClient:t,apiBaseUrl:r,fetchImpl:i,timeRange:o,startTime:s,endTime:n,interval:a,attributes:l,groupBy:c,operator:m,appearance:h,tooltip:d,colors:u,sortByValues:f}){return(0,fe.jsx)(Ce,{queryClient:t,apiBaseUrl:r,fetchImpl:i,children:(0,fe.jsx)(ie,{timeRange:o,startTime:s,endTime:n,interval:a,attributes:l,groupBy:c,operator:m,appearance:h,tooltip:d,colors:u,sortByValues:f,children:e})})}var we=require("@tanstack/react-query");function Ae(){let{apiBaseUrl:e,fetchImpl:t=fetch}=O(),r=(0,we.useQuery)({queryKey:["unblind","metrics"],queryFn:async()=>{let i=await t(`${e}/metrics`,{headers:{"Content-Type":"application/json"}});if(!i.ok)throw new Error("Error loading metrics metadata");if(i.status===200){let{data:o}=await i.json();return o}else throw new Error("Unexpected status code")}});return{metrics:r.data,isLoading:r.isLoading,hasError:r.isError,refetch:r.refetch}}var Re=require("@tanstack/react-query"),Q=require("react");var Se=ee(require("ms"));function ht(e){let t=Math.floor(Date.now()/1e3);return[t-Math.floor((0,Se.default)(e)/1e3),t]}function $(e,t,r){let i,o;if(typeof t=="number"&&typeof r=="number")i=t,o=r;else if(e){let[s,n]=ht(e);i=s,o=n}else throw new Error("Either timeRange or both startTime and endTime must be provided");return[i,o]}function ne({queries:e,timeRange:t,startTime:r,endTime:i,interval:o}){let{apiBaseUrl:s,fetchImpl:n=fetch}=O(),a=(0,Q.useMemo)(()=>e.map(T=>T.metrics.join(",")).join(","),[e]),l=(0,Q.useMemo)(()=>e.map(T=>{let x=T.attributes;if(!x)return"";let k=Object.keys(x);return k.length===0?"":k.map(C=>C+":"+x[C]?.join(",")).join(",")}).join(","),[e]),c=(0,Q.useMemo)(()=>e.map(T=>T.operator),[e]),m=(0,Q.useMemo)(()=>e.map(T=>T.groupBy).join(", "),[e]),d=(0,Re.useQuery)({queryKey:["unblind","timeseries",a,l,r,i,t,o,c,m],queryFn:async()=>{if(!a)throw new Error("Missing required parameters");if(a.length===0)throw new Error("No series provided");let[T,x]=$(t,r,i),k={queries:e,startTime:T,endTime:x,interval:o},C=await n(`${s}/tenants/timeseries`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)});if(!C.ok)throw new Error("Error fetching metric");let{series:S,times:M,metadata:w}=await C.json();if(!S)throw console.error("Series not found"),new Error("Series not found");return{series:S,times:M,metadata:w}},enabled:!!a&&(typeof r=="number"&&typeof i=="number"||!!t)}),{metadata:u,series:f,times:b}=(0,Q.useMemo)(()=>d.data?{series:d.data.series,times:d.data.times,metadata:d.data.metadata}:{series:[],times:[],metadata:{}},[d]),p=d.isLoading,g=d.isFetching,v=d.isError;return{data:{series:f,times:b,metadata:u},isLoading:p,isFetching:g,hasError:v,refetch:d.refetch}}var Ue=require("@tanstack/react-query"),Le=require("react");function Me({timeRange:e,startTime:t,endTime:r}){let{apiBaseUrl:i,fetchImpl:o=fetch}=O(),n=(0,Ue.useQuery)({queryKey:["unblind","usage",e,t,r],queryFn:async()=>{let[m,h]=$(e,t,r),d=`${i}/tenants/usage`,u=await o(d,{headers:{"Content-Type":"application/json"},body:JSON.stringify({startTime:m,endTime:h})});if(!u.ok)throw new Error("Error fetching usage");let{data:f}=await u.json();if(!f)throw new Error("usage not found");return f},enabled:typeof t=="number"&&typeof r=="number"||!!e}),a=(0,Le.useMemo)(()=>n.data?n.data||[]:[],[n]),l=n.isLoading||n.isRefetching,c=n.isError;return{usage:a,isLoading:l,hasError:c,refetch:n.refetch}}var Ee=require("@tanstack/react-query"),Ne=require("react");function Ie({timeRange:e,filters:t,startTime:r,endTime:i}){let{apiBaseUrl:o,fetchImpl:s=fetch}=O(),n=typeof r=="number"&&typeof i=="number"||!!e,a=(0,Ee.useInfiniteQuery)({queryKey:["unblind","logs",e,t.map(c=>c.name+":"+c.value).sort().join(",")],queryFn:async({pageParam:c})=>{let m=t.reduce((C,S)=>(C[S.name]||(C[S.name]=[]),C[S.name].push(S.value),C),{}),{body:h=[],severity:d=[],"service.name":u=[],"trace.id":f=[],"span.id":b=[],...p}=m,[g,v]=$(e,r,i),T=await s(`${o}/tenants/logs`,{method:"POST",body:JSON.stringify({filter:{attributes:p,body:h,severity:d,traceId:f,spanId:b,service:u},startTime:g,endTime:v,pagination:{page:c}}),headers:{"Content-Type":"application/json"}});if(!T.ok)throw new Error("Error fetching logs");let{data:x,next_page:k}=await T.json();if(!x)throw new Error("logs not found");return{data:x,next_page:k}},enabled:n,initialPageParam:void 0,getNextPageParam:c=>c.next_page});return{logs:(0,Ne.useMemo)(()=>a.data?a.data.pages.flatMap(c=>c.data||[]):[],[a.data]),isLoading:a.isLoading,hasError:a.isError,hasNextPage:a.hasNextPage??!1,fetchNextPage:a.fetchNextPage,isFetchingNextPage:a.isFetchingNextPage,refetch:a.refetch}}var it=require("react");var ue=require("react"),rt=ee(require("uplot"));var ae=e=>"value"in e,Y=e=>"from"in e&&"to"in e;var J=ee(require("uplot")),Qe=require("@unblind/units");var z=require("@unblind/units");var A={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,month:24192e5,year:31536e6},W={second:[1,2,5,10,15,30],minute:[1,2,5,10,15,30],hour:[1,2,3,4,6,8,12],day:[1,2,3,7,14],month:[1,2,3,6],year:[1,2,5,10,20,50,100]};function ft(e,t,r,i){if(t>7*A.day){let o=z.systemDateFormats.interval.year,s=Math.round(A.year/A.day)*A.day;return Math.round(t/A.day)*A.day===s?o=z.systemDateFormats.interval.year:t<=A.year?o=z.systemDateFormats.interval.month:o=z.systemDateFormats.interval.day,e.map(a=>(0,z.dateTimeFormat)(a,{format:o,timeZone:i}))}return e.map(o=>{let s=new Date(o),n=t<A.minute,a=t<A.second,l=s.toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit",hour12:!1,timeZone:i});return(l==="00:00"||l==="24:00")&&!n&&!a?s.toLocaleDateString(void 0,{day:"2-digit",month:"short",timeZone:i}):s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:n?"2-digit":void 0,fractionalSecondDigits:a?3:void 0,hour12:!1,timeZone:i})})}function Oe(e){let t=[{size:A.second/1e3,increments:W.second},{size:A.minute/1e3,increments:W.minute},{size:A.hour/1e3,increments:W.hour},{size:A.day/1e3,increments:W.day},{size:A.month/1e3,increments:W.month},{size:A.year/1e3,increments:W.year}];for(let o of t)for(let s of o.increments){let n=o.size*s;if(n>=e)return{increment:n*1e3,multiplier:s}}let r=t[t.length-1],i=r.increments[r.increments.length-1];return{increment:r.size*i*1e3,multiplier:i}}function Ve(e,t,r){return[t,r]}function gt(e,t,r,i){let o=r-t,s=e.width,n=Math.floor(s/100),a=o/n,{increment:l,multiplier:c}=Oe(a),m=l/1e3,h=[];if(o<12*3600){let u=Math.ceil(t/m)*m;for(;u<=r;u+=m)h.push(u);return h}if(o<3*86400){if(l>=6*3600*1e3){let f=l/1e3/3600,b=new Date(t*1e3);if(i==="UTC"){let g=b.getUTCHours(),v=Math.floor(g/f)*f;b.setUTCHours(v,0,0,0)}else{let g=b.getHours(),v=Math.floor(g/f)*f;b.setHours(v,0,0,0)}let p=b.getTime()/1e3;for(p<t&&(p+=m);p<=r;)h.push(p),p+=m;return h}let u=Math.ceil(t/m)*m;for(;u<=r;u+=m)h.push(u);return h}if(l>=A.day){let u=new Date(t*1e3);i==="UTC"?(u.setUTCHours(0,0,0,0),u.getTime()/1e3<t&&u.setUTCDate(u.getUTCDate()+c)):(u.setHours(0,0,0,0),u.getTime()/1e3<t&&u.setDate(u.getDate()+c));let f=u.getTime()/1e3;for(;f<=r;)h.push(f),i==="UTC"?u.setUTCDate(u.getUTCDate()+c):u.setDate(u.getDate()+c),f=u.getTime()/1e3;return h}let d=Math.ceil(t/m)*m;for(;d<=r;d+=m)h.push(d);return h}function De(e,t,r){return t.length===0?[]:t.map((i,o)=>o===0||o===t.length-1?(0,z.dateTimeFormatTimeAgo)(i*1e3,{timeZone:r}):"")}function bt(e,t,r){let i=e.scales.x,o=((i?.max??0)-(i?.min??0))*1e3,s=Math.floor(e.width/100),n=o/1e3/s,{increment:a}=Oe(n),l=t.map(c=>c*1e3);return ft(l,a,o,r)}function ze(e,t,r=!1){let i=r?(n,a,l,c)=>Ve(n,l,c):(n,a,l,c)=>gt(n,l,c,t),o=r?(n,a)=>De(n,a,t):(n,a)=>bt(n,a,t),s=r?(n,a,l,c,m)=>{let d=document.createElement("canvas").getContext("2d");if(!d)return 0;d.font=_(e);let u=De(n,Ve(n,l,c),t),f=Math.max(d.measureText(u[0]||"").width,d.measureText(u[1]||"").width);return Math.ceil(f/2)+15}:void 0;return{font:_(e),labelFont:_(e),grid:{show:!1,width:.5},ticks:{width:.5},splits:i,values:o,size:20}}var je=ee(require("uplot"));var X=require("@floating-ui/dom"),Fe=require("react-dom/client"),yt=4,Tt=8,ge=class{overlay=null;reactRoot=null;renderedUplot=null;initialize(){this.overlay||(this.overlay=document.createElement("div"),this.overlay.id="unblind-tooltip-overlay",this.overlay.style.display="none",this.overlay.style.position="fixed",this.overlay.style.pointerEvents="none",this.overlay.style.zIndex="9999",document.body.appendChild(this.overlay),this.reactRoot=(0,Fe.createRoot)(this.overlay))}getOverlay(){return this.overlay}render(t,r){this.reactRoot?(this.reactRoot.render(r),this.renderedUplot=t):this.renderedUplot=null}show(){this.overlay&&(this.overlay.style.display="block")}hide(t){if(t!==this.renderedUplot){console.warn("Hide call plot");return}this.overlay&&(this.overlay.style.display="none"),this.render(null,null)}getRenderedUplot(){return this.renderedUplot}async positionTooltip(t){let r=this.getOverlay();if(r){let{x:i,y:o}=await(0,X.computePosition)({getBoundingClientRect:()=>({x:t.left,y:t.top,width:0,height:0,top:t.top,left:t.left,right:t.left,bottom:t.top})},r,{placement:"top-start",strategy:"fixed",middleware:[(0,X.offset)({mainAxis:yt,crossAxis:Tt}),(0,X.flip)()]});r.style.left=`${i}px`,r.style.top=`${o}px`}}},L=new ge;var be=require("@unblind/units"),ye=require("react");var y=require("react/jsx-runtime");function He(e){return e.metric.displayName||e.metric.name||(typeof e.serie.label=="string"?e.serie.label:e.serie.label?.textContent||"Unknown")}function Be(e){let t=e.attributes||{};if(t["service.name"])return String(t["service.name"]);let i=Object.keys(t)[0];return i?String(t[i]):"z-fallback"}function Ke(e){return[...e].sort((t,r)=>(Number(r.value)||0)-(Number(t.value)||0))}function qe(e){return[...e].sort((t,r)=>Be(t).localeCompare(Be(r)))}function vt(e){let t={};return e.forEach(r=>{let i=He(r);t[i]||(t[i]=[]),t[i].push(r)}),t}function xt(e,t,r,i="original"){if(r==="flat")return[{label:"",items:t?Ke(e):qe(e)}];let o=vt(e);return Object.keys(o).sort((n,a)=>n.localeCompare(a)).map(n=>{let a=o[n];if(!a)return{label:se(n,i),items:[]};let l=t?Ke(a):qe(a);return{label:se(n,i),items:l}})}function se(e,t,r){switch(t){case"suffix":{let i=e.split(/[._-]/),o=i[i.length-1]||"";return r?o:o.charAt(0).toUpperCase()+o.slice(1).toLowerCase()}case"title":return e.split(/[._-]/).map(i=>r?i:i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()).join(" ");default:return e}}function Ct(e,t){if(t&&t!=="auto")return t;let r=e.some(o=>o.attributes&&Object.keys(o.attributes).length>0),i=new Set(e.map(He));return r&&i.size>=1?"group-by-metric":"flat"}function Ge({hideAttributeKey:e,attribute:t,format:r,isLastAttribute:i}){let[o,s]=t;return(0,y.jsxs)("div",{className:"ub-tooltip-item-attribute-container",children:[(0,y.jsxs)("div",{className:e?"ub-tooltip-item-hidden-attribute-key":"ub-tooltip-item-attribute-with-key",children:[!e&&(0,y.jsxs)("span",{className:"ub-tooltip-item-attribute-key",children:[se(o,r),":"]}),(0,y.jsx)("span",{className:"ub-tooltip-item-attribute-value",children:s})]}),!i&&e&&(0,y.jsx)("span",{"data-text":", ",className:"ub-tooltip-item-attribute-divider"})]})}function Pt({item:e,hideMetric:t,hideAttributeKey:r,hideAttributes:i,format:o}){let n=Object.entries(e.attributes||{}),a=n.length>0&&!i;return i&&t&&console.warn("Invalid configuration. Attributes and metrics are hidden."),(0,y.jsxs)("div",{className:"ub-tooltip-item-row",children:[(0,y.jsxs)("div",{className:"ub-tooltip-item-left"+(t?" ub-tooltip-item-hidden-metric":""),children:[(0,y.jsxs)("div",{className:"ub-tooltip-item-heading",children:[(0,y.jsx)("span",{className:"ub-tooltip-item-dot",style:{backgroundColor:e.color}}),t?(0,y.jsx)("div",{className:"ub-tooltip-item-attributes",children:n.map((l,c)=>(0,y.jsx)(Ge,{hideAttributeKey:r,attribute:l,format:o,isLastAttribute:c>=n.length-1},"attr_"+l[0]))}):(0,y.jsx)("span",{className:a?"ub-tooltip-item-metric-name-label":"ub-tooltip-item-metric-name",children:se(e.metric.name,o)})]}),a&&!t&&(0,y.jsx)("div",{className:"ub-tooltip-item-attributes",children:n.map((l,c)=>(0,y.jsx)(Ge,{hideAttributeKey:r,attribute:l,format:o,isLastAttribute:c>=n.length-1},"attr_"+l[0]))})]}),(0,y.jsx)("div",{className:"ub-tooltip-item-value",children:e.formattedValue??(0,y.jsx)("span",{className:"ub-tooltip-item-value--empty",children:"\u2014"})})]})}function kt({className:e="ub-tooltip-divider",...t}){return(0,y.jsx)("hr",{role:"presentation",...t,className:e})}function wt({group:e,groupIdx:t,hideAttributeKey:r,hideMetric:i,hideAttributes:o,format:s,hideGroupLabel:n}){return(0,y.jsxs)("div",{className:"ub-tooltip-group",children:[!n&&(0,y.jsx)("div",{className:`ub-tooltip-group-header${t>0?" ub-tooltip-group-header--separator":""}`,children:e.label}),(0,y.jsx)("div",{className:"ub-tooltip-items",children:e.items.map((a,l)=>(0,y.jsx)(Pt,{item:a,format:s,hideAttributeKey:r,hideMetric:i,hideAttributes:o},`item-${t}-${l}`))})]},e.label)}function _e({timestamp:e,items:t,timeZone:r,spansMultipleDays:i,sortByValues:o,format:s="original",layout:n="flat",hideAttributeKey:a,hideMetric:l,hideAttributes:c}){let m=i?(0,be.dateTimeFormat)(e*1e3,{format:"MMM DD, HH:mm",timeZone:r}):(0,be.dateTimeFormat)(e*1e3,{format:"HH:mm",timeZone:r}),h=(0,ye.useMemo)(()=>Ct(t,n),[t,n]),d=h==="flat",f=typeof l=="boolean"?l:h==="group-by-metric",b=typeof a=="boolean"?a:!1,p=typeof c=="boolean"?c:!1,g=(0,ye.useMemo)(()=>xt(t,o,h,s),[t,o,h,s]);return(0,y.jsxs)("div",{className:"ub-tooltip",children:[(0,y.jsx)("div",{className:"ub-tooltip-datetime",children:m}),(0,y.jsx)(kt,{}),g.length>0?(0,y.jsx)("div",{className:"ub-tooltip-content",children:g.map((v,T)=>(0,y.jsx)(wt,{group:v,groupIdx:T,hideAttributeKey:b,hideMetric:f,hideAttributes:p,hideGroupLabel:d,format:s},v.label))}):(0,y.jsx)("div",{className:"ub-tooltip-no-data",children:"No data available"})]})}var Te=require("react/jsx-runtime");function At(e,t){if(!e||e.length===0)return!1;let r=e[0],i=e[e.length-1];if(r==null||i==null)return!1;let o=new Date(r*1e3),s=new Date(i*1e3),n=a=>t==="UTC"?`${a.getUTCFullYear()}-${a.getUTCMonth()}-${a.getUTCDate()}`:a.toLocaleDateString(void 0,{timeZone:t});return n(o)!==n(s)}function St(e,t){let r=!1;for(let o=1;o<e.series.length;o++)if(e.data[o]?.[t]!=null){r=!0;break}if(r)return t;let i=e.data[0].length;for(let o=1;t+o<i||t-o>=0;o++){let s=t-o,n=t+o;if(s>=0){for(let a=1;a<e.series.length;a++)if(e.data[a]?.[s]!=null)return s}if(n<i){for(let a=1;a<e.series.length;a++)if(e.data[a]?.[n]!=null)return n}}return t}function Rt(e,t,r,i,o,s){let n=!1,a=[];for(let l=1;l<e.series.length;l++){let c=e.data[l]?.[t]??null;if(i&&c!=null&&l>1){let p=e.data[l-1]?.[t]??0;c=c-p}let m=e.series[l],h=s?.[l-1];if(!h){console.warn("Original serie not found");continue}let d=o[h.metric];if(!d){console.warn("Metric metadata not found");continue}let u=m?.stroke,f=typeof u=="function"?u(je.default,l):u??"#ffffff00",b=c==null?void 0:r?r(c):String(c);h?.attributes&&Object.keys(h?.attributes).length>0&&(n=!0),a.push({metric:d,color:f,value:c===null?void 0:c,formattedValue:b,attributes:h?.attributes,serie:m})}return{items:a,hasAttributes:n}}function $e(e,t,r,i,o,s,n,a,l,c,m,h){let d,u,f,b=!1;function p(){let g=d.getBoundingClientRect();u=g.left,f=g.top}return{hooks:{init:g=>{L.initialize(),d=g.over,window.addEventListener("scroll",p,!0),window.addEventListener("resize",p),d.onmouseenter=()=>{b=!0,L.show()},d.onmouseleave=()=>{b=!1,L.getRenderedUplot()===g&&L.hide(g)},p()},setSize:()=>{p()},setCursor:g=>{let{left:v,top:T,idx:x}=g.cursor;if(!b||x==null){L.getRenderedUplot()===g&&L.hide(g);return}let C=g.data[0],S=At(C,o),M=St(g,x),w=g.data[0][M];if(w===void 0)return;let{items:E}=Rt(g,M,e,t,r,n);L.show();let I=s,F=I?(0,Te.jsx)(I,{timestamp:w,items:E,timeZone:o}):(0,Te.jsx)(_e,{timestamp:w,items:E,timeZone:o,spansMultipleDays:S,stacked:t,sortByValues:i,layout:a,format:l,hideAttributeKey:c,hideAttributes:m,hideMetric:h});L.render(g,F),L.positionTooltip({left:(v||0)+u,top:(T||0)+f})},destroy(g){window.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p),d&&(d.onmouseenter=null,d.onmouseleave=null),L.getRenderedUplot()===g&&L.hide(g)}}}}var le=["oklch(0.70 0.24 293)","oklch(0.85 0.18 95)","oklch(0.65 0.25 255)","oklch(0.72 0.26 27)","oklch(0.70 0.22 150)","oklch(0.78 0.18 50)","oklch(0.72 0.18 215)","oklch(0.70 0.27 301)","oklch(0.75 0.20 90)","oklch(0.68 0.23 277)","oklch(0.70 0.18 193)","oklch(0.68 0.25 4)"],_=e=>`${getComputedStyle(document.documentElement).getPropertyValue("--ub-chart-font-size").trim()} ${e}`,We=(e,t)=>{let r=e;return t&&t.unit&&t.unit.code&&t.unit.code!=="1"&&(!r&&t.unit?r=t.unit.code:r&&t.unit.code!==r&&(r=void 0)),r};function Ut(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Array.isArray(e.fill)&&Array.isArray(e.border)}function Lt(e){return Array.isArray(e)}var Xe=(e,t,r,i,o,s)=>{if(r)return Lt(r)?r[t]:Ut(r)?s?r.fill[t]:r.border[t]:r(e,t,i,s);let n=s?`--ub-chart-serie-color-fill-${t+1}`:`--ub-chart-serie-color-${t+1}`,a=o.getPropertyValue(n).trim();return a||(s&&(i==="step"||i==="line"||i==="spline")?`oklch(from ${le[t%le.length]} l c h / 0.4)`:le[t%le.length])},Mt=e=>{let t=J.default.paths.bars({size:[.6,100],radius:0,gap:0}),r=J.default.paths.linear({alignGaps:0}),i=J.default.paths.spline({alignGaps:1}),o=J.default.paths.stepped({alignGaps:1});switch(e){case"line":return r;case"bar":return t;case"area":return r;case"step":return o;case"spline":return i;default:return r}},Et=(e,t,r,i,o)=>Xe(e,t,r,i,o,!0),Nt=(e,t)=>{switch(e){case"bar":return 1;case"line":return t?1.5:2;case"spline":return t?1.5:2;case"area":return 1;case"step":return 1.5;default:return 1}},It=(e,t,r)=>{if(t<0||r<0)return[t,r];let i=e.posToVal(t,"x"),o=e.data[0];if(!o||o.length===0)return[t,r];let s=0,n=0,a=o.length-1;for(;a-n>1;){let u=Math.floor((n+a)/2),f=o[u];f!=null&&f<i?n=u:a=u}let l=o[n],c=o[a];l!=null&&c!=null?s=Math.abs(l-i)<Math.abs(c-i)?n:a:l!=null?s=n:c!=null&&(s=a);let m=s;for(let u=s;u>=0;u--){let f=!1;for(let b=1;b<e.data.length;b++){let p=e.data[b];if(p&&p[u]!=null){f=!0;break}}if(f){m=u;break}}let h=o[m];return h==null?[t,r]:[e.valToPos(h,"x"),r]},Vt=(e,t)=>{let r=t.getPropertyValue("--ub-chart-font-color").trim(),i=t.getPropertyValue("--ub-chart-grid-color").trim(),o=e.axes?.[0],s=e.axes?.[1];return o&&(o.stroke=r,o.grid?o.grid.stroke=i:o.grid={stroke:i}),s&&(s.stroke=r,s.grid?s.grid.stroke=i:s.grid={stroke:i}),e},Dt=(e,t)=>e.getPropertyValue(`--ub-chart-threshold-${t}`).trim()||e.getPropertyValue("--ub-chart-threshold-default").trim(),Ot=(e,t)=>e.getPropertyValue(`--ub-chart-threshold-${t}-fill`).trim()||e.getPropertyValue("--ub-chart-threshold-default-fill").trim(),zt=e=>{switch(e){case"bold":return 2;case"line":return 1;case"dashed":return 1;default:return 1}},Ft=e=>e==="line"?void 0:[5,5],Bt=(e,t)=>{if(t){let r=[];return t.forEach(i=>{let o={label:i.label,stroke:Dt(e,i.level),width:zt(),dash:Ft(i.type),points:{show:!1,size:0},spanGaps:!0,show:!0,auto:!1};ae(i)||r.push(o),r.push(o)}),r}else return[]},Kt=(e,t,r,i)=>{if(!i||!i.some(s=>Y(s)))return t.bands;let o=i.map((s,n)=>Y(s)?{series:[e.length+n*2+1,e.length+n*2+2],fill:Ot(r,s.level),dir:1}:null).filter(s=>s!==null);return[...t.bands,...o]},qt=(e,t,r,i,o,s,n)=>{let a=Nt(t,i);return[{},...e.map((l,c)=>({label:l.metric,stroke:Xe(l,c,r,t,s),width:a,points:{show:!1},spanGaps:!0,paths:Mt(t),fill:i||o?Et(l,c,r,t,s):void 0})),...Bt(s,n)]},Gt=e=>{if(typeof e=="string"){let t=String(e).toLowerCase().trim();if(t==="by")return"bytes";if(t.startsWith("{")&&t.endsWith("}"))return"short"}return e},Ye=(e,t,r,i,o,s,n,a,l,c,m,h,d,u,f,b,p,g,v,T,x)=>{let k=window.getComputedStyle(e),C=k.fontFamily,S=e?.clientWidth??1050,M=e?.clientHeight??250,w=Gt(i),E=(0,Qe.getValueFormat)(w==="1"?null:w),I=R=>{let B=E(R,Number.isInteger(R)?0:2);return B.text+(B.suffix?.trim()||"")},F={width:S,height:M,scales:{y:{range:Je(i,T,x)}},plugins:[$e(I,n,t,c,m,h,o,f,u,b,p,g)],padding:d?[10,15,10,15]:[8,15,8,15],cursor:{y:!1,sync:{key:"_"},drag:{setScale:!0,x:!0,y:!1},move:It},series:qt(o,s,a,l,n,k,v),bands:Kt(o,r,k,v),axes:[ze(C,m,d),Ze(E,C)],legend:{show:!1}};return Vt(F,k)};var et=(e,t=4)=>{let r=e/t,i=Math.pow(10,Math.floor(Math.log10(r))),o=r/i,s;return o>5?s=10*i:o>2?s=5*i:o>1?s=2*i:s=i,Math.ceil(e/s)*s},P=(e,t)=>typeof e=="number"?e:t,Je=(e,t,r)=>(i,o,s)=>{if(o===0&&s===0)return[P(t,0),P(r,100)];let n=1,a=s*(1+n),l=o<0?o*(1+n):o*(1-n);if(e==="percent"||e==="percentunit")return s>100?o<0?[P(t,l),P(r,a)]:[P(t,0),P(r,a)]:o<0?[P(t,l),P(r,100)]:[P(t,0),P(r,100)];if(s<=.9999)return o<=0?[P(t,l),P(r,1)]:[P(t,0),P(r,1)];let c=et(a),m=et(Math.abs(l));return o<0?[P(r,-m),P(r,c)]:[P(t,0),P(r,c)]},Ht=(e,t,r,i)=>{let o=e.axes[r];if(i>1)return o?._size;let s=(o?.ticks?.size||0)+(o?.gap||0),n=(t??[]).reduce((a,l)=>l.length>a.length?l:a,"");return n!=""&&(e.ctx.font=o?.font?.[0]??e.ctx.font,s+=e.ctx.measureText(n).width/devicePixelRatio),Math.ceil(s)};function Ze(e,t){return{gap:0,font:_(t),labelFont:_(t),grid:{show:!0,width:.5},ticks:{width:.5},values:(r,i)=>i.map(o=>{let s=e(o);return s.text+(s.suffix?.trim()||"")}),size:Ht,space:60}}function tt(e,t){let r=[],i=e[0],o=i.length,s=Array(o).fill(0),n=[i];return e.forEach((a,l)=>{l!==0&&(t?n.push(a):n.push(a.map((c,m)=>s[m]=s[m]+(c||0))))}),e.forEach((a,l)=>{l===0||t||r.push({series:[e.findIndex((c,m)=>m>l),l]})}),{data:n,bands:r.filter(a=>a.series[1]>-1)}}var ot=require("react/jsx-runtime");function ce(e){let{times:t,series:r,metadata:i,type:o,className:s,timeZone:n,options:a,tooltip:l,colors:c,tooltipComponent:m,sortByValues:h=!1,unit:d,fill:u=!1,thresholds:f,min:b,max:p}=e,{layout:g,format:v,hideAttributeKey:T,hideAttributes:x,hideMetric:k}=l||{},C=(0,ue.useRef)(null),S=H(),M=c||S.colors;return(0,ue.useEffect)(()=>{if(!r||r.length===0){console.warn("No series provided");return}let w=[t],E=d;r.forEach(U=>{let j=i[U.metric];d||(E=We(E,j)),w.push(U.values)}),f&&f.forEach(U=>{ae(U)?w.push(new Array(t.length).fill(U.value)):Y(U)&&(w.push(new Array(t.length).fill(U.from)),w.push(new Array(t.length).fill(U.to)))});let I=o==="bar"||o==="area",F=tt(w,!I),R=C.current,B=null;if(R){let U=Ye(R,i,F,E,r,o,I,M,u,h,n,m,!1,v,g,T,x,k,f,b,p);B=new rt.default({...U,...a},F.data,R);let j=new ResizeObserver(()=>{B?.setSize({width:R.clientWidth,height:R.clientHeight})});return j.observe(R),()=>{B?.destroy(),j.disconnect()}}},[r,t,o,i,n,m,M,u,h,d,v,g,T,x,k,f,b,p]),(0,ot.jsx)("div",{ref:C,className:"ub-chart-container"+(s?` ${s}`:"")})}var q=require("react/jsx-runtime");function nt({metrics:e,operator:t,attributes:r,groupBy:i,interval:o,type:s="line",className:n,appearance:a,unit:l,thresholds:c,min:m,max:h,colors:d,tooltip:u,sortByValues:f,fill:b}){let p=H(),g=o??p.interval,v=r??p.attributes,T=i??p.groupBy,x=t??p.operator,k=d??p.colors,C=typeof f=="boolean"?f:p.sortByValues,S=typeof b=="boolean"?b:p.fill,M=a?.components?.Tooltip??p.appearance.components.Tooltip,w=(0,it.useMemo)(()=>({layout:u?.layout??p.tooltip?.layout,format:u?.format??p.tooltip?.format,hideAttributes:u?.hideAttributes??p.tooltip?.hideAttributes,hideAttributeKey:u?.hideAttributeKey??p.tooltip?.hideAttributeKey,hideMetric:u?.hideMetric??p.tooltip?.hideMetric}),[u?.layout,u?.format,u?.hideAttributes,u?.hideAttributeKey,u?.hideMetric,p.tooltip?.layout,p.tooltip?.format,p.tooltip?.hideAttributes,p.tooltip?.hideAttributeKey,p.tooltip?.hideMetric]),{isLoading:E,data:I,hasError:F}=ne({queries:(Array.isArray(e)?e:[e]).map(V=>({metrics:[V],operator:x,attributes:v,groupBy:T})),timeRange:p.timeRange,startTime:p.startTime,endTime:p.endTime,interval:g}),{series:R,times:B,metadata:U}=I,j=R.every(V=>V.isEmpty),pe=`ub-chart-container${n?` ${n}`:""}`;if(E){let V=a?.components?.Loading??p.appearance.components.Loading;return(0,q.jsx)("div",{className:pe,children:(0,q.jsx)(V,{})})}if(j){let V=a?.components?.Empty??p.appearance.components.Empty;return(0,q.jsx)("div",{className:pe,children:(0,q.jsx)(V,{})})}if(F){let V=a?.components?.Error??p.appearance.components.Error;return(0,q.jsx)("div",{className:pe,children:(0,q.jsx)(V,{})})}return(0,q.jsx)(ce,{times:B,series:R,metadata:U,type:s,className:n,tooltip:w,colors:k,sortByValues:C,unit:l,fill:S,tooltipComponent:M,thresholds:c,min:m,max:h})}0&&(module.exports={Chart,Empty,Error,Loading,Scope,Timeseries,UnblindProvider,useLogs,useMetrics,useRefresh,useScope,useTimeseries,useUsage});
1
+ "use strict";var ot=Object.create;var Z=Object.defineProperty;var it=Object.getOwnPropertyDescriptor;var nt=Object.getOwnPropertyNames;var at=Object.getPrototypeOf,st=Object.prototype.hasOwnProperty;var lt=(e,t)=>{for(var r in t)Z(e,r,{get:t[r],enumerable:!0})},ve=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of nt(t))!st.call(e,o)&&o!==r&&Z(e,o,{get:()=>t[o],enumerable:!(i=it(t,o))||i.enumerable});return e};var pe=(e,t,r)=>(r=e!=null?ot(at(e)):{},ve(t||!e||!e.__esModule?Z(r,"default",{value:e,enumerable:!0}):r,e)),ut=e=>ve(Z({},"__esModule",{value:!0}),e);var _t={};lt(_t,{Chart:()=>ue,Empty:()=>ee,Error:()=>te,Loading:()=>re,Scope:()=>oe,Timeseries:()=>rt,UnblindProvider:()=>Ae,useLogs:()=>Ie,useMetrics:()=>we,useRefresh:()=>de,useScope:()=>_,useTimeseries:()=>ie,useUsage:()=>Ee});module.exports=ut(_t);var H=require("@tanstack/react-query"),z=require("react"),me=require("react/jsx-runtime"),xe=(0,z.createContext)(void 0);function Ce({children:e,queryClient:t,queryClientConfig:r,apiBaseUrl:i="/api/unblind",fetchImpl:o}){let n=(0,z.useMemo)(()=>{if(t)return t;let a={refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchOnMount:!1},u={defaultOptions:{queries:a}};return r?new H.QueryClient({...r,defaultOptions:{...r.defaultOptions,queries:{...a,...r.defaultOptions?.queries}}}):new H.QueryClient(u)},[t,r]),s=(0,z.useMemo)(()=>({apiBaseUrl:i,fetchImpl:o}),[i,o]);return(0,me.jsx)(H.QueryClientProvider,{client:n,children:(0,me.jsx)(xe.Provider,{value:s,children:e})})}function O(){let e=(0,z.useContext)(xe);if(!e)throw new Error("useUnblindConfig must be used within an UnblindClientProvider. Please wrap your app or component tree with <UnblindClientProvider>.");return e}function de(){let e=(0,H.useQueryClient)();return(0,z.useCallback)(async()=>{await e.refetchQueries({queryKey:["unblind","timeseries"]})},[e])}var I=require("react");var N=require("react/jsx-runtime");function ee(){return(0,N.jsx)("div",{className:"ub-default",children:(0,N.jsxs)("div",{className:"ub-empty-content",children:[(0,N.jsx)("div",{className:"ub-empty-icon-wrapper",children:(0,N.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"ub-icon",children:(0,N.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})})}),(0,N.jsx)("p",{className:"ub-empty-text","data-text":"No data available for this time range"})]})})}function te(){return(0,N.jsx)("div",{className:"ub-error"})}function re(){return(0,N.jsx)("div",{className:"ub-default","data-text":"Loading"})}var Pe=require("react/jsx-runtime"),he=(0,I.createContext)(void 0);function oe({children:e,timeRange:t,startTime:r,endTime:i,interval:o,attributes:n,groupBy:s,operator:a,appearance:u,tooltip:c,colors:m,fill:f,sortByValues:d}){let l=(0,I.useContext)(he),h=u?.components?.Loading||l?.appearance?.components?.Loading,b=u?.components?.Error||l?.appearance?.components?.Error,p=u?.components?.Tooltip||l?.appearance?.components?.Tooltip,g=u?.components?.Empty||l?.appearance?.components?.Empty,v=c?.layout||l?.tooltip?.layout,T=c?.format||l?.tooltip?.format,C=typeof c?.hideAttributes=="boolean"?c?.hideAttributes:l?.tooltip?.hideAttributes,P=typeof c?.hideAttributeKey=="boolean"?c?.hideAttributeKey:l?.tooltip?.hideAttributeKey,x=typeof c?.hideMetric=="boolean"?c?.hideMetric:l?.tooltip?.hideMetric,A=(0,I.useMemo)(()=>({components:{...h&&{Loading:h},...b&&{Error:b},...p&&{Tooltip:p},...g&&{Empty:g}}}),[h,b,p,g]),R=(0,I.useMemo)(()=>({layout:v,format:T,hideAttributes:C,hideAttributeKey:P,hideMetric:x}),[v,T,C,P,x]),k=(0,I.useMemo)(()=>({timeRange:t??l?.timeRange,startTime:r??l?.startTime,endTime:i??l?.endTime,interval:o??l?.interval,attributes:n??l?.attributes,groupBy:s??l?.groupBy,operator:a??l?.operator,colors:m??l?.colors,sortByValues:typeof d=="boolean"?d:l?.sortByValues,fill:f??l?.fill,appearance:A,tooltip:R}),[t,r,i,o,n,s,a,m,d,f,A,R,l]);return(0,Pe.jsx)(he.Provider,{value:k,children:e})}var ct="6h";function _(){let e=(0,I.useContext)(he);return(0,I.useMemo)(()=>({timeRange:e?.timeRange||ct,...e,appearance:{components:{Loading:e?.appearance?.components?.Loading??re,Error:e?.appearance?.components?.Error??te,Empty:e?.appearance?.components?.Empty??ee,Tooltip:e?.appearance?.components?.Tooltip}}}),[e])}var fe=require("react/jsx-runtime");function Ae({children:e,queryClient:t,apiBaseUrl:r,fetchImpl:i,timeRange:o,startTime:n,endTime:s,interval:a,attributes:u,groupBy:c,operator:m,appearance:f,tooltip:d,colors:l,sortByValues:h}){return(0,fe.jsx)(Ce,{queryClient:t,apiBaseUrl:r,fetchImpl:i,children:(0,fe.jsx)(oe,{timeRange:o,startTime:n,endTime:s,interval:a,attributes:u,groupBy:c,operator:m,appearance:f,tooltip:d,colors:l,sortByValues:h,children:e})})}var ke=require("@tanstack/react-query");function we(){let{apiBaseUrl:e,fetchImpl:t=fetch}=O(),r=(0,ke.useQuery)({queryKey:["unblind","metrics"],queryFn:async()=>{let i=await t(`${e}/metrics`,{headers:{"Content-Type":"application/json"}});if(!i.ok)throw new Error("Error loading metrics metadata");if(i.status===200){let{data:o}=await i.json();return o}else throw new Error("Unexpected status code")}});return{metrics:r.data,isLoading:r.isLoading,hasError:r.isError,refetch:r.refetch}}var Re=require("@tanstack/react-query"),j=require("react");var Se=pe(require("ms"));function pt(e){let t=Math.floor(Date.now()/1e3);return[t-Math.floor((0,Se.default)(e)/1e3),t]}function $(e,t,r){let i,o;if(typeof t=="number"&&typeof r=="number")i=t,o=r;else if(e){let[n,s]=pt(e);i=n,o=s}else throw new Error("Either timeRange or both startTime and endTime must be provided");return[i,o]}function ie({queries:e,timeRange:t,startTime:r,endTime:i,interval:o}){let{apiBaseUrl:n,fetchImpl:s=fetch}=O(),a=(0,j.useMemo)(()=>e.map(T=>T.metrics.join(",")).join(","),[e]),u=(0,j.useMemo)(()=>e.map(T=>{let C=T.attributes;if(!C)return"";let P=Object.keys(C);return P.length===0?"":P.map(x=>x+":"+C[x]?.join(",")).join(",")}).join(","),[e]),c=(0,j.useMemo)(()=>e.map(T=>T.operator),[e]),m=(0,j.useMemo)(()=>e.map(T=>T.groupBy).join(", "),[e]),d=(0,Re.useQuery)({queryKey:["unblind","timeseries",a,u,r,i,t,o,c,m],queryFn:async()=>{if(!a)throw new Error("Missing required parameters");if(a.length===0)throw new Error("No series provided");let[T,C]=$(t,r,i),P={queries:e,startTime:T,endTime:C,interval:o},x=await s(`${n}/tenants/timeseries`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(P)});if(!x.ok)throw new Error("Error fetching metric");let{series:A,times:R,metadata:k}=await x.json();if(!A)throw console.error("Series not found"),new Error("Series not found");return{series:A,times:R,metadata:k}},enabled:!!a&&(typeof r=="number"&&typeof i=="number"||!!t)}),{metadata:l,series:h,times:b}=(0,j.useMemo)(()=>d.data?{series:d.data.series,times:d.data.times,metadata:d.data.metadata}:{series:[],times:[],metadata:{}},[d]),p=d.isLoading,g=d.isFetching,v=d.isError;return{data:{series:h,times:b,metadata:l},isLoading:p,isFetching:g,hasError:v,refetch:d.refetch}}var Le=require("@tanstack/react-query"),Ue=require("react");function Ee({timeRange:e,startTime:t,endTime:r}){let{apiBaseUrl:i,fetchImpl:o=fetch}=O(),s=(0,Le.useQuery)({queryKey:["unblind","usage",e,t,r],queryFn:async()=>{let[m,f]=$(e,t,r),d=`${i}/tenants/usage`,l=await o(d,{headers:{"Content-Type":"application/json"},body:JSON.stringify({startTime:m,endTime:f})});if(!l.ok)throw new Error("Error fetching usage");let{data:h}=await l.json();if(!h)throw new Error("usage not found");return h},enabled:typeof t=="number"&&typeof r=="number"||!!e}),a=(0,Ue.useMemo)(()=>s.data?s.data||[]:[],[s]),u=s.isLoading||s.isRefetching,c=s.isError;return{usage:a,isLoading:u,hasError:c,refetch:s.refetch}}var Me=require("@tanstack/react-query"),Ne=require("react");function Ie({timeRange:e,filters:t,startTime:r,endTime:i}){let{apiBaseUrl:o,fetchImpl:n=fetch}=O(),s=typeof r=="number"&&typeof i=="number"||!!e,a=(0,Me.useInfiniteQuery)({queryKey:["unblind","logs",e,t.map(c=>c.name+":"+c.value).sort().join(",")],queryFn:async({pageParam:c})=>{let m=t.reduce((x,A)=>(x[A.name]||(x[A.name]=[]),x[A.name].push(A.value),x),{}),{body:f=[],severity:d=[],"service.name":l=[],"trace.id":h=[],"span.id":b=[],...p}=m,[g,v]=$(e,r,i),T=await n(`${o}/tenants/logs`,{method:"POST",body:JSON.stringify({filter:{attributes:p,body:f,severity:d,traceId:h,spanId:b,service:l},startTime:g,endTime:v,pagination:{page:c}}),headers:{"Content-Type":"application/json"}});if(!T.ok)throw new Error("Error fetching logs");let{data:C,next_page:P}=await T.json();if(!C)throw new Error("logs not found");return{data:C,next_page:P}},enabled:s,initialPageParam:void 0,getNextPageParam:c=>c.next_page});return{logs:(0,Ne.useMemo)(()=>a.data?a.data.pages.flatMap(c=>c.data||[]):[],[a.data]),isLoading:a.isLoading,hasError:a.isError,hasNextPage:a.hasNextPage??!1,fetchNextPage:a.fetchNextPage,isFetchingNextPage:a.isFetchingNextPage,refetch:a.refetch}}var tt=require("react");var le=require("react"),Ze=pe(require("uplot"));var ne=e=>"value"in e,Y=e=>"from"in e&&"to"in e;var J=pe(require("uplot")),Ge=require("@unblind/units");var F=require("@unblind/units");var S={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,month:24192e5,year:31536e6},Q={second:[1,2,5,10,15,30],minute:[1,2,5,10,15,30],hour:[1,2,3,4,6,8,12],day:[1,2,3,7,14],month:[1,2,3,6],year:[1,2,5,10,20,50,100]};function mt(e,t,r,i){if(t>7*S.day){let o=F.systemDateFormats.interval.year,n=Math.round(S.year/S.day)*S.day;return Math.round(t/S.day)*S.day===n?o=F.systemDateFormats.interval.year:t<=S.year?o=F.systemDateFormats.interval.month:o=F.systemDateFormats.interval.day,e.map(a=>(0,F.dateTimeFormat)(a,{format:o,timeZone:i}))}return e.map(o=>{let n=new Date(o),s=t<S.minute,a=t<S.second,u=n.toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit",hour12:!1,timeZone:i});return(u==="00:00"||u==="24:00")&&!s&&!a?n.toLocaleDateString(void 0,{day:"2-digit",month:"short",timeZone:i}):n.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:s?"2-digit":void 0,fractionalSecondDigits:a?3:void 0,hour12:!1,timeZone:i})})}function De(e){let t=[{size:S.second/1e3,increments:Q.second},{size:S.minute/1e3,increments:Q.minute},{size:S.hour/1e3,increments:Q.hour},{size:S.day/1e3,increments:Q.day},{size:S.month/1e3,increments:Q.month},{size:S.year/1e3,increments:Q.year}];for(let o of t)for(let n of o.increments){let s=o.size*n;if(s>=e)return{increment:s*1e3,multiplier:n}}let r=t[t.length-1],i=r.increments[r.increments.length-1];return{increment:r.size*i*1e3,multiplier:i}}function dt(e,t,r){return[t,r]}function ht(e,t,r,i){let o=r-t,n=e.width,s=Math.floor(n/100),a=o/s,{increment:u,multiplier:c}=De(a),m=u/1e3,f=[];if(o<12*3600){let l=Math.ceil(t/m)*m;for(;l<=r;l+=m)f.push(l);return f}if(o<3*86400){if(u>=6*3600*1e3){let h=u/1e3/3600,b=new Date(t*1e3);if(i==="UTC"){let g=b.getUTCHours(),v=Math.floor(g/h)*h;b.setUTCHours(v,0,0,0)}else{let g=b.getHours(),v=Math.floor(g/h)*h;b.setHours(v,0,0,0)}let p=b.getTime()/1e3;for(p<t&&(p+=m);p<=r;)f.push(p),p+=m;return f}let l=Math.ceil(t/m)*m;for(;l<=r;l+=m)f.push(l);return f}if(u>=S.day){let l=new Date(t*1e3);i==="UTC"?(l.setUTCHours(0,0,0,0),l.getTime()/1e3<t&&l.setUTCDate(l.getUTCDate()+c)):(l.setHours(0,0,0,0),l.getTime()/1e3<t&&l.setDate(l.getDate()+c));let h=l.getTime()/1e3;for(;h<=r;)f.push(h),i==="UTC"?l.setUTCDate(l.getUTCDate()+c):l.setDate(l.getDate()+c),h=l.getTime()/1e3;return f}let d=Math.ceil(t/m)*m;for(;d<=r;d+=m)f.push(d);return f}function ft(e,t,r){return t.length===0?[]:t.map((i,o)=>o===0||o===t.length-1?(0,F.dateTimeFormatTimeAgo)(i*1e3,{timeZone:r}):"")}function gt(e,t,r){let i=e.scales.x,o=((i?.max??0)-(i?.min??0))*1e3,n=Math.floor(e.width/100),s=o/1e3/n,{increment:a}=De(s),u=t.map(c=>c*1e3);return mt(u,a,o,r)}function Ve(e,t,r=!1){let i=r?(n,s,a,u)=>dt(n,a,u):(n,s,a,u)=>ht(n,a,u,t),o=r?(n,s)=>ft(n,s,t):(n,s)=>gt(n,s,t);return{font:W(e),labelFont:W(e),grid:{show:!1,width:.5},ticks:{width:.5},splits:i,values:o,size:20}}var X=require("@floating-ui/dom"),ze=require("react-dom/client"),bt=4,yt=8,ge=class{overlay=null;reactRoot=null;renderedUplot=null;initialize(){this.overlay||(this.overlay=document.createElement("div"),this.overlay.id="unblind-tooltip-overlay",this.overlay.style.display="none",this.overlay.style.position="fixed",this.overlay.style.pointerEvents="none",this.overlay.style.zIndex="9999",document.body.appendChild(this.overlay),this.reactRoot=(0,ze.createRoot)(this.overlay))}getOverlay(){return this.overlay}render(t,r){this.reactRoot?(this.reactRoot.render(r),this.renderedUplot=t):this.renderedUplot=null}show(){this.overlay&&(this.overlay.style.display="block")}hide(t){if(t!==this.renderedUplot){console.warn("Hide call plot");return}this.overlay&&(this.overlay.style.display="none"),this.render(null,null)}getRenderedUplot(){return this.renderedUplot}async positionTooltip(t){let r=this.getOverlay();if(r){let{x:i,y:o}=await(0,X.computePosition)({getBoundingClientRect:()=>({x:t.left,y:t.top,width:0,height:0,top:t.top,left:t.left,right:t.left,bottom:t.top})},r,{placement:"top-start",strategy:"fixed",middleware:[(0,X.offset)({mainAxis:bt,crossAxis:yt}),(0,X.flip)()]});r.style.left=`${i}px`,r.style.top=`${o}px`}}},E=new ge;var be=require("@unblind/units"),ye=require("react");var y=require("react/jsx-runtime");function qe(e){return e.metric.displayName||e.metric.name||(typeof e.serie.label=="string"?e.serie.label:e.serie.label?.textContent||"Unknown")}function Oe(e){let t=e.attributes||{};if(t["service.name"])return String(t["service.name"]);let i=Object.keys(t)[0];return i?String(t[i]):"z-fallback"}function Fe(e){return[...e].sort((t,r)=>(Number(r.value)||0)-(Number(t.value)||0))}function Be(e){return[...e].sort((t,r)=>Oe(t).localeCompare(Oe(r)))}function Tt(e){let t={};return e.forEach(r=>{let i=qe(r);t[i]||(t[i]=[]),t[i].push(r)}),t}function vt(e,t,r,i="original"){if(r==="flat")return[{label:"",items:t?Fe(e):Be(e)}];let o=Tt(e);return Object.keys(o).sort((s,a)=>s.localeCompare(a)).map(s=>{let a=o[s];if(!a)return{label:ae(s,i),items:[]};let u=t?Fe(a):Be(a);return{label:ae(s,i),items:u}})}function ae(e,t,r){switch(t){case"suffix":{let i=e.split(/[._-]/),o=i[i.length-1]||"";return r?o:o.charAt(0).toUpperCase()+o.slice(1).toLowerCase()}case"title":return e.split(/[._-]/).map(i=>r?i:i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()).join(" ");default:return e}}function xt(e,t){if(t&&t!=="auto")return t;let r=e.some(o=>o.attributes&&Object.keys(o.attributes).length>0),i=new Set(e.map(qe));return r&&i.size>=1?"group-by-metric":"flat"}function Ke({hideAttributeKey:e,attribute:t,format:r,isLastAttribute:i}){let[o,n]=t;return(0,y.jsxs)("div",{className:"ub-tooltip-item-attribute-container",children:[(0,y.jsxs)("div",{className:e?"ub-tooltip-item-hidden-attribute-key":"ub-tooltip-item-attribute-with-key",children:[!e&&(0,y.jsxs)("span",{className:"ub-tooltip-item-attribute-key",children:[ae(o,r),":"]}),(0,y.jsx)("span",{className:"ub-tooltip-item-attribute-value",children:n})]}),!i&&e&&(0,y.jsx)("span",{"data-text":", ",className:"ub-tooltip-item-attribute-divider"})]})}function Ct({item:e,hideMetric:t,hideAttributeKey:r,hideAttributes:i,format:o}){let s=Object.entries(e.attributes||{}),a=s.length>0&&!i;return i&&t&&console.warn("Invalid configuration. Attributes and metrics are hidden."),(0,y.jsxs)("div",{className:"ub-tooltip-item-row",children:[(0,y.jsxs)("div",{className:"ub-tooltip-item-left"+(t?" ub-tooltip-item-hidden-metric":""),children:[(0,y.jsxs)("div",{className:"ub-tooltip-item-heading",children:[(0,y.jsx)("span",{className:"ub-tooltip-item-dot",style:{backgroundColor:e.color}}),t?(0,y.jsx)("div",{className:"ub-tooltip-item-attributes",children:s.map((u,c)=>(0,y.jsx)(Ke,{hideAttributeKey:r,attribute:u,format:o,isLastAttribute:c>=s.length-1},"attr_"+u[0]))}):(0,y.jsx)("span",{className:a?"ub-tooltip-item-metric-name-label":"ub-tooltip-item-metric-name",children:ae(e.metric.name,o)})]}),a&&!t&&(0,y.jsx)("div",{className:"ub-tooltip-item-attributes",children:s.map((u,c)=>(0,y.jsx)(Ke,{hideAttributeKey:r,attribute:u,format:o,isLastAttribute:c>=s.length-1},"attr_"+u[0]))})]}),(0,y.jsx)("div",{className:"ub-tooltip-item-value",children:e.formattedValue??(0,y.jsx)("span",{className:"ub-tooltip-item-value--empty",children:"\u2014"})})]})}function Pt({className:e="ub-tooltip-divider",...t}){return(0,y.jsx)("hr",{role:"presentation",...t,className:e})}function At({group:e,groupIdx:t,hideAttributeKey:r,hideMetric:i,hideAttributes:o,format:n,hideGroupLabel:s}){return(0,y.jsxs)("div",{className:"ub-tooltip-group",children:[!s&&(0,y.jsx)("div",{className:`ub-tooltip-group-header${t>0?" ub-tooltip-group-header--separator":""}`,children:e.label}),(0,y.jsx)("div",{className:"ub-tooltip-items",children:e.items.map((a,u)=>(0,y.jsx)(Ct,{item:a,format:n,hideAttributeKey:r,hideMetric:i,hideAttributes:o},`item-${t}-${u}`))})]},e.label)}function He({timestamp:e,items:t,timeZone:r,spansMultipleDays:i,sortByValues:o,format:n="original",layout:s="flat",hideAttributeKey:a,hideMetric:u,hideAttributes:c}){let m=i?(0,be.dateTimeFormat)(e*1e3,{format:"MMM DD, HH:mm",timeZone:r}):(0,be.dateTimeFormat)(e*1e3,{format:"HH:mm",timeZone:r}),f=(0,ye.useMemo)(()=>xt(t,s),[t,s]),d=f==="flat",h=typeof u=="boolean"?u:f==="group-by-metric",b=typeof a=="boolean"?a:!1,p=typeof c=="boolean"?c:!1,g=(0,ye.useMemo)(()=>vt(t,o,f,n),[t,o,f,n]);return(0,y.jsxs)("div",{className:"ub-tooltip",children:[(0,y.jsx)("div",{className:"ub-tooltip-datetime",children:m}),(0,y.jsx)(Pt,{}),g.length>0?(0,y.jsx)("div",{className:"ub-tooltip-content",children:g.map((v,T)=>(0,y.jsx)(At,{group:v,groupIdx:T,hideAttributeKey:b,hideMetric:h,hideAttributes:p,hideGroupLabel:d,format:n},v.label))}):(0,y.jsx)("div",{className:"ub-tooltip-no-data",children:"No data available"})]})}var Te=require("react/jsx-runtime");function kt(e,t){if(!e||e.length===0)return!1;let r=e[0],i=e[e.length-1];if(r==null||i==null)return!1;let o=new Date(r*1e3),n=new Date(i*1e3),s=a=>t==="UTC"?`${a.getUTCFullYear()}-${a.getUTCMonth()}-${a.getUTCDate()}`:a.toLocaleDateString(void 0,{timeZone:t});return s(o)!==s(n)}function wt(e,t){let r=!1;for(let o=1;o<e.series.length;o++)if(e.data[o]?.[t]!=null){r=!0;break}if(r)return t;let i=e.data[0].length;for(let o=1;t+o<i||t-o>=0;o++){let n=t-o,s=t+o;if(n>=0){for(let a=1;a<e.series.length;a++)if(e.data[a]?.[n]!=null)return n}if(s<i){for(let a=1;a<e.series.length;a++)if(e.data[a]?.[s]!=null)return s}}return t}function St(e,t,r,i,o,n){let s=!1,a=[];for(let u=1;u<e.series.length;u++){let c=e.data[u]?.[t]??null;if(i&&c!=null&&u>1){let p=e.data[u-1]?.[t]??0;c=c-p}let m=e.series[u],f=n?.[u-1];if(!f){console.warn("Original serie not found");continue}let d=o[f.metric];if(!d){console.warn("Metric metadata not found");continue}let l=m?.stroke,h=typeof l=="function"?l(e,u):l??"#ffffff00",b=c==null?void 0:r?r(c):String(c);f?.attributes&&Object.keys(f?.attributes).length>0&&(s=!0),a.push({metric:d,color:h,value:c===null?void 0:c,formattedValue:b,attributes:f?.attributes,serie:m})}return{items:a,hasAttributes:s}}function _e(e,t,r,i,o,n,s,a,u,c,m,f){let d,l,h,b=!1;function p(){let g=d.getBoundingClientRect();l=g.left,h=g.top}return{hooks:{init:g=>{E.initialize(),d=g.over,window.addEventListener("scroll",p,!0),window.addEventListener("resize",p),d.onmouseenter=()=>{b=!0,E.show()},d.onmouseleave=()=>{b=!1,E.getRenderedUplot()===g&&E.hide(g)},p()},setSize:()=>{p()},setCursor:g=>{let{left:v,top:T,idx:C}=g.cursor;if(!b||C==null){E.getRenderedUplot()===g&&E.hide(g);return}let x=g.data[0],A=kt(x,o),R=wt(g,C),k=g.data[0][R];if(k===void 0)return;let{items:M}=St(g,R,e,t,r,s);E.show();let D=n,B=D?(0,Te.jsx)(D,{timestamp:k,items:M,timeZone:o}):(0,Te.jsx)(He,{timestamp:k,items:M,timeZone:o,spansMultipleDays:A,stacked:t,sortByValues:i,layout:a,format:u,hideAttributeKey:c,hideAttributes:m,hideMetric:f});E.render(g,B),E.positionTooltip({left:(v||0)+l,top:(T||0)+h})},destroy(g){window.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p),d&&(d.onmouseenter=null,d.onmouseleave=null),E.getRenderedUplot()===g&&E.hide(g)}}}}var se=["oklch(0.70 0.24 293)","oklch(0.85 0.18 95)","oklch(0.65 0.25 255)","oklch(0.72 0.26 27)","oklch(0.70 0.22 150)","oklch(0.78 0.18 50)","oklch(0.72 0.18 215)","oklch(0.70 0.27 301)","oklch(0.75 0.20 90)","oklch(0.68 0.23 277)","oklch(0.70 0.18 193)","oklch(0.68 0.25 4)"],W=e=>`${getComputedStyle(document.documentElement).getPropertyValue("--ub-chart-font-size").trim()} ${e}`,$e=(e,t)=>{let r=e;return t&&t.unit&&t.unit.code&&t.unit.code!=="1"&&(!r&&t.unit?r=t.unit.code:r&&t.unit.code!==r&&(r=void 0)),r};function Rt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Array.isArray(e.fill)&&Array.isArray(e.border)}function Lt(e){return Array.isArray(e)}var je=(e,t,r,i,o,n)=>{if(r)return Lt(r)?r[t]:Rt(r)?n?r.fill[t]:r.border[t]:r(e,t,i,n);let s=n?`--ub-chart-serie-color-fill-${t+1}`:`--ub-chart-serie-color-${t+1}`,a=o.getPropertyValue(s).trim();return a||(n&&(i==="step"||i==="line"||i==="spline")?`oklch(from ${se[t%se.length]} l c h / 0.4)`:se[t%se.length])},Ut=e=>{let t=J.default.paths.bars({size:[.6,100],radius:0,gap:0}),r=J.default.paths.linear({alignGaps:0}),i=J.default.paths.spline({alignGaps:1}),o=J.default.paths.stepped({alignGaps:1});switch(e){case"line":return r;case"bar":return t;case"area":return r;case"step":return o;case"spline":return i;default:return r}},Et=(e,t,r,i,o)=>je(e,t,r,i,o,!0),Mt=(e,t)=>{switch(e){case"bar":return 1;case"line":return t?1.5:2;case"spline":return t?1.5:2;case"area":return 1;case"step":return 1.5;default:return 1}},Nt=(e,t,r)=>{if(t<0||r<0)return[t,r];let i=e.posToVal(t,"x"),o=e.data[0];if(!o||o.length===0)return[t,r];let n=0,s=0,a=o.length-1;for(;a-s>1;){let l=Math.floor((s+a)/2),h=o[l];h!=null&&h<i?s=l:a=l}let u=o[s],c=o[a];u!=null&&c!=null?n=Math.abs(u-i)<Math.abs(c-i)?s:a:u!=null?n=s:c!=null&&(n=a);let m=n;for(let l=n;l>=0;l--){let h=!1;for(let b=1;b<e.data.length;b++){let p=e.data[b];if(p&&p[l]!=null){h=!0;break}}if(h){m=l;break}}let f=o[m];return f==null?[t,r]:[e.valToPos(f,"x"),r]},It=(e,t)=>{let r=t.getPropertyValue("--ub-chart-font-color").trim(),i=t.getPropertyValue("--ub-chart-grid-color").trim(),o=e.axes?.[0],n=e.axes?.[1];return o&&(o.stroke=r,o.grid?o.grid.stroke=i:o.grid={stroke:i}),n&&(n.stroke=r,n.grid?n.grid.stroke=i:n.grid={stroke:i}),e},Dt=(e,t)=>e.getPropertyValue(`--ub-chart-threshold-${t}`).trim()||e.getPropertyValue("--ub-chart-threshold-default").trim(),Vt=(e,t)=>e.getPropertyValue(`--ub-chart-threshold-${t}-fill`).trim()||e.getPropertyValue("--ub-chart-threshold-default-fill").trim(),zt=e=>{switch(e){case"bold":return 2;case"line":return 1;case"dashed":return 1;default:return 1}},Ot=e=>e==="line"?void 0:[5,5],Ft=(e,t)=>{if(t){let r=[];return t.forEach(i=>{let o={label:i.label,stroke:Dt(e,i.level),width:zt(),dash:Ot(i.type),points:{show:!1,size:0},spanGaps:!0,show:!0,auto:!1};ne(i)||r.push(o),r.push(o)}),r}else return[]},Bt=(e,t,r,i)=>{if(!i||!i.some(n=>Y(n)))return t.bands;let o=i.map((n,s)=>Y(n)?{series:[e.length+s*2+1,e.length+s*2+2],fill:Vt(r,n.level),dir:1}:null).filter(n=>n!==null);return[...t.bands,...o]},Kt=(e,t,r,i,o,n,s)=>{let a=Mt(t,i);return[{},...e.map((u,c)=>({label:u.metric,stroke:je(u,c,r,t,n),width:a,points:{show:!1},spanGaps:!0,paths:Ut(t),fill:i||o?Et(u,c,r,t,n):void 0})),...Ft(n,s)]},qt=e=>{if(typeof e=="string"){let t=String(e).toLowerCase().trim();if(t==="by")return"bytes";if(t.startsWith("{")&&t.endsWith("}"))return"short"}return e},Qe=(e,t,r,i,o,n,s,a,u,c,m,f,d,l,h,b,p,g,v,T,C)=>{let P=window.getComputedStyle(e),x=P.fontFamily,A=e?.clientWidth??1050,R=e?.clientHeight??250,k=qt(i),M=(0,Ge.getValueFormat)(k==="1"?null:k),D=L=>{let K=M(L,Number.isInteger(L)?0:2);return K.text+(K.suffix?.trim()||"")},B={width:A,height:R,scales:{y:{range:We(i,T,C)}},plugins:[_e(D,s,t,c,m,f,o,h,l,b,p,g)],padding:d?[10,15,10,15]:[8,15,8,15],cursor:{y:!1,sync:{key:"_"},drag:{setScale:!0,x:!0,y:!1},move:Nt},series:Kt(o,n,a,u,s,P,v),bands:Bt(o,r,P,v),axes:[Ve(x,m,d),Xe(M,x)],legend:{show:!1}};return It(B,P)};var Ye=(e,t=4)=>{let r=e/t,i=Math.pow(10,Math.floor(Math.log10(r))),o=r/i,n;return o>5?n=10*i:o>2?n=5*i:o>1?n=2*i:n=i,Math.ceil(e/n)*n},w=(e,t)=>typeof e=="number"?e:t,We=(e,t,r)=>(i,o,n)=>{if(o===0&&n===0)return[w(t,0),w(r,100)];let s=1,a=n*(1+s),u=o<0?o*(1+s):o*(1-s);if(e==="percent"||e==="percentunit")return n>100?o<0?[w(t,u),w(r,a)]:[w(t,0),w(r,a)]:o<0?[w(t,u),w(r,100)]:[w(t,0),w(r,100)];if(n<=.9999)return o<=0?[w(t,u),w(r,1)]:[w(t,0),w(r,1)];let c=Ye(a),m=Ye(Math.abs(u));return o<0?[w(r,-m),w(r,c)]:[w(t,0),w(r,c)]},Ht=(e,t,r,i)=>{let o=e.axes[r];if(i>1)return o?._size||0;let n=(o?.ticks?.size||0)+(o?.gap||0),s=(t??[]).reduce((a,u)=>u.length>a.length?u:a,"");return s!=""&&(e.ctx.font=o?.font?.[0]??e.ctx.font,n+=e.ctx.measureText(s).width/devicePixelRatio),Math.ceil(n)};function Xe(e,t){return{gap:0,font:W(t),labelFont:W(t),grid:{show:!0,width:.5},ticks:{width:.5},values:(r,i)=>i.map(o=>{let n=e(o);return n.text+(n.suffix?.trim()||"")}),size:Ht,space:60}}function Je(e,t){let r=[],i=e[0],o=i.length,n=Array(o).fill(0),s=[i];return e.forEach((a,u)=>{u!==0&&(t?s.push(a):s.push(a.map((c,m)=>n[m]=n[m]+(c||0))))}),e.forEach((a,u)=>{u===0||t||r.push({series:[e.findIndex((c,m)=>m>u),u]})}),{data:s,bands:r.filter(a=>a.series[1]>-1)}}var et=require("react/jsx-runtime");function ue(e){let{times:t,series:r,metadata:i,type:o,className:n,timeZone:s,options:a,tooltip:u,colors:c,tooltipComponent:m,sortByValues:f=!1,unit:d,fill:l=!1,thresholds:h,min:b,max:p}=e,{layout:g,format:v,hideAttributeKey:T,hideAttributes:C,hideMetric:P}=u||{},x=(0,le.useRef)(null),A=_(),R=c||A.colors;return(0,le.useEffect)(()=>{if(!r||r.length===0){console.warn("No series provided");return}let k=[t],M=d;r.forEach(U=>{let G=i[U.metric];d||(M=$e(M,G)),k.push(U.values)}),h&&h.forEach(U=>{ne(U)?k.push(new Array(t.length).fill(U.value)):Y(U)&&(k.push(new Array(t.length).fill(U.from)),k.push(new Array(t.length).fill(U.to)))});let D=o==="bar"||o==="area",B=Je(k,!D),L=x.current,K=null;if(L){let U=Qe(L,i,B,M,r,o,D,R,l,f,s,m,!1,v,g,T,C,P,h,b,p);K=new Ze.default({...U,...a},B.data,L);let G=new ResizeObserver(()=>{K?.setSize({width:L.clientWidth,height:L.clientHeight})});return G.observe(L),()=>{K?.destroy(),G.disconnect()}}},[r,t,o,i,s,m,R,l,f,d,v,g,T,C,P,h,b,p,a]),(0,et.jsx)("div",{ref:x,className:"ub-chart-container"+(n?` ${n}`:"")})}var q=require("react/jsx-runtime");function rt({metrics:e,operator:t,attributes:r,groupBy:i,interval:o,type:n="line",className:s,appearance:a,unit:u,thresholds:c,min:m,max:f,colors:d,tooltip:l,sortByValues:h,fill:b}){let p=_(),g=o??p.interval,v=r??p.attributes,T=i??p.groupBy,C=t??p.operator,P=d??p.colors,x=typeof h=="boolean"?h:p.sortByValues,A=typeof b=="boolean"?b:p.fill,R=a?.components?.Tooltip??p.appearance.components.Tooltip,k=(0,tt.useMemo)(()=>({layout:l?.layout??p.tooltip?.layout,format:l?.format??p.tooltip?.format,hideAttributes:l?.hideAttributes??p.tooltip?.hideAttributes,hideAttributeKey:l?.hideAttributeKey??p.tooltip?.hideAttributeKey,hideMetric:l?.hideMetric??p.tooltip?.hideMetric}),[l?.layout,l?.format,l?.hideAttributes,l?.hideAttributeKey,l?.hideMetric,p.tooltip?.layout,p.tooltip?.format,p.tooltip?.hideAttributes,p.tooltip?.hideAttributeKey,p.tooltip?.hideMetric]),{isLoading:M,data:D,hasError:B}=ie({queries:(Array.isArray(e)?e:[e]).map(V=>({metrics:[V],operator:C,attributes:v,groupBy:T})),timeRange:p.timeRange,startTime:p.startTime,endTime:p.endTime,interval:g}),{series:L,times:K,metadata:U}=D,G=L.every(V=>V.isEmpty),ce=`ub-chart-container${s?` ${s}`:""}`;if(M){let V=a?.components?.Loading??p.appearance.components.Loading;return(0,q.jsx)("div",{className:ce,children:(0,q.jsx)(V,{})})}if(G){let V=a?.components?.Empty??p.appearance.components.Empty;return(0,q.jsx)("div",{className:ce,children:(0,q.jsx)(V,{})})}if(B){let V=a?.components?.Error??p.appearance.components.Error;return(0,q.jsx)("div",{className:ce,children:(0,q.jsx)(V,{})})}return(0,q.jsx)(ue,{times:K,series:L,metadata:U,type:n,className:s,tooltip:k,colors:P,sortByValues:x,unit:u,fill:A,tooltipComponent:R,thresholds:c,min:m,max:f})}0&&(module.exports={Chart,Empty,Error,Loading,Scope,Timeseries,UnblindProvider,useLogs,useMetrics,useRefresh,useScope,useTimeseries,useUsage});
2
2
  //# sourceMappingURL=index.js.map