@pitcher/canvas-ui 2025.12.10-71132 → 2025.12.10-82548

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/canvas-ui.js CHANGED
@@ -92770,6 +92770,55 @@ function renderTemplate(template, context = {}) {
92770
92770
  return template;
92771
92771
  }
92772
92772
  }
92773
+ function registerCustomHelper(helper) {
92774
+ if (!helper || typeof helper.name !== "string" || !helper.name.trim()) {
92775
+ console.warn("[handlebars] Invalid helper: missing or empty name");
92776
+ return false;
92777
+ }
92778
+ if (typeof helper.code !== "string" || !helper.code.trim()) {
92779
+ console.warn(`[handlebars] Invalid helper "${helper.name}": missing or empty code`);
92780
+ return false;
92781
+ }
92782
+ try {
92783
+ const fn = new Function("return " + helper.code)();
92784
+ if (typeof fn !== "function") {
92785
+ console.warn(`[handlebars] Helper "${helper.name}" code does not evaluate to a function`);
92786
+ return false;
92787
+ }
92788
+ Handlebars.registerHelper(helper.name, fn);
92789
+ console.info(`[handlebars] Registered custom helper: ${helper.name}`);
92790
+ return true;
92791
+ } catch (e) {
92792
+ console.warn(`[handlebars] Failed to register helper "${helper.name}":`, e?.message);
92793
+ return false;
92794
+ }
92795
+ }
92796
+ function registerCustomHelpers(helpers) {
92797
+ let registered = 0;
92798
+ let failed = 0;
92799
+ for (const helper of helpers) {
92800
+ if (registerCustomHelper(helper)) {
92801
+ registered++;
92802
+ } else {
92803
+ failed++;
92804
+ }
92805
+ }
92806
+ return { registered, failed };
92807
+ }
92808
+ function loadCustomHelpersFromApps(installedApps) {
92809
+ const helpersApp = installedApps.find((app) => app.app_metadata?.name === "handlebars-helpers");
92810
+ if (!helpersApp) {
92811
+ console.info("[handlebars] No handlebars-helpers app installed");
92812
+ return { registered: 0, failed: 0 };
92813
+ }
92814
+ const helpers = helpersApp.metadata?.handlebars_helpers;
92815
+ if (!helpers || !Array.isArray(helpers) || helpers.length === 0) {
92816
+ console.info("[handlebars] handlebars-helpers app has no helpers configured");
92817
+ return { registered: 0, failed: 0 };
92818
+ }
92819
+ console.info(`[handlebars] Loading ${helpers.length} custom helper(s) from handlebars-helpers app`);
92820
+ return registerCustomHelpers(helpers);
92821
+ }
92773
92822
 
92774
92823
  function createPageId(fileId, pageIndex) {
92775
92824
  return `file-${fileId}-page-index-${pageIndex}`;
@@ -94586,40 +94635,40 @@ const _hoisted_47$4 = { class: "ml-2 text-sm text-gray-500" };
94586
94635
  const _hoisted_48$4 = ["data-result-selected", "onClick"];
94587
94636
  const _hoisted_49$4 = { class: "w-18 h-14 border-rounded-1 mr-4 flex-shrink-0 bg-gray-200 flex items-center justify-center" };
94588
94637
  const _hoisted_50$4 = { class: "flex-1 min-w-0" };
94589
- const _hoisted_51$2 = { class: "text-sm font-bold text-gray-900 truncate mb-1" };
94590
- const _hoisted_52$2 = { class: "text-xs text-gray-500" };
94591
- const _hoisted_53$2 = { class: "text-xs text-gray-400" };
94592
- const _hoisted_54$1 = {
94638
+ const _hoisted_51$3 = { class: "text-sm font-bold text-gray-900 truncate mb-1" };
94639
+ const _hoisted_52$3 = { class: "text-xs text-gray-500" };
94640
+ const _hoisted_53$3 = { class: "text-xs text-gray-400" };
94641
+ const _hoisted_54$2 = {
94593
94642
  key: 0,
94594
94643
  class: "px-0 py-0"
94595
94644
  };
94596
- const _hoisted_55$1 = {
94645
+ const _hoisted_55$2 = {
94597
94646
  key: 0,
94598
94647
  class: "flex flex-col items-center justify-center text-center p-8 gap-4"
94599
94648
  };
94600
- const _hoisted_56$1 = {
94649
+ const _hoisted_56$2 = {
94601
94650
  key: 2,
94602
94651
  class: "flex-1 overflow-y-auto bg-white w-full"
94603
94652
  };
94604
- const _hoisted_57$1 = { class: "w-full px-0" };
94605
- const _hoisted_58$1 = { class: "flex items-center px-0 pt-2 pb-1" };
94606
- const _hoisted_59$1 = { class: "text-m font-semibold text-gray-900" };
94607
- const _hoisted_60$1 = { class: "ml-2 text-sm text-gray-500" };
94608
- const _hoisted_61$1 = ["data-result-selected", "onClick"];
94609
- const _hoisted_62$1 = {
94653
+ const _hoisted_57$2 = { class: "w-full px-0" };
94654
+ const _hoisted_58$2 = { class: "flex items-center px-0 pt-2 pb-1" };
94655
+ const _hoisted_59$2 = { class: "text-m font-semibold text-gray-900" };
94656
+ const _hoisted_60$2 = { class: "ml-2 text-sm text-gray-500" };
94657
+ const _hoisted_61$2 = ["data-result-selected", "onClick"];
94658
+ const _hoisted_62$2 = {
94610
94659
  key: 1,
94611
94660
  class: "w-18 h-14 border-rounded-1 mr-4 flex-shrink-0 bg-gray-200 flex items-center justify-center"
94612
94661
  };
94613
- const _hoisted_63$1 = { class: "flex-1 min-w-0" };
94614
- const _hoisted_64$1 = { class: "text-sm font-bold text-gray-900 truncate mb-1" };
94615
- const _hoisted_65$1 = ["innerHTML"];
94616
- const _hoisted_66$1 = { class: "text-xs text-gray-500" };
94617
- const _hoisted_67$1 = { class: "text-xs text-gray-400" };
94618
- const _hoisted_68$1 = {
94662
+ const _hoisted_63$2 = { class: "flex-1 min-w-0" };
94663
+ const _hoisted_64$2 = { class: "text-sm font-bold text-gray-900 truncate mb-1" };
94664
+ const _hoisted_65$2 = ["innerHTML"];
94665
+ const _hoisted_66$2 = { class: "text-xs text-gray-500" };
94666
+ const _hoisted_67$2 = { class: "text-xs text-gray-400" };
94667
+ const _hoisted_68$2 = {
94619
94668
  key: 0,
94620
94669
  class: "flex flex-col items-center justify-center text-center p-8 gap-4"
94621
94670
  };
94622
- const _hoisted_69 = {
94671
+ const _hoisted_69$1 = {
94623
94672
  key: 0,
94624
94673
  class: "flex flex-wrap line-height-6 pt-4 pb-2 px-6 border-t border-gray-200 gap-y-4 gap-x-4"
94625
94674
  };
@@ -95798,14 +95847,14 @@ const _sfc_main$5I = /* @__PURE__ */ defineComponent({
95798
95847
  })
95799
95848
  ]),
95800
95849
  createElementVNode("div", _hoisted_50$4, [
95801
- createElementVNode("h3", _hoisted_51$2, toDisplayString(item.name), 1),
95802
- createElementVNode("p", _hoisted_52$2, toDisplayString(formatCanvasType(item.content_type)), 1)
95850
+ createElementVNode("h3", _hoisted_51$3, toDisplayString(item.name), 1),
95851
+ createElementVNode("p", _hoisted_52$3, toDisplayString(formatCanvasType(item.content_type)), 1)
95803
95852
  ]),
95804
- createElementVNode("div", _hoisted_53$2, toDisplayString(item.folder?.name || ""), 1)
95853
+ createElementVNode("div", _hoisted_53$3, toDisplayString(item.folder?.name || ""), 1)
95805
95854
  ], 10, _hoisted_48$4);
95806
95855
  }), 128))
95807
95856
  ]),
95808
- filteredCanvasFiles.value.length > 5 ? (openBlock(), createElementBlock("div", _hoisted_54$1, [
95857
+ filteredCanvasFiles.value.length > 5 ? (openBlock(), createElementBlock("div", _hoisted_54$2, [
95809
95858
  createElementVNode("span", {
95810
95859
  class: "text-sm text-gray-600 hover:text-gray-800 font-bold flex items-center cursor-pointer",
95811
95860
  onClick: _cache[14] || (_cache[14] = ($event) => searchType.value = "canvases")
@@ -95820,7 +95869,7 @@ const _sfc_main$5I = /* @__PURE__ */ defineComponent({
95820
95869
  ])) : createCommentVNode("", true)
95821
95870
  ])) : createCommentVNode("", true)
95822
95871
  ]),
95823
- searchError.value || shouldShowNoResults.value ? (openBlock(), createElementBlock("div", _hoisted_55$1, [
95872
+ searchError.value || shouldShowNoResults.value ? (openBlock(), createElementBlock("div", _hoisted_55$2, [
95824
95873
  createVNode(CIcon, {
95825
95874
  class: "text-6xl",
95826
95875
  color: searchError.value ? "var(--p-error)" : "var(--p-text3)",
@@ -95831,9 +95880,9 @@ const _sfc_main$5I = /* @__PURE__ */ defineComponent({
95831
95880
  class: normalizeClass(searchError.value ? "text-error font-semibold" : "text-text2")
95832
95881
  }, toDisplayString(searchError.value || unref(t)("canvasUI.CGlobalSearch.noResults")), 3)
95833
95882
  ])) : createCommentVNode("", true)
95834
- ])) : (openBlock(), createElementBlock("div", _hoisted_56$1, [
95835
- createElementVNode("div", _hoisted_57$1, [
95836
- createElementVNode("div", _hoisted_58$1, [
95883
+ ])) : (openBlock(), createElementBlock("div", _hoisted_56$2, [
95884
+ createElementVNode("div", _hoisted_57$2, [
95885
+ createElementVNode("div", _hoisted_58$2, [
95837
95886
  searchType.value === "content" ? (openBlock(), createBlock(CIcon, {
95838
95887
  key: 0,
95839
95888
  class: "mr-2",
@@ -95847,8 +95896,8 @@ const _sfc_main$5I = /* @__PURE__ */ defineComponent({
95847
95896
  icon: "presentation",
95848
95897
  size: "16"
95849
95898
  })),
95850
- createElementVNode("span", _hoisted_59$1, toDisplayString(searchType.value === "content" ? unref(t)("canvasUI.CAlgoliaSearch.sections.content") : unref(t)("canvasUI.CAlgoliaSearch.sections.pitchDecks")), 1),
95851
- createElementVNode("span", _hoisted_60$1, " (" + toDisplayString(searchType.value === "content" ? filteredContentFiles.value.length : filteredCanvasFiles.value.length) + ") ", 1)
95899
+ createElementVNode("span", _hoisted_59$2, toDisplayString(searchType.value === "content" ? unref(t)("canvasUI.CAlgoliaSearch.sections.content") : unref(t)("canvasUI.CAlgoliaSearch.sections.pitchDecks")), 1),
95900
+ createElementVNode("span", _hoisted_60$2, " (" + toDisplayString(searchType.value === "content" ? filteredContentFiles.value.length : filteredCanvasFiles.value.length) + ") ", 1)
95852
95901
  ]),
95853
95902
  createElementVNode("div", null, [
95854
95903
  (openBlock(true), createElementBlock(Fragment, null, renderList(searchType.value === "content" ? filteredContentFiles.value : filteredCanvasFiles.value, (item) => {
@@ -95873,7 +95922,7 @@ const _sfc_main$5I = /* @__PURE__ */ defineComponent({
95873
95922
  "object-fit": "cover",
95874
95923
  src: item.picture_url || "",
95875
95924
  width: "72"
95876
- }, null, 8, ["file-data", "src"])) : (openBlock(), createElementBlock("div", _hoisted_62$1, [
95925
+ }, null, 8, ["file-data", "src"])) : (openBlock(), createElementBlock("div", _hoisted_62$2, [
95877
95926
  searchType.value === "content" ? (openBlock(), createBlock(CIcon, {
95878
95927
  key: 0,
95879
95928
  color: "var(--p-text2)",
@@ -95886,20 +95935,20 @@ const _sfc_main$5I = /* @__PURE__ */ defineComponent({
95886
95935
  size: "32"
95887
95936
  }))
95888
95937
  ])),
95889
- createElementVNode("div", _hoisted_63$1, [
95890
- createElementVNode("h3", _hoisted_64$1, toDisplayString(item.name), 1),
95938
+ createElementVNode("div", _hoisted_63$2, [
95939
+ createElementVNode("h3", _hoisted_64$2, toDisplayString(item.name), 1),
95891
95940
  searchType.value === "content" && item.type === "file" && getSnippet(item) ? (openBlock(), createElementBlock("p", {
95892
95941
  key: 0,
95893
95942
  class: "text-xs text-gray-600 mb-1",
95894
95943
  innerHTML: getSnippet(item)
95895
- }, null, 8, _hoisted_65$1)) : createCommentVNode("", true),
95896
- createElementVNode("p", _hoisted_66$1, toDisplayString(searchType.value === "content" ? item.type === "folder" ? "Folder" : item.content_type || "PDF" : formatCanvasType(item.content_type)), 1)
95944
+ }, null, 8, _hoisted_65$2)) : createCommentVNode("", true),
95945
+ createElementVNode("p", _hoisted_66$2, toDisplayString(searchType.value === "content" ? item.type === "folder" ? "Folder" : item.content_type || "PDF" : formatCanvasType(item.content_type)), 1)
95897
95946
  ]),
95898
- createElementVNode("div", _hoisted_67$1, toDisplayString(searchType.value === "content" && item.type === "folder" ? item.parent_folder?.name || "" : item.folder?.name || ""), 1)
95899
- ], 10, _hoisted_61$1);
95947
+ createElementVNode("div", _hoisted_67$2, toDisplayString(searchType.value === "content" && item.type === "folder" ? item.parent_folder?.name || "" : item.folder?.name || ""), 1)
95948
+ ], 10, _hoisted_61$2);
95900
95949
  }), 128))
95901
95950
  ]),
95902
- searchError.value || shouldShowNoResults.value ? (openBlock(), createElementBlock("div", _hoisted_68$1, [
95951
+ searchError.value || shouldShowNoResults.value ? (openBlock(), createElementBlock("div", _hoisted_68$2, [
95903
95952
  createVNode(CIcon, {
95904
95953
  class: "text-6xl",
95905
95954
  color: searchError.value ? "var(--p-error)" : "var(--p-text3)",
@@ -95913,7 +95962,7 @@ const _sfc_main$5I = /* @__PURE__ */ defineComponent({
95913
95962
  ])
95914
95963
  ]))
95915
95964
  ]),
95916
- !showRecentView.value ? (openBlock(), createElementBlock("div", _hoisted_69, [
95965
+ !showRecentView.value ? (openBlock(), createElementBlock("div", _hoisted_69$1, [
95917
95966
  createVNode(CShortcut, null, {
95918
95967
  default: withCtx(() => [
95919
95968
  createVNode(CShortcutIcon, { icon: "arrow-up" }),
@@ -140790,17 +140839,96 @@ const _sfc_main$2G = /* @__PURE__ */ defineComponent({
140790
140839
  }
140791
140840
  });
140792
140841
 
140793
- const _hoisted_1$24 = { class: "cb-data-charts-raw" };
140842
+ const _hoisted_1$24 = {
140843
+ key: 0,
140844
+ class: "cb-data-charts-raw__controls"
140845
+ };
140794
140846
  const _sfc_main$2F = /* @__PURE__ */ defineComponent({
140795
140847
  __name: "DataCharts.raw",
140796
140848
  props: {
140797
- data: {}
140849
+ data: {},
140850
+ isPreview: { type: Boolean },
140851
+ isEditMode: { type: Boolean }
140798
140852
  },
140799
140853
  setup(__props) {
140854
+ const { t } = useI18n();
140800
140855
  const chartRef = ref(null);
140856
+ const containerRef = ref(null);
140801
140857
  let chart = null;
140802
140858
  const isChartLoaded = ref(false);
140859
+ const isFullscreen = ref(false);
140860
+ const currentChartType = ref("");
140803
140861
  const props = __props;
140862
+ const showViewControls = computed(() => {
140863
+ if (props.isPreview || props.isEditMode) return false;
140864
+ return props.data?.view_controls?.enable_fullscreen_btn || props.data?.view_controls?.enable_chart_type_switcher;
140865
+ });
140866
+ const containerStyle = computed(() => {
140867
+ if (isFullscreen.value || props.isPreview) {
140868
+ return {};
140869
+ }
140870
+ return {
140871
+ height: props.data?.chart_height ? `${props.data.chart_height}px` : void 0,
140872
+ width: props.data?.chart_width ? `${props.data.chart_width}%` : void 0,
140873
+ minHeight: props.data?.chart_height ? `${props.data.chart_height}px` : void 0,
140874
+ maxHeight: props.data?.chart_height ? `${props.data.chart_height}px` : void 0
140875
+ };
140876
+ });
140877
+ const originalChartType = computed(() => {
140878
+ return props.data?.type || props.data?._primary_chart_type || "bar";
140879
+ });
140880
+ const isScatterChart = computed(() => originalChartType.value === "scatter");
140881
+ const isBubbleChart = computed(() => originalChartType.value === "bubble");
140882
+ const labelValueChartTypes = [
140883
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.bar"), key: "bar" },
140884
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.line"), key: "line" },
140885
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.area"), key: "area" },
140886
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.pie"), key: "pie" },
140887
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.doughnut"), key: "doughnut" },
140888
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.polarArea"), key: "polarArea" },
140889
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.radar"), key: "radar" }
140890
+ ];
140891
+ const scatterChartTypes = [{ label: t("canvasUI.canvasBuilder.dataCharts.types.scatter"), key: "scatter" }];
140892
+ const bubbleChartTypes = [{ label: t("canvasUI.canvasBuilder.dataCharts.types.bubble"), key: "bubble" }];
140893
+ const chartTypeSwitcherOptions = computed(() => {
140894
+ if (isBubbleChart.value) return bubbleChartTypes;
140895
+ if (isScatterChart.value) return scatterChartTypes;
140896
+ return labelValueChartTypes;
140897
+ });
140898
+ function toggleFullscreen() {
140899
+ if (!containerRef.value) return;
140900
+ if (!isFullscreen.value) {
140901
+ isFullscreen.value = true;
140902
+ } else {
140903
+ isFullscreen.value = false;
140904
+ }
140905
+ nextTick(() => {
140906
+ if (chart) {
140907
+ chart.resize();
140908
+ }
140909
+ });
140910
+ }
140911
+ function handleChartTypeChange(newType) {
140912
+ if (!chart || !props.data) return;
140913
+ currentChartType.value = newType;
140914
+ initChart(newType);
140915
+ }
140916
+ function handleKeydown(e) {
140917
+ if (e.key === "Escape" && isFullscreen.value) {
140918
+ isFullscreen.value = false;
140919
+ nextTick(() => {
140920
+ if (chart) {
140921
+ chart.resize();
140922
+ }
140923
+ });
140924
+ }
140925
+ }
140926
+ onMounted(() => {
140927
+ window.addEventListener("keydown", handleKeydown);
140928
+ });
140929
+ onUnmounted(() => {
140930
+ window.removeEventListener("keydown", handleKeydown);
140931
+ });
140804
140932
  const sectionListSectionInfo = inject(
140805
140933
  "sectionListSectionInfo",
140806
140934
  computed(() => null)
@@ -140831,41 +140959,191 @@ const _sfc_main$2F = /* @__PURE__ */ defineComponent({
140831
140959
  }
140832
140960
  return window._chartJsPromise;
140833
140961
  }
140834
- function processChartData(chartData, context) {
140962
+ function normalizeRValues(values, minRadius = 5, maxRadius = 40) {
140963
+ if (values.length === 0) return [];
140964
+ const rValues = values.map((v) => v.r);
140965
+ const minR = Math.min(...rValues);
140966
+ const maxR = Math.max(...rValues);
140967
+ if (minR === maxR) {
140968
+ return values.map((v) => ({
140969
+ ...v,
140970
+ r: (minRadius + maxRadius) / 2,
140971
+ originalR: v.r
140972
+ }));
140973
+ }
140974
+ return values.map((v) => ({
140975
+ ...v,
140976
+ r: minRadius + (v.r - minR) / (maxR - minR) * (maxRadius - minRadius),
140977
+ originalR: v.r
140978
+ }));
140979
+ }
140980
+ function processSeriesDataPoints(dataPoints, chartType, context) {
140981
+ const isScatterChart2 = chartType === "scatter";
140982
+ const isBubbleChart2 = chartType === "bubble";
140983
+ const isXYChart = isScatterChart2 || isBubbleChart2;
140835
140984
  const processedData = {
140836
140985
  labels: [],
140837
140986
  values: []
140838
140987
  };
140839
- chartData.data_points?.forEach((point) => {
140988
+ const rawBubbleData = [];
140989
+ dataPoints?.forEach((point) => {
140840
140990
  let label = point.label;
140841
- let value = point.value;
140842
140991
  try {
140843
140992
  if (typeof label === "string") {
140844
140993
  label = renderTemplate(label, context);
140845
140994
  }
140846
- if (typeof value === "string") {
140847
- value = renderTemplate(value, context);
140848
- }
140849
- if (typeof label === "string" && label.includes(",") && typeof value === "string" && value.includes(",")) {
140850
- const labels = label.split(",");
140851
- const values = value.split(",");
140852
- labels.forEach((l, idx) => {
140853
- const v = values[idx];
140854
- if (v !== void 0) {
140855
- processedData.labels.push(l);
140856
- processedData.values.push(Number(v) || 0);
140995
+ if (isXYChart) {
140996
+ let xValue = point.x_value ?? "0";
140997
+ let yValue = point.y_value ?? "0";
140998
+ let rValue = point.r_value ?? "10";
140999
+ if (typeof xValue === "string") {
141000
+ xValue = renderTemplate(xValue, context);
141001
+ }
141002
+ if (typeof yValue === "string") {
141003
+ yValue = renderTemplate(yValue, context);
141004
+ }
141005
+ if (typeof rValue === "string") {
141006
+ rValue = renderTemplate(rValue, context);
141007
+ }
141008
+ if (typeof label === "string" && label.includes(",") && typeof xValue === "string" && xValue.includes(",") && typeof yValue === "string" && yValue.includes(",")) {
141009
+ const labels = label.split(",");
141010
+ const xValues = xValue.split(",");
141011
+ const yValues = yValue.split(",");
141012
+ const rValues = typeof rValue === "string" && rValue.includes(",") ? rValue.split(",") : [];
141013
+ labels.forEach((l, idx) => {
141014
+ const x = Number(xValues[idx]) || 0;
141015
+ const y = Number(yValues[idx]) || 0;
141016
+ if (isBubbleChart2) {
141017
+ const r = rValues[idx] ? Number(rValues[idx]) || 10 : 10;
141018
+ rawBubbleData.push({ label: l, x, y, r: Math.abs(r) });
141019
+ } else {
141020
+ processedData.labels.push(l);
141021
+ processedData.values.push({ x, y });
141022
+ }
141023
+ });
141024
+ } else {
141025
+ const x = Number(xValue) || 0;
141026
+ const y = Number(yValue) || 0;
141027
+ if (isBubbleChart2) {
141028
+ const r = Number(rValue) || 10;
141029
+ rawBubbleData.push({ label, x, y, r: Math.abs(r) });
141030
+ } else {
141031
+ processedData.labels.push(label);
141032
+ processedData.values.push({ x, y });
140857
141033
  }
140858
- });
141034
+ }
140859
141035
  } else {
140860
- processedData.labels.push(label);
140861
- processedData.values.push(Number(value) || 0);
141036
+ let value = point.value;
141037
+ if (typeof value === "string") {
141038
+ value = renderTemplate(value, context);
141039
+ }
141040
+ if (typeof label === "string" && label.includes(",") && typeof value === "string" && value.includes(",")) {
141041
+ const labels = label.split(",");
141042
+ const values = value.split(",");
141043
+ labels.forEach((l, idx) => {
141044
+ const v = values[idx];
141045
+ if (v !== void 0) {
141046
+ processedData.labels.push(l);
141047
+ processedData.values.push(Number(v) || 0);
141048
+ }
141049
+ });
141050
+ } else {
141051
+ processedData.labels.push(label);
141052
+ processedData.values.push(Number(value) || 0);
141053
+ }
140862
141054
  }
140863
141055
  } catch (err) {
140864
141056
  console.warn("Error processing chart data point:", err);
140865
- processedData.labels.push(label);
140866
- processedData.values.push(Number(value) || 0);
141057
+ if (isBubbleChart2) {
141058
+ rawBubbleData.push({ label, x: 0, y: 0, r: 10 });
141059
+ } else if (isXYChart) {
141060
+ processedData.labels.push(label);
141061
+ processedData.values.push({ x: 0, y: 0 });
141062
+ } else {
141063
+ processedData.labels.push(label);
141064
+ processedData.values.push(0);
141065
+ }
140867
141066
  }
140868
141067
  });
141068
+ if (isBubbleChart2 && rawBubbleData.length > 0) {
141069
+ const bubbleValues = rawBubbleData.map((d) => ({ x: d.x, y: d.y, r: d.r }));
141070
+ const normalizedValues = normalizeRValues(bubbleValues);
141071
+ rawBubbleData.forEach((d, idx) => {
141072
+ processedData.labels.push(d.label);
141073
+ processedData.values.push(normalizedValues[idx]);
141074
+ });
141075
+ }
141076
+ return processedData;
141077
+ }
141078
+ function processChartData(chartData, context, overrideType) {
141079
+ if (chartData.series && Array.isArray(chartData.series) && chartData.series.length > 0) {
141080
+ const datasets = [];
141081
+ let allLabels = [];
141082
+ const isSingleSeries = chartData.series.length === 1;
141083
+ chartData.series.forEach((series, index) => {
141084
+ const seriesChartType = overrideType || series.chart_type || chartData.type || "bar";
141085
+ const processedData2 = processSeriesDataPoints(series.data_points || [], seriesChartType, context);
141086
+ if (processedData2.labels.length > allLabels.length) {
141087
+ allLabels = processedData2.labels;
141088
+ }
141089
+ const preBuiltDataset = chartData.data?.datasets?.[index];
141090
+ let backgroundColor2 = preBuiltDataset?.background_color || preBuiltDataset?.backgroundColor;
141091
+ let borderColor2 = preBuiltDataset?.border_color || preBuiltDataset?.borderColor;
141092
+ if (isSingleSeries && Array.isArray(backgroundColor2)) {
141093
+ const resolvedColors = backgroundColor2.map((color, i) => {
141094
+ if (typeof color === "string" && color.startsWith("palette")) {
141095
+ const paletteIndex = parseInt(color.replace("palette", ""));
141096
+ const validIndex = paletteIndex >= 0 ? paletteIndex % palette.value.length : i;
141097
+ return palette.value[validIndex];
141098
+ }
141099
+ return color;
141100
+ });
141101
+ const dataPointsCount = processedData2.values.length;
141102
+ backgroundColor2 = Array.from({ length: dataPointsCount }, (_, i) => resolvedColors[i % resolvedColors.length]);
141103
+ borderColor2 = [...backgroundColor2];
141104
+ } else if (typeof backgroundColor2 === "string" && backgroundColor2.startsWith("palette")) {
141105
+ const paletteIndex = parseInt(backgroundColor2.replace("palette", ""));
141106
+ const validIndex = paletteIndex >= 0 ? paletteIndex % palette.value.length : index;
141107
+ backgroundColor2 = palette.value[validIndex];
141108
+ borderColor2 = backgroundColor2;
141109
+ }
141110
+ const datasetOptions = {
141111
+ label: series.name,
141112
+ data: processedData2.values,
141113
+ backgroundColor: backgroundColor2 || palette.value[index % palette.value.length],
141114
+ borderColor: borderColor2 || palette.value[index % palette.value.length],
141115
+ borderWidth: 1
141116
+ };
141117
+ if (!isSingleSeries) {
141118
+ if (series.chart_type === "area") {
141119
+ datasetOptions.type = "line";
141120
+ datasetOptions.fill = true;
141121
+ datasetOptions.tension = 0.4;
141122
+ } else {
141123
+ datasetOptions.type = series.chart_type;
141124
+ }
141125
+ }
141126
+ if (series.chart_type === "area") {
141127
+ datasetOptions.fill = true;
141128
+ datasetOptions.tension = 0.4;
141129
+ }
141130
+ if (["line", "area"].includes(series.chart_type)) {
141131
+ datasetOptions.tension = 0.4;
141132
+ }
141133
+ datasets.push(datasetOptions);
141134
+ });
141135
+ return {
141136
+ ...chartData,
141137
+ type: chartData.type || chartData._primary_chart_type || "bar",
141138
+ data: {
141139
+ ...chartData.data,
141140
+ labels: allLabels,
141141
+ datasets
141142
+ }
141143
+ };
141144
+ }
141145
+ const chartType = overrideType || chartData.type || "bar";
141146
+ const processedData = processSeriesDataPoints(chartData.data_points || [], chartType, context);
140869
141147
  let backgroundColor = chartData.data?.datasets?.[0]?.background_color || [];
140870
141148
  let borderColor = chartData.data?.datasets?.[0]?.border_color || [];
140871
141149
  if (chartData.color_scheme_type === "theme" && Array.isArray(backgroundColor)) {
@@ -140911,7 +141189,7 @@ const _sfc_main$2F = /* @__PURE__ */ defineComponent({
140911
141189
  }
140912
141190
  };
140913
141191
  }
140914
- function initChart() {
141192
+ function initChart(overrideType) {
140915
141193
  if (!props.data || !chartRef.value || !isChartLoaded.value) {
140916
141194
  return;
140917
141195
  }
@@ -140919,25 +141197,85 @@ const _sfc_main$2F = /* @__PURE__ */ defineComponent({
140919
141197
  chart.destroy();
140920
141198
  }
140921
141199
  const context = props.data.context ?? (!isEmpty(activeCanvas.value?.context) || isCanvas.value ? { ...crmShape.value, ...activeCanvas.value?.context } : crmShape.value);
140922
- const processedChartData = processChartData(props.data, context);
141200
+ const processedChartData = processChartData(props.data, context, overrideType);
141201
+ let chartType = overrideType || currentChartType.value || processedChartData.type || "bar";
141202
+ const isAreaChart = chartType === "area";
141203
+ if (isAreaChart) {
141204
+ chartType = "line";
141205
+ }
140923
141206
  if (processedChartData.data?.datasets) {
140924
141207
  processedChartData.data.datasets = processedChartData.data.datasets.map((dataset) => {
140925
- const { background_color, border_color, point_style, ...rest } = dataset;
141208
+ const { background_color, border_color, point_style, fill, tension, show_line, ...rest } = dataset;
140926
141209
  return {
140927
141210
  ...rest,
140928
141211
  backgroundColor: dataset.backgroundColor || background_color || ["#000000"],
140929
141212
  borderColor: dataset.borderColor || border_color || ["#000000"],
140930
- pointStyle: point_style
141213
+ pointStyle: point_style,
141214
+ fill: isAreaChart ? true : fill,
141215
+ tension: isAreaChart ? tension ?? 0.4 : tension,
141216
+ showLine: show_line
140931
141217
  };
140932
141218
  });
140933
141219
  }
141220
+ let scales = processedChartData.options?.scales;
141221
+ if (scales) {
141222
+ const convertedScales = {};
141223
+ if (scales.x) {
141224
+ convertedScales.x = { ...scales.x };
141225
+ }
141226
+ if (scales.y) {
141227
+ convertedScales.y = {
141228
+ ...scales.y,
141229
+ beginAtZero: scales.y.begin_at_zero
141230
+ };
141231
+ delete convertedScales.y.begin_at_zero;
141232
+ }
141233
+ if (scales.r) {
141234
+ convertedScales.r = {
141235
+ ...scales.r,
141236
+ beginAtZero: scales.r.begin_at_zero,
141237
+ ticks: scales.r.ticks ? {
141238
+ stepSize: scales.r.ticks.step_size
141239
+ } : void 0
141240
+ };
141241
+ }
141242
+ scales = convertedScales;
141243
+ }
141244
+ if (["pie", "doughnut", "polarArea"].includes(chartType)) {
141245
+ scales = void 0;
141246
+ }
141247
+ const tooltipCallbacks = {};
141248
+ const isBubble = chartType === "bubble";
141249
+ if (props.data.percent_display || isBubble) {
141250
+ tooltipCallbacks.label = function(context2) {
141251
+ const label = context2.dataset.label || "";
141252
+ const value = context2.raw;
141253
+ if (isBubble && typeof value === "object" && value !== null) {
141254
+ const x = value.x;
141255
+ const y = value.y;
141256
+ const r = value.originalR !== void 0 ? value.originalR : value.r;
141257
+ return `${label}${label ? ": " : ""}(${x}, ${y}, ${r})`;
141258
+ }
141259
+ if (props.data?.percent_display && typeof value === "number" && value >= 0 && value <= 1) {
141260
+ return `${label}${label ? ": " : ""}${(value * 100).toFixed(2)}%`;
141261
+ }
141262
+ return `${label}${label ? ": " : ""}${value}`;
141263
+ };
141264
+ }
140934
141265
  const chartConfig = {
140935
141266
  ...processedChartData,
140936
- type: processedChartData.type,
141267
+ type: chartType,
140937
141268
  options: merge$1({}, processedChartData.options, {
140938
141269
  responsive: true,
140939
141270
  maintainAspectRatio: false,
140940
- indexAxis: processedChartData.options?.index_axis
141271
+ indexAxis: processedChartData.options?.index_axis,
141272
+ scales,
141273
+ plugins: {
141274
+ ...processedChartData.options?.plugins,
141275
+ tooltip: props.data.percent_display || isBubble ? {
141276
+ callbacks: tooltipCallbacks
141277
+ } : void 0
141278
+ }
140941
141279
  })
140942
141280
  };
140943
141281
  chart = new window.Chart(chartRef.value, chartConfig);
@@ -140957,84 +141295,172 @@ const _sfc_main$2F = /* @__PURE__ */ defineComponent({
140957
141295
  isChartLoaded.value = true;
140958
141296
  });
140959
141297
  return (_ctx, _cache) => {
140960
- return openBlock(), createElementBlock("div", _hoisted_1$24, [
141298
+ return openBlock(), createElementBlock("div", {
141299
+ ref_key: "containerRef",
141300
+ ref: containerRef,
141301
+ class: normalizeClass(["cb-data-charts-raw", { "is-fullscreen": isFullscreen.value }]),
141302
+ style: normalizeStyle(containerStyle.value)
141303
+ }, [
141304
+ showViewControls.value ? (openBlock(), createElementBlock("div", _hoisted_1$24, [
141305
+ props.data?.view_controls?.enable_chart_type_switcher ? (openBlock(), createBlock(unref(NDropdown), {
141306
+ key: 0,
141307
+ options: chartTypeSwitcherOptions.value,
141308
+ trigger: "click",
141309
+ onSelect: handleChartTypeChange
141310
+ }, {
141311
+ default: withCtx(() => [
141312
+ createVNode(CButton, {
141313
+ quaternary: "",
141314
+ size: "small"
141315
+ }, {
141316
+ icon: withCtx(() => [
141317
+ createVNode(CIcon, { icon: "chart-bar" })
141318
+ ]),
141319
+ _: 1
141320
+ })
141321
+ ]),
141322
+ _: 1
141323
+ }, 8, ["options"])) : createCommentVNode("", true),
141324
+ props.data?.view_controls?.enable_fullscreen_btn ? (openBlock(), createBlock(CButton, {
141325
+ key: 1,
141326
+ quaternary: "",
141327
+ size: "small",
141328
+ onClick: toggleFullscreen
141329
+ }, {
141330
+ icon: withCtx(() => [
141331
+ createVNode(CIcon, {
141332
+ icon: isFullscreen.value ? "compress" : "expand"
141333
+ }, null, 8, ["icon"])
141334
+ ]),
141335
+ _: 1
141336
+ })) : createCommentVNode("", true)
141337
+ ])) : createCommentVNode("", true),
140961
141338
  createElementVNode("canvas", {
140962
141339
  ref_key: "chartRef",
140963
141340
  ref: chartRef,
140964
141341
  class: "w-full h-full"
140965
141342
  }, null, 512)
140966
- ]);
141343
+ ], 6);
140967
141344
  };
140968
141345
  }
140969
141346
  });
140970
141347
 
140971
- const RawDataCharts = /* @__PURE__ */ _export_sfc(_sfc_main$2F, [["__scopeId", "data-v-e71330a8"]]);
141348
+ const RawDataCharts = /* @__PURE__ */ _export_sfc(_sfc_main$2F, [["__scopeId", "data-v-7078dc66"]]);
141349
+
141350
+ const STANDALONE_CHART_TYPES = ["pie", "doughnut", "radar", "polarArea"];
141351
+ const ONE_D_CHART_TYPES = ["bar", "line", "area"];
141352
+ const TWO_D_CHART_TYPES = ["scatter"];
141353
+ const THREE_D_CHART_TYPES = ["bubble"];
141354
+ const XY_CHART_TYPES = ["scatter"];
141355
+ const XYR_CHART_TYPES = ["bubble"];
140972
141356
 
140973
141357
  const _hoisted_1$23 = { class: "flex gap-4 h-[calc(80vh-120px)] w-full" };
140974
141358
  const _hoisted_2$1t = { class: "cb-data-charts-settings__card overflow-auto flex-1" };
140975
141359
  const _hoisted_3$17 = { class: "flex flex-col h-full" };
140976
141360
  const _hoisted_4$X = { class: "flex-grow overflow-y-auto overflow-x-hidden" };
140977
- const _hoisted_5$O = { class: "mb-4" };
140978
- const _hoisted_6$H = { class: "block mb-2" };
140979
- const _hoisted_7$v = { class: "mb-4" };
140980
- const _hoisted_8$q = { class: "block mb-2" };
140981
- const _hoisted_9$m = { class: "mb-4" };
140982
- const _hoisted_10$h = { class: "block mb-2" };
140983
- const _hoisted_11$f = { class: "mb-4" };
140984
- const _hoisted_12$b = { class: "block mb-2" };
140985
- const _hoisted_13$a = {
141361
+ const _hoisted_5$O = { class: "text-sm font-semibold mb-3 text-gray-600 dark:text-gray-400 uppercase tracking-wide" };
141362
+ const _hoisted_6$H = { class: "flex items-end border-b border-gray-200 dark:border-gray-700 mb-4 -mx-4 px-4" };
141363
+ const _hoisted_7$v = ["onClick"];
141364
+ const _hoisted_8$q = { class: "text-sm font-medium truncate max-w-24" };
141365
+ const _hoisted_9$m = ["onClick"];
141366
+ const _hoisted_10$h = ["title"];
141367
+ const _hoisted_11$f = {
140986
141368
  key: 0,
140987
141369
  class: "mb-4"
140988
141370
  };
141371
+ const _hoisted_12$b = { class: "block mb-2" };
141372
+ const _hoisted_13$a = { class: "mb-4" };
140989
141373
  const _hoisted_14$9 = { class: "block mb-2" };
140990
141374
  const _hoisted_15$8 = { class: "mb-4" };
140991
- const _hoisted_16$8 = { class: "block mb-2" };
140992
- const _hoisted_17$7 = {
140993
- key: 1,
140994
- class: "mb-4"
140995
- };
140996
- const _hoisted_18$6 = { class: "block mb-2" };
140997
- const _hoisted_19$6 = { class: "mb-4" };
140998
- const _hoisted_20$5 = { class: "flex justify-between items-center mb-2" };
140999
- const _hoisted_21$5 = { class: "block" };
141000
- const _hoisted_22$3 = { class: "flex gap-2 flex-1" };
141001
- const _hoisted_23$3 = ["onClick"];
141002
- const _hoisted_24$3 = { class: "p-4 min-w-[400px] max-h-[400px]" };
141003
- const _hoisted_25$3 = { class: "flex gap-4 h-full" };
141004
- const _hoisted_26$3 = { class: "flex-1 flex flex-col" };
141005
- const _hoisted_27$3 = { class: "text-sm mb-2" };
141006
- const _hoisted_28$3 = { class: "overflow-auto" };
141007
- const _hoisted_29$3 = {
141375
+ const _hoisted_16$8 = { class: "flex justify-between items-center mb-2" };
141376
+ const _hoisted_17$7 = { class: "block" };
141377
+ const _hoisted_18$6 = ["onClick"];
141378
+ const _hoisted_19$6 = { class: "p-4 min-w-[400px] max-h-[400px]" };
141379
+ const _hoisted_20$5 = { class: "flex gap-4 h-full" };
141380
+ const _hoisted_21$5 = { class: "flex-1 flex flex-col" };
141381
+ const _hoisted_22$3 = { class: "text-sm mb-2" };
141382
+ const _hoisted_23$3 = { class: "overflow-auto" };
141383
+ const _hoisted_24$3 = {
141008
141384
  key: 0,
141009
141385
  class: "flex-1 border-l pl-4"
141010
141386
  };
141011
- const _hoisted_30$3 = { class: "text-sm font-medium mb-2" };
141012
- const _hoisted_31$3 = { class: "flex flex-col gap-2" };
141013
- const _hoisted_32$3 = { class: "block mb-1 text-sm" };
141014
- const _hoisted_33$3 = { class: "block mb-1 text-sm" };
141015
- const _hoisted_34$3 = ["onClick"];
141016
- const _hoisted_35$3 = { class: "p-4 min-w-[400px] max-h-[400px]" };
141017
- const _hoisted_36$3 = { class: "flex gap-4 h-full" };
141018
- const _hoisted_37$3 = { class: "flex-1 flex flex-col" };
141019
- const _hoisted_38$3 = { class: "text-sm mb-2" };
141020
- const _hoisted_39$3 = { class: "overflow-auto" };
141021
- const _hoisted_40$3 = {
141387
+ const _hoisted_25$3 = { class: "text-sm font-medium mb-2" };
141388
+ const _hoisted_26$3 = { class: "flex flex-col gap-2" };
141389
+ const _hoisted_27$3 = { class: "block mb-1 text-sm" };
141390
+ const _hoisted_28$3 = { class: "block mb-1 text-sm" };
141391
+ const _hoisted_29$3 = ["onClick"];
141392
+ const _hoisted_30$3 = { class: "p-4 min-w-[400px] max-h-[400px]" };
141393
+ const _hoisted_31$3 = { class: "flex gap-4 h-full" };
141394
+ const _hoisted_32$3 = { class: "flex-1 flex flex-col" };
141395
+ const _hoisted_33$3 = { class: "text-sm mb-2" };
141396
+ const _hoisted_34$3 = { class: "overflow-auto" };
141397
+ const _hoisted_35$3 = {
141022
141398
  key: 0,
141023
141399
  class: "flex-1 border-l pl-4"
141024
141400
  };
141025
- const _hoisted_41$3 = { class: "flex flex-col gap-2" };
141026
- const _hoisted_42$3 = { class: "flex justify-center mt-2" };
141027
- const _hoisted_43$3 = { class: "mb-4" };
141028
- const _hoisted_44$3 = { class: "block mb-2" };
141029
- const _hoisted_45$3 = { class: "mb-4" };
141030
- const _hoisted_46$3 = { class: "block mb-2" };
141031
- const _hoisted_47$3 = { class: "cb-data-charts-settings__preview flex-1 border-l border-[#eee] pl-4" };
141032
- const _hoisted_48$3 = { class: "text-sm font-medium mb-4" };
141033
- const _hoisted_49$3 = {
141401
+ const _hoisted_36$3 = { class: "text-sm font-medium mb-2" };
141402
+ const _hoisted_37$3 = { class: "flex flex-col gap-2" };
141403
+ const _hoisted_38$3 = { class: "block mb-1 text-sm" };
141404
+ const _hoisted_39$3 = { class: "block mb-1 text-sm" };
141405
+ const _hoisted_40$3 = { class: "block mb-1 text-sm" };
141406
+ const _hoisted_41$3 = { key: 0 };
141407
+ const _hoisted_42$3 = { class: "block mb-1 text-sm" };
141408
+ const _hoisted_43$3 = ["onClick"];
141409
+ const _hoisted_44$3 = { class: "p-4 min-w-[400px] max-h-[400px] overflow-auto" };
141410
+ const _hoisted_45$3 = { class: "text-sm mb-2" };
141411
+ const _hoisted_46$3 = ["onClick"];
141412
+ const _hoisted_47$3 = { class: "p-4 min-w-[400px] max-h-[400px] overflow-auto" };
141413
+ const _hoisted_48$3 = { class: "text-sm mb-2" };
141414
+ const _hoisted_49$3 = { class: "flex justify-center mt-2" };
141415
+ const _hoisted_50$3 = { class: "text-sm font-semibold mb-3 mt-6 text-gray-600 dark:text-gray-400 uppercase tracking-wide border-t border-gray-200 dark:border-gray-700 pt-6" };
141416
+ const _hoisted_51$2 = { class: "mb-4" };
141417
+ const _hoisted_52$2 = { class: "block mb-2" };
141418
+ const _hoisted_53$2 = { class: "mb-4" };
141419
+ const _hoisted_54$1 = { class: "block mb-2" };
141420
+ const _hoisted_55$1 = { class: "mb-4" };
141421
+ const _hoisted_56$1 = { class: "block mb-2" };
141422
+ const _hoisted_57$1 = { class: "mb-4" };
141423
+ const _hoisted_58$1 = { class: "block mb-2" };
141424
+ const _hoisted_59$1 = {
141425
+ key: 2,
141426
+ class: "mb-4"
141427
+ };
141428
+ const _hoisted_60$1 = { class: "block mb-2" };
141429
+ const _hoisted_61$1 = {
141430
+ key: 3,
141431
+ class: "mb-4"
141432
+ };
141433
+ const _hoisted_62$1 = { class: "block mb-2" };
141434
+ const _hoisted_63$1 = { class: "mb-4" };
141435
+ const _hoisted_64$1 = { class: "block mb-2" };
141436
+ const _hoisted_65$1 = { class: "mb-4" };
141437
+ const _hoisted_66$1 = { class: "block mb-2" };
141438
+ const _hoisted_67$1 = { class: "mb-4" };
141439
+ const _hoisted_68$1 = { class: "block mb-2" };
141440
+ const _hoisted_69 = { class: "flex items-center gap-2" };
141441
+ const _hoisted_70 = { class: "text-sm text-gray-500" };
141442
+ const _hoisted_71 = { class: "mb-4" };
141443
+ const _hoisted_72 = { class: "block mb-2" };
141444
+ const _hoisted_73 = { class: "flex flex-col gap-2" };
141445
+ const _hoisted_74 = { class: "flex items-center gap-2" };
141446
+ const _hoisted_75 = { class: "text-sm" };
141447
+ const _hoisted_76 = { class: "text-sm" };
141448
+ const _hoisted_77 = { class: "flex items-center gap-2" };
141449
+ const _hoisted_78 = { class: "text-sm" };
141450
+ const _hoisted_79 = { class: "mb-4" };
141451
+ const _hoisted_80 = { class: "block mb-2" };
141452
+ const _hoisted_81 = { class: "flex flex-col gap-3" };
141453
+ const _hoisted_82 = { class: "flex items-center gap-2" };
141454
+ const _hoisted_83 = { class: "text-sm w-16" };
141455
+ const _hoisted_84 = { class: "flex items-center gap-2" };
141456
+ const _hoisted_85 = { class: "text-sm w-16" };
141457
+ const _hoisted_86 = { class: "cb-data-charts-settings__preview flex-1 border-l border-[#eee] pl-4" };
141458
+ const _hoisted_87 = { class: "text-sm font-medium mb-4" };
141459
+ const _hoisted_88 = {
141034
141460
  class: "preview-container",
141035
141461
  style: { "height": "300px" }
141036
141462
  };
141037
- const _hoisted_50$3 = { class: "flex justify-between gap-4" };
141463
+ const _hoisted_89 = { class: "flex justify-between gap-4" };
141038
141464
  const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141039
141465
  __name: "DataCharts.settings",
141040
141466
  props: {
@@ -141048,7 +141474,91 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141048
141474
  const { setComponentEditMode, updateNodeDataById } = useCanvas$1();
141049
141475
  const { crmShape } = useCrmShape();
141050
141476
  const { palette } = useCanvasTheme$1();
141051
- const chartType = ref(props.data?.type ?? "bar");
141477
+ let seriesIdCounter = 0;
141478
+ function generateSeriesId() {
141479
+ return `series_${Date.now()}_${seriesIdCounter++}`;
141480
+ }
141481
+ function convertSavedSeriesToRuntime(savedSeries) {
141482
+ return {
141483
+ id: savedSeries.id || generateSeriesId(),
141484
+ name: savedSeries.name || "Series 1",
141485
+ chartType: savedSeries.chart_type || "bar",
141486
+ dataPoints: (savedSeries.data_points || []).map((dp) => ({
141487
+ label: dp.label || "",
141488
+ value: dp.value || "",
141489
+ xValue: dp.x_value ?? "",
141490
+ yValue: dp.y_value ?? "",
141491
+ rValue: dp.r_value ?? "",
141492
+ dynamicValue: dp.dynamic_value,
141493
+ dynamicXValue: dp.dynamic_x_value,
141494
+ dynamicYValue: dp.dynamic_y_value,
141495
+ dynamicRValue: dp.dynamic_r_value,
141496
+ arrayConfig: dp.array_config
141497
+ }))
141498
+ };
141499
+ }
141500
+ function convertLegacyToSeries() {
141501
+ const chartTypeValue = props.data?.type ?? props.data?._primary_chart_type ?? "bar";
141502
+ const dataPoints = props.data?.data_points && Array.isArray(props.data.data_points) ? props.data.data_points.map((dp) => ({
141503
+ label: dp.label,
141504
+ value: dp.value,
141505
+ xValue: dp.x_value ?? "",
141506
+ yValue: dp.y_value ?? "",
141507
+ dynamicValue: dp.dynamic_value,
141508
+ dynamicXValue: dp.dynamic_x_value,
141509
+ dynamicYValue: dp.dynamic_y_value,
141510
+ arrayConfig: dp.array_config
141511
+ })) : props.data?.data?.labels ? props.data.data.labels.map((label, index) => ({
141512
+ label: String(label),
141513
+ value: String(props.data?.data?.datasets?.[0]?.data?.[index] ?? 0),
141514
+ xValue: "",
141515
+ yValue: ""
141516
+ })) : [];
141517
+ return [
141518
+ {
141519
+ id: generateSeriesId(),
141520
+ name: t("canvasUI.canvasBuilder.dataCharts.series") + " 1",
141521
+ chartType: chartTypeValue,
141522
+ dataPoints
141523
+ }
141524
+ ];
141525
+ }
141526
+ const seriesList = ref(
141527
+ props.data?.series && Array.isArray(props.data.series) && props.data.series.length > 0 ? props.data.series.map((s) => convertSavedSeriesToRuntime(s)) : convertLegacyToSeries()
141528
+ );
141529
+ const activeSeriesIndex = ref(0);
141530
+ const activeSeries = computed(() => seriesList.value[activeSeriesIndex.value]);
141531
+ const isActiveSeriesXYChart = computed(() => XY_CHART_TYPES.includes(activeSeries.value?.chartType));
141532
+ const isActiveSeriesXYRChart = computed(() => XYR_CHART_TYPES.includes(activeSeries.value?.chartType));
141533
+ const isPrimaryStandalone = computed(() => STANDALONE_CHART_TYPES.includes(seriesList.value[0]?.chartType));
141534
+ const isMultiSeries = computed(() => seriesList.value.length > 1);
141535
+ const canAddSeries = computed(() => !isPrimaryStandalone.value);
141536
+ const availableChartTypeOptions = computed(() => {
141537
+ const allOptions = [
141538
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.bar"), value: "bar" },
141539
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.line"), value: "line" },
141540
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.pie"), value: "pie" },
141541
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.doughnut"), value: "doughnut" },
141542
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.polarArea"), value: "polarArea" },
141543
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.radar"), value: "radar" },
141544
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.scatter"), value: "scatter" },
141545
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.bubble"), value: "bubble" },
141546
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.area"), value: "area" }
141547
+ ];
141548
+ const primaryType = seriesList.value[0]?.chartType;
141549
+ if (seriesList.value.length > 1 || activeSeriesIndex.value > 0) {
141550
+ if (THREE_D_CHART_TYPES.includes(primaryType)) {
141551
+ return allOptions.filter((opt) => THREE_D_CHART_TYPES.includes(opt.value));
141552
+ }
141553
+ if (TWO_D_CHART_TYPES.includes(primaryType)) {
141554
+ return allOptions.filter((opt) => TWO_D_CHART_TYPES.includes(opt.value));
141555
+ }
141556
+ return allOptions.filter((opt) => ONE_D_CHART_TYPES.includes(opt.value));
141557
+ }
141558
+ return allOptions;
141559
+ });
141560
+ const chartType = computed(() => seriesList.value[0]?.chartType ?? "bar");
141561
+ const primaryChartType = computed(() => seriesList.value[0]?.chartType ?? "bar");
141052
141562
  const backgroundColor = props.data?.data?.datasets?.[0]?.background_color;
141053
141563
  const colorSchemeType = ref(props.data?.color_scheme_type ?? "theme");
141054
141564
  const chartColors = ref([]);
@@ -141077,24 +141587,16 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141077
141587
  const chartTitle = ref(props.data?.options?.plugins?.title?.text ?? "");
141078
141588
  const legendPosition = ref(props.data?.options?.plugins?.legend?.position ?? "top");
141079
141589
  const enableAnimation = ref((props.data?.options?.animation?.duration ?? 0) > 0);
141080
- const dataPoints = ref(
141081
- props.data?.data_points && Array.isArray(props.data.data_points) ? [...props.data.data_points] : props.data?.data?.labels ? props.data.data.labels.map((label, index) => ({
141082
- label: String(label),
141083
- value: String(props.data?.data?.datasets?.[0]?.data?.[index] ?? 0)
141084
- })) : []
141085
- );
141086
141590
  const xAxisLabel = ref(props.data?.options?.scales?.x?.title?.text ?? "");
141087
141591
  const yAxisLabel = ref(props.data?.options?.scales?.y?.title?.text ?? "");
141088
141592
  const orientation = ref(props.data?.options?.index_axis ?? "x");
141089
141593
  const pointStyle = ref(props.data?.data?.datasets?.[0]?.point_style ?? "circle");
141090
- const chartTypeOptions = [
141091
- { label: t("canvasUI.canvasBuilder.dataCharts.types.bar"), value: "bar" },
141092
- { label: t("canvasUI.canvasBuilder.dataCharts.types.line"), value: "line" },
141093
- { label: t("canvasUI.canvasBuilder.dataCharts.types.pie"), value: "pie" },
141094
- { label: t("canvasUI.canvasBuilder.dataCharts.types.doughnut"), value: "doughnut" },
141095
- { label: t("canvasUI.canvasBuilder.dataCharts.types.polarArea"), value: "polarArea" },
141096
- { label: t("canvasUI.canvasBuilder.dataCharts.types.radar"), value: "radar" }
141097
- ];
141594
+ const percentDisplay = ref(props.data?.percent_display ?? false);
141595
+ const enableFullscreenBtn = ref(props.data?.view_controls?.enable_fullscreen_btn ?? false);
141596
+ const enableChartTypeSwitcher = ref(props.data?.view_controls?.enable_chart_type_switcher ?? false);
141597
+ const enableDataEntry = ref(props.data?.view_controls?.enable_data_entry ?? false);
141598
+ const chartHeight = ref(props.data?.chart_height ?? 800);
141599
+ const chartWidth = ref(props.data?.chart_width ?? 100);
141098
141600
  const legendPositionOptions = [
141099
141601
  { label: t("canvasUI.canvasBuilder.dataCharts.legendPositions.none"), value: "none" },
141100
141602
  { label: t("canvasUI.canvasBuilder.dataCharts.legendPositions.top"), value: "top" },
@@ -141103,8 +141605,8 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141103
141605
  { label: t("canvasUI.canvasBuilder.dataCharts.legendPositions.right"), value: "right" }
141104
141606
  ];
141105
141607
  const orientationOptions = [
141106
- { label: t("canvasUI.canvasBuilder.dataCharts.orientations.horizontal"), value: "x" },
141107
- { label: t("canvasUI.canvasBuilder.dataCharts.orientations.vertical"), value: "y" }
141608
+ { label: t("canvasUI.canvasBuilder.dataCharts.orientations.horizontal"), value: "y" },
141609
+ { label: t("canvasUI.canvasBuilder.dataCharts.orientations.vertical"), value: "x" }
141108
141610
  ];
141109
141611
  const pointStyleOptions = [
141110
141612
  { label: t("canvasUI.canvasBuilder.dataCharts.pointStyles.circle"), value: "circle" },
@@ -141114,12 +141616,18 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141114
141616
  { label: t("canvasUI.canvasBuilder.dataCharts.pointStyles.star"), value: "star" },
141115
141617
  { label: t("canvasUI.canvasBuilder.dataCharts.pointStyles.triangle"), value: "triangle" }
141116
141618
  ];
141117
- function getColors() {
141118
- if (colorSchemeType.value === "theme") {
141119
- return chartColors.value.map((index) => `palette${index}`);
141120
- }
141121
- return chartColors.value;
141122
- }
141619
+ const deleteButtonStyle = computed(() => ({
141620
+ "--n-border": "1px solid transparent",
141621
+ "--n-border-disabled": "1px solid transparent",
141622
+ "--n-border-focus": "1px solid transparent",
141623
+ "--n-border-hover": "1px solid transparent",
141624
+ "--n-border-pressed": "1px solid transparent",
141625
+ "--n-color-focus": themeVars.value.error2,
141626
+ "--n-color-hover": themeVars.value.error2,
141627
+ "--n-color-disabled": themeVars.value.error2,
141628
+ "--n-color-pressed": themeVars.value.error2
141629
+ }));
141630
+ const activePopoverField = ref(null);
141123
141631
  function updateChartColors(newColors) {
141124
141632
  if (colorSchemeType.value === "theme") {
141125
141633
  chartColors.value = newColors.map((color, i) => {
@@ -141147,17 +141655,55 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141147
141655
  }
141148
141656
  }
141149
141657
  );
141658
+ function closePopover() {
141659
+ activePopoverPoint.value = null;
141660
+ activePopoverField.value = null;
141661
+ }
141662
+ function addSeries() {
141663
+ if (!canAddSeries.value) return;
141664
+ const newIndex = seriesList.value.length;
141665
+ const newSeries = {
141666
+ id: generateSeriesId(),
141667
+ name: `${t("canvasUI.canvasBuilder.dataCharts.series")} ${newIndex + 1}`,
141668
+ chartType: seriesList.value[0].chartType,
141669
+ // Default to same type as first series
141670
+ dataPoints: []
141671
+ };
141672
+ seriesList.value.push(newSeries);
141673
+ activeSeriesIndex.value = newIndex;
141674
+ updatePreview();
141675
+ }
141676
+ function removeSeries(index) {
141677
+ if (index === 0 || index >= seriesList.value.length) return;
141678
+ seriesList.value.splice(index, 1);
141679
+ if (activeSeriesIndex.value >= seriesList.value.length) {
141680
+ activeSeriesIndex.value = seriesList.value.length - 1;
141681
+ }
141682
+ updatePreview();
141683
+ }
141684
+ function onChartTypeChange(newType) {
141685
+ if (activeSeriesIndex.value === 0 && STANDALONE_CHART_TYPES.includes(newType)) {
141686
+ seriesList.value = [seriesList.value[0]];
141687
+ }
141688
+ updatePreview();
141689
+ }
141150
141690
  function addDataPoint() {
141151
- dataPoints.value.push({
141691
+ activeSeries.value.dataPoints.push({
141152
141692
  label: "",
141693
+ xValue: "",
141694
+ yValue: "",
141695
+ rValue: "",
141153
141696
  value: ""
141154
141697
  });
141155
141698
  }
141156
141699
  function removeDataPoint(index) {
141157
- dataPoints.value.splice(index, 1);
141700
+ activeSeries.value.dataPoints.splice(index, 1);
141158
141701
  }
141159
141702
  function removeAllDataPoints() {
141160
- dataPoints.value = [];
141703
+ activeSeries.value.dataPoints = [];
141704
+ }
141705
+ function isArrayOrObject(value) {
141706
+ return Array.isArray(value) || typeof value === "object" && value !== null;
141161
141707
  }
141162
141708
  function getFieldOptions(data) {
141163
141709
  if (!data || typeof data !== "object") return [];
@@ -141168,6 +141714,54 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141168
141714
  value: field
141169
141715
  }));
141170
141716
  }
141717
+ function updateDynamicValueExpression(point) {
141718
+ if (!point.selectedValue || !point.arrayConfig?.labelField || !point.arrayConfig?.valueField) {
141719
+ return;
141720
+ }
141721
+ const path = point.dynamicValue?.path;
141722
+ if (!path) {
141723
+ return;
141724
+ }
141725
+ point.label = `{{#each ${path}}}{{lookup this "${point.arrayConfig.labelField}"}}{{#unless @last}},{{/unless}}{{/each}}`;
141726
+ point.value = `{{#each ${path}}}{{lookup this "${point.arrayConfig.valueField}"}}{{#unless @last}},{{/unless}}{{/each}}`;
141727
+ point.dynamicValue = {
141728
+ path,
141729
+ value: point.value
141730
+ };
141731
+ closePopover();
141732
+ }
141733
+ function updateXYDynamicValueExpression(point) {
141734
+ if (!point.selectedXValue || !point.arrayConfig?.labelField || !point.arrayConfig?.xField || !point.arrayConfig?.yField) {
141735
+ return;
141736
+ }
141737
+ const isBubble = isActiveSeriesXYRChart.value;
141738
+ if (isBubble && !point.arrayConfig?.rField) {
141739
+ return;
141740
+ }
141741
+ const path = point.dynamicXValue?.path;
141742
+ if (!path) {
141743
+ return;
141744
+ }
141745
+ point.label = `{{#each ${path}}}{{lookup this "${point.arrayConfig.labelField}"}}{{#unless @last}},{{/unless}}{{/each}}`;
141746
+ point.xValue = `{{#each ${path}}}{{lookup this "${point.arrayConfig.xField}"}}{{#unless @last}},{{/unless}}{{/each}}`;
141747
+ point.yValue = `{{#each ${path}}}{{lookup this "${point.arrayConfig.yField}"}}{{#unless @last}},{{/unless}}{{/each}}`;
141748
+ point.dynamicXValue = {
141749
+ path,
141750
+ value: point.xValue
141751
+ };
141752
+ point.dynamicYValue = {
141753
+ path,
141754
+ value: point.yValue
141755
+ };
141756
+ if (isBubble && point.arrayConfig.rField) {
141757
+ point.rValue = `{{#each ${path}}}{{lookup this "${point.arrayConfig.rField}"}}{{#unless @last}},{{/unless}}{{/each}}`;
141758
+ point.dynamicRValue = {
141759
+ path,
141760
+ value: point.rValue
141761
+ };
141762
+ }
141763
+ closePopover();
141764
+ }
141171
141765
  const dynamicValueTreeData = computed(() => {
141172
141766
  function processObject(obj, path = []) {
141173
141767
  const result = [];
@@ -141218,24 +141812,59 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141218
141812
  return h("span", { class: "text-sm" }, { default: () => info.option.label || "" });
141219
141813
  }
141220
141814
  const activePopoverPoint = ref(null);
141221
- function handleDynamicValueClick(point) {
141222
- if (activePopoverPoint.value === point) {
141223
- activePopoverPoint.value = null;
141815
+ function handleDynamicValueClick(point, field = "value") {
141816
+ if (activePopoverPoint.value === point && activePopoverField.value === field) {
141817
+ closePopover();
141224
141818
  } else {
141225
- point.selectedValue = void 0;
141226
- point.dynamicValue = void 0;
141227
- point.arrayConfig = void 0;
141228
- point.value = "";
141819
+ if (field === "value") {
141820
+ point.selectedValue = void 0;
141821
+ point.dynamicValue = void 0;
141822
+ point.arrayConfig = void 0;
141823
+ point.value = "";
141824
+ } else if (field === "x") {
141825
+ point.selectedXValue = void 0;
141826
+ point.dynamicXValue = void 0;
141827
+ point.dynamicYValue = void 0;
141828
+ point.dynamicRValue = void 0;
141829
+ point.arrayConfig = void 0;
141830
+ point.xValue = "";
141831
+ point.yValue = "";
141832
+ point.rValue = "";
141833
+ point.label = "";
141834
+ } else if (field === "y") {
141835
+ point.selectedYValue = void 0;
141836
+ point.dynamicYValue = void 0;
141837
+ point.yValue = "";
141838
+ } else if (field === "r") {
141839
+ point.selectedRValue = void 0;
141840
+ point.dynamicRValue = void 0;
141841
+ point.rValue = "";
141842
+ }
141229
141843
  activePopoverPoint.value = point;
141844
+ activePopoverField.value = field;
141230
141845
  }
141231
141846
  }
141232
- function handleDynamicValueSelect(keys, point) {
141847
+ function handleDynamicValueSelect(keys, point, field = "value") {
141233
141848
  const selectedKey = keys[0];
141234
141849
  if (!selectedKey) {
141235
- point.dynamicValue = void 0;
141236
- point.selectedValue = void 0;
141237
- point.value = "";
141238
- activePopoverPoint.value = null;
141850
+ if (field === "value") {
141851
+ point.dynamicValue = void 0;
141852
+ point.selectedValue = void 0;
141853
+ point.value = "";
141854
+ } else if (field === "x") {
141855
+ point.dynamicXValue = void 0;
141856
+ point.selectedXValue = void 0;
141857
+ point.xValue = "";
141858
+ } else if (field === "y") {
141859
+ point.dynamicYValue = void 0;
141860
+ point.selectedYValue = void 0;
141861
+ point.yValue = "";
141862
+ } else if (field === "r") {
141863
+ point.dynamicRValue = void 0;
141864
+ point.selectedRValue = void 0;
141865
+ point.rValue = "";
141866
+ }
141867
+ closePopover();
141239
141868
  return;
141240
141869
  }
141241
141870
  const pathParts = selectedKey.split(/\.(?![^[]*])/) || [];
@@ -141250,6 +141879,80 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141250
141879
  currentValue = currentValue?.[part];
141251
141880
  }
141252
141881
  }
141882
+ if (field === "x") {
141883
+ point.selectedXValue = currentValue;
141884
+ if (Array.isArray(currentValue) || typeof currentValue === "object" && currentValue !== null) {
141885
+ point.arrayConfig = {
141886
+ labelField: "",
141887
+ valueField: "",
141888
+ xField: "",
141889
+ yField: "",
141890
+ rField: ""
141891
+ };
141892
+ point.dynamicXValue = {
141893
+ path: selectedKey,
141894
+ value: ""
141895
+ };
141896
+ return;
141897
+ }
141898
+ const rootPart = pathParts[0];
141899
+ let expression = "";
141900
+ if (pathParts.length === 1) {
141901
+ expression = `{{${rootPart}}}`;
141902
+ } else {
141903
+ const restOfPath = pathParts.slice(1).map((part) => {
141904
+ if (part.includes("[") && part.includes("]")) {
141905
+ return part.split("[")[1].split("]")[0];
141906
+ }
141907
+ return part;
141908
+ });
141909
+ expression = `{{lookup (lookup ${rootPart} ${restOfPath[0]}) "${restOfPath[1]}"}}`;
141910
+ }
141911
+ point.dynamicXValue = { path: selectedKey, value: expression };
141912
+ point.xValue = expression;
141913
+ closePopover();
141914
+ return;
141915
+ }
141916
+ if (field === "y") {
141917
+ point.selectedYValue = currentValue;
141918
+ const rootPart = pathParts[0];
141919
+ let expression = "";
141920
+ if (pathParts.length === 1) {
141921
+ expression = `{{${rootPart}}}`;
141922
+ } else {
141923
+ const restOfPath = pathParts.slice(1).map((part) => {
141924
+ if (part.includes("[") && part.includes("]")) {
141925
+ return part.split("[")[1].split("]")[0];
141926
+ }
141927
+ return part;
141928
+ });
141929
+ expression = `{{lookup (lookup ${rootPart} ${restOfPath[0]}) "${restOfPath[1]}"}}`;
141930
+ }
141931
+ point.dynamicYValue = { path: selectedKey, value: expression };
141932
+ point.yValue = expression;
141933
+ closePopover();
141934
+ return;
141935
+ }
141936
+ if (field === "r") {
141937
+ point.selectedRValue = currentValue;
141938
+ const rootPart = pathParts[0];
141939
+ let expression = "";
141940
+ if (pathParts.length === 1) {
141941
+ expression = `{{${rootPart}}}`;
141942
+ } else {
141943
+ const restOfPath = pathParts.slice(1).map((part) => {
141944
+ if (part.includes("[") && part.includes("]")) {
141945
+ return part.split("[")[1].split("]")[0];
141946
+ }
141947
+ return part;
141948
+ });
141949
+ expression = `{{lookup (lookup ${rootPart} ${restOfPath[0]}) "${restOfPath[1]}"}}`;
141950
+ }
141951
+ point.dynamicRValue = { path: selectedKey, value: expression };
141952
+ point.rValue = expression;
141953
+ closePopover();
141954
+ return;
141955
+ }
141253
141956
  point.selectedValue = currentValue;
141254
141957
  if (Array.isArray(currentValue) || typeof currentValue === "object" && currentValue !== null) {
141255
141958
  point.arrayConfig = {
@@ -141279,79 +141982,189 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141279
141982
  value: expression
141280
141983
  };
141281
141984
  point.value = expression;
141282
- activePopoverPoint.value = null;
141985
+ closePopover();
141986
+ }
141987
+ }
141988
+ function normalizeRValues(values, minRadius = 5, maxRadius = 40) {
141989
+ if (values.length === 0) return [];
141990
+ const rValues = values.map((v) => v.r);
141991
+ const minR = Math.min(...rValues);
141992
+ const maxR = Math.max(...rValues);
141993
+ if (minR === maxR) {
141994
+ return values.map((v) => ({
141995
+ ...v,
141996
+ r: (minRadius + maxRadius) / 2,
141997
+ originalR: v.r
141998
+ }));
141283
141999
  }
142000
+ return values.map((v) => ({
142001
+ ...v,
142002
+ r: minRadius + (v.r - minR) / (maxR - minR) * (maxRadius - minRadius),
142003
+ originalR: v.r
142004
+ }));
141284
142005
  }
141285
- function updateDynamicValueExpression(point) {
141286
- if (!point.selectedValue || !point.arrayConfig?.labelField || !point.arrayConfig?.valueField) {
141287
- return;
141288
- }
141289
- const path = point.dynamicValue?.path;
141290
- if (!path) {
141291
- return;
142006
+ function processSeriesData(series) {
142007
+ const isXY = XY_CHART_TYPES.includes(series.chartType);
142008
+ const isXYR = XYR_CHART_TYPES.includes(series.chartType);
142009
+ if (isXY || isXYR) {
142010
+ const processedData2 = {
142011
+ labels: [],
142012
+ values: []
142013
+ };
142014
+ const rawBubbleData = [];
142015
+ series.dataPoints.forEach((point) => {
142016
+ const x = !isNaN(Number(point.xValue)) ? Number(point.xValue) : 0;
142017
+ const y = !isNaN(Number(point.yValue)) ? Number(point.yValue) : 0;
142018
+ if (series.chartType === "bubble") {
142019
+ const r = point.rValue && !isNaN(Number(point.rValue)) ? Math.abs(Number(point.rValue)) : 10;
142020
+ rawBubbleData.push({ label: point.label, x, y, r });
142021
+ } else {
142022
+ processedData2.labels.push(point.label);
142023
+ processedData2.values.push({ x, y });
142024
+ }
142025
+ });
142026
+ if (series.chartType === "bubble" && rawBubbleData.length > 0) {
142027
+ const bubbleValues = rawBubbleData.map((d) => ({ x: d.x, y: d.y, r: d.r }));
142028
+ const normalizedValues = normalizeRValues(bubbleValues);
142029
+ rawBubbleData.forEach((d, idx) => {
142030
+ processedData2.labels.push(d.label);
142031
+ processedData2.values.push(normalizedValues[idx]);
142032
+ });
142033
+ }
142034
+ return processedData2;
141292
142035
  }
141293
- point.label = `{{#each ${path}}}{{lookup this "${point.arrayConfig.labelField}"}}{{#unless @last}},{{/unless}}{{/each}}`;
141294
- point.value = `{{#each ${path}}}{{lookup this "${point.arrayConfig.valueField}"}}{{#unless @last}},{{/unless}}{{/each}}`;
141295
- point.dynamicValue = {
141296
- path,
141297
- value: point.value
141298
- };
141299
- activePopoverPoint.value = null;
141300
- }
141301
- function processChartData() {
141302
142036
  const processedData = {
141303
142037
  labels: [],
141304
142038
  values: []
141305
142039
  };
141306
- dataPoints.value.forEach((point) => {
142040
+ series.dataPoints.forEach((point) => {
141307
142041
  processedData.labels.push(point.label);
141308
142042
  processedData.values.push(!isNaN(Number(point.value)) ? Number(point.value) : 0);
141309
142043
  });
141310
142044
  return processedData;
141311
142045
  }
142046
+ function getSeriesColors(forStorage = false) {
142047
+ if (colorSchemeType.value === "theme") {
142048
+ if (forStorage) {
142049
+ return chartColors.value.map((index) => `palette${index}`);
142050
+ }
142051
+ return chartColors.value.map((index) => {
142052
+ const idx = parseInt(index);
142053
+ return palette.value[idx % palette.value.length];
142054
+ });
142055
+ }
142056
+ return chartColors.value;
142057
+ }
141312
142058
  function createChartConfig() {
142059
+ const datasets = [];
142060
+ let allLabels = [];
142061
+ const colorsForStorage = getSeriesColors(true);
142062
+ const isSingleSeries = seriesList.value.length === 1;
142063
+ seriesList.value.forEach((series, index) => {
142064
+ const processedData = processSeriesData(series);
142065
+ let backgroundColor2;
142066
+ let borderColor;
142067
+ if (isSingleSeries) {
142068
+ backgroundColor2 = colorsForStorage;
142069
+ borderColor = [...colorsForStorage];
142070
+ } else {
142071
+ const seriesColor = colorsForStorage[index % colorsForStorage.length];
142072
+ backgroundColor2 = seriesColor;
142073
+ borderColor = seriesColor;
142074
+ }
142075
+ const datasetOptions = {
142076
+ label: series.name,
142077
+ data: processedData.values,
142078
+ background_color: backgroundColor2,
142079
+ border_color: borderColor,
142080
+ borderWidth: 1
142081
+ };
142082
+ if (!isSingleSeries) {
142083
+ if (series.chartType === "area") {
142084
+ datasetOptions.type = "line";
142085
+ datasetOptions.fill = true;
142086
+ datasetOptions.tension = 0.4;
142087
+ } else {
142088
+ datasetOptions.type = series.chartType;
142089
+ }
142090
+ }
142091
+ if (series.chartType === "area") {
142092
+ datasetOptions.fill = true;
142093
+ datasetOptions.tension = 0.4;
142094
+ }
142095
+ if (["line", "scatter", "area"].includes(series.chartType)) {
142096
+ datasetOptions.pointStyle = pointStyle.value;
142097
+ }
142098
+ if (["line", "area"].includes(series.chartType)) {
142099
+ datasetOptions.tension = 0.4;
142100
+ }
142101
+ if (processedData.labels.length > allLabels.length) {
142102
+ allLabels = processedData.labels;
142103
+ }
142104
+ datasets.push(datasetOptions);
142105
+ });
142106
+ const primaryType = seriesList.value[0].chartType;
142107
+ let actualPrimaryType = primaryType;
142108
+ if (primaryType === "area") {
142109
+ actualPrimaryType = "line";
142110
+ }
142111
+ let scales = void 0;
142112
+ const chartTypesWithScales = ["bar", "line", "scatter", "bubble", "area"];
142113
+ if (chartTypesWithScales.includes(primaryType)) {
142114
+ scales = {
142115
+ x: {
142116
+ title: {
142117
+ display: !!xAxisLabel.value,
142118
+ text: xAxisLabel.value
142119
+ }
142120
+ },
142121
+ y: {
142122
+ title: {
142123
+ display: !!yAxisLabel.value,
142124
+ text: yAxisLabel.value
142125
+ },
142126
+ begin_at_zero: true
142127
+ }
142128
+ };
142129
+ } else if (["radar", "polarArea"].includes(primaryType)) {
142130
+ scales = {
142131
+ r: {
142132
+ begin_at_zero: true,
142133
+ ticks: {
142134
+ step_size: 1
142135
+ }
142136
+ }
142137
+ };
142138
+ }
142139
+ const showLegend = seriesList.value.length > 1 || legendPosition.value !== "none";
141313
142140
  const config = {
141314
- type: chartType.value,
142141
+ type: actualPrimaryType,
141315
142142
  color_scheme_type: colorSchemeType.value,
142143
+ percent_display: percentDisplay.value,
142144
+ chart_height: chartHeight.value,
142145
+ chart_width: chartWidth.value,
142146
+ view_controls: {
142147
+ enable_fullscreen_btn: enableFullscreenBtn.value,
142148
+ enable_chart_type_switcher: enableChartTypeSwitcher.value,
142149
+ enable_data_entry: enableDataEntry.value
142150
+ },
141316
142151
  data: {
141317
- labels: [],
141318
- datasets: [
141319
- {
141320
- label: "Data Series",
141321
- data: [],
141322
- background_color: getColors(),
141323
- border_color: getColors(),
141324
- border_width: 1,
141325
- point_style: ["line"].includes(chartType.value) ? pointStyle.value : void 0
141326
- }
141327
- ]
142152
+ labels: allLabels,
142153
+ datasets
141328
142154
  },
141329
142155
  options: {
141330
142156
  responsive: true,
141331
142157
  maintainAspectRatio: false,
141332
- index_axis: ["bar", "line"].includes(chartType.value) ? orientation.value : void 0,
141333
- scales: ["bar", "line"].includes(chartType.value) ? {
141334
- x: {
141335
- title: {
141336
- display: !!xAxisLabel.value,
141337
- text: xAxisLabel.value
141338
- }
141339
- },
141340
- y: {
141341
- title: {
141342
- display: !!yAxisLabel.value,
141343
- text: yAxisLabel.value
141344
- }
141345
- }
141346
- } : void 0,
142158
+ index_axis: ["bar", "line"].includes(primaryType) ? orientation.value : void 0,
142159
+ scales,
141347
142160
  plugins: {
141348
142161
  title: {
141349
142162
  display: !!chartTitle.value,
141350
142163
  text: chartTitle.value
141351
142164
  },
141352
142165
  legend: {
141353
- display: legendPosition.value !== "none",
141354
- position: legendPosition.value,
142166
+ display: showLegend,
142167
+ position: legendPosition.value !== "none" ? legendPosition.value : "top",
141355
142168
  labels: {
141356
142169
  usePointStyle: true
141357
142170
  }
@@ -141361,14 +142174,27 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141361
142174
  duration: enableAnimation.value ? 1e3 : 0
141362
142175
  }
141363
142176
  },
141364
- data_points: dataPoints.value.map((point) => ({
141365
- label: point.label,
141366
- value: point.value
141367
- }))
142177
+ // Save series data for editing
142178
+ series: seriesList.value.map((series) => ({
142179
+ id: series.id,
142180
+ name: series.name,
142181
+ chart_type: series.chartType,
142182
+ data_points: series.dataPoints.map((point) => ({
142183
+ label: point.label,
142184
+ value: point.value,
142185
+ x_value: point.xValue,
142186
+ y_value: point.yValue,
142187
+ r_value: point.rValue,
142188
+ dynamic_value: point.dynamicValue,
142189
+ dynamic_x_value: point.dynamicXValue,
142190
+ dynamic_y_value: point.dynamicYValue,
142191
+ dynamic_r_value: point.dynamicRValue,
142192
+ array_config: point.arrayConfig
142193
+ }))
142194
+ })),
142195
+ // Store the primary chart type for reference
142196
+ _primary_chart_type: primaryType
141368
142197
  };
141369
- const processedData = processChartData();
141370
- config.data.labels = processedData.labels;
141371
- config.data.datasets[0].data = processedData.values;
141372
142198
  return config;
141373
142199
  }
141374
142200
  function onCancel() {
@@ -141396,9 +142222,14 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141396
142222
  },
141397
142223
  { immediate: true }
141398
142224
  );
142225
+ watch(isMultiSeries, (multiSeries) => {
142226
+ if (multiSeries) {
142227
+ enableChartTypeSwitcher.value = false;
142228
+ }
142229
+ });
141399
142230
  watch(
141400
142231
  [
141401
- chartType,
142232
+ seriesList,
141402
142233
  chartColors,
141403
142234
  colorSchemeType,
141404
142235
  chartTitle,
@@ -141407,7 +142238,13 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141407
142238
  yAxisLabel,
141408
142239
  orientation,
141409
142240
  pointStyle,
141410
- dataPoints
142241
+ percentDisplay,
142242
+ enableAnimation,
142243
+ enableFullscreenBtn,
142244
+ enableChartTypeSwitcher,
142245
+ enableDataEntry,
142246
+ chartHeight,
142247
+ chartWidth
141411
142248
  ],
141412
142249
  () => {
141413
142250
  updatePreview();
@@ -141433,10 +142270,10 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141433
142270
  "--n-padding-left": "16px"
141434
142271
  }]),
141435
142272
  title: unref(t)("canvasUI.canvasBuilder.dataCharts.editDataChartsComponent"),
141436
- onClose: _cache[11] || (_cache[11] = ($event) => unref(setComponentEditMode)(false))
142273
+ onClose: _cache[16] || (_cache[16] = ($event) => unref(setComponentEditMode)(false))
141437
142274
  }, {
141438
142275
  footer: withCtx(() => [
141439
- createElementVNode("div", _hoisted_50$3, [
142276
+ createElementVNode("div", _hoisted_89, [
141440
142277
  createVNode(CButton, { onClick: onCancel }, {
141441
142278
  default: withCtx(() => [
141442
142279
  createTextVNode(toDisplayString(unref(t)("canvasUI.common.cancel")), 1)
@@ -141474,69 +142311,66 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141474
142311
  createElementVNode("div", _hoisted_2$1t, [
141475
142312
  createElementVNode("div", _hoisted_3$17, [
141476
142313
  createElementVNode("div", _hoisted_4$X, [
141477
- createElementVNode("div", _hoisted_5$O, [
141478
- createElementVNode("label", _hoisted_6$H, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.chartType")), 1),
141479
- createVNode(unref(NSelect), {
141480
- value: chartType.value,
141481
- "onUpdate:value": _cache[0] || (_cache[0] = ($event) => chartType.value = $event),
141482
- options: chartTypeOptions
141483
- }, null, 8, ["value"])
142314
+ createElementVNode("div", _hoisted_5$O, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.dataSettings")), 1),
142315
+ createElementVNode("div", _hoisted_6$H, [
142316
+ (openBlock(true), createElementBlock(Fragment, null, renderList(seriesList.value, (series, index) => {
142317
+ return openBlock(), createElementBlock("div", {
142318
+ key: series.id,
142319
+ class: normalizeClass(["series-tab flex items-center gap-1 px-3 py-2 h-9 cursor-pointer border border-b-0 rounded-t-lg mr-1 transition-colors", [
142320
+ activeSeriesIndex.value === index ? "bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 -mb-px" : "bg-gray-100 dark:bg-gray-900 border-transparent hover:bg-gray-200 dark:hover:bg-gray-700"
142321
+ ]]),
142322
+ onClick: ($event) => activeSeriesIndex.value = index
142323
+ }, [
142324
+ createElementVNode("span", _hoisted_8$q, toDisplayString(series.name), 1),
142325
+ index > 0 ? (openBlock(), createElementBlock("div", {
142326
+ key: 0,
142327
+ class: "ml-1 p-0.5 rounded hover:bg-gray-300 dark:hover:bg-gray-600",
142328
+ onClick: withModifiers(($event) => removeSeries(index), ["stop"])
142329
+ }, [
142330
+ createVNode(CIcon, {
142331
+ class: "text-gray-500",
142332
+ icon: "times",
142333
+ size: 10
142334
+ })
142335
+ ], 8, _hoisted_9$m)) : createCommentVNode("", true)
142336
+ ], 10, _hoisted_7$v);
142337
+ }), 128)),
142338
+ canAddSeries.value ? (openBlock(), createElementBlock("button", {
142339
+ key: 0,
142340
+ class: "flex items-center justify-center w-8 h-8 mb-1 rounded bg-transparent border-none hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors cursor-pointer",
142341
+ title: unref(t)("canvasUI.canvasBuilder.dataCharts.addSeries"),
142342
+ onClick: addSeries
142343
+ }, [
142344
+ createVNode(CIcon, {
142345
+ icon: "plus",
142346
+ size: 14
142347
+ })
142348
+ ], 8, _hoisted_10$h)) : createCommentVNode("", true)
141484
142349
  ]),
141485
- ["bar", "line"].includes(chartType.value) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
141486
- createElementVNode("div", _hoisted_7$v, [
141487
- createElementVNode("label", _hoisted_8$q, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.xAxisLabel")), 1),
141488
- createVNode(unref(NInput), {
141489
- value: xAxisLabel.value,
141490
- "onUpdate:value": _cache[1] || (_cache[1] = ($event) => xAxisLabel.value = $event),
141491
- type: "text"
141492
- }, null, 8, ["value"])
141493
- ]),
141494
- createElementVNode("div", _hoisted_9$m, [
141495
- createElementVNode("label", _hoisted_10$h, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.yAxisLabel")), 1),
141496
- createVNode(unref(NInput), {
141497
- value: yAxisLabel.value,
141498
- "onUpdate:value": _cache[2] || (_cache[2] = ($event) => yAxisLabel.value = $event),
141499
- type: "text"
141500
- }, null, 8, ["value"])
141501
- ]),
141502
- createElementVNode("div", _hoisted_11$f, [
141503
- createElementVNode("label", _hoisted_12$b, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.orientation")), 1),
141504
- createVNode(unref(NSelect), {
141505
- value: orientation.value,
141506
- "onUpdate:value": _cache[3] || (_cache[3] = ($event) => orientation.value = $event),
141507
- options: orientationOptions
141508
- }, null, 8, ["value"])
141509
- ]),
141510
- ["line", "radar"].includes(chartType.value) ? (openBlock(), createElementBlock("div", _hoisted_13$a, [
141511
- createElementVNode("label", _hoisted_14$9, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.pointStyle")), 1),
141512
- createVNode(unref(NSelect), {
141513
- value: pointStyle.value,
141514
- "onUpdate:value": _cache[4] || (_cache[4] = ($event) => pointStyle.value = $event),
141515
- options: pointStyleOptions
141516
- }, null, 8, ["value"])
141517
- ])) : createCommentVNode("", true)
141518
- ], 64)) : createCommentVNode("", true),
141519
- createElementVNode("div", _hoisted_15$8, [
141520
- createElementVNode("label", _hoisted_16$8, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.chartTitle")), 1),
142350
+ seriesList.value.length > 1 ? (openBlock(), createElementBlock("div", _hoisted_11$f, [
142351
+ createElementVNode("label", _hoisted_12$b, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.seriesName")), 1),
141521
142352
  createVNode(unref(NInput), {
141522
- value: chartTitle.value,
141523
- "onUpdate:value": _cache[5] || (_cache[5] = ($event) => chartTitle.value = $event),
142353
+ value: activeSeries.value.name,
142354
+ "onUpdate:value": _cache[0] || (_cache[0] = ($event) => activeSeries.value.name = $event),
141524
142355
  type: "text"
141525
142356
  }, null, 8, ["value"])
141526
- ]),
141527
- ["pie", "doughnut", "polarArea"].includes(chartType.value) ? (openBlock(), createElementBlock("div", _hoisted_17$7, [
141528
- createElementVNode("label", _hoisted_18$6, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.legendPosition")), 1),
141529
- createVNode(unref(NSelect), {
141530
- value: legendPosition.value,
141531
- "onUpdate:value": _cache[6] || (_cache[6] = ($event) => legendPosition.value = $event),
141532
- options: legendPositionOptions
141533
- }, null, 8, ["value"])
141534
142357
  ])) : createCommentVNode("", true),
141535
- createElementVNode("div", _hoisted_19$6, [
141536
- createElementVNode("div", _hoisted_20$5, [
141537
- createElementVNode("label", _hoisted_21$5, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.dataPoints")), 1),
142358
+ createElementVNode("div", _hoisted_13$a, [
142359
+ createElementVNode("label", _hoisted_14$9, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.chartType")), 1),
142360
+ createVNode(unref(NSelect), {
142361
+ value: activeSeries.value.chartType,
142362
+ "onUpdate:value": [
142363
+ _cache[1] || (_cache[1] = ($event) => activeSeries.value.chartType = $event),
142364
+ onChartTypeChange
142365
+ ],
142366
+ options: availableChartTypeOptions.value
142367
+ }, null, 8, ["value", "options"])
142368
+ ]),
142369
+ createElementVNode("div", _hoisted_15$8, [
142370
+ createElementVNode("div", _hoisted_16$8, [
142371
+ createElementVNode("label", _hoisted_17$7, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.dataPoints")), 1),
141538
142372
  createVNode(unref(Button), {
141539
- disabled: !dataPoints.value.length,
142373
+ disabled: !activeSeries.value.dataPoints.length,
141540
142374
  size: "small",
141541
142375
  onClick: removeAllDataPoints
141542
142376
  }, {
@@ -141546,205 +142380,301 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141546
142380
  _: 1
141547
142381
  }, 8, ["disabled"])
141548
142382
  ]),
141549
- (openBlock(true), createElementBlock(Fragment, null, renderList(dataPoints.value, (point, index) => {
142383
+ !isActiveSeriesXYChart.value && !isActiveSeriesXYRChart.value ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(activeSeries.value.dataPoints, (point, index) => {
141550
142384
  return openBlock(), createElementBlock("div", {
141551
142385
  key: index,
141552
142386
  class: "flex gap-2 mb-2"
141553
142387
  }, [
141554
- point.selectedValue && (Array.isArray(point.selectedValue) || typeof point.selectedValue === "object" && point.selectedValue !== null) ? (openBlock(), createBlock(unref(NTooltip), {
141555
- key: 0,
141556
- trigger: "hover"
142388
+ createVNode(unref(NInput), {
142389
+ value: point.label,
142390
+ "onUpdate:value": ($event) => point.label = $event,
142391
+ class: "flex-1",
142392
+ disabled: !!point.arrayConfig,
142393
+ placeholder: "Label"
142394
+ }, null, 8, ["value", "onUpdate:value", "disabled"]),
142395
+ createVNode(unref(NInput), {
142396
+ value: point.value,
142397
+ "onUpdate:value": ($event) => point.value = $event,
142398
+ class: "flex-1",
142399
+ disabled: !!point.dynamicValue,
142400
+ placeholder: "Value",
142401
+ type: "text"
141557
142402
  }, {
141558
- trigger: withCtx(() => [
141559
- createVNode(unref(NInput), {
141560
- value: point.label,
141561
- "onUpdate:value": ($event) => point.label = $event,
141562
- class: "flex-1",
141563
- disabled: true,
141564
- placeholder: "Label"
141565
- }, null, 8, ["value", "onUpdate:value"])
142403
+ suffix: withCtx(() => [
142404
+ createVNode(unref(NPopover), {
142405
+ placement: "bottom",
142406
+ show: activePopoverPoint.value === point && activePopoverField.value === "value",
142407
+ trigger: "manual",
142408
+ onClickoutside: closePopover
142409
+ }, {
142410
+ trigger: withCtx(() => [
142411
+ createElementVNode("div", {
142412
+ class: "cursor-pointer flex items-center",
142413
+ onClick: ($event) => handleDynamicValueClick(point, "value")
142414
+ }, [
142415
+ createVNode(CIcon, {
142416
+ class: normalizeClass(point.dynamicValue ? "text-blue-500" : ""),
142417
+ icon: "caret-down"
142418
+ }, null, 8, ["class"])
142419
+ ], 8, _hoisted_18$6)
142420
+ ]),
142421
+ default: withCtx(() => [
142422
+ createElementVNode("div", _hoisted_19$6, [
142423
+ createElementVNode("div", _hoisted_20$5, [
142424
+ createElementVNode("div", _hoisted_21$5, [
142425
+ createElementVNode("div", _hoisted_22$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.selectDynamicValue")), 1),
142426
+ createElementVNode("div", _hoisted_23$3, [
142427
+ createVNode(unref(NTree), {
142428
+ "block-line": "",
142429
+ class: "max-h-[300px]",
142430
+ data: dynamicValueTreeData.value,
142431
+ "render-label": renderDynamicValueTreeLabel,
142432
+ "selected-keys": [point.dynamicValue?.path ?? ""],
142433
+ "onUpdate:selectedKeys": (keys) => handleDynamicValueSelect(keys, point, "value")
142434
+ }, null, 8, ["data", "selected-keys", "onUpdate:selectedKeys"])
142435
+ ])
142436
+ ]),
142437
+ point.selectedValue && point.arrayConfig && isArrayOrObject(point.selectedValue) ? (openBlock(), createElementBlock("div", _hoisted_24$3, [
142438
+ createElementVNode("div", _hoisted_25$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.configureArrayObjectFields")), 1),
142439
+ createElementVNode("div", _hoisted_26$3, [
142440
+ createElementVNode("div", null, [
142441
+ createElementVNode("label", _hoisted_27$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.labelField")), 1),
142442
+ createVNode(unref(NSelect), {
142443
+ value: point.arrayConfig.labelField,
142444
+ "onUpdate:value": [($event) => point.arrayConfig.labelField = $event, ($event) => updateDynamicValueExpression(point)],
142445
+ options: getFieldOptions(point.selectedValue)
142446
+ }, null, 8, ["value", "onUpdate:value", "options"])
142447
+ ]),
142448
+ createElementVNode("div", null, [
142449
+ createElementVNode("label", _hoisted_28$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.valueField")), 1),
142450
+ createVNode(unref(NSelect), {
142451
+ value: point.arrayConfig.valueField,
142452
+ "onUpdate:value": [($event) => point.arrayConfig.valueField = $event, ($event) => updateDynamicValueExpression(point)],
142453
+ options: getFieldOptions(point.selectedValue)
142454
+ }, null, 8, ["value", "onUpdate:value", "options"])
142455
+ ])
142456
+ ])
142457
+ ])) : createCommentVNode("", true)
142458
+ ])
142459
+ ])
142460
+ ]),
142461
+ _: 2
142462
+ }, 1032, ["show"])
141566
142463
  ]),
141567
- default: withCtx(() => [
141568
- createTextVNode(" " + toDisplayString(point.label), 1)
142464
+ _: 2
142465
+ }, 1032, ["value", "onUpdate:value", "disabled"]),
142466
+ createVNode(CButton, {
142467
+ circle: "",
142468
+ class: "bg-error2 self-center",
142469
+ size: "small",
142470
+ style: normalizeStyle(deleteButtonStyle.value),
142471
+ type: "error",
142472
+ onClick: ($event) => removeDataPoint(index)
142473
+ }, {
142474
+ icon: withCtx(() => [
142475
+ createVNode(CIcon, {
142476
+ class: "color-error",
142477
+ "fa-type": "far",
142478
+ icon: "trash",
142479
+ size: 12
142480
+ })
141569
142481
  ]),
141570
142482
  _: 2
141571
- }, 1024)) : (openBlock(), createBlock(unref(NInput), {
141572
- key: 1,
142483
+ }, 1032, ["style", "onClick"])
142484
+ ]);
142485
+ }), 128)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(activeSeries.value.dataPoints, (point, index) => {
142486
+ return openBlock(), createElementBlock("div", {
142487
+ key: index,
142488
+ class: "flex gap-2 mb-2"
142489
+ }, [
142490
+ createVNode(unref(NInput), {
141573
142491
  value: point.label,
141574
142492
  "onUpdate:value": ($event) => point.label = $event,
141575
142493
  class: "flex-1",
142494
+ disabled: !!point.arrayConfig,
141576
142495
  placeholder: "Label"
141577
- }, null, 8, ["value", "onUpdate:value"])),
141578
- createElementVNode("div", _hoisted_22$3, [
141579
- point.dynamicValue ? (openBlock(), createBlock(unref(NTooltip), {
141580
- key: 0,
141581
- trigger: "hover"
141582
- }, {
141583
- trigger: withCtx(() => [
141584
- createVNode(unref(NInput), {
141585
- value: point.value,
141586
- "onUpdate:value": ($event) => point.value = $event,
141587
- class: "flex-1",
141588
- disabled: !!point.dynamicValue,
141589
- placeholder: "Value",
141590
- type: "text"
141591
- }, {
141592
- suffix: withCtx(() => [
141593
- createVNode(unref(NPopover), {
141594
- placement: "bottom",
141595
- show: activePopoverPoint.value === point,
141596
- trigger: "manual",
141597
- onClickoutside: _cache[7] || (_cache[7] = ($event) => activePopoverPoint.value = null)
141598
- }, {
141599
- trigger: withCtx(() => [
141600
- createElementVNode("div", {
141601
- class: "cursor-pointer flex items-center",
141602
- onClick: ($event) => handleDynamicValueClick(point)
141603
- }, [
141604
- createVNode(CIcon, {
141605
- class: normalizeClass(point.dynamicValue ? "text-blue-500" : ""),
141606
- icon: "caret-down"
141607
- }, null, 8, ["class"])
141608
- ], 8, _hoisted_23$3)
141609
- ]),
141610
- default: withCtx(() => [
141611
- createElementVNode("div", _hoisted_24$3, [
141612
- createElementVNode("div", _hoisted_25$3, [
141613
- createElementVNode("div", _hoisted_26$3, [
141614
- createElementVNode("div", _hoisted_27$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.selectDynamicValue")), 1),
141615
- createElementVNode("div", _hoisted_28$3, [
141616
- createVNode(unref(NTree), {
141617
- "block-line": "",
141618
- class: "max-h-[300px]",
141619
- data: dynamicValueTreeData.value,
141620
- "render-label": renderDynamicValueTreeLabel,
141621
- "selected-keys": [point.dynamicValue?.path ?? ""],
141622
- "onUpdate:selectedKeys": (keys) => handleDynamicValueSelect(keys, point)
141623
- }, null, 8, ["data", "selected-keys", "onUpdate:selectedKeys"])
141624
- ])
141625
- ]),
141626
- point.selectedValue && point.arrayConfig && (Array.isArray(point.selectedValue) || typeof point.selectedValue === "object" && point.selectedValue !== null) ? (openBlock(), createElementBlock("div", _hoisted_29$3, [
141627
- createElementVNode("div", _hoisted_30$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.configureArrayObjectFields")), 1),
141628
- createElementVNode("div", _hoisted_31$3, [
141629
- createElementVNode("div", null, [
141630
- createElementVNode("label", _hoisted_32$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.labelField")), 1),
141631
- createVNode(unref(NSelect), {
141632
- value: point.arrayConfig.labelField,
141633
- "onUpdate:value": [($event) => point.arrayConfig.labelField = $event, ($event) => updateDynamicValueExpression(point)],
141634
- options: getFieldOptions(point.selectedValue)
141635
- }, null, 8, ["value", "onUpdate:value", "options"])
141636
- ]),
141637
- createElementVNode("div", null, [
141638
- createElementVNode("label", _hoisted_33$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.valueField")), 1),
141639
- createVNode(unref(NSelect), {
141640
- value: point.arrayConfig.valueField,
141641
- "onUpdate:value": [($event) => point.arrayConfig.valueField = $event, ($event) => updateDynamicValueExpression(point)],
141642
- options: getFieldOptions(point.selectedValue)
141643
- }, null, 8, ["value", "onUpdate:value", "options"])
141644
- ])
141645
- ])
141646
- ])) : createCommentVNode("", true)
141647
- ])
142496
+ }, null, 8, ["value", "onUpdate:value", "disabled"]),
142497
+ createVNode(unref(NInput), {
142498
+ value: point.xValue,
142499
+ "onUpdate:value": ($event) => point.xValue = $event,
142500
+ class: "flex-1",
142501
+ disabled: !!point.dynamicXValue,
142502
+ placeholder: "X Value",
142503
+ type: "text"
142504
+ }, {
142505
+ suffix: withCtx(() => [
142506
+ createVNode(unref(NPopover), {
142507
+ placement: "bottom",
142508
+ show: activePopoverPoint.value === point && activePopoverField.value === "x",
142509
+ trigger: "manual",
142510
+ onClickoutside: closePopover
142511
+ }, {
142512
+ trigger: withCtx(() => [
142513
+ createElementVNode("div", {
142514
+ class: "cursor-pointer flex items-center",
142515
+ onClick: ($event) => handleDynamicValueClick(point, "x")
142516
+ }, [
142517
+ createVNode(CIcon, {
142518
+ class: normalizeClass(point.dynamicXValue ? "text-blue-500" : ""),
142519
+ icon: "caret-down"
142520
+ }, null, 8, ["class"])
142521
+ ], 8, _hoisted_29$3)
142522
+ ]),
142523
+ default: withCtx(() => [
142524
+ createElementVNode("div", _hoisted_30$3, [
142525
+ createElementVNode("div", _hoisted_31$3, [
142526
+ createElementVNode("div", _hoisted_32$3, [
142527
+ createElementVNode("div", _hoisted_33$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.selectDynamicValue")), 1),
142528
+ createElementVNode("div", _hoisted_34$3, [
142529
+ createVNode(unref(NTree), {
142530
+ "block-line": "",
142531
+ class: "max-h-[300px]",
142532
+ data: dynamicValueTreeData.value,
142533
+ "render-label": renderDynamicValueTreeLabel,
142534
+ "selected-keys": [point.dynamicXValue?.path ?? ""],
142535
+ "onUpdate:selectedKeys": (keys) => handleDynamicValueSelect(keys, point, "x")
142536
+ }, null, 8, ["data", "selected-keys", "onUpdate:selectedKeys"])
141648
142537
  ])
141649
142538
  ]),
141650
- _: 2
141651
- }, 1032, ["show"])
141652
- ]),
141653
- _: 2
141654
- }, 1032, ["value", "onUpdate:value", "disabled"])
141655
- ]),
141656
- default: withCtx(() => [
141657
- createTextVNode(" " + toDisplayString(point.value), 1)
141658
- ]),
141659
- _: 2
141660
- }, 1024)) : (openBlock(), createBlock(unref(NInput), {
141661
- key: 1,
141662
- value: point.value,
141663
- "onUpdate:value": ($event) => point.value = $event,
141664
- class: "flex-1",
141665
- disabled: !!point.dynamicValue,
141666
- placeholder: "Value",
141667
- type: "text"
141668
- }, {
141669
- suffix: withCtx(() => [
141670
- createVNode(unref(NPopover), {
141671
- placement: "bottom",
141672
- show: activePopoverPoint.value === point,
141673
- trigger: "manual",
141674
- onClickoutside: _cache[8] || (_cache[8] = ($event) => activePopoverPoint.value = null)
141675
- }, {
141676
- trigger: withCtx(() => [
141677
- createElementVNode("div", {
141678
- class: "cursor-pointer flex items-center",
141679
- onClick: ($event) => handleDynamicValueClick(point)
141680
- }, [
141681
- createVNode(CIcon, {
141682
- class: normalizeClass(point.dynamicValue ? "text-blue-500" : ""),
141683
- icon: "caret-down"
141684
- }, null, 8, ["class"])
141685
- ], 8, _hoisted_34$3)
141686
- ]),
141687
- default: withCtx(() => [
141688
- createElementVNode("div", _hoisted_35$3, [
141689
- createElementVNode("div", _hoisted_36$3, [
142539
+ point.selectedXValue && point.arrayConfig && isArrayOrObject(point.selectedXValue) ? (openBlock(), createElementBlock("div", _hoisted_35$3, [
142540
+ createElementVNode("div", _hoisted_36$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.configureArrayObjectFields")), 1),
141690
142541
  createElementVNode("div", _hoisted_37$3, [
141691
- createElementVNode("div", _hoisted_38$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.selectDynamicValue")), 1),
141692
- createElementVNode("div", _hoisted_39$3, [
141693
- createVNode(unref(NTree), {
141694
- "block-line": "",
141695
- class: "max-h-[300px]",
141696
- data: dynamicValueTreeData.value,
141697
- "render-label": renderDynamicValueTreeLabel,
141698
- "selected-keys": [point.dynamicValue?.path ?? ""],
141699
- "onUpdate:selectedKeys": (keys) => handleDynamicValueSelect(keys, point)
141700
- }, null, 8, ["data", "selected-keys", "onUpdate:selectedKeys"])
141701
- ])
141702
- ]),
141703
- point.selectedValue && point.arrayConfig && (Array.isArray(point.selectedValue) || typeof point.selectedValue === "object" && point.selectedValue !== null) ? (openBlock(), createElementBlock("div", _hoisted_40$3, [
141704
- _cache[14] || (_cache[14] = createElementVNode("div", { class: "text-sm font-medium mb-2" }, "Configure Array/Object Fields", -1)),
141705
- createElementVNode("div", _hoisted_41$3, [
141706
- createElementVNode("div", null, [
141707
- _cache[12] || (_cache[12] = createElementVNode("label", { class: "block mb-1 text-sm" }, "Label Field", -1)),
141708
- createVNode(unref(NSelect), {
141709
- value: point.arrayConfig.labelField,
141710
- "onUpdate:value": [($event) => point.arrayConfig.labelField = $event, ($event) => updateDynamicValueExpression(point)],
141711
- options: getFieldOptions(point.selectedValue)
141712
- }, null, 8, ["value", "onUpdate:value", "options"])
141713
- ]),
141714
- createElementVNode("div", null, [
141715
- _cache[13] || (_cache[13] = createElementVNode("label", { class: "block mb-1 text-sm" }, "Value Field", -1)),
141716
- createVNode(unref(NSelect), {
141717
- value: point.arrayConfig.valueField,
141718
- "onUpdate:value": [($event) => point.arrayConfig.valueField = $event, ($event) => updateDynamicValueExpression(point)],
141719
- options: getFieldOptions(point.selectedValue)
141720
- }, null, 8, ["value", "onUpdate:value", "options"])
141721
- ])
141722
- ])
141723
- ])) : createCommentVNode("", true)
141724
- ])
142542
+ createElementVNode("div", null, [
142543
+ createElementVNode("label", _hoisted_38$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.labelField")), 1),
142544
+ createVNode(unref(NSelect), {
142545
+ value: point.arrayConfig.labelField,
142546
+ "onUpdate:value": [($event) => point.arrayConfig.labelField = $event, ($event) => updateXYDynamicValueExpression(point)],
142547
+ options: getFieldOptions(point.selectedXValue)
142548
+ }, null, 8, ["value", "onUpdate:value", "options"])
142549
+ ]),
142550
+ createElementVNode("div", null, [
142551
+ createElementVNode("label", _hoisted_39$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.xValueField")), 1),
142552
+ createVNode(unref(NSelect), {
142553
+ value: point.arrayConfig.xField,
142554
+ "onUpdate:value": [($event) => point.arrayConfig.xField = $event, ($event) => updateXYDynamicValueExpression(point)],
142555
+ options: getFieldOptions(point.selectedXValue)
142556
+ }, null, 8, ["value", "onUpdate:value", "options"])
142557
+ ]),
142558
+ createElementVNode("div", null, [
142559
+ createElementVNode("label", _hoisted_40$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.yValueField")), 1),
142560
+ createVNode(unref(NSelect), {
142561
+ value: point.arrayConfig.yField,
142562
+ "onUpdate:value": [($event) => point.arrayConfig.yField = $event, ($event) => updateXYDynamicValueExpression(point)],
142563
+ options: getFieldOptions(point.selectedXValue)
142564
+ }, null, 8, ["value", "onUpdate:value", "options"])
142565
+ ]),
142566
+ isActiveSeriesXYRChart.value ? (openBlock(), createElementBlock("div", _hoisted_41$3, [
142567
+ createElementVNode("label", _hoisted_42$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.rValueField")), 1),
142568
+ createVNode(unref(NSelect), {
142569
+ value: point.arrayConfig.rField,
142570
+ "onUpdate:value": [($event) => point.arrayConfig.rField = $event, ($event) => updateXYDynamicValueExpression(point)],
142571
+ options: getFieldOptions(point.selectedXValue)
142572
+ }, null, 8, ["value", "onUpdate:value", "options"])
142573
+ ])) : createCommentVNode("", true)
142574
+ ])
142575
+ ])) : createCommentVNode("", true)
141725
142576
  ])
141726
- ]),
141727
- _: 2
141728
- }, 1032, ["show"])
141729
- ]),
141730
- _: 2
141731
- }, 1032, ["value", "onUpdate:value", "disabled"]))
141732
- ]),
142577
+ ])
142578
+ ]),
142579
+ _: 2
142580
+ }, 1032, ["show"])
142581
+ ]),
142582
+ _: 2
142583
+ }, 1032, ["value", "onUpdate:value", "disabled"]),
142584
+ createVNode(unref(NInput), {
142585
+ value: point.yValue,
142586
+ "onUpdate:value": ($event) => point.yValue = $event,
142587
+ class: "flex-1",
142588
+ disabled: !!point.dynamicYValue,
142589
+ placeholder: "Y Value",
142590
+ type: "text"
142591
+ }, {
142592
+ suffix: withCtx(() => [
142593
+ createVNode(unref(NPopover), {
142594
+ placement: "bottom",
142595
+ show: activePopoverPoint.value === point && activePopoverField.value === "y",
142596
+ trigger: "manual",
142597
+ onClickoutside: closePopover
142598
+ }, {
142599
+ trigger: withCtx(() => [
142600
+ createElementVNode("div", {
142601
+ class: "cursor-pointer flex items-center",
142602
+ onClick: ($event) => handleDynamicValueClick(point, "y")
142603
+ }, [
142604
+ createVNode(CIcon, {
142605
+ class: normalizeClass(point.dynamicYValue ? "text-blue-500" : ""),
142606
+ icon: "caret-down"
142607
+ }, null, 8, ["class"])
142608
+ ], 8, _hoisted_43$3)
142609
+ ]),
142610
+ default: withCtx(() => [
142611
+ createElementVNode("div", _hoisted_44$3, [
142612
+ createElementVNode("div", _hoisted_45$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.selectDynamicValue")), 1),
142613
+ createVNode(unref(NTree), {
142614
+ "block-line": "",
142615
+ class: "max-h-[300px]",
142616
+ data: dynamicValueTreeData.value,
142617
+ "render-label": renderDynamicValueTreeLabel,
142618
+ "selected-keys": [point.dynamicYValue?.path ?? ""],
142619
+ "onUpdate:selectedKeys": (keys) => handleDynamicValueSelect(keys, point, "y")
142620
+ }, null, 8, ["data", "selected-keys", "onUpdate:selectedKeys"])
142621
+ ])
142622
+ ]),
142623
+ _: 2
142624
+ }, 1032, ["show"])
142625
+ ]),
142626
+ _: 2
142627
+ }, 1032, ["value", "onUpdate:value", "disabled"]),
142628
+ isActiveSeriesXYRChart.value ? (openBlock(), createBlock(unref(NInput), {
142629
+ key: 0,
142630
+ value: point.rValue,
142631
+ "onUpdate:value": ($event) => point.rValue = $event,
142632
+ class: "flex-1",
142633
+ disabled: !!point.dynamicRValue,
142634
+ placeholder: "Size (R)",
142635
+ type: "text"
142636
+ }, {
142637
+ suffix: withCtx(() => [
142638
+ createVNode(unref(NPopover), {
142639
+ placement: "bottom",
142640
+ show: activePopoverPoint.value === point && activePopoverField.value === "r",
142641
+ trigger: "manual",
142642
+ onClickoutside: closePopover
142643
+ }, {
142644
+ trigger: withCtx(() => [
142645
+ createElementVNode("div", {
142646
+ class: "cursor-pointer flex items-center",
142647
+ onClick: ($event) => handleDynamicValueClick(point, "r")
142648
+ }, [
142649
+ createVNode(CIcon, {
142650
+ class: normalizeClass(point.dynamicRValue ? "text-blue-500" : ""),
142651
+ icon: "caret-down"
142652
+ }, null, 8, ["class"])
142653
+ ], 8, _hoisted_46$3)
142654
+ ]),
142655
+ default: withCtx(() => [
142656
+ createElementVNode("div", _hoisted_47$3, [
142657
+ createElementVNode("div", _hoisted_48$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.selectDynamicValue")), 1),
142658
+ createVNode(unref(NTree), {
142659
+ "block-line": "",
142660
+ class: "max-h-[300px]",
142661
+ data: dynamicValueTreeData.value,
142662
+ "render-label": renderDynamicValueTreeLabel,
142663
+ "selected-keys": [point.dynamicRValue?.path ?? ""],
142664
+ "onUpdate:selectedKeys": (keys) => handleDynamicValueSelect(keys, point, "r")
142665
+ }, null, 8, ["data", "selected-keys", "onUpdate:selectedKeys"])
142666
+ ])
142667
+ ]),
142668
+ _: 2
142669
+ }, 1032, ["show"])
142670
+ ]),
142671
+ _: 2
142672
+ }, 1032, ["value", "onUpdate:value", "disabled"])) : createCommentVNode("", true),
141733
142673
  createVNode(CButton, {
141734
142674
  circle: "",
141735
142675
  class: "bg-error2 self-center",
141736
142676
  size: "small",
141737
- style: normalizeStyle({
141738
- "--n-border": "1px solid transparent",
141739
- "--n-border-disabled": "1px solid transparent",
141740
- "--n-border-focus": "1px solid transparent",
141741
- "--n-border-hover": "1px solid transparent",
141742
- "--n-border-pressed": "1px solid transparent",
141743
- "--n-color-focus": unref(themeVars).error2,
141744
- "--n-color-hover": unref(themeVars).error2,
141745
- "--n-color-disabled": unref(themeVars).error2,
141746
- "--n-color-pressed": unref(themeVars).error2
141747
- }),
142677
+ style: normalizeStyle(deleteButtonStyle.value),
141748
142678
  type: "error",
141749
142679
  onClick: ($event) => removeDataPoint(index)
141750
142680
  }, {
@@ -141760,7 +142690,7 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141760
142690
  }, 1032, ["style", "onClick"])
141761
142691
  ]);
141762
142692
  }), 128)),
141763
- createElementVNode("div", _hoisted_42$3, [
142693
+ createElementVNode("div", _hoisted_49$3, [
141764
142694
  createVNode(CButton, {
141765
142695
  class: "mt-2",
141766
142696
  "icon-placement": "left",
@@ -141780,11 +142710,62 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141780
142710
  })
141781
142711
  ])
141782
142712
  ]),
141783
- createElementVNode("div", _hoisted_43$3, [
141784
- createElementVNode("label", _hoisted_44$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.colorScheme")), 1),
142713
+ createElementVNode("div", _hoisted_50$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.chartSettings")), 1),
142714
+ createElementVNode("div", _hoisted_51$2, [
142715
+ createElementVNode("label", _hoisted_52$2, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.chartTitle")), 1),
142716
+ createVNode(unref(NInput), {
142717
+ value: chartTitle.value,
142718
+ "onUpdate:value": _cache[2] || (_cache[2] = ($event) => chartTitle.value = $event),
142719
+ type: "text"
142720
+ }, null, 8, ["value"])
142721
+ ]),
142722
+ ["bar", "line"].includes(primaryChartType.value) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
142723
+ createElementVNode("div", _hoisted_53$2, [
142724
+ createElementVNode("label", _hoisted_54$1, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.xAxisLabel")), 1),
142725
+ createVNode(unref(NInput), {
142726
+ value: xAxisLabel.value,
142727
+ "onUpdate:value": _cache[3] || (_cache[3] = ($event) => xAxisLabel.value = $event),
142728
+ type: "text"
142729
+ }, null, 8, ["value"])
142730
+ ]),
142731
+ createElementVNode("div", _hoisted_55$1, [
142732
+ createElementVNode("label", _hoisted_56$1, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.yAxisLabel")), 1),
142733
+ createVNode(unref(NInput), {
142734
+ value: yAxisLabel.value,
142735
+ "onUpdate:value": _cache[4] || (_cache[4] = ($event) => yAxisLabel.value = $event),
142736
+ type: "text"
142737
+ }, null, 8, ["value"])
142738
+ ]),
142739
+ createElementVNode("div", _hoisted_57$1, [
142740
+ createElementVNode("label", _hoisted_58$1, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.orientation")), 1),
142741
+ createVNode(unref(NSelect), {
142742
+ value: orientation.value,
142743
+ "onUpdate:value": _cache[5] || (_cache[5] = ($event) => orientation.value = $event),
142744
+ options: orientationOptions
142745
+ }, null, 8, ["value"])
142746
+ ])
142747
+ ], 64)) : createCommentVNode("", true),
142748
+ ["pie", "doughnut", "polarArea"].includes(primaryChartType.value) ? (openBlock(), createElementBlock("div", _hoisted_59$1, [
142749
+ createElementVNode("label", _hoisted_60$1, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.legendPosition")), 1),
142750
+ createVNode(unref(NSelect), {
142751
+ value: legendPosition.value,
142752
+ "onUpdate:value": _cache[6] || (_cache[6] = ($event) => legendPosition.value = $event),
142753
+ options: legendPositionOptions
142754
+ }, null, 8, ["value"])
142755
+ ])) : createCommentVNode("", true),
142756
+ ["line", "scatter", "area"].includes(primaryChartType.value) ? (openBlock(), createElementBlock("div", _hoisted_61$1, [
142757
+ createElementVNode("label", _hoisted_62$1, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.pointStyle")), 1),
142758
+ createVNode(unref(NSelect), {
142759
+ value: pointStyle.value,
142760
+ "onUpdate:value": _cache[7] || (_cache[7] = ($event) => pointStyle.value = $event),
142761
+ options: pointStyleOptions
142762
+ }, null, 8, ["value"])
142763
+ ])) : createCommentVNode("", true),
142764
+ createElementVNode("div", _hoisted_63$1, [
142765
+ createElementVNode("label", _hoisted_64$1, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.colorScheme")), 1),
141785
142766
  createVNode(unref(NSelect), {
141786
142767
  value: colorSchemeType.value,
141787
- "onUpdate:value": _cache[9] || (_cache[9] = ($event) => colorSchemeType.value = $event),
142768
+ "onUpdate:value": _cache[8] || (_cache[8] = ($event) => colorSchemeType.value = $event),
141788
142769
  class: "mb-2",
141789
142770
  options: [
141790
142771
  { label: unref(t)("canvasUI.canvasBuilder.dataCharts.useThemeColors"), value: "theme" },
@@ -141801,19 +142782,106 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141801
142782
  "onUpdate:palette": updateChartColors
141802
142783
  }, null, 8, ["allow-add", "allow-delete", "allow-edit", "initial-palette"]))
141803
142784
  ]),
141804
- createElementVNode("div", _hoisted_45$3, [
141805
- createElementVNode("label", _hoisted_46$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.animation")), 1),
142785
+ createElementVNode("div", _hoisted_65$1, [
142786
+ createElementVNode("label", _hoisted_66$1, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.animation")), 1),
141806
142787
  createVNode(unref(NSwitch), {
141807
142788
  value: enableAnimation.value,
141808
- "onUpdate:value": _cache[10] || (_cache[10] = ($event) => enableAnimation.value = $event)
142789
+ "onUpdate:value": _cache[9] || (_cache[9] = ($event) => enableAnimation.value = $event)
141809
142790
  }, null, 8, ["value"])
142791
+ ]),
142792
+ createElementVNode("div", _hoisted_67$1, [
142793
+ createElementVNode("label", _hoisted_68$1, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.percentDisplay")), 1),
142794
+ createElementVNode("div", _hoisted_69, [
142795
+ createVNode(unref(NSwitch), {
142796
+ value: percentDisplay.value,
142797
+ "onUpdate:value": _cache[10] || (_cache[10] = ($event) => percentDisplay.value = $event)
142798
+ }, null, 8, ["value"]),
142799
+ createElementVNode("span", _hoisted_70, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.percentDisplayHint")), 1)
142800
+ ])
142801
+ ]),
142802
+ createElementVNode("div", _hoisted_71, [
142803
+ createElementVNode("label", _hoisted_72, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.viewModeControls")), 1),
142804
+ createElementVNode("div", _hoisted_73, [
142805
+ createElementVNode("div", _hoisted_74, [
142806
+ createVNode(unref(NSwitch), {
142807
+ value: enableFullscreenBtn.value,
142808
+ "onUpdate:value": _cache[11] || (_cache[11] = ($event) => enableFullscreenBtn.value = $event)
142809
+ }, null, 8, ["value"]),
142810
+ createElementVNode("span", _hoisted_75, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.enableFullscreenBtn")), 1)
142811
+ ]),
142812
+ createVNode(unref(NTooltip), {
142813
+ disabled: !isMultiSeries.value,
142814
+ trigger: "hover"
142815
+ }, {
142816
+ trigger: withCtx(() => [
142817
+ createElementVNode("div", {
142818
+ class: normalizeClass(["flex items-center gap-2", { "opacity-50 cursor-not-allowed": isMultiSeries.value }])
142819
+ }, [
142820
+ createVNode(unref(NSwitch), {
142821
+ value: enableChartTypeSwitcher.value,
142822
+ "onUpdate:value": _cache[12] || (_cache[12] = ($event) => enableChartTypeSwitcher.value = $event),
142823
+ disabled: isMultiSeries.value
142824
+ }, null, 8, ["value", "disabled"]),
142825
+ createElementVNode("span", _hoisted_76, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.enableChartTypeSwitcher")), 1)
142826
+ ], 2)
142827
+ ]),
142828
+ default: withCtx(() => [
142829
+ createTextVNode(" " + toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.chartTypeSwitcherMultiSeriesDisabled")), 1)
142830
+ ]),
142831
+ _: 1
142832
+ }, 8, ["disabled"]),
142833
+ createElementVNode("div", _hoisted_77, [
142834
+ createVNode(unref(NSwitch), {
142835
+ value: enableDataEntry.value,
142836
+ "onUpdate:value": _cache[13] || (_cache[13] = ($event) => enableDataEntry.value = $event)
142837
+ }, null, 8, ["value"]),
142838
+ createElementVNode("span", _hoisted_78, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.enableDataEntry")), 1)
142839
+ ])
142840
+ ])
142841
+ ]),
142842
+ createElementVNode("div", _hoisted_79, [
142843
+ createElementVNode("label", _hoisted_80, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.chartSize")), 1),
142844
+ createElementVNode("div", _hoisted_81, [
142845
+ createElementVNode("div", _hoisted_82, [
142846
+ createElementVNode("label", _hoisted_83, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.height")), 1),
142847
+ createVNode(unref(NInputNumber), {
142848
+ value: chartHeight.value,
142849
+ "onUpdate:value": _cache[14] || (_cache[14] = ($event) => chartHeight.value = $event),
142850
+ class: "flex-1",
142851
+ max: 1e3,
142852
+ min: 100,
142853
+ step: 10
142854
+ }, {
142855
+ suffix: withCtx(() => _cache[17] || (_cache[17] = [
142856
+ createTextVNode("px")
142857
+ ])),
142858
+ _: 1
142859
+ }, 8, ["value"])
142860
+ ]),
142861
+ createElementVNode("div", _hoisted_84, [
142862
+ createElementVNode("label", _hoisted_85, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.width")), 1),
142863
+ createVNode(unref(NInputNumber), {
142864
+ value: chartWidth.value,
142865
+ "onUpdate:value": _cache[15] || (_cache[15] = ($event) => chartWidth.value = $event),
142866
+ class: "flex-1",
142867
+ max: 100,
142868
+ min: 10,
142869
+ step: 5
142870
+ }, {
142871
+ suffix: withCtx(() => _cache[18] || (_cache[18] = [
142872
+ createTextVNode("%")
142873
+ ])),
142874
+ _: 1
142875
+ }, 8, ["value"])
142876
+ ])
142877
+ ])
141810
142878
  ])
141811
142879
  ])
141812
142880
  ])
141813
142881
  ]),
141814
- createElementVNode("div", _hoisted_47$3, [
141815
- createElementVNode("div", _hoisted_48$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.preview")), 1),
141816
- createElementVNode("div", _hoisted_49$3, [
142882
+ createElementVNode("div", _hoisted_86, [
142883
+ createElementVNode("div", _hoisted_87, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.preview")), 1),
142884
+ createElementVNode("div", _hoisted_88, [
141817
142885
  createVNode(unref(NCard), { bordered: false }, {
141818
142886
  default: withCtx(() => [
141819
142887
  (openBlock(), createBlock(RawDataCharts, {
@@ -141821,7 +142889,8 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141821
142889
  data: {
141822
142890
  ...previewData.value,
141823
142891
  context: unref(crmShape)
141824
- }
142892
+ },
142893
+ "is-preview": ""
141825
142894
  }, null, 8, ["data"]))
141826
142895
  ]),
141827
142896
  _: 1
@@ -141878,6 +142947,12 @@ const _sfc_main$2D = /* @__PURE__ */ defineComponent({
141878
142947
  usedInSectionId,
141879
142948
  when_used_in_section
141880
142949
  });
142950
+ const canEditChart = computed(() => {
142951
+ if (mode.value === CanvasBuilderMode.ADMIN) {
142952
+ return true;
142953
+ }
142954
+ return props.data?.view_controls?.enable_data_entry ?? false;
142955
+ });
141881
142956
  onMounted(() => {
141882
142957
  if (justAddedComponentId.value === props.id) {
141883
142958
  setComponentEditMode(ComponentTypes.DataCharts, props.id);
@@ -141889,7 +142964,7 @@ const _sfc_main$2D = /* @__PURE__ */ defineComponent({
141889
142964
  unref(shouldDisplayPlaceholderComponent)(unref(isEditMode), unref(mode), _ctx.visible) ? (openBlock(), createBlock(PlaceholderComponent, {
141890
142965
  key: 0,
141891
142966
  name: _ctx.tracking_id
141892
- }, null, 8, ["name"])) : unref(isEditMode) && !unref(isViewOnlyMode) && unref(componentPermissions).hasSomethingEditable ? (openBlock(), createBlock(_sfc_main$34, {
142967
+ }, null, 8, ["name"])) : unref(isEditMode) && !unref(isViewOnlyMode) && unref(componentPermissions).hasSomethingEditable && canEditChart.value ? (openBlock(), createBlock(_sfc_main$34, {
141893
142968
  key: 1,
141894
142969
  id: unref(id),
141895
142970
  active: unref(componentEditMode) && unref(componentEditMode)?.id === unref(id),
@@ -141911,6 +142986,7 @@ const _sfc_main$2D = /* @__PURE__ */ defineComponent({
141911
142986
  key: key.value,
141912
142987
  class: "ma-1",
141913
142988
  data: _ctx.data,
142989
+ "is-edit-mode": "",
141914
142990
  style: normalizeStyle(_ctx.style)
141915
142991
  }, null, 8, ["data", "style"])) : (openBlock(), createBlock(_sfc_main$2G, {
141916
142992
  key: 1,
@@ -141922,8 +142998,9 @@ const _sfc_main$2D = /* @__PURE__ */ defineComponent({
141922
142998
  }, 8, ["id", "active", "duplicate", "edit", "remove", "selected", "settings", "stylable"])) : (openBlock(), createBlock(RawDataCharts, {
141923
142999
  key: 2,
141924
143000
  data: _ctx.data,
143001
+ "is-edit-mode": unref(isEditMode),
141925
143002
  style: normalizeStyle(_ctx.style)
141926
- }, null, 8, ["data", "style"])),
143003
+ }, null, 8, ["data", "is-edit-mode", "style"])),
141927
143004
  unref(componentEditMode) && unref(componentEditMode).id === unref(id) ? (openBlock(), createBlock(_sfc_main$2E, {
141928
143005
  key: 3,
141929
143006
  id: unref(id),
@@ -181044,6 +182121,19 @@ const convertToSosl = (soqlQuery, searchString, searchInField = "ALL") => {
181044
182121
  return `FIND {${searchString}} IN ${searchInField} FIELDS RETURNING ${objectName}(${fields.join(", ")}${soslWhereClause}${soslOrderByClause}${soslLimitClause})`;
181045
182122
  };
181046
182123
 
182124
+ const isTheUiItself = (app) => !!app?.app_metadata?.provide?.includes("ui");
182125
+ const isPostcallApp = (app) => !!app?.app_metadata?.provide?.includes("postcall");
182126
+ const isFileViewerReplacement = (app) => !!app?.app_metadata?.replaces?.includes("file-viewer") || !!app?.app_metadata?.replaces?.some(
182127
+ (r) => r && typeof r !== "string" && r.module === "file-viewer"
182128
+ );
182129
+ const doesNotHaveAnyModuleOrHookSpecified = (app) => !app?.app_metadata?.module && !app?.app_metadata?.hooks && !app?.app_metadata?.app_type;
182130
+ const hasAppTypeDefined = (app) => !!app?.app_metadata?.app_type;
182131
+ const isCanvasSectionExecution = (app) => !!app?.app_metadata?.module?.canvas_section_execution?.enabled;
182132
+ const isCanvasDrawerApp = (app) => !!app?.app_metadata?.module?.canvas_drawer?.enabled;
182133
+ const appRequiresCrm = (app) => !!app?.app_metadata?.require?.includes("crm");
182134
+ const shouldShowInSidebar = (app) => !isTheUiItself(app) && (!!app?.app_metadata?.module?.ui_app?.enabled || doesNotHaveAnyModuleOrHookSpecified(app) && !isPostcallApp(app) && !isFileViewerReplacement(app) && !isCanvasDrawerApp(app) && !isCanvasSectionExecution(app) && !hasAppTypeDefined(app));
182135
+ const filterSidebarApps = (apps) => apps.filter(shouldShowInSidebar);
182136
+
181047
182137
  var EventAction = /* @__PURE__ */ ((EventAction2) => {
181048
182138
  EventAction2["CREATE"] = "create";
181049
182139
  EventAction2["PATCH"] = "patch";
@@ -181679,5 +182769,5 @@ const localeNames = {
181679
182769
  };
181680
182770
  const localeDropdownOptions = supportedLocales.map((locale) => ({ key: locale, name: localeNames[locale] }));
181681
182771
 
181682
- export { ADMIN_API_METHOD_TYPES, ADMIN_API_TYPES, ADMIN_MESSAGE, ADMIN_MESSAGE_TYPES, APPS_DB, AccessTypeEnum, App$3 as AgendaSelectorApp, AppTypeEnum, _sfc_main as AssetsManagerApp, App$1 as Browser, BulkUpdateMetadataOperationEnum, BulkUpdateTagsOperationEnum, CALL_STORAGE_KEY, CANVASES, CANVAS_HOOKS, CANVAS_TYPOGRAPHY_CSS_PROPERTIES, CANVAS_TYPOGRAPHY_PRESETS, CAlgoliaSearch, CAssignedCanvasesManagement, _sfc_main$4n as CAssignedCanvasesManagementToolbar, _sfc_main$6q as CAvatar, _sfc_main$4M as CBlockManagement, CButton, _sfc_main$5d as CCanvasDeleteDialogContent, _sfc_main$5e as CCanvasMetadataFilters, CCanvasSelector, _sfc_main$6T as CCard, CCarousel, _sfc_main$3G as CCatalogIqSwitcher, _sfc_main$6S as CCheckbox, _sfc_main$3A as CChip, CCollapse, _sfc_main$6P as CCollapseItem, _sfc_main$6p as CCollapseTransition, NColorPicker as CColorPicker, CComponentListItem, CConfigEditor, NConfigProvider as CConfigProvider, _sfc_main$6f as CConfirmationAction, CConfirmationContent, CConfirmationHeader, CConfirmationModal, CContactSelector, CContactSelectorSelected, _sfc_main$66 as CContentError, _sfc_main$63 as CCreateCanvasModal, _sfc_main$62 as CCreateTemplateSectionBlockModal, _sfc_main$5T as CCreateThemeModal, CDP_EVENT_TYPE, CDataTable, NDatePicker as CDatePicker, CDateRangeFilter, CDetailPageSectionButtons, NDialogProvider as CDialogProvider, _sfc_main$6N as CDivider, _sfc_main$6M as CDrawer, _sfc_main$6L as CDrawerContent, _sfc_main$6K as CDropdown, _sfc_main$6n as CEmpty, _sfc_main$4k as CEntitySelector, _sfc_main$6J as CErrorFullScreen, _sfc_main$6l as CFeedback, _sfc_main$3o as CFileAccessManagement, _sfc_main$6A as CFileAttributes, _sfc_main$3p as CFilePanel, _sfc_main$6G as CFileThumbnail, CFileViewer, CFilesAccessInfo, _sfc_main$3Z as CFilesAccessManage, _sfc_main$3I as CFilesFolderDeleteDialogContent, NForm as CForm, NFormItem as CFormItem, NFormItemCol as CFormItemCol, NFormItemGridItem as CFormItemGi, NFormItemGridItem as CFormItemGridItem, FormItemRow as CFormItemRow, _sfc_main$4f as CFullScreenLoader, NGridItem as CGi, CGlobalLoader, _sfc_main$5M as CGlobalSearch, GlobalStyle as CGlobalStyle, NGrid as CGrid, NGridItem as CGridItem, CGroupsAccessInfo, NH1 as CH1, NH2 as CH2, NH3 as CH3, NH4 as CH4, NH5 as CH5, NH6 as CH6, _sfc_main$6k as CHelpText, CIcon, _sfc_main$6I as CImage, _sfc_main$4U as CInfoBadge, _sfc_main$6z as CInput, NInputNumber as CInputNumber, _sfc_main$3y as CKnockNotificationsAppWrapper, CLIENT_TYPE, NLayout as CLayout, NLayoutContent as CLayoutContent, LayoutFooter as CLayoutFooter, LayoutHeader as CLayoutHeader, LayoutSider as CLayoutSider, _sfc_main$4V as CList, NMessageProvider as CMessageProvider, _sfc_main$5J as CMetaDataBadge, _sfc_main$6y as CModal, CMonacoEditor, CMovableWidget, CMultiSelect, NNotificationProvider as CNotificationProvider, NPagination as CPagination, _sfc_main$6j as CPillSelect, _sfc_main$6x as CPopover, _sfc_main$6H as CProcessingOverlay, NProgress as CProgress, _sfc_main$5q as CRichTextEditor, _sfc_main$4o as CSavedCanvasesManagement, CSearch, _sfc_main$6v as CSearchOnClick, CSearchOnClickWithSuggestions, CSecondaryNav, _sfc_main$4P as CSectionManagement, CSelect, CSelectFilter, _sfc_main$3x as CSettingsEditor, CShortcut, CSingleSelect, NSkeleton as CSkeleton, _sfc_main$3C as CSlideViewer, NSpace as CSpace, _sfc_main$6o as CSpin, _sfc_main$6m as CSwitch, CTable, _sfc_main$5a as CTableInput, CTableMore, CTableSelect, CTableTag, _sfc_main$6D as CTag, CTags, _sfc_main$4E as CTemplateManagement, text as CText, _sfc_main$6t as CThemeEditor, _sfc_main$4z as CThemeManagement, _sfc_main$5j as CToastProvider, CToolbar, _sfc_main$6r as CTooltip, CUpsertFolderModal, _sfc_main$5n as CUserAvatar, CUserMenu, CUsersAccessInfo, CUsersGroupsAccessManage, _sfc_main$5k as CVirtualTable, _sfc_main$46 as CWarningAlert, CallState, CanvasActions, _sfc_main$15 as CanvasBuilderApp, CanvasBuilderMode, CanvasExcludedComponentTypesEnum, CanvasHistoryAction, App as CanvasSelector, CanvasStatus, CanvasThemeStatus, CanvasesViewsTypes, CollaborationRoleEnum, CollectionPlayerApp, App$4 as CollectionSelectorApp, ComponentIcon, ComponentTypes, ContactSelectorQuickFilterType, ContentGridLayoutTypes, ContentSelector, CoreFolderEntityType, DATE_TIME_FORMAT, DEFAULT_ADMIN_TABLE_HEIGHT, DEFAULT_ADMIN_TABLE_WITH_PAGINATION_HEIGHT, DEFAULT_GLOBAL_COMPONENT_SPACING, DEFAULT_GLOBAL_COMPONENT_SPACING_INTERVAL, DEFAULT_ITEMS_PER_PAGE, DEFAULT_PAGE_SIZE, DEFAULT_PAGE_SIZE_OPTIONS, DEFAULT_PEER_CONNECTIVITY_VERSION, DEFAULT_PITCHER_SETTINGS, DSR_API_METHOD_TYPES, DSR_API_TYPES, DSR_MESSAGE, DSR_MESSAGE_TYPES, DSR_TYPE, DefaultExpiresAtEnum, DownloadTypeEnum, EMBED_TYPE, EventAction, EventExternalObjectContentTypeEnum, EventStatusEnum, FileContentTypeEnum, FileStatusEnum, FileTypeEnum, GlobalSearchResultType, GridLayoutTypes, HIDE_IF_EMPTY_COMPONENT_ID_TAG_PREFIX, HIDE_IF_EMPTY_COMPONENT_TRACKING_ID_TAG_PREFIX, HIDE_TAGS_WITH_PREFIX, HtmlLayoutTypes, IFRAME_ACTION_TYPES, IFRAME_DATA_MESSAGE, INITIAL_CALL_STATE, IS_DEV_ORG, IS_LOCALHOST, InstanceMembershipRoleEnum, InstanceMembershipUserStatusEnum, InvitationStatusEnum, LanguageEnum, LinkAlignmentTypes, LinkAnchorTypes, LinkPreviewTypes, MAX_LUMINANCE_FOR_LIGHT_TEXT, MAX_UPLOAD_SIZE, MIN_DIFFERENCE_IN_MINUTES, MetadataTemplateFieldTypeEnum, MultimediaHorizontalAlignmentOptions, NON_MEMBER_ROLES, NotesApp, OperatorEnum, PAPER_SIZE_PRESETS, PEER_CONNECTIVITY_EVENT, PEER_CONNECTIVITY_HANDLER_MATCH_ALL, PITCHER_EVENT, PITCHER_SETTINGS_KEY, PLATFORM_TYPE, PRINT_SCALE_FACTOR, PeerConnectivityActions, PitcherBroadcastedEventName, PitcherEventName, PitcherExternalEventName, PitcherMessageType, PitcherResponseStatus, PostAction, App$2 as PptConversionSelectorApp, REQUEST_DEFAULT_CANCEL_TIMEOUT, SEARCH_DEBOUNCE_TIME, SUPPORTED_FONT_EXTENSIONS, SUPPORTED_FONT_TYPES, SUPPORTED_IMAGE_EXTENSIONS, SUPPORTED_IMAGE_TYPES, SUPPORTED_UPLOAD_FILE_EXTENSIONS, SUPPORTED_VIDEO_EXTENSIONS, SUPPORTED_VIDEO_TYPES, SfEventColors, SfEventColorsLight, StorageRegionEnum, TRACKING_EVENTS_STORAGE_KEY, UI_API_METHOD_TYPES, UI_MESSAGE, UI_MESSAGE_TYPES, UI_NATIVE_MESSAGE_TYPES, UserRoleEnum, ViewCompactItemType, addCanvasComponent, _export as agendaSelector, applyCanvasThemeAssetsToNode, applyFont, applyToTreeBy, autofocus as autofocusDirective, camelCaseKeys, canvasUiUnoPreset, clearLocalStorageIfNeeded, ClickOutsideDirective as clickOutsideDirective, collectAllNodesByCondition, _export$3 as collectionPlayer, _export$2 as collectionSelector, componentIconType, computeLocalStorageBytes, convertSecondsToMinutes, convertToPixels, convertToSosl, createNodeId, createPitcherSettings, dayjs, deepDiff, deepToRaw, derivePatchRequestFields, determineUserRole, discardSectionComponentOverride, displayBytesWithMUnit, displayIntegerWithMunit, doesLocalOverrideExist, downloadFile, draggable as draggableDirective, elementMounted as elementMountedDirective, escapeSoqlString, evaluateAccessor, executeWithDoublingTime, exitFullscreen, fallbackLocale, fetchAll, fetchAllWithOffset, fetchFirstChunkAndRemainingAsync, filterTreeBy, findAllEmbeddableTypesInCanvasContent, findAllEmbeddableTypesInSectionsContent, findEmbeddableInCanvasContent, findEmbeddableInSectionsContent, findNodeInTreeByCondition, findNodeInTreeById, findNodeInTreeByType, findParentByNodeId, formatDate, formatDateDetailed, formatDateTime, formatDateTimeAgo, formatDayMonthBasedOnBrowserLang, formatDimensionForGotenberg, generateAIThumbnailUrl, getAllPages, getAppConfigFromAppSource, getAvailableApis, getComponentDescription, getComponentKeywords, getComponentTitle, getContrastTextColor, getDefinedProps, getEventColor, getExcessItemsIndexes, getFontAwesomeIconNameAndType, getImageSize, getLocalOverrideUrl, getLuminance, getNextPageParam, getNodeDisplayNameByComponentType, getNumberWithRegex, getPageQuantity, getPageRange, getPreviewUrl, getRoleIcon, getSectionGlobalComponentSpacing, handleThemeAssetComparison, highLevelApi, indirectEval, insertItemSorted, isAfter, isBefore, isBeforeMinDate, isEmbeddableWithZeroHeight, isFirefox, isFullscreen, isHeadlessOrNotAvailableApp, isImageAccessible, isIosDevice, isMac, isMobile, isModifierClick, isNonMemberRole, isOriginValid, isPastMaxDate, isPitcherOrIosDevice, isPitcherWkWebView, isQueryParamTruthy, isSafari, isSafariOnIosDevice, isSameOrAfter, isSameOrBefore, isTextComponentEmpty, isTouchScreen, isValidHex, isWindows, lightThemeOverrides, loadRemoteScriptWithCtx, loadScript, loadScriptStyle, loadStyle, localeDropdownOptions, localeNames, locales, minFutureDate, minPastDate, moveNodeTo, msToSeconds, navigateTo, normalizeFilterParams, normalizeNetworkFilterParams, openUsdz, parseCollectionPlayerSlidesToContentSelector, parseContentSelectorToCollectionPlayerSlides, parseFileToCollectionPlayer, parsePdfFileToCollectionPlayer, parsePptxFileToCollectionPlayer, pascalCaseKeys, _export$1 as pptConversionSelector, processCanvasForSectionThemeOverride, regenerateTreeIds, registerPeerConnectivityHandler, replaceThemePresetsWithInlineStyles, replaceTranslationMessagesWithOverrides, requestFullscreen, requestStream, scrollCanvasToTop, scrollToComponentById, secondsToHumanReadable, sendPeerConnectivityEvent, setDateTime, shouldDisplayPlaceholderComponent, shouldOpenInCollectionPlayerViewer, shouldShowEmbeddable, skipElementsInTree, snakeCaseKeys, someNodeInTree, sortCollectionByString, splitUserName, stringToHslColor, supportedLocales, tapDirective, titleCase, toggleFullscreen, tooltipDirective, transformFilesToCollectionPlayer, transformFilesToContentGrid, updateFirstContentGridWithShareboxItems, urlSafeFetchInChunks, useAdmin, useAdminAndDsrState, useApi, useAppsDb, useBindValidation, useBroadcastRouteChange, useCanvasById, useCanvasLocks, useCanvasOverlay, useCanvasVisibility, useCanvasesAsInfinity, useCollectionPlayerOverlay, useCommentTracking, useConfirmation, useCreateEvent, useDeleteEvent, useDsr, useFetchCanvases, useFetchEvents, useFetchUsers, useFileDisplayHelpers, useFolderNameDescription, useGlobalSearch, useInfiniteScroll, useLocation, useMetadataSearch, useMetadataTemplates, useNotesApp, useNotification, useOpenFileStack, usePitcherApi, usePolling, usePresentationHistory, useRecentFiles, useShareCanvas, useSharedCommentsStorage, useSuggestedTags, useTheme, useThemeVars, useToast, useUi, useUpdateEvent, useWindowEvents, vueQueryPluginOptions, wait, waitForIframeInitialize, waitForValue };
182772
+ export { ADMIN_API_METHOD_TYPES, ADMIN_API_TYPES, ADMIN_MESSAGE, ADMIN_MESSAGE_TYPES, APPS_DB, AccessTypeEnum, App$3 as AgendaSelectorApp, AppTypeEnum, _sfc_main as AssetsManagerApp, App$1 as Browser, BulkUpdateMetadataOperationEnum, BulkUpdateTagsOperationEnum, CALL_STORAGE_KEY, CANVASES, CANVAS_HOOKS, CANVAS_TYPOGRAPHY_CSS_PROPERTIES, CANVAS_TYPOGRAPHY_PRESETS, CAlgoliaSearch, CAssignedCanvasesManagement, _sfc_main$4n as CAssignedCanvasesManagementToolbar, _sfc_main$6q as CAvatar, _sfc_main$4M as CBlockManagement, CButton, _sfc_main$5d as CCanvasDeleteDialogContent, _sfc_main$5e as CCanvasMetadataFilters, CCanvasSelector, _sfc_main$6T as CCard, CCarousel, _sfc_main$3G as CCatalogIqSwitcher, _sfc_main$6S as CCheckbox, _sfc_main$3A as CChip, CCollapse, _sfc_main$6P as CCollapseItem, _sfc_main$6p as CCollapseTransition, NColorPicker as CColorPicker, CComponentListItem, CConfigEditor, NConfigProvider as CConfigProvider, _sfc_main$6f as CConfirmationAction, CConfirmationContent, CConfirmationHeader, CConfirmationModal, CContactSelector, CContactSelectorSelected, _sfc_main$66 as CContentError, _sfc_main$63 as CCreateCanvasModal, _sfc_main$62 as CCreateTemplateSectionBlockModal, _sfc_main$5T as CCreateThemeModal, CDP_EVENT_TYPE, CDataTable, NDatePicker as CDatePicker, CDateRangeFilter, CDetailPageSectionButtons, NDialogProvider as CDialogProvider, _sfc_main$6N as CDivider, _sfc_main$6M as CDrawer, _sfc_main$6L as CDrawerContent, _sfc_main$6K as CDropdown, _sfc_main$6n as CEmpty, _sfc_main$4k as CEntitySelector, _sfc_main$6J as CErrorFullScreen, _sfc_main$6l as CFeedback, _sfc_main$3o as CFileAccessManagement, _sfc_main$6A as CFileAttributes, _sfc_main$3p as CFilePanel, _sfc_main$6G as CFileThumbnail, CFileViewer, CFilesAccessInfo, _sfc_main$3Z as CFilesAccessManage, _sfc_main$3I as CFilesFolderDeleteDialogContent, NForm as CForm, NFormItem as CFormItem, NFormItemCol as CFormItemCol, NFormItemGridItem as CFormItemGi, NFormItemGridItem as CFormItemGridItem, FormItemRow as CFormItemRow, _sfc_main$4f as CFullScreenLoader, NGridItem as CGi, CGlobalLoader, _sfc_main$5M as CGlobalSearch, GlobalStyle as CGlobalStyle, NGrid as CGrid, NGridItem as CGridItem, CGroupsAccessInfo, NH1 as CH1, NH2 as CH2, NH3 as CH3, NH4 as CH4, NH5 as CH5, NH6 as CH6, _sfc_main$6k as CHelpText, CIcon, _sfc_main$6I as CImage, _sfc_main$4U as CInfoBadge, _sfc_main$6z as CInput, NInputNumber as CInputNumber, _sfc_main$3y as CKnockNotificationsAppWrapper, CLIENT_TYPE, NLayout as CLayout, NLayoutContent as CLayoutContent, LayoutFooter as CLayoutFooter, LayoutHeader as CLayoutHeader, LayoutSider as CLayoutSider, _sfc_main$4V as CList, NMessageProvider as CMessageProvider, _sfc_main$5J as CMetaDataBadge, _sfc_main$6y as CModal, CMonacoEditor, CMovableWidget, CMultiSelect, NNotificationProvider as CNotificationProvider, NPagination as CPagination, _sfc_main$6j as CPillSelect, _sfc_main$6x as CPopover, _sfc_main$6H as CProcessingOverlay, NProgress as CProgress, _sfc_main$5q as CRichTextEditor, _sfc_main$4o as CSavedCanvasesManagement, CSearch, _sfc_main$6v as CSearchOnClick, CSearchOnClickWithSuggestions, CSecondaryNav, _sfc_main$4P as CSectionManagement, CSelect, CSelectFilter, _sfc_main$3x as CSettingsEditor, CShortcut, CSingleSelect, NSkeleton as CSkeleton, _sfc_main$3C as CSlideViewer, NSpace as CSpace, _sfc_main$6o as CSpin, _sfc_main$6m as CSwitch, CTable, _sfc_main$5a as CTableInput, CTableMore, CTableSelect, CTableTag, _sfc_main$6D as CTag, CTags, _sfc_main$4E as CTemplateManagement, text as CText, _sfc_main$6t as CThemeEditor, _sfc_main$4z as CThemeManagement, _sfc_main$5j as CToastProvider, CToolbar, _sfc_main$6r as CTooltip, CUpsertFolderModal, _sfc_main$5n as CUserAvatar, CUserMenu, CUsersAccessInfo, CUsersGroupsAccessManage, _sfc_main$5k as CVirtualTable, _sfc_main$46 as CWarningAlert, CallState, CanvasActions, _sfc_main$15 as CanvasBuilderApp, CanvasBuilderMode, CanvasExcludedComponentTypesEnum, CanvasHistoryAction, App as CanvasSelector, CanvasStatus, CanvasThemeStatus, CanvasesViewsTypes, CollaborationRoleEnum, CollectionPlayerApp, App$4 as CollectionSelectorApp, ComponentIcon, ComponentTypes, ContactSelectorQuickFilterType, ContentGridLayoutTypes, ContentSelector, CoreFolderEntityType, DATE_TIME_FORMAT, DEFAULT_ADMIN_TABLE_HEIGHT, DEFAULT_ADMIN_TABLE_WITH_PAGINATION_HEIGHT, DEFAULT_GLOBAL_COMPONENT_SPACING, DEFAULT_GLOBAL_COMPONENT_SPACING_INTERVAL, DEFAULT_ITEMS_PER_PAGE, DEFAULT_PAGE_SIZE, DEFAULT_PAGE_SIZE_OPTIONS, DEFAULT_PEER_CONNECTIVITY_VERSION, DEFAULT_PITCHER_SETTINGS, DSR_API_METHOD_TYPES, DSR_API_TYPES, DSR_MESSAGE, DSR_MESSAGE_TYPES, DSR_TYPE, DefaultExpiresAtEnum, DownloadTypeEnum, EMBED_TYPE, EventAction, EventExternalObjectContentTypeEnum, EventStatusEnum, FileContentTypeEnum, FileStatusEnum, FileTypeEnum, GlobalSearchResultType, GridLayoutTypes, HIDE_IF_EMPTY_COMPONENT_ID_TAG_PREFIX, HIDE_IF_EMPTY_COMPONENT_TRACKING_ID_TAG_PREFIX, HIDE_TAGS_WITH_PREFIX, HtmlLayoutTypes, IFRAME_ACTION_TYPES, IFRAME_DATA_MESSAGE, INITIAL_CALL_STATE, IS_DEV_ORG, IS_LOCALHOST, InstanceMembershipRoleEnum, InstanceMembershipUserStatusEnum, InvitationStatusEnum, LanguageEnum, LinkAlignmentTypes, LinkAnchorTypes, LinkPreviewTypes, MAX_LUMINANCE_FOR_LIGHT_TEXT, MAX_UPLOAD_SIZE, MIN_DIFFERENCE_IN_MINUTES, MetadataTemplateFieldTypeEnum, MultimediaHorizontalAlignmentOptions, NON_MEMBER_ROLES, NotesApp, OperatorEnum, PAPER_SIZE_PRESETS, PEER_CONNECTIVITY_EVENT, PEER_CONNECTIVITY_HANDLER_MATCH_ALL, PITCHER_EVENT, PITCHER_SETTINGS_KEY, PLATFORM_TYPE, PRINT_SCALE_FACTOR, PeerConnectivityActions, PitcherBroadcastedEventName, PitcherEventName, PitcherExternalEventName, PitcherMessageType, PitcherResponseStatus, PostAction, App$2 as PptConversionSelectorApp, REQUEST_DEFAULT_CANCEL_TIMEOUT, SEARCH_DEBOUNCE_TIME, SUPPORTED_FONT_EXTENSIONS, SUPPORTED_FONT_TYPES, SUPPORTED_IMAGE_EXTENSIONS, SUPPORTED_IMAGE_TYPES, SUPPORTED_UPLOAD_FILE_EXTENSIONS, SUPPORTED_VIDEO_EXTENSIONS, SUPPORTED_VIDEO_TYPES, SfEventColors, SfEventColorsLight, StorageRegionEnum, TRACKING_EVENTS_STORAGE_KEY, UI_API_METHOD_TYPES, UI_MESSAGE, UI_MESSAGE_TYPES, UI_NATIVE_MESSAGE_TYPES, UserRoleEnum, ViewCompactItemType, addCanvasComponent, _export as agendaSelector, appRequiresCrm, applyCanvasThemeAssetsToNode, applyFont, applyToTreeBy, autofocus as autofocusDirective, camelCaseKeys, canvasUiUnoPreset, clearLocalStorageIfNeeded, ClickOutsideDirective as clickOutsideDirective, collectAllNodesByCondition, _export$3 as collectionPlayer, _export$2 as collectionSelector, componentIconType, computeLocalStorageBytes, convertSecondsToMinutes, convertToPixels, convertToSosl, createNodeId, createPitcherSettings, dayjs, deepDiff, deepToRaw, derivePatchRequestFields, determineUserRole, discardSectionComponentOverride, displayBytesWithMUnit, displayIntegerWithMunit, doesLocalOverrideExist, doesNotHaveAnyModuleOrHookSpecified, downloadFile, draggable as draggableDirective, elementMounted as elementMountedDirective, escapeSoqlString, evaluateAccessor, executeWithDoublingTime, exitFullscreen, fallbackLocale, fetchAll, fetchAllWithOffset, fetchFirstChunkAndRemainingAsync, filterSidebarApps, filterTreeBy, findAllEmbeddableTypesInCanvasContent, findAllEmbeddableTypesInSectionsContent, findEmbeddableInCanvasContent, findEmbeddableInSectionsContent, findNodeInTreeByCondition, findNodeInTreeById, findNodeInTreeByType, findParentByNodeId, formatDate, formatDateDetailed, formatDateTime, formatDateTimeAgo, formatDayMonthBasedOnBrowserLang, formatDimensionForGotenberg, generateAIThumbnailUrl, getAllPages, getAppConfigFromAppSource, getAvailableApis, getComponentDescription, getComponentKeywords, getComponentTitle, getContrastTextColor, getDefinedProps, getEventColor, getExcessItemsIndexes, getFontAwesomeIconNameAndType, getImageSize, getLocalOverrideUrl, getLuminance, getNextPageParam, getNodeDisplayNameByComponentType, getNumberWithRegex, getPageQuantity, getPageRange, getPreviewUrl, getRoleIcon, getSectionGlobalComponentSpacing, handleThemeAssetComparison, hasAppTypeDefined, highLevelApi, indirectEval, insertItemSorted, isAfter, isBefore, isBeforeMinDate, isCanvasDrawerApp, isCanvasSectionExecution, isEmbeddableWithZeroHeight, isFileViewerReplacement, isFirefox, isFullscreen, isHeadlessOrNotAvailableApp, isImageAccessible, isIosDevice, isMac, isMobile, isModifierClick, isNonMemberRole, isOriginValid, isPastMaxDate, isPitcherOrIosDevice, isPitcherWkWebView, isPostcallApp, isQueryParamTruthy, isSafari, isSafariOnIosDevice, isSameOrAfter, isSameOrBefore, isTextComponentEmpty, isTheUiItself, isTouchScreen, isValidHex, isWindows, lightThemeOverrides, loadCustomHelpersFromApps, loadRemoteScriptWithCtx, loadScript, loadScriptStyle, loadStyle, localeDropdownOptions, localeNames, locales, minFutureDate, minPastDate, moveNodeTo, msToSeconds, navigateTo, normalizeFilterParams, normalizeNetworkFilterParams, openUsdz, parseCollectionPlayerSlidesToContentSelector, parseContentSelectorToCollectionPlayerSlides, parseFileToCollectionPlayer, parsePdfFileToCollectionPlayer, parsePptxFileToCollectionPlayer, pascalCaseKeys, _export$1 as pptConversionSelector, processCanvasForSectionThemeOverride, regenerateTreeIds, registerCustomHelper, registerCustomHelpers, registerPeerConnectivityHandler, renderTemplate, replaceThemePresetsWithInlineStyles, replaceTranslationMessagesWithOverrides, requestFullscreen, requestStream, scrollCanvasToTop, scrollToComponentById, secondsToHumanReadable, sendPeerConnectivityEvent, setDateTime, shouldDisplayPlaceholderComponent, shouldOpenInCollectionPlayerViewer, shouldShowEmbeddable, shouldShowInSidebar, skipElementsInTree, snakeCaseKeys, someNodeInTree, sortCollectionByString, splitUserName, stringToHslColor, supportedLocales, tapDirective, titleCase, toggleFullscreen, tooltipDirective, transformFilesToCollectionPlayer, transformFilesToContentGrid, updateFirstContentGridWithShareboxItems, urlSafeFetchInChunks, useAdmin, useAdminAndDsrState, useApi, useAppsDb, useBindValidation, useBroadcastRouteChange, useCanvasById, useCanvasLocks, useCanvasOverlay, useCanvasVisibility, useCanvasesAsInfinity, useCollectionPlayerOverlay, useCommentTracking, useConfirmation, useCreateEvent, useDeleteEvent, useDsr, useFetchCanvases, useFetchEvents, useFetchUsers, useFileDisplayHelpers, useFolderNameDescription, useGlobalSearch, useInfiniteScroll, useLocation, useMetadataSearch, useMetadataTemplates, useNotesApp, useNotification, useOpenFileStack, usePitcherApi, usePolling, usePresentationHistory, useRecentFiles, useShareCanvas, useSharedCommentsStorage, useSuggestedTags, useTheme, useThemeVars, useToast, useUi, useUpdateEvent, useWindowEvents, vueQueryPluginOptions, wait, waitForIframeInitialize, waitForValue };
181683
182773
  //# sourceMappingURL=canvas-ui.js.map