react-semaphor 0.1.525 → 0.1.527

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.
Files changed (196) hide show
  1. package/DATA_APP_SDK.md +5 -1
  2. package/dist/analytics-protocol/index.js +1179 -296
  3. package/dist/brand-studio/index.js +31 -31
  4. package/dist/briefings/index.js +50 -49
  5. package/dist/chunks/{calculated-field-identity-Dy_WpDdo.js → calculated-field-identity-DEhjPSr-.js} +77 -76
  6. package/dist/chunks/{card-config-utils-CAyjC5Tp.js → card-config-utils-BlIbwkuD.js} +62 -59
  7. package/dist/chunks/{constants-DeLIHVAW.js → constants-DNWVy8Y3.js} +4 -4
  8. package/dist/chunks/dashboard-JNHR0_cZ.js +14 -0
  9. package/dist/chunks/{dashboard-briefing-launcher-BilVIEyw.js → dashboard-briefing-launcher-D9pFByPh.js} +274 -267
  10. package/dist/chunks/{dashboard-controls-DyLPcvCK.js → dashboard-controls-CJI5ZWMq.js} +740 -692
  11. package/dist/chunks/dashboard-json-DLdrFry-.js +65 -0
  12. package/dist/chunks/{edit-dashboard-visual-DtmKNNdE.js → edit-dashboard-visual-D5LjWle1.js} +6760 -6728
  13. package/dist/chunks/editor-action-buttons-G91NQKxU.js +2070 -0
  14. package/dist/chunks/{field-aggregations-BQjogiI1.js → field-aggregations-DeVQLIsP.js} +19 -19
  15. package/dist/chunks/{field-dependencies-v-lJNzC7.js → field-dependencies-CGYic38w.js} +1 -1
  16. package/dist/chunks/{index-ON7Gpvcv.js → index-BvJOYbNv.js} +760 -750
  17. package/dist/chunks/{matrix-analytical-definition-BimC4XIV.js → matrix-analytical-definition-BJyH5-99.js} +1 -1
  18. package/dist/chunks/{matrix-card-CIlz0Dnp.js → matrix-card-DY45yiUM.js} +7 -6
  19. package/dist/chunks/{matrix-control-sources-B1K7x0SL.js → matrix-control-sources-BypfLZsK.js} +36 -36
  20. package/dist/chunks/{matrix-definition-E5gXXSTZ.js → matrix-definition-Cdn3LoxW.js} +3 -3
  21. package/dist/chunks/{semantic-format-Baqp8kD_.js → matrix-formatter-BoKU3MzZ.js} +655 -511
  22. package/dist/chunks/{matrix-member-presentation-Bw7-JCrr.js → matrix-member-presentation-BBW0n1iY.js} +1 -1
  23. package/dist/chunks/matrix-operation-contract-BV02rLhu.js +809 -0
  24. package/dist/chunks/{metric-comparison-BphoJ9bq.js → metric-comparison-Crljx_XY.js} +15 -10
  25. package/dist/chunks/{numeric-presentation-VhMUHfrJ.js → numeric-presentation-LvnNY5Ma.js} +68 -68
  26. package/dist/chunks/pivot-header-presentation-D5v8uyjj.js +618 -0
  27. package/dist/chunks/{pivot-result-identity-BzUQiCEV.js → pivot-result-identity-CY__BuwI.js} +1 -1
  28. package/dist/chunks/{pivot-result-lifecycle-BFO354lk.js → pivot-result-lifecycle-BWrPhlGT.js} +259 -204
  29. package/dist/chunks/{raw-temporal-7bFbXd2a.js → raw-temporal-CdnA_OXJ.js} +10 -10
  30. package/dist/chunks/{raw-temporal-contract-BQZIJ1fn.js → raw-temporal-contract-Bc9z83t-.js} +1 -1
  31. package/dist/chunks/relative-date-DAF9J7mt.js +456 -0
  32. package/dist/chunks/report-preferences-dialog-D3hxu4sE.js +1231 -0
  33. package/dist/chunks/{report-runtime-context-CxIoGyNM.js → report-runtime-context-CtaGGlit.js} +1 -1
  34. package/dist/chunks/{selection-reducer-CvCBQbl2.js → selection-reducer-C7Um5XN-.js} +3 -3
  35. package/dist/chunks/semantic-format-BjBMOSoo.js +192 -0
  36. package/dist/chunks/{index-DYOaHuLS.js → semaphor-ready-indicator-D46I_4g7.js} +145070 -146854
  37. package/dist/chunks/slider-B6LELqx6.js +876 -0
  38. package/dist/chunks/{source-entity-resolution-Bzefiive.js → source-entity-resolution-Bde29mqE.js} +25 -25
  39. package/dist/chunks/{switch-CWPcwAZ4.js → switch-_7uBAbYx.js} +7950 -8545
  40. package/dist/chunks/{temporal-bucket-PcLFSYWX.js → temporal-bucket-DlFuhCnT.js} +6 -6
  41. package/dist/chunks/{temporal-bucket-contract-DTLDRzgV.js → temporal-bucket-contract-C6lUGPS3.js} +1 -1
  42. package/dist/chunks/temporal-input-presentation-DyMWCZYh.js +195 -0
  43. package/dist/chunks/{token-types-BC6RcUY8.js → token-types-UjyNz95-.js} +1 -1
  44. package/dist/chunks/{validators-CsdOtZI6.js → validators-CQcG0EPN.js} +852 -731
  45. package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +46 -0
  46. package/dist/dashboard/index.js +1 -1
  47. package/dist/dashboard-authoring/index.js +138 -137
  48. package/dist/data-app-sdk/index.js +30 -29
  49. package/dist/data-app-sdk-adapters/index.js +23 -22
  50. package/dist/data-app-sdk-validation/index.js +27 -26
  51. package/dist/format-utils/index.js +247 -329
  52. package/dist/index.js +435 -246
  53. package/dist/report-runtime-context/index.js +2 -2
  54. package/dist/style.css +1 -1
  55. package/dist/surfboard/index.js +4 -5
  56. package/dist/types/briefings/index.d.ts +3 -0
  57. package/dist/types/components/dashboard/dashboard-container.d.ts +1 -1
  58. package/dist/types/components/dashboard/sheet/layout-change-guard.d.ts +1 -1
  59. package/dist/types/components/dashboard/sheet/sheet-layout.d.ts +1 -1
  60. package/dist/types/components/editor/editor-main/text-card.d.ts +1 -1
  61. package/dist/types/components/editor/editor.d.ts +1 -1
  62. package/dist/types/components/explorer/filters/card-date-filter.d.ts +13 -5
  63. package/dist/types/components/explorer/filters/card-date-selection.d.ts +28 -0
  64. package/dist/types/components/providers/semaphor-context-provider.d.ts +1 -1
  65. package/dist/types/components/providers/theme-provider-context.d.ts +1 -1
  66. package/dist/types/components/providers/theme-provider.d.ts +1 -1
  67. package/dist/types/components/shared/unsaved-changes/use-pristine-snapshot-initializer.d.ts +1 -1
  68. package/dist/types/components/sharing-and-management/dashboard-actions-menu.d.ts +1 -1
  69. package/dist/types/components/sharing-and-management/hooks/use-resource-management.d.ts +0 -1
  70. package/dist/types/components/surfboard/dashboard-plus.d.ts +1 -1
  71. package/dist/types/components/surfboard/download-settings-dialog.d.ts +8 -0
  72. package/dist/types/components/surfboard/filter/types.d.ts +8 -29
  73. package/dist/types/components/surfboard/filter/use-dashboard-filter-mapping-popover.d.ts +5 -1
  74. package/dist/types/components/ui-custom/date-range-picker.d.ts +18 -2
  75. package/dist/types/components/ui-custom/date-range-presets.d.ts +8 -21
  76. package/dist/types/components/ui-custom/report-calendar.d.ts +18 -0
  77. package/dist/types/components/visual/aggregated-table/utils/export-utils.d.ts +3 -5
  78. package/dist/types/components/visual/column-display-utils.d.ts +1 -1
  79. package/dist/types/components/visual/data-table/data-table-toolbar.d.ts +1 -1
  80. package/dist/types/components/visual/kpi-visual/kpi-utils.d.ts +1 -1
  81. package/dist/types/components/visual/pivot-table/utils/pivot-table-export-utils.d.ts +3 -1
  82. package/dist/types/components/visual/settings/color-format.d.ts +1 -1
  83. package/dist/types/components/visual/visual-utils.d.ts +1 -1
  84. package/dist/types/index.js +5 -5
  85. package/dist/types/lib/actions/data-point-click-action.d.ts +2 -1
  86. package/dist/types/lib/api/exports-api.d.ts +3 -0
  87. package/dist/types/lib/csv-download.d.ts +9 -0
  88. package/dist/types/lib/csv-encoding-options.d.ts +6 -0
  89. package/dist/types/lib/dashboard/normalize-dashboard-for-dirty-check.d.ts +1 -1
  90. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +2 -1
  91. package/dist/types/lib/dashboard-navigation/build-carried-click-context.d.ts +0 -1
  92. package/dist/types/lib/document/document-input-runtime.d.ts +2 -1
  93. package/dist/types/lib/export-utils.d.ts +17 -15
  94. package/dist/types/lib/hooks/explorer/use-filter-builder.d.ts +2 -2
  95. package/dist/types/lib/hooks/explorer/use-schemas.d.ts +1 -1
  96. package/dist/types/lib/hooks/use-dashboard.d.ts +2 -2
  97. package/dist/types/lib/hooks/use-relative-date-summarizer.d.ts +7 -0
  98. package/dist/types/lib/interactions/get-click-context-from-chartjs.d.ts +1 -2
  99. package/dist/types/lib/matrix-table/matrix-application-adapter.d.ts +3 -2
  100. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +1 -1
  101. package/dist/types/lib/matrix-table/matrix-card-draft.d.ts +1 -1
  102. package/dist/types/lib/matrix-table/matrix-dataset-history.d.ts +47 -0
  103. package/dist/types/lib/matrix-table/matrix-delivery.d.ts +7 -3
  104. package/dist/types/lib/matrix-table/matrix-execution-context.d.ts +2 -0
  105. package/dist/types/lib/matrix-table/matrix-query-transport.d.ts +4 -1
  106. package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +105 -4
  107. package/dist/types/lib/matrix-table/matrix-runtime.d.ts +43 -2
  108. package/dist/types/lib/matrix-table/use-matrix.d.ts +6 -0
  109. package/dist/types/lib/query-context/build-card-query-context.d.ts +5 -1
  110. package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +0 -1
  111. package/dist/types/lib/query-context/build-global-date-comparison-context.d.ts +1 -2
  112. package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +1 -2
  113. package/dist/types/lib/query-context/dashboard-card-query-key.d.ts +10 -0
  114. package/dist/types/lib/query-context/query-auth-scope.d.ts +5 -0
  115. package/dist/types/lib/stores/dashboard-store.d.ts +9 -4
  116. package/dist/types/lib/stores/editor-store.d.ts +1 -2
  117. package/dist/types/lib/stores/table-actions.d.ts +2 -1
  118. package/dist/types/lib/temporal-filter/temporal-filter-utils.d.ts +9 -2
  119. package/dist/types/lib/types/common-types.d.ts +5 -0
  120. package/dist/types/lib/types/explorer-types.d.ts +14 -0
  121. package/dist/types/lib/types/token-types.d.ts +0 -13
  122. package/dist/types/lib/utils/card-definition.d.ts +1 -1
  123. package/dist/types/lib/utils/date-timezone-utils.d.ts +4 -46
  124. package/dist/types/lib/utils/filter-default-value-utils.d.ts +8 -2
  125. package/dist/types/lib/utils/inline-filter-utils.d.ts +3 -2
  126. package/dist/types/lib/utils/relative-date-description.d.ts +38 -0
  127. package/dist/types/lib/utils.d.ts +0 -2
  128. package/dist/types/shared/analytics-protocol/contracts.d.ts +10 -7
  129. package/dist/types/shared/analytics-protocol/index.d.ts +12 -1
  130. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +20 -20
  131. package/dist/types/shared/analytics-protocol/matrix-operation-contract.d.ts +10 -10
  132. package/dist/types/shared/analytics-protocol/matrix-operation-request.d.ts +8 -8
  133. package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +51 -5
  134. package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +9 -3
  135. package/dist/types/shared/analytics-protocol/operation-temporal-state.d.ts +64 -0
  136. package/dist/types/shared/analytics-protocol/relative-date-filter.d.ts +61 -0
  137. package/dist/types/shared/analytics-protocol/relative-date-label.d.ts +20 -0
  138. package/dist/types/shared/analytics-protocol/runtime-schemas.d.ts +0 -2
  139. package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +314 -0
  140. package/dist/types/shared/analytics-protocol/time-window.d.ts +13 -0
  141. package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +8 -4
  142. package/dist/types/shared/format-utils/exporters/csv-utils.d.ts +46 -15
  143. package/dist/types/shared/format-utils/exporters/index.d.ts +2 -3
  144. package/dist/types/shared/format-utils/flat-table-export-totals.d.ts +2 -1
  145. package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +2 -2
  146. package/dist/types/shared/format-utils/types/format-types.d.ts +0 -42
  147. package/dist/types/shared/temporal/calendar-periods.d.ts +56 -0
  148. package/dist/types/shared/temporal/index.d.ts +5 -0
  149. package/dist/types/shared/temporal/relative-date.d.ts +21 -0
  150. package/dist/types/shared/temporal/temporal-parity-fixtures.d.ts +73 -0
  151. package/dist/types/shared/temporal/time-window-periods.d.ts +21 -0
  152. package/dist/types/shared/temporal/zoned-wall-clock.d.ts +23 -0
  153. package/package.json +2 -17
  154. package/src/data-app-sdk/README.md +6 -3
  155. package/dist/chunks/dashboard-date-comparison-definition-BqNhECUr.js +0 -183
  156. package/dist/chunks/dashboard-json-QEoU-mx4.js +0 -75
  157. package/dist/chunks/editor-action-buttons-B9VRW3Bh.js +0 -2019
  158. package/dist/chunks/matrix-formatter-WBgtebUT.js +0 -341
  159. package/dist/chunks/matrix-operation-contract-D32U2CSw.js +0 -1802
  160. package/dist/chunks/mouse-pointer-2-BZvGk45-.js +0 -19
  161. package/dist/chunks/pivot-header-presentation-CGtudHo7.js +0 -661
  162. package/dist/chunks/report-preferences-dialog-BLaFmlE2.js +0 -723
  163. package/dist/chunks/temporal-input-presentation-2RJrvmYL.js +0 -222
  164. package/dist/chunks/update-policy-DhAUtiC8.js +0 -913
  165. package/dist/data-app-builder/index.js +0 -3666
  166. package/dist/data-app-builder-browser-runtime/index.js +0 -8
  167. package/dist/data-app-codegen/index.js +0 -22
  168. package/dist/data-app-codegen-node/index.js +0 -1807
  169. package/dist/types/components/data-app-runtime/published-data-app-runtime.d.ts +0 -7
  170. package/dist/types/components/surfboard/json-to-csv.d.ts +0 -7
  171. package/dist/types/components/visual/data-table/utils/export-utils.d.ts +0 -31
  172. package/dist/types/data-app-builder/browser-runtime.d.ts +0 -174
  173. package/dist/types/data-app-builder/constants.d.ts +0 -14
  174. package/dist/types/data-app-builder/data-app-builder.d.ts +0 -14
  175. package/dist/types/data-app-builder/index.d.ts +0 -1
  176. package/dist/types/data-app-builder/lib/api.d.ts +0 -36
  177. package/dist/types/data-app-builder/lib/context-select.d.ts +0 -3
  178. package/dist/types/data-app-builder/lib/diagnostics.d.ts +0 -12
  179. package/dist/types/data-app-builder/lib/file-tree.d.ts +0 -2
  180. package/dist/types/data-app-builder/types.d.ts +0 -558
  181. package/dist/types/data-app-builder-browser-runtime.d.ts +0 -2
  182. package/dist/types/data-app-builder.d.ts +0 -2
  183. package/dist/types/data-app-codegen/generate-contract.d.ts +0 -26
  184. package/dist/types/data-app-codegen/generated-contract-files.d.ts +0 -7
  185. package/dist/types/data-app-codegen/generated-contract-validation.d.ts +0 -13
  186. package/dist/types/data-app-codegen/index.d.ts +0 -6
  187. package/dist/types/data-app-codegen/live-execution.d.ts +0 -42
  188. package/dist/types/data-app-codegen/node.d.ts +0 -2
  189. package/dist/types/data-app-codegen/update-policy.d.ts +0 -25
  190. package/dist/types/data-app-codegen/validation.d.ts +0 -8
  191. package/dist/types/data-app-codegen-node.d.ts +0 -2
  192. package/dist/types/data-app-codegen.d.ts +0 -2
  193. package/dist/types/lib/encrypt-utils.d.ts +0 -9
  194. package/dist/types/shared/analytics-protocol/data-app-codegen-summary.d.ts +0 -418
  195. package/dist/types/shared/format-utils/exporters/pivot-exporter.d.ts +0 -13
  196. package/dist/types/shared/format-utils/exporters/table-exporter.d.ts +0 -10
@@ -0,0 +1,876 @@
1
+ import { jsxs as B, jsx as p, Fragment as fe } from "react/jsx-runtime";
2
+ import * as C from "react";
3
+ import Ue, { useState as pe, useRef as F, useCallback as W, useEffect as Q, forwardRef as ge, useMemo as T, memo as Qe, Suspense as Ye } from "react";
4
+ import { ax as $e, ay as oe, az as he, aA as Ge, aB as je, aC as We, aD as Xe, aE as Je, aF as Ze, aG as et, aH as tt, aI as nt, aJ as rt, aK as ot, aL as st, aM as at } from "./semaphor-ready-indicator-D46I_4g7.js";
5
+ import { a4 as Se, a5 as z, a6 as k, c as ve, a7 as it, a2 as L, a3 as ye, C as be, B as lt, a8 as ct, a9 as ut, u as Z, aa as dt, ab as ft, ac as H, ad as mt, ae as Ce, af as pt, ag as gt } from "./switch-_7uBAbYx.js";
6
+ import "./x-CXDkqdur.js";
7
+ import "./validators-CQcG0EPN.js";
8
+ import "./matrix-operation-contract-BV02rLhu.js";
9
+ import "zod";
10
+ import "../value-format-preferences/index.js";
11
+ import { u as Ee, r as we, f as Re } from "./editor-action-buttons-G91NQKxU.js";
12
+ import { M as ht } from "./selection-reducer-C7Um5XN-.js";
13
+ import "./card-config-utils-BlIbwkuD.js";
14
+ import { P as St, r as vt, g as yt, a as me, b as ee, n as bt, c as Ct } from "./index-BvJOYbNv.js";
15
+ import { u as Et } from "./appearance-context-DEYtWinQ.js";
16
+ const dn = Ue.memo(function({
17
+ context: t = "editor"
18
+ } = {}) {
19
+ return /* @__PURE__ */ B(
20
+ "div",
21
+ {
22
+ "data-content": "fields-section",
23
+ className: "flex h-full grow flex-col items-center overflow-hidden",
24
+ children: [
25
+ " ",
26
+ /* @__PURE__ */ p($e, { context: t }),
27
+ " "
28
+ ]
29
+ }
30
+ );
31
+ });
32
+ var xe = "Toggle", Pe = C.forwardRef((e, t) => {
33
+ const { pressed: o, defaultPressed: r, onPressedChange: s, ...l } = e, [n, a] = Se({
34
+ prop: o,
35
+ onChange: s,
36
+ defaultProp: r ?? !1,
37
+ caller: xe
38
+ });
39
+ return /* @__PURE__ */ p(
40
+ z.button,
41
+ {
42
+ type: "button",
43
+ "aria-pressed": n,
44
+ "data-state": n ? "on" : "off",
45
+ "data-disabled": e.disabled ? "" : void 0,
46
+ ...l,
47
+ ref: t,
48
+ onClick: k(e.onClick, () => {
49
+ e.disabled || a(!n);
50
+ })
51
+ }
52
+ );
53
+ });
54
+ Pe.displayName = xe;
55
+ var De = Pe;
56
+ const wt = it(
57
+ "inline-flex items-center justify-center rounded-control text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
58
+ {
59
+ variants: {
60
+ variant: {
61
+ default: "bg-transparent",
62
+ outline: "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"
63
+ },
64
+ size: {
65
+ default: "h-10 px-3",
66
+ sm: "h-9 px-2.5",
67
+ lg: "h-11 px-5"
68
+ }
69
+ },
70
+ defaultVariants: {
71
+ variant: "default",
72
+ size: "default"
73
+ }
74
+ }
75
+ ), Rt = C.forwardRef(({ className: e, variant: t, size: o, ...r }, s) => /* @__PURE__ */ p(
76
+ De,
77
+ {
78
+ ref: s,
79
+ className: ve(wt({ variant: t, size: o, className: e })),
80
+ ...r
81
+ }
82
+ ));
83
+ Rt.displayName = De.displayName;
84
+ function Te({
85
+ storeValue: e,
86
+ defaultValue: t = "",
87
+ onStoreUpdate: o,
88
+ delay: r = 300
89
+ }) {
90
+ const [s, l] = pe(e ?? t), n = F(null), a = F(s), u = F(e), g = F(!1), S = W(() => {
91
+ n.current && (clearTimeout(n.current), n.current = null), g.current && a.current !== (u.current ?? t) && (o(a.current), u.current = a.current);
92
+ }, [t, o]);
93
+ Q(() => {
94
+ if (e !== u.current) {
95
+ n.current && (clearTimeout(n.current), n.current = null);
96
+ const c = e ?? t;
97
+ l(c), a.current = c, u.current = e, g.current = !1;
98
+ }
99
+ }, [e, t]), Q(() => {
100
+ if (g.current)
101
+ return n.current = setTimeout(() => {
102
+ S();
103
+ }, r), () => {
104
+ n.current && (clearTimeout(n.current), n.current = null);
105
+ };
106
+ }, [r, S, s]), Q(() => () => {
107
+ n.current && clearTimeout(n.current);
108
+ }, []);
109
+ const i = W(
110
+ (c) => {
111
+ const b = c ?? t;
112
+ g.current = !0, a.current = b, l(b);
113
+ },
114
+ [t]
115
+ );
116
+ return { value: s, onChange: i, flush: S };
117
+ }
118
+ const xt = 300;
119
+ function Pt({ onExpand: e }, t) {
120
+ const o = L((f) => f.card.sql), r = L((f) => f.sqlGen), s = L((f) => f.card), l = Ee(), { setCardSql: n, setSqlGen: a, setRunSql: u } = ye(), g = T(() => l !== s.type ? { ...s, type: l } : s, [s, l]), { queryKey: S } = oe(g), i = he(), c = F(S);
121
+ c.current = S;
122
+ const b = F(r);
123
+ b.current = r;
124
+ const E = W(
125
+ (f) => {
126
+ n(f);
127
+ },
128
+ [n]
129
+ ), {
130
+ value: d,
131
+ onChange: h,
132
+ flush: v
133
+ } = Te({
134
+ storeValue: o,
135
+ defaultValue: "",
136
+ onStoreUpdate: E,
137
+ delay: xt
138
+ });
139
+ Q(() => we(v), [v]);
140
+ function P(f) {
141
+ h(f), ct(b.current) || a({});
142
+ }
143
+ return /* @__PURE__ */ B("div", { className: "relative h-full w-full", children: [
144
+ /* @__PURE__ */ p(
145
+ be,
146
+ {
147
+ ref: t,
148
+ value: d ?? "",
149
+ onValueChange: P,
150
+ language: "sql-jinja",
151
+ embedded: !0,
152
+ hideLineNumbers: !0,
153
+ wrapLines: !0,
154
+ placeholder: "Write your SQL here",
155
+ onKeyDown: (f) => {
156
+ f.key === "Enter" && f.shiftKey && (f.preventDefault(), Re(), setTimeout(() => {
157
+ i.removeQueries({
158
+ queryKey: c.current,
159
+ exact: !0
160
+ }), u(!0);
161
+ }, 0));
162
+ }
163
+ }
164
+ ),
165
+ e ? /* @__PURE__ */ p(
166
+ lt,
167
+ {
168
+ type: "button",
169
+ variant: "ghost",
170
+ size: "icon",
171
+ className: "absolute right-2.5 top-2 z-20 h-7 w-7 bg-background/80 p-0 text-muted-foreground backdrop-blur-sm transition-colors hover:bg-accent hover:text-foreground focus-visible:text-foreground",
172
+ onClick: e,
173
+ "aria-label": "Expand SQL editor",
174
+ title: "Expand SQL editor",
175
+ children: /* @__PURE__ */ p(ht, { className: "h-3.5 w-3.5", strokeWidth: 1.75 })
176
+ }
177
+ ) : null
178
+ ] });
179
+ }
180
+ const fn = ge(Pt), Dt = 300;
181
+ function Tt(e, t) {
182
+ const o = L((E) => E.card.python), r = L((E) => E.card), s = Ee(), { setCardPython: l, setRunSql: n } = ye(), a = T(() => s !== r.type ? { ...r, type: s } : r, [r, s]), { queryKey: u } = oe(a), g = he(), S = F(u);
183
+ S.current = u;
184
+ const { value: i, onChange: c, flush: b } = Te({
185
+ storeValue: o,
186
+ defaultValue: St,
187
+ onStoreUpdate: l,
188
+ delay: Dt
189
+ });
190
+ return Q(() => we(b), [b]), /* @__PURE__ */ p(
191
+ be,
192
+ {
193
+ ref: t,
194
+ value: i ?? "",
195
+ onValueChange: c,
196
+ language: "python",
197
+ embedded: !0,
198
+ hideLineNumbers: !0,
199
+ wrapLines: !0,
200
+ className: "[&_.code-editor-pre]:!pt-2 [&_.code-editor-textarea]:!pt-2",
201
+ onKeyDown: (E) => {
202
+ E.key === "Enter" && E.shiftKey && (E.preventDefault(), Re(), setTimeout(() => {
203
+ g.removeQueries({
204
+ queryKey: S.current,
205
+ exact: !0
206
+ }), n(!0);
207
+ }, 0));
208
+ }
209
+ }
210
+ );
211
+ }
212
+ const mn = ge(Tt), _t = /* @__PURE__ */ new Set([
213
+ "askForMoreInfo",
214
+ "getAvailableChartTypes",
215
+ "getChartSQLSyntax",
216
+ "getDomainRelationships",
217
+ "getTableColumns",
218
+ "getUserSql",
219
+ "validateCardConfigFormat"
220
+ ]), pn = /* @__PURE__ */ new Set([
221
+ "createChartFromSql",
222
+ "createForecast",
223
+ "generateQueryConfig",
224
+ "getChartDataFromCardConfig",
225
+ "getChartDataFromSqlAndPython",
226
+ "getForecastDataFromSqlAndPython"
227
+ ]), gn = Array.from(
228
+ _t
229
+ ).join(", "), hn = 3, Sn = "Self-heal", vn = /* @__PURE__ */ new Set([
230
+ "SQL_PARSE_ERROR",
231
+ "SQL_EXPLAIN_ERROR"
232
+ ]);
233
+ function It({ card: e }) {
234
+ var ie, le, ce, ue, de;
235
+ const t = Ge(), [o, r] = pe({}), { authToken: s } = je(), l = ut(s == null ? void 0 : s.accessToken), { compiledAppearance: n } = Et(), a = T(
236
+ () => We(n),
237
+ [n]
238
+ ), u = L((m) => m.frame), g = L(
239
+ (m) => m.inlineFilterValuesMap[e.id]
240
+ ), S = L(
241
+ (m) => m.actions.setCardInlineFilterValue
242
+ ), i = L(
243
+ (m) => m.actions.removeCardInlineFilterValue
244
+ ), c = e, { getCard: b, manifest: E } = Xe(
245
+ ((ie = c.customCardPreferences) == null ? void 0 : ie.url) || ""
246
+ ), d = (le = E == null ? void 0 : E.visuals) == null ? void 0 : le.find(
247
+ (m) => {
248
+ var D;
249
+ return m.name === ((D = c.customCardPreferences) == null ? void 0 : D.componentName);
250
+ }
251
+ ), h = vt(c, d) ?? "single", v = T(
252
+ () => yt({
253
+ frame: u,
254
+ configCard: c,
255
+ isMultiInputVisual: h === "multiple"
256
+ }),
257
+ [u, c, h]
258
+ ), P = T(() => {
259
+ const m = v.findIndex(
260
+ (D) => (D == null ? void 0 : D.id) === e.id
261
+ );
262
+ return m < 0 ? -1 : me(e, m);
263
+ }, [v, e]), f = T(() => h !== "multiple" || P < 0 ? e.type : ee(
264
+ e,
265
+ P,
266
+ d == null ? void 0 : d.slots
267
+ ) ?? e.type, [h, P, e, d == null ? void 0 : d.slots]), w = T(() => h === "multiple" ? {
268
+ ...e,
269
+ connectionId: void 0,
270
+ dataSource: void 0,
271
+ sql: "",
272
+ python: "",
273
+ config: void 0,
274
+ queryConfig: void 0
275
+ } : f !== e.type ? { ...e, type: f } : e, [e, f, h]), { data: y, effectiveCardConfig: K } = oe(w), O = Je(), Y = Z((m) => m.dashboard.filters), $ = Z((m) => m.filterValues), _ = Z((m) => m.selectedSheetId), R = T(
276
+ () => Ze({
277
+ card: e,
278
+ sheetId: _ || "",
279
+ inlineFilterValues: g,
280
+ setInlineFilterValue: (m) => S(e.id, m),
281
+ removeInlineFilterValue: (m) => i(e.id, m)
282
+ }),
283
+ [
284
+ e,
285
+ _,
286
+ g,
287
+ S,
288
+ i
289
+ ]
290
+ ), { cardFilters: I, cardFilterValues: M } = T(
291
+ () => et({
292
+ card: e,
293
+ transientContexts: O,
294
+ filters: Y,
295
+ filterValues: $,
296
+ selectedSheetId: _
297
+ }),
298
+ [
299
+ e,
300
+ O,
301
+ Y,
302
+ $,
303
+ _
304
+ ]
305
+ ), q = W(
306
+ (m, D) => {
307
+ const j = bt(D);
308
+ r((J) => ({
309
+ ...J,
310
+ [m]: j
311
+ }));
312
+ },
313
+ []
314
+ ), A = (ce = c.customCardPreferences) == null ? void 0 : ce.componentName, N = A ? b(A) : null, V = tt(
315
+ (ue = c.customCardPreferences) == null ? void 0 : ue.settings,
316
+ c
317
+ ), x = T(
318
+ () => Ct(v),
319
+ [v]
320
+ ), G = T(
321
+ () => x.map(
322
+ (m, D) => ee(
323
+ m,
324
+ D,
325
+ d == null ? void 0 : d.slots
326
+ )
327
+ ),
328
+ [x, d == null ? void 0 : d.slots]
329
+ ), ae = T(
330
+ () => nt(
331
+ h === "multiple" ? rt({
332
+ slotOrderedCards: x,
333
+ multiInputData: o,
334
+ valueFormatPreferences: t
335
+ }) : [
336
+ {
337
+ card: e,
338
+ cardConfig: K,
339
+ columns: y == null ? void 0 : y.columns,
340
+ columnKeyMap: y == null ? void 0 : y.columnKeyMap,
341
+ valueFormatPreferences: t
342
+ }
343
+ ]
344
+ ),
345
+ [
346
+ e,
347
+ y == null ? void 0 : y.columnKeyMap,
348
+ y == null ? void 0 : y.columns,
349
+ K,
350
+ o,
351
+ x,
352
+ h,
353
+ t
354
+ ]
355
+ );
356
+ return A ? /* @__PURE__ */ p("div", { className: "semaphor-custom mb-3 flex grow basis-0 flex-col space-y-2 overflow-y-auto", children: /* @__PURE__ */ B(
357
+ Ye,
358
+ {
359
+ fallback: /* @__PURE__ */ p(fe, {}),
360
+ children: [
361
+ N && h === "single" && /* @__PURE__ */ p(
362
+ N,
363
+ {
364
+ editing: !0,
365
+ params: l,
366
+ theme: a,
367
+ settings: V,
368
+ cardMetadata: ot({
369
+ card: e,
370
+ dataMetadata: y == null ? void 0 : y.metadata
371
+ }),
372
+ onDataChange: q,
373
+ data: (y == null ? void 0 : y.records) || [],
374
+ columns: (y == null ? void 0 : y.columns) || [],
375
+ formatTemporalBucketValue: ae,
376
+ filters: I,
377
+ filterValues: [
378
+ ...M || [],
379
+ ...g || []
380
+ ],
381
+ inlineFilters: R
382
+ }
383
+ ),
384
+ N && h === "multiple" && /* @__PURE__ */ B(fe, { children: [
385
+ v.map((m, D) => {
386
+ if (!m) return null;
387
+ const j = me(m, D), J = ee(
388
+ m,
389
+ j,
390
+ d == null ? void 0 : d.slots
391
+ );
392
+ return /* @__PURE__ */ p(
393
+ st,
394
+ {
395
+ onDataChange: q,
396
+ card: m,
397
+ effectiveCardType: J
398
+ },
399
+ `${m.id}-${j}`
400
+ );
401
+ }),
402
+ /* @__PURE__ */ p("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ p(
403
+ N,
404
+ {
405
+ editing: !0,
406
+ onDataChange: q,
407
+ ...at({
408
+ configCard: c,
409
+ slotOrderedCards: x,
410
+ slotTypes: G,
411
+ multiInputData: o,
412
+ params: l,
413
+ theme: a,
414
+ chartSettings: V,
415
+ filters: I,
416
+ filterValues: [
417
+ ...M || [],
418
+ ...g || []
419
+ ],
420
+ inlineFilters: R,
421
+ formatTemporalBucketValue: ae
422
+ })
423
+ }
424
+ ) })
425
+ ] })
426
+ ]
427
+ },
428
+ (de = c.customCardPreferences) == null ? void 0 : de.componentName
429
+ ) }) : null;
430
+ }
431
+ const yn = Qe(It);
432
+ var _e = ["PageUp", "PageDown"], Ie = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], Ne = {
433
+ "from-left": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
434
+ "from-right": ["Home", "PageDown", "ArrowDown", "ArrowRight"],
435
+ "from-bottom": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
436
+ "from-top": ["Home", "PageDown", "ArrowUp", "ArrowLeft"]
437
+ }, U = "Slider", [te, Nt, Mt] = ft(U), [Me] = dt(U, [
438
+ Mt
439
+ ]), [Vt, X] = Me(U), Ve = C.forwardRef(
440
+ (e, t) => {
441
+ const {
442
+ name: o,
443
+ min: r = 0,
444
+ max: s = 100,
445
+ step: l = 1,
446
+ orientation: n = "horizontal",
447
+ disabled: a = !1,
448
+ minStepsBetweenThumbs: u = 0,
449
+ defaultValue: g = [r],
450
+ value: S,
451
+ onValueChange: i = () => {
452
+ },
453
+ onValueCommit: c = () => {
454
+ },
455
+ inverted: b = !1,
456
+ form: E,
457
+ ...d
458
+ } = e, h = C.useRef(/* @__PURE__ */ new Set()), v = C.useRef(0), f = n === "horizontal" ? Lt : At, [w = [], y] = Se({
459
+ prop: S,
460
+ defaultProp: g,
461
+ onChange: (R) => {
462
+ var M;
463
+ (M = [...h.current][v.current]) == null || M.focus(), i(R);
464
+ }
465
+ }), K = C.useRef(w);
466
+ function O(R) {
467
+ const I = qt(w, R);
468
+ _(R, I);
469
+ }
470
+ function Y(R) {
471
+ _(R, v.current);
472
+ }
473
+ function $() {
474
+ const R = K.current[v.current];
475
+ w[v.current] !== R && c(w);
476
+ }
477
+ function _(R, I, { commit: M } = { commit: !1 }) {
478
+ const q = Ut(l), A = Qt(Math.round((R - r) / l) * l + r, q), N = Ce(A, [r, s]);
479
+ y((V = []) => {
480
+ const x = Kt(V, N, I);
481
+ if (Ht(x, u * l)) {
482
+ v.current = x.indexOf(N);
483
+ const G = String(x) !== String(V);
484
+ return G && M && c(x), G ? x : V;
485
+ } else
486
+ return V;
487
+ });
488
+ }
489
+ return /* @__PURE__ */ p(
490
+ Vt,
491
+ {
492
+ scope: e.__scopeSlider,
493
+ name: o,
494
+ disabled: a,
495
+ min: r,
496
+ max: s,
497
+ valueIndexToChangeRef: v,
498
+ thumbs: h.current,
499
+ values: w,
500
+ orientation: n,
501
+ form: E,
502
+ children: /* @__PURE__ */ p(te.Provider, { scope: e.__scopeSlider, children: /* @__PURE__ */ p(te.Slot, { scope: e.__scopeSlider, children: /* @__PURE__ */ p(
503
+ f,
504
+ {
505
+ "aria-disabled": a,
506
+ "data-disabled": a ? "" : void 0,
507
+ ...d,
508
+ ref: t,
509
+ onPointerDown: k(d.onPointerDown, () => {
510
+ a || (K.current = w);
511
+ }),
512
+ min: r,
513
+ max: s,
514
+ inverted: b,
515
+ onSlideStart: a ? void 0 : O,
516
+ onSlideMove: a ? void 0 : Y,
517
+ onSlideEnd: a ? void 0 : $,
518
+ onHomeKeyDown: () => !a && _(r, 0, { commit: !0 }),
519
+ onEndKeyDown: () => !a && _(s, w.length - 1, { commit: !0 }),
520
+ onStepKeyDown: ({ event: R, direction: I }) => {
521
+ if (!a) {
522
+ const A = _e.includes(R.key) || R.shiftKey && Ie.includes(R.key) ? 10 : 1, N = v.current, V = w[N], x = l * A * I;
523
+ _(V + x, N, { commit: !0 });
524
+ }
525
+ }
526
+ }
527
+ ) }) })
528
+ }
529
+ );
530
+ }
531
+ );
532
+ Ve.displayName = U;
533
+ var [Le, Ae] = Me(U, {
534
+ startEdge: "left",
535
+ endEdge: "right",
536
+ size: "width",
537
+ direction: 1
538
+ }), Lt = C.forwardRef(
539
+ (e, t) => {
540
+ const {
541
+ min: o,
542
+ max: r,
543
+ dir: s,
544
+ inverted: l,
545
+ onSlideStart: n,
546
+ onSlideMove: a,
547
+ onSlideEnd: u,
548
+ onStepKeyDown: g,
549
+ ...S
550
+ } = e, [i, c] = C.useState(null), b = H(t, (f) => c(f)), E = C.useRef(void 0), d = mt(s), h = d === "ltr", v = h && !l || !h && l;
551
+ function P(f) {
552
+ const w = E.current || i.getBoundingClientRect(), y = [0, w.width], O = se(y, v ? [o, r] : [r, o]);
553
+ return E.current = w, O(f - w.left);
554
+ }
555
+ return /* @__PURE__ */ p(
556
+ Le,
557
+ {
558
+ scope: e.__scopeSlider,
559
+ startEdge: v ? "left" : "right",
560
+ endEdge: v ? "right" : "left",
561
+ direction: v ? 1 : -1,
562
+ size: "width",
563
+ children: /* @__PURE__ */ p(
564
+ Fe,
565
+ {
566
+ dir: d,
567
+ "data-orientation": "horizontal",
568
+ ...S,
569
+ ref: b,
570
+ style: {
571
+ ...S.style,
572
+ "--radix-slider-thumb-transform": "translateX(-50%)"
573
+ },
574
+ onSlideStart: (f) => {
575
+ const w = P(f.clientX);
576
+ n == null || n(w);
577
+ },
578
+ onSlideMove: (f) => {
579
+ const w = P(f.clientX);
580
+ a == null || a(w);
581
+ },
582
+ onSlideEnd: () => {
583
+ E.current = void 0, u == null || u();
584
+ },
585
+ onStepKeyDown: (f) => {
586
+ const y = Ne[v ? "from-left" : "from-right"].includes(f.key);
587
+ g == null || g({ event: f, direction: y ? -1 : 1 });
588
+ }
589
+ }
590
+ )
591
+ }
592
+ );
593
+ }
594
+ ), At = C.forwardRef(
595
+ (e, t) => {
596
+ const {
597
+ min: o,
598
+ max: r,
599
+ inverted: s,
600
+ onSlideStart: l,
601
+ onSlideMove: n,
602
+ onSlideEnd: a,
603
+ onStepKeyDown: u,
604
+ ...g
605
+ } = e, S = C.useRef(null), i = H(t, S), c = C.useRef(void 0), b = !s;
606
+ function E(d) {
607
+ const h = c.current || S.current.getBoundingClientRect(), v = [0, h.height], f = se(v, b ? [r, o] : [o, r]);
608
+ return c.current = h, f(d - h.top);
609
+ }
610
+ return /* @__PURE__ */ p(
611
+ Le,
612
+ {
613
+ scope: e.__scopeSlider,
614
+ startEdge: b ? "bottom" : "top",
615
+ endEdge: b ? "top" : "bottom",
616
+ size: "height",
617
+ direction: b ? 1 : -1,
618
+ children: /* @__PURE__ */ p(
619
+ Fe,
620
+ {
621
+ "data-orientation": "vertical",
622
+ ...g,
623
+ ref: i,
624
+ style: {
625
+ ...g.style,
626
+ "--radix-slider-thumb-transform": "translateY(50%)"
627
+ },
628
+ onSlideStart: (d) => {
629
+ const h = E(d.clientY);
630
+ l == null || l(h);
631
+ },
632
+ onSlideMove: (d) => {
633
+ const h = E(d.clientY);
634
+ n == null || n(h);
635
+ },
636
+ onSlideEnd: () => {
637
+ c.current = void 0, a == null || a();
638
+ },
639
+ onStepKeyDown: (d) => {
640
+ const v = Ne[b ? "from-bottom" : "from-top"].includes(d.key);
641
+ u == null || u({ event: d, direction: v ? -1 : 1 });
642
+ }
643
+ }
644
+ )
645
+ }
646
+ );
647
+ }
648
+ ), Fe = C.forwardRef(
649
+ (e, t) => {
650
+ const {
651
+ __scopeSlider: o,
652
+ onSlideStart: r,
653
+ onSlideMove: s,
654
+ onSlideEnd: l,
655
+ onHomeKeyDown: n,
656
+ onEndKeyDown: a,
657
+ onStepKeyDown: u,
658
+ ...g
659
+ } = e, S = X(U, o);
660
+ return /* @__PURE__ */ p(
661
+ z.span,
662
+ {
663
+ ...g,
664
+ ref: t,
665
+ onKeyDown: k(e.onKeyDown, (i) => {
666
+ i.key === "Home" ? (n(i), i.preventDefault()) : i.key === "End" ? (a(i), i.preventDefault()) : _e.concat(Ie).includes(i.key) && (u(i), i.preventDefault());
667
+ }),
668
+ onPointerDown: k(e.onPointerDown, (i) => {
669
+ const c = i.target;
670
+ c.setPointerCapture(i.pointerId), i.preventDefault(), S.thumbs.has(c) ? c.focus() : r(i);
671
+ }),
672
+ onPointerMove: k(e.onPointerMove, (i) => {
673
+ i.target.hasPointerCapture(i.pointerId) && s(i);
674
+ }),
675
+ onPointerUp: k(e.onPointerUp, (i) => {
676
+ const c = i.target;
677
+ c.hasPointerCapture(i.pointerId) && (c.releasePointerCapture(i.pointerId), l(i));
678
+ })
679
+ }
680
+ );
681
+ }
682
+ ), ke = "SliderTrack", Ke = C.forwardRef(
683
+ (e, t) => {
684
+ const { __scopeSlider: o, ...r } = e, s = X(ke, o);
685
+ return /* @__PURE__ */ p(
686
+ z.span,
687
+ {
688
+ "data-disabled": s.disabled ? "" : void 0,
689
+ "data-orientation": s.orientation,
690
+ ...r,
691
+ ref: t
692
+ }
693
+ );
694
+ }
695
+ );
696
+ Ke.displayName = ke;
697
+ var ne = "SliderRange", Oe = C.forwardRef(
698
+ (e, t) => {
699
+ const { __scopeSlider: o, ...r } = e, s = X(ne, o), l = Ae(ne, o), n = C.useRef(null), a = H(t, n), u = s.values.length, g = s.values.map(
700
+ (c) => ze(c, s.min, s.max)
701
+ ), S = u > 1 ? Math.min(...g) : 0, i = 100 - Math.max(...g);
702
+ return /* @__PURE__ */ p(
703
+ z.span,
704
+ {
705
+ "data-orientation": s.orientation,
706
+ "data-disabled": s.disabled ? "" : void 0,
707
+ ...r,
708
+ ref: a,
709
+ style: {
710
+ ...e.style,
711
+ [l.startEdge]: S + "%",
712
+ [l.endEdge]: i + "%"
713
+ }
714
+ }
715
+ );
716
+ }
717
+ );
718
+ Oe.displayName = ne;
719
+ var re = "SliderThumb", qe = C.forwardRef(
720
+ (e, t) => {
721
+ const o = Nt(e.__scopeSlider), [r, s] = C.useState(null), l = H(t, (a) => s(a)), n = C.useMemo(
722
+ () => r ? o().findIndex((a) => a.ref.current === r) : -1,
723
+ [o, r]
724
+ );
725
+ return /* @__PURE__ */ p(Ft, { ...e, ref: l, index: n });
726
+ }
727
+ ), Ft = C.forwardRef(
728
+ (e, t) => {
729
+ const { __scopeSlider: o, index: r, name: s, ...l } = e, n = X(re, o), a = Ae(re, o), [u, g] = C.useState(null), S = H(t, (P) => g(P)), i = u ? n.form || !!u.closest("form") : !0, c = pt(u), b = n.values[r], E = b === void 0 ? 0 : ze(b, n.min, n.max), d = Ot(r, n.values.length), h = c == null ? void 0 : c[a.size], v = h ? Bt(h, E, a.direction) : 0;
730
+ return C.useEffect(() => {
731
+ if (u)
732
+ return n.thumbs.add(u), () => {
733
+ n.thumbs.delete(u);
734
+ };
735
+ }, [u, n.thumbs]), /* @__PURE__ */ B(
736
+ "span",
737
+ {
738
+ style: {
739
+ transform: "var(--radix-slider-thumb-transform)",
740
+ position: "absolute",
741
+ [a.startEdge]: `calc(${E}% + ${v}px)`
742
+ },
743
+ children: [
744
+ /* @__PURE__ */ p(te.ItemSlot, { scope: e.__scopeSlider, children: /* @__PURE__ */ p(
745
+ z.span,
746
+ {
747
+ role: "slider",
748
+ "aria-label": e["aria-label"] || d,
749
+ "aria-valuemin": n.min,
750
+ "aria-valuenow": b,
751
+ "aria-valuemax": n.max,
752
+ "aria-orientation": n.orientation,
753
+ "data-orientation": n.orientation,
754
+ "data-disabled": n.disabled ? "" : void 0,
755
+ tabIndex: n.disabled ? void 0 : 0,
756
+ ...l,
757
+ ref: S,
758
+ style: b === void 0 ? { display: "none" } : e.style,
759
+ onFocus: k(e.onFocus, () => {
760
+ n.valueIndexToChangeRef.current = r;
761
+ })
762
+ }
763
+ ) }),
764
+ i && /* @__PURE__ */ p(
765
+ Be,
766
+ {
767
+ name: s ?? (n.name ? n.name + (n.values.length > 1 ? "[]" : "") : void 0),
768
+ form: n.form,
769
+ value: b
770
+ },
771
+ r
772
+ )
773
+ ]
774
+ }
775
+ );
776
+ }
777
+ );
778
+ qe.displayName = re;
779
+ var kt = "RadioBubbleInput", Be = C.forwardRef(
780
+ ({ __scopeSlider: e, value: t, ...o }, r) => {
781
+ const s = C.useRef(null), l = H(s, r), n = gt(t);
782
+ return C.useEffect(() => {
783
+ const a = s.current;
784
+ if (!a) return;
785
+ const u = window.HTMLInputElement.prototype, S = Object.getOwnPropertyDescriptor(u, "value").set;
786
+ if (n !== t && S) {
787
+ const i = new Event("input", { bubbles: !0 });
788
+ S.call(a, t), a.dispatchEvent(i);
789
+ }
790
+ }, [n, t]), /* @__PURE__ */ p(
791
+ z.input,
792
+ {
793
+ style: { display: "none" },
794
+ ...o,
795
+ ref: l,
796
+ defaultValue: t
797
+ }
798
+ );
799
+ }
800
+ );
801
+ Be.displayName = kt;
802
+ function Kt(e = [], t, o) {
803
+ const r = [...e];
804
+ return r[o] = t, r.sort((s, l) => s - l);
805
+ }
806
+ function ze(e, t, o) {
807
+ const l = 100 / (o - t) * (e - t);
808
+ return Ce(l, [0, 100]);
809
+ }
810
+ function Ot(e, t) {
811
+ return t > 2 ? `Value ${e + 1} of ${t}` : t === 2 ? ["Minimum", "Maximum"][e] : void 0;
812
+ }
813
+ function qt(e, t) {
814
+ if (e.length === 1) return 0;
815
+ const o = e.map((s) => Math.abs(s - t)), r = Math.min(...o);
816
+ return o.indexOf(r);
817
+ }
818
+ function Bt(e, t, o) {
819
+ const r = e / 2, l = se([0, 50], [0, r]);
820
+ return (r - l(t) * o) * o;
821
+ }
822
+ function zt(e) {
823
+ return e.slice(0, -1).map((t, o) => e[o + 1] - t);
824
+ }
825
+ function Ht(e, t) {
826
+ if (t > 0) {
827
+ const o = zt(e);
828
+ return Math.min(...o) >= t;
829
+ }
830
+ return !0;
831
+ }
832
+ function se(e, t) {
833
+ return (o) => {
834
+ if (e[0] === e[1] || t[0] === t[1]) return t[0];
835
+ const r = (t[1] - t[0]) / (e[1] - e[0]);
836
+ return t[0] + r * (o - e[0]);
837
+ };
838
+ }
839
+ function Ut(e) {
840
+ return (String(e).split(".")[1] || "").length;
841
+ }
842
+ function Qt(e, t) {
843
+ const o = Math.pow(10, t);
844
+ return Math.round(e * o) / o;
845
+ }
846
+ var He = Ve, Yt = Ke, $t = Oe, Gt = qe;
847
+ const jt = C.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ B(
848
+ He,
849
+ {
850
+ ref: o,
851
+ className: ve(
852
+ "relative flex w-full touch-none select-none items-center",
853
+ e
854
+ ),
855
+ ...t,
856
+ children: [
857
+ /* @__PURE__ */ p(Yt, { className: "relative h-2 w-full grow overflow-hidden rounded-full bg-secondary", children: /* @__PURE__ */ p($t, { className: "absolute h-full bg-primary" }) }),
858
+ /* @__PURE__ */ p(Gt, { className: "block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50" })
859
+ ]
860
+ }
861
+ ));
862
+ jt.displayName = He.displayName;
863
+ export {
864
+ yn as E,
865
+ dn as F,
866
+ gn as I,
867
+ hn as M,
868
+ mn as P,
869
+ vn as R,
870
+ Sn as S,
871
+ Rt as T,
872
+ pn as a,
873
+ _t as b,
874
+ fn as c,
875
+ jt as d
876
+ };