@pitcher/canvas-ui 2025.12.9-123223-beta → 2025.12.9-123521-beta

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,47 +92770,6 @@ function renderTemplate(template, context = {}) {
92770
92770
  return template;
92771
92771
  }
92772
92772
  }
92773
- function registerCustomHelper(helper) {
92774
- try {
92775
- const fn = new Function("return " + helper.code)();
92776
- if (typeof fn !== "function") {
92777
- console.warn(`[handlebars] Helper "${helper.name}" code does not evaluate to a function`);
92778
- return false;
92779
- }
92780
- Handlebars.registerHelper(helper.name, fn);
92781
- console.info(`[handlebars] Registered custom helper: ${helper.name}`);
92782
- return true;
92783
- } catch (e) {
92784
- console.warn(`[handlebars] Failed to register helper "${helper.name}":`, e?.message);
92785
- return false;
92786
- }
92787
- }
92788
- function registerCustomHelpers(helpers) {
92789
- let registered = 0;
92790
- let failed = 0;
92791
- for (const helper of helpers) {
92792
- if (registerCustomHelper(helper)) {
92793
- registered++;
92794
- } else {
92795
- failed++;
92796
- }
92797
- }
92798
- return { registered, failed };
92799
- }
92800
- function loadCustomHelpersFromApps(installedApps) {
92801
- const helpersApp = installedApps.find((app) => app.app_metadata?.name === "handlebars-helpers");
92802
- if (!helpersApp) {
92803
- console.info("[handlebars] No handlebars-helpers app installed");
92804
- return { registered: 0, failed: 0 };
92805
- }
92806
- const helpers = helpersApp.metadata?.handlebars_helpers;
92807
- if (!helpers || !Array.isArray(helpers) || helpers.length === 0) {
92808
- console.info("[handlebars] handlebars-helpers app has no helpers configured");
92809
- return { registered: 0, failed: 0 };
92810
- }
92811
- console.info(`[handlebars] Loading ${helpers.length} custom helper(s) from handlebars-helpers app`);
92812
- return registerCustomHelpers(helpers);
92813
- }
92814
92773
 
92815
92774
  function createPageId(fileId, pageIndex) {
92816
92775
  return `file-${fileId}-page-index-${pageIndex}`;
@@ -94627,38 +94586,38 @@ const _hoisted_47$4 = ["data-result-selected", "onClick"];
94627
94586
  const _hoisted_48$4 = { class: "w-18 h-14 border-rounded-1 mr-4 flex-shrink-0 bg-gray-200 flex items-center justify-center" };
94628
94587
  const _hoisted_49$4 = { class: "flex-1 min-w-0" };
94629
94588
  const _hoisted_50$4 = { class: "text-sm font-bold text-gray-900 truncate mb-1" };
94630
- const _hoisted_51$2 = { class: "text-xs text-gray-500" };
94631
- const _hoisted_52$2 = { class: "text-xs text-gray-400" };
94632
- const _hoisted_53$2 = {
94589
+ const _hoisted_51$3 = { class: "text-xs text-gray-500" };
94590
+ const _hoisted_52$3 = { class: "text-xs text-gray-400" };
94591
+ const _hoisted_53$3 = {
94633
94592
  key: 0,
94634
94593
  class: "px-0 py-0"
94635
94594
  };
94636
- const _hoisted_54$1 = {
94595
+ const _hoisted_54$2 = {
94637
94596
  key: 0,
94638
94597
  class: "flex flex-col items-center justify-center text-center p-8 gap-4"
94639
94598
  };
94640
- const _hoisted_55$1 = {
94599
+ const _hoisted_55$2 = {
94641
94600
  key: 2,
94642
94601
  class: "flex-1 overflow-y-auto bg-white w-full"
94643
94602
  };
94644
- const _hoisted_56$1 = { class: "w-full px-0" };
94645
- const _hoisted_57$1 = { class: "flex items-center px-0 pt-2 pb-1" };
94646
- const _hoisted_58$1 = { class: "text-m font-semibold text-gray-900" };
94647
- const _hoisted_59$1 = { class: "ml-2 text-sm text-gray-500" };
94648
- const _hoisted_60$1 = ["data-result-selected", "onClick"];
94649
- const _hoisted_61$1 = {
94603
+ const _hoisted_56$2 = { class: "w-full px-0" };
94604
+ const _hoisted_57$2 = { class: "flex items-center px-0 pt-2 pb-1" };
94605
+ const _hoisted_58$2 = { class: "text-m font-semibold text-gray-900" };
94606
+ const _hoisted_59$2 = { class: "ml-2 text-sm text-gray-500" };
94607
+ const _hoisted_60$2 = ["data-result-selected", "onClick"];
94608
+ const _hoisted_61$2 = {
94650
94609
  key: 1,
94651
94610
  class: "w-18 h-14 border-rounded-1 mr-4 flex-shrink-0 bg-gray-200 flex items-center justify-center"
94652
94611
  };
94653
- const _hoisted_62$1 = { class: "flex-1 min-w-0" };
94654
- const _hoisted_63$1 = { class: "text-sm font-bold text-gray-900 truncate mb-1" };
94655
- const _hoisted_64$1 = { class: "text-xs text-gray-500" };
94656
- const _hoisted_65$1 = { class: "text-xs text-gray-400" };
94657
- const _hoisted_66$1 = {
94612
+ const _hoisted_62$2 = { class: "flex-1 min-w-0" };
94613
+ const _hoisted_63$2 = { class: "text-sm font-bold text-gray-900 truncate mb-1" };
94614
+ const _hoisted_64$2 = { class: "text-xs text-gray-500" };
94615
+ const _hoisted_65$2 = { class: "text-xs text-gray-400" };
94616
+ const _hoisted_66$2 = {
94658
94617
  key: 0,
94659
94618
  class: "flex flex-col items-center justify-center text-center p-8 gap-4"
94660
94619
  };
94661
- const _hoisted_67$1 = {
94620
+ const _hoisted_67$2 = {
94662
94621
  key: 0,
94663
94622
  class: "flex flex-wrap line-height-6 pt-4 pb-2 px-6 border-t border-gray-200 gap-y-4 gap-x-4"
94664
94623
  };
@@ -95820,13 +95779,13 @@ const _sfc_main$5I = /* @__PURE__ */ defineComponent({
95820
95779
  ]),
95821
95780
  createElementVNode("div", _hoisted_49$4, [
95822
95781
  createElementVNode("h3", _hoisted_50$4, toDisplayString(item.name), 1),
95823
- createElementVNode("p", _hoisted_51$2, toDisplayString(formatCanvasType(item.content_type)), 1)
95782
+ createElementVNode("p", _hoisted_51$3, toDisplayString(formatCanvasType(item.content_type)), 1)
95824
95783
  ]),
95825
- createElementVNode("div", _hoisted_52$2, toDisplayString(item.folder?.name || ""), 1)
95784
+ createElementVNode("div", _hoisted_52$3, toDisplayString(item.folder?.name || ""), 1)
95826
95785
  ], 10, _hoisted_47$4);
95827
95786
  }), 128))
95828
95787
  ]),
95829
- filteredCanvasFiles.value.length > 5 ? (openBlock(), createElementBlock("div", _hoisted_53$2, [
95788
+ filteredCanvasFiles.value.length > 5 ? (openBlock(), createElementBlock("div", _hoisted_53$3, [
95830
95789
  createElementVNode("span", {
95831
95790
  class: "text-sm text-gray-600 hover:text-gray-800 font-bold flex items-center cursor-pointer",
95832
95791
  onClick: _cache[14] || (_cache[14] = ($event) => searchType.value = "canvases")
@@ -95841,7 +95800,7 @@ const _sfc_main$5I = /* @__PURE__ */ defineComponent({
95841
95800
  ])) : createCommentVNode("", true)
95842
95801
  ])) : createCommentVNode("", true)
95843
95802
  ]),
95844
- searchError.value || shouldShowNoResults.value ? (openBlock(), createElementBlock("div", _hoisted_54$1, [
95803
+ searchError.value || shouldShowNoResults.value ? (openBlock(), createElementBlock("div", _hoisted_54$2, [
95845
95804
  createVNode(CIcon, {
95846
95805
  class: "text-6xl",
95847
95806
  color: searchError.value ? "var(--p-error)" : "var(--p-text3)",
@@ -95852,9 +95811,9 @@ const _sfc_main$5I = /* @__PURE__ */ defineComponent({
95852
95811
  class: normalizeClass(searchError.value ? "text-error font-semibold" : "text-text2")
95853
95812
  }, toDisplayString(searchError.value || unref(t)("canvasUI.CGlobalSearch.noResults")), 3)
95854
95813
  ])) : createCommentVNode("", true)
95855
- ])) : (openBlock(), createElementBlock("div", _hoisted_55$1, [
95856
- createElementVNode("div", _hoisted_56$1, [
95857
- createElementVNode("div", _hoisted_57$1, [
95814
+ ])) : (openBlock(), createElementBlock("div", _hoisted_55$2, [
95815
+ createElementVNode("div", _hoisted_56$2, [
95816
+ createElementVNode("div", _hoisted_57$2, [
95858
95817
  searchType.value === "content" ? (openBlock(), createBlock(CIcon, {
95859
95818
  key: 0,
95860
95819
  class: "mr-2",
@@ -95868,8 +95827,8 @@ const _sfc_main$5I = /* @__PURE__ */ defineComponent({
95868
95827
  icon: "presentation",
95869
95828
  size: "16"
95870
95829
  })),
95871
- createElementVNode("span", _hoisted_58$1, toDisplayString(searchType.value === "content" ? unref(t)("canvasUI.CAlgoliaSearch.sections.content") : unref(t)("canvasUI.CAlgoliaSearch.sections.pitchDecks")), 1),
95872
- createElementVNode("span", _hoisted_59$1, " (" + toDisplayString(searchType.value === "content" ? filteredContentFiles.value.length : filteredCanvasFiles.value.length) + ") ", 1)
95830
+ createElementVNode("span", _hoisted_58$2, toDisplayString(searchType.value === "content" ? unref(t)("canvasUI.CAlgoliaSearch.sections.content") : unref(t)("canvasUI.CAlgoliaSearch.sections.pitchDecks")), 1),
95831
+ createElementVNode("span", _hoisted_59$2, " (" + toDisplayString(searchType.value === "content" ? filteredContentFiles.value.length : filteredCanvasFiles.value.length) + ") ", 1)
95873
95832
  ]),
95874
95833
  createElementVNode("div", null, [
95875
95834
  (openBlock(true), createElementBlock(Fragment, null, renderList(searchType.value === "content" ? filteredContentFiles.value : filteredCanvasFiles.value, (item) => {
@@ -95894,7 +95853,7 @@ const _sfc_main$5I = /* @__PURE__ */ defineComponent({
95894
95853
  "object-fit": "cover",
95895
95854
  src: item.picture_url || "",
95896
95855
  width: "72"
95897
- }, null, 8, ["file-data", "src"])) : (openBlock(), createElementBlock("div", _hoisted_61$1, [
95856
+ }, null, 8, ["file-data", "src"])) : (openBlock(), createElementBlock("div", _hoisted_61$2, [
95898
95857
  searchType.value === "content" ? (openBlock(), createBlock(CIcon, {
95899
95858
  key: 0,
95900
95859
  color: "var(--p-text2)",
@@ -95907,15 +95866,15 @@ const _sfc_main$5I = /* @__PURE__ */ defineComponent({
95907
95866
  size: "32"
95908
95867
  }))
95909
95868
  ])),
95910
- createElementVNode("div", _hoisted_62$1, [
95911
- createElementVNode("h3", _hoisted_63$1, toDisplayString(item.name), 1),
95912
- createElementVNode("p", _hoisted_64$1, toDisplayString(searchType.value === "content" ? item.type === "folder" ? "Folder" : item.content_type || "PDF" : formatCanvasType(item.content_type)), 1)
95869
+ createElementVNode("div", _hoisted_62$2, [
95870
+ createElementVNode("h3", _hoisted_63$2, toDisplayString(item.name), 1),
95871
+ createElementVNode("p", _hoisted_64$2, toDisplayString(searchType.value === "content" ? item.type === "folder" ? "Folder" : item.content_type || "PDF" : formatCanvasType(item.content_type)), 1)
95913
95872
  ]),
95914
- createElementVNode("div", _hoisted_65$1, toDisplayString(searchType.value === "content" && item.type === "folder" ? item.parent_folder?.name || "" : item.folder?.name || ""), 1)
95915
- ], 10, _hoisted_60$1);
95873
+ createElementVNode("div", _hoisted_65$2, toDisplayString(searchType.value === "content" && item.type === "folder" ? item.parent_folder?.name || "" : item.folder?.name || ""), 1)
95874
+ ], 10, _hoisted_60$2);
95916
95875
  }), 128))
95917
95876
  ]),
95918
- searchError.value || shouldShowNoResults.value ? (openBlock(), createElementBlock("div", _hoisted_66$1, [
95877
+ searchError.value || shouldShowNoResults.value ? (openBlock(), createElementBlock("div", _hoisted_66$2, [
95919
95878
  createVNode(CIcon, {
95920
95879
  class: "text-6xl",
95921
95880
  color: searchError.value ? "var(--p-error)" : "var(--p-text3)",
@@ -95929,7 +95888,7 @@ const _sfc_main$5I = /* @__PURE__ */ defineComponent({
95929
95888
  ])
95930
95889
  ]))
95931
95890
  ]),
95932
- !showRecentView.value ? (openBlock(), createElementBlock("div", _hoisted_67$1, [
95891
+ !showRecentView.value ? (openBlock(), createElementBlock("div", _hoisted_67$2, [
95933
95892
  createVNode(CShortcut, null, {
95934
95893
  default: withCtx(() => [
95935
95894
  createVNode(CShortcutIcon, { icon: "arrow-up" }),
@@ -140806,17 +140765,96 @@ const _sfc_main$2G = /* @__PURE__ */ defineComponent({
140806
140765
  }
140807
140766
  });
140808
140767
 
140809
- const _hoisted_1$24 = { class: "cb-data-charts-raw" };
140768
+ const _hoisted_1$24 = {
140769
+ key: 0,
140770
+ class: "cb-data-charts-raw__controls"
140771
+ };
140810
140772
  const _sfc_main$2F = /* @__PURE__ */ defineComponent({
140811
140773
  __name: "DataCharts.raw",
140812
140774
  props: {
140813
- data: {}
140775
+ data: {},
140776
+ isPreview: { type: Boolean },
140777
+ isEditMode: { type: Boolean }
140814
140778
  },
140815
140779
  setup(__props) {
140780
+ const { t } = useI18n();
140816
140781
  const chartRef = ref(null);
140782
+ const containerRef = ref(null);
140817
140783
  let chart = null;
140818
140784
  const isChartLoaded = ref(false);
140785
+ const isFullscreen = ref(false);
140786
+ const currentChartType = ref("");
140819
140787
  const props = __props;
140788
+ const showViewControls = computed(() => {
140789
+ if (props.isPreview || props.isEditMode) return false;
140790
+ return props.data?.view_controls?.enable_fullscreen_btn || props.data?.view_controls?.enable_chart_type_switcher;
140791
+ });
140792
+ const containerStyle = computed(() => {
140793
+ if (isFullscreen.value || props.isPreview) {
140794
+ return {};
140795
+ }
140796
+ return {
140797
+ height: props.data?.chart_height ? `${props.data.chart_height}px` : void 0,
140798
+ width: props.data?.chart_width ? `${props.data.chart_width}%` : void 0,
140799
+ minHeight: props.data?.chart_height ? `${props.data.chart_height}px` : void 0,
140800
+ maxHeight: props.data?.chart_height ? `${props.data.chart_height}px` : void 0
140801
+ };
140802
+ });
140803
+ const originalChartType = computed(() => {
140804
+ return props.data?.type || props.data?._primary_chart_type || "bar";
140805
+ });
140806
+ const isScatterChart = computed(() => originalChartType.value === "scatter");
140807
+ const isBubbleChart = computed(() => originalChartType.value === "bubble");
140808
+ const labelValueChartTypes = [
140809
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.bar"), key: "bar" },
140810
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.line"), key: "line" },
140811
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.area"), key: "area" },
140812
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.pie"), key: "pie" },
140813
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.doughnut"), key: "doughnut" },
140814
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.polarArea"), key: "polarArea" },
140815
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.radar"), key: "radar" }
140816
+ ];
140817
+ const scatterChartTypes = [{ label: t("canvasUI.canvasBuilder.dataCharts.types.scatter"), key: "scatter" }];
140818
+ const bubbleChartTypes = [{ label: t("canvasUI.canvasBuilder.dataCharts.types.bubble"), key: "bubble" }];
140819
+ const chartTypeSwitcherOptions = computed(() => {
140820
+ if (isBubbleChart.value) return bubbleChartTypes;
140821
+ if (isScatterChart.value) return scatterChartTypes;
140822
+ return labelValueChartTypes;
140823
+ });
140824
+ function toggleFullscreen() {
140825
+ if (!containerRef.value) return;
140826
+ if (!isFullscreen.value) {
140827
+ isFullscreen.value = true;
140828
+ } else {
140829
+ isFullscreen.value = false;
140830
+ }
140831
+ nextTick(() => {
140832
+ if (chart) {
140833
+ chart.resize();
140834
+ }
140835
+ });
140836
+ }
140837
+ function handleChartTypeChange(newType) {
140838
+ if (!chart || !props.data) return;
140839
+ currentChartType.value = newType;
140840
+ initChart(newType);
140841
+ }
140842
+ function handleKeydown(e) {
140843
+ if (e.key === "Escape" && isFullscreen.value) {
140844
+ isFullscreen.value = false;
140845
+ nextTick(() => {
140846
+ if (chart) {
140847
+ chart.resize();
140848
+ }
140849
+ });
140850
+ }
140851
+ }
140852
+ onMounted(() => {
140853
+ window.addEventListener("keydown", handleKeydown);
140854
+ });
140855
+ onUnmounted(() => {
140856
+ window.removeEventListener("keydown", handleKeydown);
140857
+ });
140820
140858
  const sectionListSectionInfo = inject(
140821
140859
  "sectionListSectionInfo",
140822
140860
  computed(() => null)
@@ -140847,41 +140885,191 @@ const _sfc_main$2F = /* @__PURE__ */ defineComponent({
140847
140885
  }
140848
140886
  return window._chartJsPromise;
140849
140887
  }
140850
- function processChartData(chartData, context) {
140888
+ function normalizeRValues(values, minRadius = 5, maxRadius = 40) {
140889
+ if (values.length === 0) return [];
140890
+ const rValues = values.map((v) => v.r);
140891
+ const minR = Math.min(...rValues);
140892
+ const maxR = Math.max(...rValues);
140893
+ if (minR === maxR) {
140894
+ return values.map((v) => ({
140895
+ ...v,
140896
+ r: (minRadius + maxRadius) / 2,
140897
+ originalR: v.r
140898
+ }));
140899
+ }
140900
+ return values.map((v) => ({
140901
+ ...v,
140902
+ r: minRadius + (v.r - minR) / (maxR - minR) * (maxRadius - minRadius),
140903
+ originalR: v.r
140904
+ }));
140905
+ }
140906
+ function processSeriesDataPoints(dataPoints, chartType, context) {
140907
+ const isScatterChart2 = chartType === "scatter";
140908
+ const isBubbleChart2 = chartType === "bubble";
140909
+ const isXYChart = isScatterChart2 || isBubbleChart2;
140851
140910
  const processedData = {
140852
140911
  labels: [],
140853
140912
  values: []
140854
140913
  };
140855
- chartData.data_points?.forEach((point) => {
140914
+ const rawBubbleData = [];
140915
+ dataPoints?.forEach((point) => {
140856
140916
  let label = point.label;
140857
- let value = point.value;
140858
140917
  try {
140859
140918
  if (typeof label === "string") {
140860
140919
  label = renderTemplate(label, context);
140861
140920
  }
140862
- if (typeof value === "string") {
140863
- value = renderTemplate(value, context);
140864
- }
140865
- if (typeof label === "string" && label.includes(",") && typeof value === "string" && value.includes(",")) {
140866
- const labels = label.split(",");
140867
- const values = value.split(",");
140868
- labels.forEach((l, idx) => {
140869
- const v = values[idx];
140870
- if (v !== void 0) {
140871
- processedData.labels.push(l);
140872
- processedData.values.push(Number(v) || 0);
140921
+ if (isXYChart) {
140922
+ let xValue = point.x_value ?? "0";
140923
+ let yValue = point.y_value ?? "0";
140924
+ let rValue = point.r_value ?? "10";
140925
+ if (typeof xValue === "string") {
140926
+ xValue = renderTemplate(xValue, context);
140927
+ }
140928
+ if (typeof yValue === "string") {
140929
+ yValue = renderTemplate(yValue, context);
140930
+ }
140931
+ if (typeof rValue === "string") {
140932
+ rValue = renderTemplate(rValue, context);
140933
+ }
140934
+ if (typeof label === "string" && label.includes(",") && typeof xValue === "string" && xValue.includes(",") && typeof yValue === "string" && yValue.includes(",")) {
140935
+ const labels = label.split(",");
140936
+ const xValues = xValue.split(",");
140937
+ const yValues = yValue.split(",");
140938
+ const rValues = typeof rValue === "string" && rValue.includes(",") ? rValue.split(",") : [];
140939
+ labels.forEach((l, idx) => {
140940
+ const x = Number(xValues[idx]) || 0;
140941
+ const y = Number(yValues[idx]) || 0;
140942
+ if (isBubbleChart2) {
140943
+ const r = rValues[idx] ? Number(rValues[idx]) || 10 : 10;
140944
+ rawBubbleData.push({ label: l, x, y, r: Math.abs(r) });
140945
+ } else {
140946
+ processedData.labels.push(l);
140947
+ processedData.values.push({ x, y });
140948
+ }
140949
+ });
140950
+ } else {
140951
+ const x = Number(xValue) || 0;
140952
+ const y = Number(yValue) || 0;
140953
+ if (isBubbleChart2) {
140954
+ const r = Number(rValue) || 10;
140955
+ rawBubbleData.push({ label, x, y, r: Math.abs(r) });
140956
+ } else {
140957
+ processedData.labels.push(label);
140958
+ processedData.values.push({ x, y });
140873
140959
  }
140874
- });
140960
+ }
140875
140961
  } else {
140876
- processedData.labels.push(label);
140877
- processedData.values.push(Number(value) || 0);
140962
+ let value = point.value;
140963
+ if (typeof value === "string") {
140964
+ value = renderTemplate(value, context);
140965
+ }
140966
+ if (typeof label === "string" && label.includes(",") && typeof value === "string" && value.includes(",")) {
140967
+ const labels = label.split(",");
140968
+ const values = value.split(",");
140969
+ labels.forEach((l, idx) => {
140970
+ const v = values[idx];
140971
+ if (v !== void 0) {
140972
+ processedData.labels.push(l);
140973
+ processedData.values.push(Number(v) || 0);
140974
+ }
140975
+ });
140976
+ } else {
140977
+ processedData.labels.push(label);
140978
+ processedData.values.push(Number(value) || 0);
140979
+ }
140878
140980
  }
140879
140981
  } catch (err) {
140880
140982
  console.warn("Error processing chart data point:", err);
140881
- processedData.labels.push(label);
140882
- processedData.values.push(Number(value) || 0);
140983
+ if (isBubbleChart2) {
140984
+ rawBubbleData.push({ label, x: 0, y: 0, r: 10 });
140985
+ } else if (isXYChart) {
140986
+ processedData.labels.push(label);
140987
+ processedData.values.push({ x: 0, y: 0 });
140988
+ } else {
140989
+ processedData.labels.push(label);
140990
+ processedData.values.push(0);
140991
+ }
140883
140992
  }
140884
140993
  });
140994
+ if (isBubbleChart2 && rawBubbleData.length > 0) {
140995
+ const bubbleValues = rawBubbleData.map((d) => ({ x: d.x, y: d.y, r: d.r }));
140996
+ const normalizedValues = normalizeRValues(bubbleValues);
140997
+ rawBubbleData.forEach((d, idx) => {
140998
+ processedData.labels.push(d.label);
140999
+ processedData.values.push(normalizedValues[idx]);
141000
+ });
141001
+ }
141002
+ return processedData;
141003
+ }
141004
+ function processChartData(chartData, context, overrideType) {
141005
+ if (chartData.series && Array.isArray(chartData.series) && chartData.series.length > 0) {
141006
+ const datasets = [];
141007
+ let allLabels = [];
141008
+ const isSingleSeries = chartData.series.length === 1;
141009
+ chartData.series.forEach((series, index) => {
141010
+ const seriesChartType = overrideType || series.chart_type || chartData.type || "bar";
141011
+ const processedData2 = processSeriesDataPoints(series.data_points || [], seriesChartType, context);
141012
+ if (processedData2.labels.length > allLabels.length) {
141013
+ allLabels = processedData2.labels;
141014
+ }
141015
+ const preBuiltDataset = chartData.data?.datasets?.[index];
141016
+ let backgroundColor2 = preBuiltDataset?.background_color || preBuiltDataset?.backgroundColor;
141017
+ let borderColor2 = preBuiltDataset?.border_color || preBuiltDataset?.borderColor;
141018
+ if (isSingleSeries && Array.isArray(backgroundColor2)) {
141019
+ const resolvedColors = backgroundColor2.map((color, i) => {
141020
+ if (typeof color === "string" && color.startsWith("palette")) {
141021
+ const paletteIndex = parseInt(color.replace("palette", ""));
141022
+ const validIndex = paletteIndex >= 0 ? paletteIndex % palette.value.length : i;
141023
+ return palette.value[validIndex];
141024
+ }
141025
+ return color;
141026
+ });
141027
+ const dataPointsCount = processedData2.values.length;
141028
+ backgroundColor2 = Array.from({ length: dataPointsCount }, (_, i) => resolvedColors[i % resolvedColors.length]);
141029
+ borderColor2 = [...backgroundColor2];
141030
+ } else if (typeof backgroundColor2 === "string" && backgroundColor2.startsWith("palette")) {
141031
+ const paletteIndex = parseInt(backgroundColor2.replace("palette", ""));
141032
+ const validIndex = paletteIndex >= 0 ? paletteIndex % palette.value.length : index;
141033
+ backgroundColor2 = palette.value[validIndex];
141034
+ borderColor2 = backgroundColor2;
141035
+ }
141036
+ const datasetOptions = {
141037
+ label: series.name,
141038
+ data: processedData2.values,
141039
+ backgroundColor: backgroundColor2 || palette.value[index % palette.value.length],
141040
+ borderColor: borderColor2 || palette.value[index % palette.value.length],
141041
+ borderWidth: 1
141042
+ };
141043
+ if (!isSingleSeries) {
141044
+ if (series.chart_type === "area") {
141045
+ datasetOptions.type = "line";
141046
+ datasetOptions.fill = true;
141047
+ datasetOptions.tension = 0.4;
141048
+ } else {
141049
+ datasetOptions.type = series.chart_type;
141050
+ }
141051
+ }
141052
+ if (series.chart_type === "area") {
141053
+ datasetOptions.fill = true;
141054
+ datasetOptions.tension = 0.4;
141055
+ }
141056
+ if (["line", "area"].includes(series.chart_type)) {
141057
+ datasetOptions.tension = 0.4;
141058
+ }
141059
+ datasets.push(datasetOptions);
141060
+ });
141061
+ return {
141062
+ ...chartData,
141063
+ type: chartData.type || chartData._primary_chart_type || "bar",
141064
+ data: {
141065
+ ...chartData.data,
141066
+ labels: allLabels,
141067
+ datasets
141068
+ }
141069
+ };
141070
+ }
141071
+ const chartType = overrideType || chartData.type || "bar";
141072
+ const processedData = processSeriesDataPoints(chartData.data_points || [], chartType, context);
140885
141073
  let backgroundColor = chartData.data?.datasets?.[0]?.background_color || [];
140886
141074
  let borderColor = chartData.data?.datasets?.[0]?.border_color || [];
140887
141075
  if (chartData.color_scheme_type === "theme" && Array.isArray(backgroundColor)) {
@@ -140927,7 +141115,7 @@ const _sfc_main$2F = /* @__PURE__ */ defineComponent({
140927
141115
  }
140928
141116
  };
140929
141117
  }
140930
- function initChart() {
141118
+ function initChart(overrideType) {
140931
141119
  if (!props.data || !chartRef.value || !isChartLoaded.value) {
140932
141120
  return;
140933
141121
  }
@@ -140935,25 +141123,85 @@ const _sfc_main$2F = /* @__PURE__ */ defineComponent({
140935
141123
  chart.destroy();
140936
141124
  }
140937
141125
  const context = props.data.context ?? (!isEmpty(activeCanvas.value?.context) || isCanvas.value ? { ...crmShape.value, ...activeCanvas.value?.context } : crmShape.value);
140938
- const processedChartData = processChartData(props.data, context);
141126
+ const processedChartData = processChartData(props.data, context, overrideType);
141127
+ let chartType = overrideType || currentChartType.value || processedChartData.type || "bar";
141128
+ const isAreaChart = chartType === "area";
141129
+ if (isAreaChart) {
141130
+ chartType = "line";
141131
+ }
140939
141132
  if (processedChartData.data?.datasets) {
140940
141133
  processedChartData.data.datasets = processedChartData.data.datasets.map((dataset) => {
140941
- const { background_color, border_color, point_style, ...rest } = dataset;
141134
+ const { background_color, border_color, point_style, fill, tension, show_line, ...rest } = dataset;
140942
141135
  return {
140943
141136
  ...rest,
140944
141137
  backgroundColor: dataset.backgroundColor || background_color || ["#000000"],
140945
141138
  borderColor: dataset.borderColor || border_color || ["#000000"],
140946
- pointStyle: point_style
141139
+ pointStyle: point_style,
141140
+ fill: isAreaChart ? true : fill,
141141
+ tension: isAreaChart ? tension ?? 0.4 : tension,
141142
+ showLine: show_line
140947
141143
  };
140948
141144
  });
140949
141145
  }
141146
+ let scales = processedChartData.options?.scales;
141147
+ if (scales) {
141148
+ const convertedScales = {};
141149
+ if (scales.x) {
141150
+ convertedScales.x = { ...scales.x };
141151
+ }
141152
+ if (scales.y) {
141153
+ convertedScales.y = {
141154
+ ...scales.y,
141155
+ beginAtZero: scales.y.begin_at_zero
141156
+ };
141157
+ delete convertedScales.y.begin_at_zero;
141158
+ }
141159
+ if (scales.r) {
141160
+ convertedScales.r = {
141161
+ ...scales.r,
141162
+ beginAtZero: scales.r.begin_at_zero,
141163
+ ticks: scales.r.ticks ? {
141164
+ stepSize: scales.r.ticks.step_size
141165
+ } : void 0
141166
+ };
141167
+ }
141168
+ scales = convertedScales;
141169
+ }
141170
+ if (["pie", "doughnut", "polarArea"].includes(chartType)) {
141171
+ scales = void 0;
141172
+ }
141173
+ const tooltipCallbacks = {};
141174
+ const isBubble = chartType === "bubble";
141175
+ if (props.data.percent_display || isBubble) {
141176
+ tooltipCallbacks.label = function(context2) {
141177
+ const label = context2.dataset.label || "";
141178
+ const value = context2.raw;
141179
+ if (isBubble && typeof value === "object" && value !== null) {
141180
+ const x = value.x;
141181
+ const y = value.y;
141182
+ const r = value.originalR !== void 0 ? value.originalR : value.r;
141183
+ return `${label}${label ? ": " : ""}(${x}, ${y}, ${r})`;
141184
+ }
141185
+ if (props.data?.percent_display && typeof value === "number" && value >= 0 && value <= 1) {
141186
+ return `${label}${label ? ": " : ""}${(value * 100).toFixed(2)}%`;
141187
+ }
141188
+ return `${label}${label ? ": " : ""}${value}`;
141189
+ };
141190
+ }
140950
141191
  const chartConfig = {
140951
141192
  ...processedChartData,
140952
- type: processedChartData.type,
141193
+ type: chartType,
140953
141194
  options: merge$1({}, processedChartData.options, {
140954
141195
  responsive: true,
140955
141196
  maintainAspectRatio: false,
140956
- indexAxis: processedChartData.options?.index_axis
141197
+ indexAxis: processedChartData.options?.index_axis,
141198
+ scales,
141199
+ plugins: {
141200
+ ...processedChartData.options?.plugins,
141201
+ tooltip: props.data.percent_display || isBubble ? {
141202
+ callbacks: tooltipCallbacks
141203
+ } : void 0
141204
+ }
140957
141205
  })
140958
141206
  };
140959
141207
  chart = new window.Chart(chartRef.value, chartConfig);
@@ -140973,84 +141221,172 @@ const _sfc_main$2F = /* @__PURE__ */ defineComponent({
140973
141221
  isChartLoaded.value = true;
140974
141222
  });
140975
141223
  return (_ctx, _cache) => {
140976
- return openBlock(), createElementBlock("div", _hoisted_1$24, [
141224
+ return openBlock(), createElementBlock("div", {
141225
+ ref_key: "containerRef",
141226
+ ref: containerRef,
141227
+ class: normalizeClass(["cb-data-charts-raw", { "is-fullscreen": isFullscreen.value }]),
141228
+ style: normalizeStyle(containerStyle.value)
141229
+ }, [
141230
+ showViewControls.value ? (openBlock(), createElementBlock("div", _hoisted_1$24, [
141231
+ props.data?.view_controls?.enable_chart_type_switcher ? (openBlock(), createBlock(unref(NDropdown), {
141232
+ key: 0,
141233
+ options: chartTypeSwitcherOptions.value,
141234
+ trigger: "click",
141235
+ onSelect: handleChartTypeChange
141236
+ }, {
141237
+ default: withCtx(() => [
141238
+ createVNode(CButton, {
141239
+ quaternary: "",
141240
+ size: "small"
141241
+ }, {
141242
+ icon: withCtx(() => [
141243
+ createVNode(CIcon, { icon: "chart-bar" })
141244
+ ]),
141245
+ _: 1
141246
+ })
141247
+ ]),
141248
+ _: 1
141249
+ }, 8, ["options"])) : createCommentVNode("", true),
141250
+ props.data?.view_controls?.enable_fullscreen_btn ? (openBlock(), createBlock(CButton, {
141251
+ key: 1,
141252
+ quaternary: "",
141253
+ size: "small",
141254
+ onClick: toggleFullscreen
141255
+ }, {
141256
+ icon: withCtx(() => [
141257
+ createVNode(CIcon, {
141258
+ icon: isFullscreen.value ? "compress" : "expand"
141259
+ }, null, 8, ["icon"])
141260
+ ]),
141261
+ _: 1
141262
+ })) : createCommentVNode("", true)
141263
+ ])) : createCommentVNode("", true),
140977
141264
  createElementVNode("canvas", {
140978
141265
  ref_key: "chartRef",
140979
141266
  ref: chartRef,
140980
141267
  class: "w-full h-full"
140981
141268
  }, null, 512)
140982
- ]);
141269
+ ], 6);
140983
141270
  };
140984
141271
  }
140985
141272
  });
140986
141273
 
140987
- const RawDataCharts = /* @__PURE__ */ _export_sfc(_sfc_main$2F, [["__scopeId", "data-v-e71330a8"]]);
141274
+ const RawDataCharts = /* @__PURE__ */ _export_sfc(_sfc_main$2F, [["__scopeId", "data-v-7078dc66"]]);
141275
+
141276
+ const STANDALONE_CHART_TYPES = ["pie", "doughnut", "radar", "polarArea"];
141277
+ const ONE_D_CHART_TYPES = ["bar", "line", "area"];
141278
+ const TWO_D_CHART_TYPES = ["scatter"];
141279
+ const THREE_D_CHART_TYPES = ["bubble"];
141280
+ const XY_CHART_TYPES = ["scatter"];
141281
+ const XYR_CHART_TYPES = ["bubble"];
140988
141282
 
140989
141283
  const _hoisted_1$23 = { class: "flex gap-4 h-[calc(80vh-120px)] w-full" };
140990
141284
  const _hoisted_2$1t = { class: "cb-data-charts-settings__card overflow-auto flex-1" };
140991
141285
  const _hoisted_3$17 = { class: "flex flex-col h-full" };
140992
141286
  const _hoisted_4$X = { class: "flex-grow overflow-y-auto overflow-x-hidden" };
140993
- const _hoisted_5$O = { class: "mb-4" };
140994
- const _hoisted_6$H = { class: "block mb-2" };
140995
- const _hoisted_7$v = { class: "mb-4" };
140996
- const _hoisted_8$q = { class: "block mb-2" };
140997
- const _hoisted_9$m = { class: "mb-4" };
140998
- const _hoisted_10$h = { class: "block mb-2" };
140999
- const _hoisted_11$f = { class: "mb-4" };
141000
- const _hoisted_12$b = { class: "block mb-2" };
141001
- const _hoisted_13$a = {
141287
+ const _hoisted_5$O = { class: "text-sm font-semibold mb-3 text-gray-600 dark:text-gray-400 uppercase tracking-wide" };
141288
+ const _hoisted_6$H = { class: "flex items-end border-b border-gray-200 dark:border-gray-700 mb-4 -mx-4 px-4" };
141289
+ const _hoisted_7$v = ["onClick"];
141290
+ const _hoisted_8$q = { class: "text-sm font-medium truncate max-w-24" };
141291
+ const _hoisted_9$m = ["onClick"];
141292
+ const _hoisted_10$h = ["title"];
141293
+ const _hoisted_11$f = {
141002
141294
  key: 0,
141003
141295
  class: "mb-4"
141004
141296
  };
141297
+ const _hoisted_12$b = { class: "block mb-2" };
141298
+ const _hoisted_13$a = { class: "mb-4" };
141005
141299
  const _hoisted_14$9 = { class: "block mb-2" };
141006
141300
  const _hoisted_15$8 = { class: "mb-4" };
141007
- const _hoisted_16$8 = { class: "block mb-2" };
141008
- const _hoisted_17$7 = {
141009
- key: 1,
141010
- class: "mb-4"
141011
- };
141012
- const _hoisted_18$6 = { class: "block mb-2" };
141013
- const _hoisted_19$6 = { class: "mb-4" };
141014
- const _hoisted_20$5 = { class: "flex justify-between items-center mb-2" };
141015
- const _hoisted_21$5 = { class: "block" };
141016
- const _hoisted_22$3 = { class: "flex gap-2 flex-1" };
141017
- const _hoisted_23$3 = ["onClick"];
141018
- const _hoisted_24$3 = { class: "p-4 min-w-[400px] max-h-[400px]" };
141019
- const _hoisted_25$3 = { class: "flex gap-4 h-full" };
141020
- const _hoisted_26$3 = { class: "flex-1 flex flex-col" };
141021
- const _hoisted_27$3 = { class: "text-sm mb-2" };
141022
- const _hoisted_28$3 = { class: "overflow-auto" };
141023
- const _hoisted_29$3 = {
141301
+ const _hoisted_16$8 = { class: "flex justify-between items-center mb-2" };
141302
+ const _hoisted_17$7 = { class: "block" };
141303
+ const _hoisted_18$6 = ["onClick"];
141304
+ const _hoisted_19$6 = { class: "p-4 min-w-[400px] max-h-[400px]" };
141305
+ const _hoisted_20$5 = { class: "flex gap-4 h-full" };
141306
+ const _hoisted_21$5 = { class: "flex-1 flex flex-col" };
141307
+ const _hoisted_22$3 = { class: "text-sm mb-2" };
141308
+ const _hoisted_23$3 = { class: "overflow-auto" };
141309
+ const _hoisted_24$3 = {
141024
141310
  key: 0,
141025
141311
  class: "flex-1 border-l pl-4"
141026
141312
  };
141027
- const _hoisted_30$3 = { class: "text-sm font-medium mb-2" };
141028
- const _hoisted_31$3 = { class: "flex flex-col gap-2" };
141029
- const _hoisted_32$3 = { class: "block mb-1 text-sm" };
141030
- const _hoisted_33$3 = { class: "block mb-1 text-sm" };
141031
- const _hoisted_34$3 = ["onClick"];
141032
- const _hoisted_35$3 = { class: "p-4 min-w-[400px] max-h-[400px]" };
141033
- const _hoisted_36$3 = { class: "flex gap-4 h-full" };
141034
- const _hoisted_37$3 = { class: "flex-1 flex flex-col" };
141035
- const _hoisted_38$3 = { class: "text-sm mb-2" };
141036
- const _hoisted_39$3 = { class: "overflow-auto" };
141037
- const _hoisted_40$3 = {
141313
+ const _hoisted_25$3 = { class: "text-sm font-medium mb-2" };
141314
+ const _hoisted_26$3 = { class: "flex flex-col gap-2" };
141315
+ const _hoisted_27$3 = { class: "block mb-1 text-sm" };
141316
+ const _hoisted_28$3 = { class: "block mb-1 text-sm" };
141317
+ const _hoisted_29$3 = ["onClick"];
141318
+ const _hoisted_30$3 = { class: "p-4 min-w-[400px] max-h-[400px]" };
141319
+ const _hoisted_31$3 = { class: "flex gap-4 h-full" };
141320
+ const _hoisted_32$3 = { class: "flex-1 flex flex-col" };
141321
+ const _hoisted_33$3 = { class: "text-sm mb-2" };
141322
+ const _hoisted_34$3 = { class: "overflow-auto" };
141323
+ const _hoisted_35$3 = {
141038
141324
  key: 0,
141039
141325
  class: "flex-1 border-l pl-4"
141040
141326
  };
141041
- const _hoisted_41$3 = { class: "flex flex-col gap-2" };
141042
- const _hoisted_42$3 = { class: "flex justify-center mt-2" };
141043
- const _hoisted_43$3 = { class: "mb-4" };
141044
- const _hoisted_44$3 = { class: "block mb-2" };
141045
- const _hoisted_45$3 = { class: "mb-4" };
141046
- const _hoisted_46$3 = { class: "block mb-2" };
141047
- const _hoisted_47$3 = { class: "cb-data-charts-settings__preview flex-1 border-l border-[#eee] pl-4" };
141048
- const _hoisted_48$3 = { class: "text-sm font-medium mb-4" };
141049
- const _hoisted_49$3 = {
141327
+ const _hoisted_36$3 = { class: "text-sm font-medium mb-2" };
141328
+ const _hoisted_37$3 = { class: "flex flex-col gap-2" };
141329
+ const _hoisted_38$3 = { class: "block mb-1 text-sm" };
141330
+ const _hoisted_39$3 = { class: "block mb-1 text-sm" };
141331
+ const _hoisted_40$3 = { class: "block mb-1 text-sm" };
141332
+ const _hoisted_41$3 = { key: 0 };
141333
+ const _hoisted_42$3 = { class: "block mb-1 text-sm" };
141334
+ const _hoisted_43$3 = ["onClick"];
141335
+ const _hoisted_44$3 = { class: "p-4 min-w-[400px] max-h-[400px] overflow-auto" };
141336
+ const _hoisted_45$3 = { class: "text-sm mb-2" };
141337
+ const _hoisted_46$3 = ["onClick"];
141338
+ const _hoisted_47$3 = { class: "p-4 min-w-[400px] max-h-[400px] overflow-auto" };
141339
+ const _hoisted_48$3 = { class: "text-sm mb-2" };
141340
+ const _hoisted_49$3 = { class: "flex justify-center mt-2" };
141341
+ 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" };
141342
+ const _hoisted_51$2 = { class: "mb-4" };
141343
+ const _hoisted_52$2 = { class: "block mb-2" };
141344
+ const _hoisted_53$2 = { class: "mb-4" };
141345
+ const _hoisted_54$1 = { class: "block mb-2" };
141346
+ const _hoisted_55$1 = { class: "mb-4" };
141347
+ const _hoisted_56$1 = { class: "block mb-2" };
141348
+ const _hoisted_57$1 = { class: "mb-4" };
141349
+ const _hoisted_58$1 = { class: "block mb-2" };
141350
+ const _hoisted_59$1 = {
141351
+ key: 2,
141352
+ class: "mb-4"
141353
+ };
141354
+ const _hoisted_60$1 = { class: "block mb-2" };
141355
+ const _hoisted_61$1 = {
141356
+ key: 3,
141357
+ class: "mb-4"
141358
+ };
141359
+ const _hoisted_62$1 = { class: "block mb-2" };
141360
+ const _hoisted_63$1 = { class: "mb-4" };
141361
+ const _hoisted_64$1 = { class: "block mb-2" };
141362
+ const _hoisted_65$1 = { class: "mb-4" };
141363
+ const _hoisted_66$1 = { class: "block mb-2" };
141364
+ const _hoisted_67$1 = { class: "mb-4" };
141365
+ const _hoisted_68$1 = { class: "block mb-2" };
141366
+ const _hoisted_69 = { class: "flex items-center gap-2" };
141367
+ const _hoisted_70 = { class: "text-sm text-gray-500" };
141368
+ const _hoisted_71 = { class: "mb-4" };
141369
+ const _hoisted_72 = { class: "block mb-2" };
141370
+ const _hoisted_73 = { class: "flex flex-col gap-2" };
141371
+ const _hoisted_74 = { class: "flex items-center gap-2" };
141372
+ const _hoisted_75 = { class: "text-sm" };
141373
+ const _hoisted_76 = { class: "text-sm" };
141374
+ const _hoisted_77 = { class: "flex items-center gap-2" };
141375
+ const _hoisted_78 = { class: "text-sm" };
141376
+ const _hoisted_79 = { class: "mb-4" };
141377
+ const _hoisted_80 = { class: "block mb-2" };
141378
+ const _hoisted_81 = { class: "flex flex-col gap-3" };
141379
+ const _hoisted_82 = { class: "flex items-center gap-2" };
141380
+ const _hoisted_83 = { class: "text-sm w-16" };
141381
+ const _hoisted_84 = { class: "flex items-center gap-2" };
141382
+ const _hoisted_85 = { class: "text-sm w-16" };
141383
+ const _hoisted_86 = { class: "cb-data-charts-settings__preview flex-1 border-l border-[#eee] pl-4" };
141384
+ const _hoisted_87 = { class: "text-sm font-medium mb-4" };
141385
+ const _hoisted_88 = {
141050
141386
  class: "preview-container",
141051
141387
  style: { "height": "300px" }
141052
141388
  };
141053
- const _hoisted_50$3 = { class: "flex justify-between gap-4" };
141389
+ const _hoisted_89 = { class: "flex justify-between gap-4" };
141054
141390
  const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141055
141391
  __name: "DataCharts.settings",
141056
141392
  props: {
@@ -141064,7 +141400,91 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141064
141400
  const { setComponentEditMode, updateNodeDataById } = useCanvas$1();
141065
141401
  const { crmShape } = useCrmShape();
141066
141402
  const { palette } = useCanvasTheme$1();
141067
- const chartType = ref(props.data?.type ?? "bar");
141403
+ let seriesIdCounter = 0;
141404
+ function generateSeriesId() {
141405
+ return `series_${Date.now()}_${seriesIdCounter++}`;
141406
+ }
141407
+ function convertSavedSeriesToRuntime(savedSeries) {
141408
+ return {
141409
+ id: savedSeries.id || generateSeriesId(),
141410
+ name: savedSeries.name || "Series 1",
141411
+ chartType: savedSeries.chart_type || "bar",
141412
+ dataPoints: (savedSeries.data_points || []).map((dp) => ({
141413
+ label: dp.label || "",
141414
+ value: dp.value || "",
141415
+ xValue: dp.x_value ?? "",
141416
+ yValue: dp.y_value ?? "",
141417
+ rValue: dp.r_value ?? "",
141418
+ dynamicValue: dp.dynamic_value,
141419
+ dynamicXValue: dp.dynamic_x_value,
141420
+ dynamicYValue: dp.dynamic_y_value,
141421
+ dynamicRValue: dp.dynamic_r_value,
141422
+ arrayConfig: dp.array_config
141423
+ }))
141424
+ };
141425
+ }
141426
+ function convertLegacyToSeries() {
141427
+ const chartTypeValue = props.data?.type ?? props.data?._primary_chart_type ?? "bar";
141428
+ const dataPoints = props.data?.data_points && Array.isArray(props.data.data_points) ? props.data.data_points.map((dp) => ({
141429
+ label: dp.label,
141430
+ value: dp.value,
141431
+ xValue: dp.x_value ?? "",
141432
+ yValue: dp.y_value ?? "",
141433
+ dynamicValue: dp.dynamic_value,
141434
+ dynamicXValue: dp.dynamic_x_value,
141435
+ dynamicYValue: dp.dynamic_y_value,
141436
+ arrayConfig: dp.array_config
141437
+ })) : props.data?.data?.labels ? props.data.data.labels.map((label, index) => ({
141438
+ label: String(label),
141439
+ value: String(props.data?.data?.datasets?.[0]?.data?.[index] ?? 0),
141440
+ xValue: "",
141441
+ yValue: ""
141442
+ })) : [];
141443
+ return [
141444
+ {
141445
+ id: generateSeriesId(),
141446
+ name: t("canvasUI.canvasBuilder.dataCharts.series") + " 1",
141447
+ chartType: chartTypeValue,
141448
+ dataPoints
141449
+ }
141450
+ ];
141451
+ }
141452
+ const seriesList = ref(
141453
+ props.data?.series && Array.isArray(props.data.series) && props.data.series.length > 0 ? props.data.series.map((s) => convertSavedSeriesToRuntime(s)) : convertLegacyToSeries()
141454
+ );
141455
+ const activeSeriesIndex = ref(0);
141456
+ const activeSeries = computed(() => seriesList.value[activeSeriesIndex.value]);
141457
+ const isActiveSeriesXYChart = computed(() => XY_CHART_TYPES.includes(activeSeries.value?.chartType));
141458
+ const isActiveSeriesXYRChart = computed(() => XYR_CHART_TYPES.includes(activeSeries.value?.chartType));
141459
+ const isPrimaryStandalone = computed(() => STANDALONE_CHART_TYPES.includes(seriesList.value[0]?.chartType));
141460
+ const isMultiSeries = computed(() => seriesList.value.length > 1);
141461
+ const canAddSeries = computed(() => !isPrimaryStandalone.value);
141462
+ const availableChartTypeOptions = computed(() => {
141463
+ const allOptions = [
141464
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.bar"), value: "bar" },
141465
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.line"), value: "line" },
141466
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.pie"), value: "pie" },
141467
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.doughnut"), value: "doughnut" },
141468
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.polarArea"), value: "polarArea" },
141469
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.radar"), value: "radar" },
141470
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.scatter"), value: "scatter" },
141471
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.bubble"), value: "bubble" },
141472
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.area"), value: "area" }
141473
+ ];
141474
+ const primaryType = seriesList.value[0]?.chartType;
141475
+ if (seriesList.value.length > 1 || activeSeriesIndex.value > 0) {
141476
+ if (THREE_D_CHART_TYPES.includes(primaryType)) {
141477
+ return allOptions.filter((opt) => THREE_D_CHART_TYPES.includes(opt.value));
141478
+ }
141479
+ if (TWO_D_CHART_TYPES.includes(primaryType)) {
141480
+ return allOptions.filter((opt) => TWO_D_CHART_TYPES.includes(opt.value));
141481
+ }
141482
+ return allOptions.filter((opt) => ONE_D_CHART_TYPES.includes(opt.value));
141483
+ }
141484
+ return allOptions;
141485
+ });
141486
+ const chartType = computed(() => seriesList.value[0]?.chartType ?? "bar");
141487
+ const primaryChartType = computed(() => seriesList.value[0]?.chartType ?? "bar");
141068
141488
  const backgroundColor = props.data?.data?.datasets?.[0]?.background_color;
141069
141489
  const colorSchemeType = ref(props.data?.color_scheme_type ?? "theme");
141070
141490
  const chartColors = ref([]);
@@ -141093,24 +141513,16 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141093
141513
  const chartTitle = ref(props.data?.options?.plugins?.title?.text ?? "");
141094
141514
  const legendPosition = ref(props.data?.options?.plugins?.legend?.position ?? "top");
141095
141515
  const enableAnimation = ref((props.data?.options?.animation?.duration ?? 0) > 0);
141096
- const dataPoints = ref(
141097
- 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) => ({
141098
- label: String(label),
141099
- value: String(props.data?.data?.datasets?.[0]?.data?.[index] ?? 0)
141100
- })) : []
141101
- );
141102
141516
  const xAxisLabel = ref(props.data?.options?.scales?.x?.title?.text ?? "");
141103
141517
  const yAxisLabel = ref(props.data?.options?.scales?.y?.title?.text ?? "");
141104
141518
  const orientation = ref(props.data?.options?.index_axis ?? "x");
141105
141519
  const pointStyle = ref(props.data?.data?.datasets?.[0]?.point_style ?? "circle");
141106
- const chartTypeOptions = [
141107
- { label: t("canvasUI.canvasBuilder.dataCharts.types.bar"), value: "bar" },
141108
- { label: t("canvasUI.canvasBuilder.dataCharts.types.line"), value: "line" },
141109
- { label: t("canvasUI.canvasBuilder.dataCharts.types.pie"), value: "pie" },
141110
- { label: t("canvasUI.canvasBuilder.dataCharts.types.doughnut"), value: "doughnut" },
141111
- { label: t("canvasUI.canvasBuilder.dataCharts.types.polarArea"), value: "polarArea" },
141112
- { label: t("canvasUI.canvasBuilder.dataCharts.types.radar"), value: "radar" }
141113
- ];
141520
+ const percentDisplay = ref(props.data?.percent_display ?? false);
141521
+ const enableFullscreenBtn = ref(props.data?.view_controls?.enable_fullscreen_btn ?? false);
141522
+ const enableChartTypeSwitcher = ref(props.data?.view_controls?.enable_chart_type_switcher ?? false);
141523
+ const enableDataEntry = ref(props.data?.view_controls?.enable_data_entry ?? false);
141524
+ const chartHeight = ref(props.data?.chart_height ?? 800);
141525
+ const chartWidth = ref(props.data?.chart_width ?? 100);
141114
141526
  const legendPositionOptions = [
141115
141527
  { label: t("canvasUI.canvasBuilder.dataCharts.legendPositions.none"), value: "none" },
141116
141528
  { label: t("canvasUI.canvasBuilder.dataCharts.legendPositions.top"), value: "top" },
@@ -141119,8 +141531,8 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141119
141531
  { label: t("canvasUI.canvasBuilder.dataCharts.legendPositions.right"), value: "right" }
141120
141532
  ];
141121
141533
  const orientationOptions = [
141122
- { label: t("canvasUI.canvasBuilder.dataCharts.orientations.horizontal"), value: "x" },
141123
- { label: t("canvasUI.canvasBuilder.dataCharts.orientations.vertical"), value: "y" }
141534
+ { label: t("canvasUI.canvasBuilder.dataCharts.orientations.horizontal"), value: "y" },
141535
+ { label: t("canvasUI.canvasBuilder.dataCharts.orientations.vertical"), value: "x" }
141124
141536
  ];
141125
141537
  const pointStyleOptions = [
141126
141538
  { label: t("canvasUI.canvasBuilder.dataCharts.pointStyles.circle"), value: "circle" },
@@ -141130,12 +141542,18 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141130
141542
  { label: t("canvasUI.canvasBuilder.dataCharts.pointStyles.star"), value: "star" },
141131
141543
  { label: t("canvasUI.canvasBuilder.dataCharts.pointStyles.triangle"), value: "triangle" }
141132
141544
  ];
141133
- function getColors() {
141134
- if (colorSchemeType.value === "theme") {
141135
- return chartColors.value.map((index) => `palette${index}`);
141136
- }
141137
- return chartColors.value;
141138
- }
141545
+ const deleteButtonStyle = computed(() => ({
141546
+ "--n-border": "1px solid transparent",
141547
+ "--n-border-disabled": "1px solid transparent",
141548
+ "--n-border-focus": "1px solid transparent",
141549
+ "--n-border-hover": "1px solid transparent",
141550
+ "--n-border-pressed": "1px solid transparent",
141551
+ "--n-color-focus": themeVars.value.error2,
141552
+ "--n-color-hover": themeVars.value.error2,
141553
+ "--n-color-disabled": themeVars.value.error2,
141554
+ "--n-color-pressed": themeVars.value.error2
141555
+ }));
141556
+ const activePopoverField = ref(null);
141139
141557
  function updateChartColors(newColors) {
141140
141558
  if (colorSchemeType.value === "theme") {
141141
141559
  chartColors.value = newColors.map((color, i) => {
@@ -141163,17 +141581,55 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141163
141581
  }
141164
141582
  }
141165
141583
  );
141584
+ function closePopover() {
141585
+ activePopoverPoint.value = null;
141586
+ activePopoverField.value = null;
141587
+ }
141588
+ function addSeries() {
141589
+ if (!canAddSeries.value) return;
141590
+ const newIndex = seriesList.value.length;
141591
+ const newSeries = {
141592
+ id: generateSeriesId(),
141593
+ name: `${t("canvasUI.canvasBuilder.dataCharts.series")} ${newIndex + 1}`,
141594
+ chartType: seriesList.value[0].chartType,
141595
+ // Default to same type as first series
141596
+ dataPoints: []
141597
+ };
141598
+ seriesList.value.push(newSeries);
141599
+ activeSeriesIndex.value = newIndex;
141600
+ updatePreview();
141601
+ }
141602
+ function removeSeries(index) {
141603
+ if (index === 0 || index >= seriesList.value.length) return;
141604
+ seriesList.value.splice(index, 1);
141605
+ if (activeSeriesIndex.value >= seriesList.value.length) {
141606
+ activeSeriesIndex.value = seriesList.value.length - 1;
141607
+ }
141608
+ updatePreview();
141609
+ }
141610
+ function onChartTypeChange(newType) {
141611
+ if (activeSeriesIndex.value === 0 && STANDALONE_CHART_TYPES.includes(newType)) {
141612
+ seriesList.value = [seriesList.value[0]];
141613
+ }
141614
+ updatePreview();
141615
+ }
141166
141616
  function addDataPoint() {
141167
- dataPoints.value.push({
141617
+ activeSeries.value.dataPoints.push({
141168
141618
  label: "",
141619
+ xValue: "",
141620
+ yValue: "",
141621
+ rValue: "",
141169
141622
  value: ""
141170
141623
  });
141171
141624
  }
141172
141625
  function removeDataPoint(index) {
141173
- dataPoints.value.splice(index, 1);
141626
+ activeSeries.value.dataPoints.splice(index, 1);
141174
141627
  }
141175
141628
  function removeAllDataPoints() {
141176
- dataPoints.value = [];
141629
+ activeSeries.value.dataPoints = [];
141630
+ }
141631
+ function isArrayOrObject(value) {
141632
+ return Array.isArray(value) || typeof value === "object" && value !== null;
141177
141633
  }
141178
141634
  function getFieldOptions(data) {
141179
141635
  if (!data || typeof data !== "object") return [];
@@ -141184,6 +141640,54 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141184
141640
  value: field
141185
141641
  }));
141186
141642
  }
141643
+ function updateDynamicValueExpression(point) {
141644
+ if (!point.selectedValue || !point.arrayConfig?.labelField || !point.arrayConfig?.valueField) {
141645
+ return;
141646
+ }
141647
+ const path = point.dynamicValue?.path;
141648
+ if (!path) {
141649
+ return;
141650
+ }
141651
+ point.label = `{{#each ${path}}}{{lookup this "${point.arrayConfig.labelField}"}}{{#unless @last}},{{/unless}}{{/each}}`;
141652
+ point.value = `{{#each ${path}}}{{lookup this "${point.arrayConfig.valueField}"}}{{#unless @last}},{{/unless}}{{/each}}`;
141653
+ point.dynamicValue = {
141654
+ path,
141655
+ value: point.value
141656
+ };
141657
+ closePopover();
141658
+ }
141659
+ function updateXYDynamicValueExpression(point) {
141660
+ if (!point.selectedXValue || !point.arrayConfig?.labelField || !point.arrayConfig?.xField || !point.arrayConfig?.yField) {
141661
+ return;
141662
+ }
141663
+ const isBubble = isActiveSeriesXYRChart.value;
141664
+ if (isBubble && !point.arrayConfig?.rField) {
141665
+ return;
141666
+ }
141667
+ const path = point.dynamicXValue?.path;
141668
+ if (!path) {
141669
+ return;
141670
+ }
141671
+ point.label = `{{#each ${path}}}{{lookup this "${point.arrayConfig.labelField}"}}{{#unless @last}},{{/unless}}{{/each}}`;
141672
+ point.xValue = `{{#each ${path}}}{{lookup this "${point.arrayConfig.xField}"}}{{#unless @last}},{{/unless}}{{/each}}`;
141673
+ point.yValue = `{{#each ${path}}}{{lookup this "${point.arrayConfig.yField}"}}{{#unless @last}},{{/unless}}{{/each}}`;
141674
+ point.dynamicXValue = {
141675
+ path,
141676
+ value: point.xValue
141677
+ };
141678
+ point.dynamicYValue = {
141679
+ path,
141680
+ value: point.yValue
141681
+ };
141682
+ if (isBubble && point.arrayConfig.rField) {
141683
+ point.rValue = `{{#each ${path}}}{{lookup this "${point.arrayConfig.rField}"}}{{#unless @last}},{{/unless}}{{/each}}`;
141684
+ point.dynamicRValue = {
141685
+ path,
141686
+ value: point.rValue
141687
+ };
141688
+ }
141689
+ closePopover();
141690
+ }
141187
141691
  const dynamicValueTreeData = computed(() => {
141188
141692
  function processObject(obj, path = []) {
141189
141693
  const result = [];
@@ -141234,24 +141738,59 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141234
141738
  return h("span", { class: "text-sm" }, { default: () => info.option.label || "" });
141235
141739
  }
141236
141740
  const activePopoverPoint = ref(null);
141237
- function handleDynamicValueClick(point) {
141238
- if (activePopoverPoint.value === point) {
141239
- activePopoverPoint.value = null;
141741
+ function handleDynamicValueClick(point, field = "value") {
141742
+ if (activePopoverPoint.value === point && activePopoverField.value === field) {
141743
+ closePopover();
141240
141744
  } else {
141241
- point.selectedValue = void 0;
141242
- point.dynamicValue = void 0;
141243
- point.arrayConfig = void 0;
141244
- point.value = "";
141745
+ if (field === "value") {
141746
+ point.selectedValue = void 0;
141747
+ point.dynamicValue = void 0;
141748
+ point.arrayConfig = void 0;
141749
+ point.value = "";
141750
+ } else if (field === "x") {
141751
+ point.selectedXValue = void 0;
141752
+ point.dynamicXValue = void 0;
141753
+ point.dynamicYValue = void 0;
141754
+ point.dynamicRValue = void 0;
141755
+ point.arrayConfig = void 0;
141756
+ point.xValue = "";
141757
+ point.yValue = "";
141758
+ point.rValue = "";
141759
+ point.label = "";
141760
+ } else if (field === "y") {
141761
+ point.selectedYValue = void 0;
141762
+ point.dynamicYValue = void 0;
141763
+ point.yValue = "";
141764
+ } else if (field === "r") {
141765
+ point.selectedRValue = void 0;
141766
+ point.dynamicRValue = void 0;
141767
+ point.rValue = "";
141768
+ }
141245
141769
  activePopoverPoint.value = point;
141770
+ activePopoverField.value = field;
141246
141771
  }
141247
141772
  }
141248
- function handleDynamicValueSelect(keys, point) {
141773
+ function handleDynamicValueSelect(keys, point, field = "value") {
141249
141774
  const selectedKey = keys[0];
141250
141775
  if (!selectedKey) {
141251
- point.dynamicValue = void 0;
141252
- point.selectedValue = void 0;
141253
- point.value = "";
141254
- activePopoverPoint.value = null;
141776
+ if (field === "value") {
141777
+ point.dynamicValue = void 0;
141778
+ point.selectedValue = void 0;
141779
+ point.value = "";
141780
+ } else if (field === "x") {
141781
+ point.dynamicXValue = void 0;
141782
+ point.selectedXValue = void 0;
141783
+ point.xValue = "";
141784
+ } else if (field === "y") {
141785
+ point.dynamicYValue = void 0;
141786
+ point.selectedYValue = void 0;
141787
+ point.yValue = "";
141788
+ } else if (field === "r") {
141789
+ point.dynamicRValue = void 0;
141790
+ point.selectedRValue = void 0;
141791
+ point.rValue = "";
141792
+ }
141793
+ closePopover();
141255
141794
  return;
141256
141795
  }
141257
141796
  const pathParts = selectedKey.split(/\.(?![^[]*])/) || [];
@@ -141266,6 +141805,80 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141266
141805
  currentValue = currentValue?.[part];
141267
141806
  }
141268
141807
  }
141808
+ if (field === "x") {
141809
+ point.selectedXValue = currentValue;
141810
+ if (Array.isArray(currentValue) || typeof currentValue === "object" && currentValue !== null) {
141811
+ point.arrayConfig = {
141812
+ labelField: "",
141813
+ valueField: "",
141814
+ xField: "",
141815
+ yField: "",
141816
+ rField: ""
141817
+ };
141818
+ point.dynamicXValue = {
141819
+ path: selectedKey,
141820
+ value: ""
141821
+ };
141822
+ return;
141823
+ }
141824
+ const rootPart = pathParts[0];
141825
+ let expression = "";
141826
+ if (pathParts.length === 1) {
141827
+ expression = `{{${rootPart}}}`;
141828
+ } else {
141829
+ const restOfPath = pathParts.slice(1).map((part) => {
141830
+ if (part.includes("[") && part.includes("]")) {
141831
+ return part.split("[")[1].split("]")[0];
141832
+ }
141833
+ return part;
141834
+ });
141835
+ expression = `{{lookup (lookup ${rootPart} ${restOfPath[0]}) "${restOfPath[1]}"}}`;
141836
+ }
141837
+ point.dynamicXValue = { path: selectedKey, value: expression };
141838
+ point.xValue = expression;
141839
+ closePopover();
141840
+ return;
141841
+ }
141842
+ if (field === "y") {
141843
+ point.selectedYValue = currentValue;
141844
+ const rootPart = pathParts[0];
141845
+ let expression = "";
141846
+ if (pathParts.length === 1) {
141847
+ expression = `{{${rootPart}}}`;
141848
+ } else {
141849
+ const restOfPath = pathParts.slice(1).map((part) => {
141850
+ if (part.includes("[") && part.includes("]")) {
141851
+ return part.split("[")[1].split("]")[0];
141852
+ }
141853
+ return part;
141854
+ });
141855
+ expression = `{{lookup (lookup ${rootPart} ${restOfPath[0]}) "${restOfPath[1]}"}}`;
141856
+ }
141857
+ point.dynamicYValue = { path: selectedKey, value: expression };
141858
+ point.yValue = expression;
141859
+ closePopover();
141860
+ return;
141861
+ }
141862
+ if (field === "r") {
141863
+ point.selectedRValue = currentValue;
141864
+ const rootPart = pathParts[0];
141865
+ let expression = "";
141866
+ if (pathParts.length === 1) {
141867
+ expression = `{{${rootPart}}}`;
141868
+ } else {
141869
+ const restOfPath = pathParts.slice(1).map((part) => {
141870
+ if (part.includes("[") && part.includes("]")) {
141871
+ return part.split("[")[1].split("]")[0];
141872
+ }
141873
+ return part;
141874
+ });
141875
+ expression = `{{lookup (lookup ${rootPart} ${restOfPath[0]}) "${restOfPath[1]}"}}`;
141876
+ }
141877
+ point.dynamicRValue = { path: selectedKey, value: expression };
141878
+ point.rValue = expression;
141879
+ closePopover();
141880
+ return;
141881
+ }
141269
141882
  point.selectedValue = currentValue;
141270
141883
  if (Array.isArray(currentValue) || typeof currentValue === "object" && currentValue !== null) {
141271
141884
  point.arrayConfig = {
@@ -141295,79 +141908,189 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141295
141908
  value: expression
141296
141909
  };
141297
141910
  point.value = expression;
141298
- activePopoverPoint.value = null;
141911
+ closePopover();
141912
+ }
141913
+ }
141914
+ function normalizeRValues(values, minRadius = 5, maxRadius = 40) {
141915
+ if (values.length === 0) return [];
141916
+ const rValues = values.map((v) => v.r);
141917
+ const minR = Math.min(...rValues);
141918
+ const maxR = Math.max(...rValues);
141919
+ if (minR === maxR) {
141920
+ return values.map((v) => ({
141921
+ ...v,
141922
+ r: (minRadius + maxRadius) / 2,
141923
+ originalR: v.r
141924
+ }));
141299
141925
  }
141926
+ return values.map((v) => ({
141927
+ ...v,
141928
+ r: minRadius + (v.r - minR) / (maxR - minR) * (maxRadius - minRadius),
141929
+ originalR: v.r
141930
+ }));
141300
141931
  }
141301
- function updateDynamicValueExpression(point) {
141302
- if (!point.selectedValue || !point.arrayConfig?.labelField || !point.arrayConfig?.valueField) {
141303
- return;
141304
- }
141305
- const path = point.dynamicValue?.path;
141306
- if (!path) {
141307
- return;
141932
+ function processSeriesData(series) {
141933
+ const isXY = XY_CHART_TYPES.includes(series.chartType);
141934
+ const isXYR = XYR_CHART_TYPES.includes(series.chartType);
141935
+ if (isXY || isXYR) {
141936
+ const processedData2 = {
141937
+ labels: [],
141938
+ values: []
141939
+ };
141940
+ const rawBubbleData = [];
141941
+ series.dataPoints.forEach((point) => {
141942
+ const x = !isNaN(Number(point.xValue)) ? Number(point.xValue) : 0;
141943
+ const y = !isNaN(Number(point.yValue)) ? Number(point.yValue) : 0;
141944
+ if (series.chartType === "bubble") {
141945
+ const r = point.rValue && !isNaN(Number(point.rValue)) ? Math.abs(Number(point.rValue)) : 10;
141946
+ rawBubbleData.push({ label: point.label, x, y, r });
141947
+ } else {
141948
+ processedData2.labels.push(point.label);
141949
+ processedData2.values.push({ x, y });
141950
+ }
141951
+ });
141952
+ if (series.chartType === "bubble" && rawBubbleData.length > 0) {
141953
+ const bubbleValues = rawBubbleData.map((d) => ({ x: d.x, y: d.y, r: d.r }));
141954
+ const normalizedValues = normalizeRValues(bubbleValues);
141955
+ rawBubbleData.forEach((d, idx) => {
141956
+ processedData2.labels.push(d.label);
141957
+ processedData2.values.push(normalizedValues[idx]);
141958
+ });
141959
+ }
141960
+ return processedData2;
141308
141961
  }
141309
- point.label = `{{#each ${path}}}{{lookup this "${point.arrayConfig.labelField}"}}{{#unless @last}},{{/unless}}{{/each}}`;
141310
- point.value = `{{#each ${path}}}{{lookup this "${point.arrayConfig.valueField}"}}{{#unless @last}},{{/unless}}{{/each}}`;
141311
- point.dynamicValue = {
141312
- path,
141313
- value: point.value
141314
- };
141315
- activePopoverPoint.value = null;
141316
- }
141317
- function processChartData() {
141318
141962
  const processedData = {
141319
141963
  labels: [],
141320
141964
  values: []
141321
141965
  };
141322
- dataPoints.value.forEach((point) => {
141966
+ series.dataPoints.forEach((point) => {
141323
141967
  processedData.labels.push(point.label);
141324
141968
  processedData.values.push(!isNaN(Number(point.value)) ? Number(point.value) : 0);
141325
141969
  });
141326
141970
  return processedData;
141327
141971
  }
141972
+ function getSeriesColors(forStorage = false) {
141973
+ if (colorSchemeType.value === "theme") {
141974
+ if (forStorage) {
141975
+ return chartColors.value.map((index) => `palette${index}`);
141976
+ }
141977
+ return chartColors.value.map((index) => {
141978
+ const idx = parseInt(index);
141979
+ return palette.value[idx % palette.value.length];
141980
+ });
141981
+ }
141982
+ return chartColors.value;
141983
+ }
141328
141984
  function createChartConfig() {
141985
+ const datasets = [];
141986
+ let allLabels = [];
141987
+ const colorsForStorage = getSeriesColors(true);
141988
+ const isSingleSeries = seriesList.value.length === 1;
141989
+ seriesList.value.forEach((series, index) => {
141990
+ const processedData = processSeriesData(series);
141991
+ let backgroundColor2;
141992
+ let borderColor;
141993
+ if (isSingleSeries) {
141994
+ backgroundColor2 = colorsForStorage;
141995
+ borderColor = [...colorsForStorage];
141996
+ } else {
141997
+ const seriesColor = colorsForStorage[index % colorsForStorage.length];
141998
+ backgroundColor2 = seriesColor;
141999
+ borderColor = seriesColor;
142000
+ }
142001
+ const datasetOptions = {
142002
+ label: series.name,
142003
+ data: processedData.values,
142004
+ background_color: backgroundColor2,
142005
+ border_color: borderColor,
142006
+ borderWidth: 1
142007
+ };
142008
+ if (!isSingleSeries) {
142009
+ if (series.chartType === "area") {
142010
+ datasetOptions.type = "line";
142011
+ datasetOptions.fill = true;
142012
+ datasetOptions.tension = 0.4;
142013
+ } else {
142014
+ datasetOptions.type = series.chartType;
142015
+ }
142016
+ }
142017
+ if (series.chartType === "area") {
142018
+ datasetOptions.fill = true;
142019
+ datasetOptions.tension = 0.4;
142020
+ }
142021
+ if (["line", "scatter", "area"].includes(series.chartType)) {
142022
+ datasetOptions.pointStyle = pointStyle.value;
142023
+ }
142024
+ if (["line", "area"].includes(series.chartType)) {
142025
+ datasetOptions.tension = 0.4;
142026
+ }
142027
+ if (processedData.labels.length > allLabels.length) {
142028
+ allLabels = processedData.labels;
142029
+ }
142030
+ datasets.push(datasetOptions);
142031
+ });
142032
+ const primaryType = seriesList.value[0].chartType;
142033
+ let actualPrimaryType = primaryType;
142034
+ if (primaryType === "area") {
142035
+ actualPrimaryType = "line";
142036
+ }
142037
+ let scales = void 0;
142038
+ const chartTypesWithScales = ["bar", "line", "scatter", "bubble", "area"];
142039
+ if (chartTypesWithScales.includes(primaryType)) {
142040
+ scales = {
142041
+ x: {
142042
+ title: {
142043
+ display: !!xAxisLabel.value,
142044
+ text: xAxisLabel.value
142045
+ }
142046
+ },
142047
+ y: {
142048
+ title: {
142049
+ display: !!yAxisLabel.value,
142050
+ text: yAxisLabel.value
142051
+ },
142052
+ begin_at_zero: true
142053
+ }
142054
+ };
142055
+ } else if (["radar", "polarArea"].includes(primaryType)) {
142056
+ scales = {
142057
+ r: {
142058
+ begin_at_zero: true,
142059
+ ticks: {
142060
+ step_size: 1
142061
+ }
142062
+ }
142063
+ };
142064
+ }
142065
+ const showLegend = seriesList.value.length > 1 || legendPosition.value !== "none";
141329
142066
  const config = {
141330
- type: chartType.value,
142067
+ type: actualPrimaryType,
141331
142068
  color_scheme_type: colorSchemeType.value,
142069
+ percent_display: percentDisplay.value,
142070
+ chart_height: chartHeight.value,
142071
+ chart_width: chartWidth.value,
142072
+ view_controls: {
142073
+ enable_fullscreen_btn: enableFullscreenBtn.value,
142074
+ enable_chart_type_switcher: enableChartTypeSwitcher.value,
142075
+ enable_data_entry: enableDataEntry.value
142076
+ },
141332
142077
  data: {
141333
- labels: [],
141334
- datasets: [
141335
- {
141336
- label: "Data Series",
141337
- data: [],
141338
- background_color: getColors(),
141339
- border_color: getColors(),
141340
- border_width: 1,
141341
- point_style: ["line"].includes(chartType.value) ? pointStyle.value : void 0
141342
- }
141343
- ]
142078
+ labels: allLabels,
142079
+ datasets
141344
142080
  },
141345
142081
  options: {
141346
142082
  responsive: true,
141347
142083
  maintainAspectRatio: false,
141348
- index_axis: ["bar", "line"].includes(chartType.value) ? orientation.value : void 0,
141349
- scales: ["bar", "line"].includes(chartType.value) ? {
141350
- x: {
141351
- title: {
141352
- display: !!xAxisLabel.value,
141353
- text: xAxisLabel.value
141354
- }
141355
- },
141356
- y: {
141357
- title: {
141358
- display: !!yAxisLabel.value,
141359
- text: yAxisLabel.value
141360
- }
141361
- }
141362
- } : void 0,
142084
+ index_axis: ["bar", "line"].includes(primaryType) ? orientation.value : void 0,
142085
+ scales,
141363
142086
  plugins: {
141364
142087
  title: {
141365
142088
  display: !!chartTitle.value,
141366
142089
  text: chartTitle.value
141367
142090
  },
141368
142091
  legend: {
141369
- display: legendPosition.value !== "none",
141370
- position: legendPosition.value,
142092
+ display: showLegend,
142093
+ position: legendPosition.value !== "none" ? legendPosition.value : "top",
141371
142094
  labels: {
141372
142095
  usePointStyle: true
141373
142096
  }
@@ -141377,14 +142100,27 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141377
142100
  duration: enableAnimation.value ? 1e3 : 0
141378
142101
  }
141379
142102
  },
141380
- data_points: dataPoints.value.map((point) => ({
141381
- label: point.label,
141382
- value: point.value
141383
- }))
142103
+ // Save series data for editing
142104
+ series: seriesList.value.map((series) => ({
142105
+ id: series.id,
142106
+ name: series.name,
142107
+ chart_type: series.chartType,
142108
+ data_points: series.dataPoints.map((point) => ({
142109
+ label: point.label,
142110
+ value: point.value,
142111
+ x_value: point.xValue,
142112
+ y_value: point.yValue,
142113
+ r_value: point.rValue,
142114
+ dynamic_value: point.dynamicValue,
142115
+ dynamic_x_value: point.dynamicXValue,
142116
+ dynamic_y_value: point.dynamicYValue,
142117
+ dynamic_r_value: point.dynamicRValue,
142118
+ array_config: point.arrayConfig
142119
+ }))
142120
+ })),
142121
+ // Store the primary chart type for reference
142122
+ _primary_chart_type: primaryType
141384
142123
  };
141385
- const processedData = processChartData();
141386
- config.data.labels = processedData.labels;
141387
- config.data.datasets[0].data = processedData.values;
141388
142124
  return config;
141389
142125
  }
141390
142126
  function onCancel() {
@@ -141412,9 +142148,14 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141412
142148
  },
141413
142149
  { immediate: true }
141414
142150
  );
142151
+ watch(isMultiSeries, (multiSeries) => {
142152
+ if (multiSeries) {
142153
+ enableChartTypeSwitcher.value = false;
142154
+ }
142155
+ });
141415
142156
  watch(
141416
142157
  [
141417
- chartType,
142158
+ seriesList,
141418
142159
  chartColors,
141419
142160
  colorSchemeType,
141420
142161
  chartTitle,
@@ -141423,7 +142164,13 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141423
142164
  yAxisLabel,
141424
142165
  orientation,
141425
142166
  pointStyle,
141426
- dataPoints
142167
+ percentDisplay,
142168
+ enableAnimation,
142169
+ enableFullscreenBtn,
142170
+ enableChartTypeSwitcher,
142171
+ enableDataEntry,
142172
+ chartHeight,
142173
+ chartWidth
141427
142174
  ],
141428
142175
  () => {
141429
142176
  updatePreview();
@@ -141449,10 +142196,10 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141449
142196
  "--n-padding-left": "16px"
141450
142197
  }]),
141451
142198
  title: unref(t)("canvasUI.canvasBuilder.dataCharts.editDataChartsComponent"),
141452
- onClose: _cache[11] || (_cache[11] = ($event) => unref(setComponentEditMode)(false))
142199
+ onClose: _cache[16] || (_cache[16] = ($event) => unref(setComponentEditMode)(false))
141453
142200
  }, {
141454
142201
  footer: withCtx(() => [
141455
- createElementVNode("div", _hoisted_50$3, [
142202
+ createElementVNode("div", _hoisted_89, [
141456
142203
  createVNode(CButton, { onClick: onCancel }, {
141457
142204
  default: withCtx(() => [
141458
142205
  createTextVNode(toDisplayString(unref(t)("canvasUI.common.cancel")), 1)
@@ -141490,69 +142237,66 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141490
142237
  createElementVNode("div", _hoisted_2$1t, [
141491
142238
  createElementVNode("div", _hoisted_3$17, [
141492
142239
  createElementVNode("div", _hoisted_4$X, [
141493
- createElementVNode("div", _hoisted_5$O, [
141494
- createElementVNode("label", _hoisted_6$H, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.chartType")), 1),
141495
- createVNode(unref(NSelect), {
141496
- value: chartType.value,
141497
- "onUpdate:value": _cache[0] || (_cache[0] = ($event) => chartType.value = $event),
141498
- options: chartTypeOptions
141499
- }, null, 8, ["value"])
142240
+ createElementVNode("div", _hoisted_5$O, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.dataSettings")), 1),
142241
+ createElementVNode("div", _hoisted_6$H, [
142242
+ (openBlock(true), createElementBlock(Fragment, null, renderList(seriesList.value, (series, index) => {
142243
+ return openBlock(), createElementBlock("div", {
142244
+ key: series.id,
142245
+ 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", [
142246
+ 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"
142247
+ ]]),
142248
+ onClick: ($event) => activeSeriesIndex.value = index
142249
+ }, [
142250
+ createElementVNode("span", _hoisted_8$q, toDisplayString(series.name), 1),
142251
+ index > 0 ? (openBlock(), createElementBlock("div", {
142252
+ key: 0,
142253
+ class: "ml-1 p-0.5 rounded hover:bg-gray-300 dark:hover:bg-gray-600",
142254
+ onClick: withModifiers(($event) => removeSeries(index), ["stop"])
142255
+ }, [
142256
+ createVNode(CIcon, {
142257
+ class: "text-gray-500",
142258
+ icon: "times",
142259
+ size: 10
142260
+ })
142261
+ ], 8, _hoisted_9$m)) : createCommentVNode("", true)
142262
+ ], 10, _hoisted_7$v);
142263
+ }), 128)),
142264
+ canAddSeries.value ? (openBlock(), createElementBlock("button", {
142265
+ key: 0,
142266
+ 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",
142267
+ title: unref(t)("canvasUI.canvasBuilder.dataCharts.addSeries"),
142268
+ onClick: addSeries
142269
+ }, [
142270
+ createVNode(CIcon, {
142271
+ icon: "plus",
142272
+ size: 14
142273
+ })
142274
+ ], 8, _hoisted_10$h)) : createCommentVNode("", true)
141500
142275
  ]),
141501
- ["bar", "line"].includes(chartType.value) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
141502
- createElementVNode("div", _hoisted_7$v, [
141503
- createElementVNode("label", _hoisted_8$q, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.xAxisLabel")), 1),
141504
- createVNode(unref(NInput), {
141505
- value: xAxisLabel.value,
141506
- "onUpdate:value": _cache[1] || (_cache[1] = ($event) => xAxisLabel.value = $event),
141507
- type: "text"
141508
- }, null, 8, ["value"])
141509
- ]),
141510
- createElementVNode("div", _hoisted_9$m, [
141511
- createElementVNode("label", _hoisted_10$h, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.yAxisLabel")), 1),
141512
- createVNode(unref(NInput), {
141513
- value: yAxisLabel.value,
141514
- "onUpdate:value": _cache[2] || (_cache[2] = ($event) => yAxisLabel.value = $event),
141515
- type: "text"
141516
- }, null, 8, ["value"])
141517
- ]),
141518
- createElementVNode("div", _hoisted_11$f, [
141519
- createElementVNode("label", _hoisted_12$b, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.orientation")), 1),
141520
- createVNode(unref(NSelect), {
141521
- value: orientation.value,
141522
- "onUpdate:value": _cache[3] || (_cache[3] = ($event) => orientation.value = $event),
141523
- options: orientationOptions
141524
- }, null, 8, ["value"])
141525
- ]),
141526
- ["line", "radar"].includes(chartType.value) ? (openBlock(), createElementBlock("div", _hoisted_13$a, [
141527
- createElementVNode("label", _hoisted_14$9, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.pointStyle")), 1),
141528
- createVNode(unref(NSelect), {
141529
- value: pointStyle.value,
141530
- "onUpdate:value": _cache[4] || (_cache[4] = ($event) => pointStyle.value = $event),
141531
- options: pointStyleOptions
141532
- }, null, 8, ["value"])
141533
- ])) : createCommentVNode("", true)
141534
- ], 64)) : createCommentVNode("", true),
141535
- createElementVNode("div", _hoisted_15$8, [
141536
- createElementVNode("label", _hoisted_16$8, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.chartTitle")), 1),
142276
+ seriesList.value.length > 1 ? (openBlock(), createElementBlock("div", _hoisted_11$f, [
142277
+ createElementVNode("label", _hoisted_12$b, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.seriesName")), 1),
141537
142278
  createVNode(unref(NInput), {
141538
- value: chartTitle.value,
141539
- "onUpdate:value": _cache[5] || (_cache[5] = ($event) => chartTitle.value = $event),
142279
+ value: activeSeries.value.name,
142280
+ "onUpdate:value": _cache[0] || (_cache[0] = ($event) => activeSeries.value.name = $event),
141540
142281
  type: "text"
141541
142282
  }, null, 8, ["value"])
141542
- ]),
141543
- ["pie", "doughnut", "polarArea"].includes(chartType.value) ? (openBlock(), createElementBlock("div", _hoisted_17$7, [
141544
- createElementVNode("label", _hoisted_18$6, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.legendPosition")), 1),
141545
- createVNode(unref(NSelect), {
141546
- value: legendPosition.value,
141547
- "onUpdate:value": _cache[6] || (_cache[6] = ($event) => legendPosition.value = $event),
141548
- options: legendPositionOptions
141549
- }, null, 8, ["value"])
141550
142283
  ])) : createCommentVNode("", true),
141551
- createElementVNode("div", _hoisted_19$6, [
141552
- createElementVNode("div", _hoisted_20$5, [
141553
- createElementVNode("label", _hoisted_21$5, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.dataPoints")), 1),
142284
+ createElementVNode("div", _hoisted_13$a, [
142285
+ createElementVNode("label", _hoisted_14$9, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.chartType")), 1),
142286
+ createVNode(unref(NSelect), {
142287
+ value: activeSeries.value.chartType,
142288
+ "onUpdate:value": [
142289
+ _cache[1] || (_cache[1] = ($event) => activeSeries.value.chartType = $event),
142290
+ onChartTypeChange
142291
+ ],
142292
+ options: availableChartTypeOptions.value
142293
+ }, null, 8, ["value", "options"])
142294
+ ]),
142295
+ createElementVNode("div", _hoisted_15$8, [
142296
+ createElementVNode("div", _hoisted_16$8, [
142297
+ createElementVNode("label", _hoisted_17$7, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.dataPoints")), 1),
141554
142298
  createVNode(unref(Button), {
141555
- disabled: !dataPoints.value.length,
142299
+ disabled: !activeSeries.value.dataPoints.length,
141556
142300
  size: "small",
141557
142301
  onClick: removeAllDataPoints
141558
142302
  }, {
@@ -141562,205 +142306,301 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141562
142306
  _: 1
141563
142307
  }, 8, ["disabled"])
141564
142308
  ]),
141565
- (openBlock(true), createElementBlock(Fragment, null, renderList(dataPoints.value, (point, index) => {
142309
+ !isActiveSeriesXYChart.value && !isActiveSeriesXYRChart.value ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(activeSeries.value.dataPoints, (point, index) => {
141566
142310
  return openBlock(), createElementBlock("div", {
141567
142311
  key: index,
141568
142312
  class: "flex gap-2 mb-2"
141569
142313
  }, [
141570
- point.selectedValue && (Array.isArray(point.selectedValue) || typeof point.selectedValue === "object" && point.selectedValue !== null) ? (openBlock(), createBlock(unref(NTooltip), {
141571
- key: 0,
141572
- trigger: "hover"
142314
+ createVNode(unref(NInput), {
142315
+ value: point.label,
142316
+ "onUpdate:value": ($event) => point.label = $event,
142317
+ class: "flex-1",
142318
+ disabled: !!point.arrayConfig,
142319
+ placeholder: "Label"
142320
+ }, null, 8, ["value", "onUpdate:value", "disabled"]),
142321
+ createVNode(unref(NInput), {
142322
+ value: point.value,
142323
+ "onUpdate:value": ($event) => point.value = $event,
142324
+ class: "flex-1",
142325
+ disabled: !!point.dynamicValue,
142326
+ placeholder: "Value",
142327
+ type: "text"
141573
142328
  }, {
141574
- trigger: withCtx(() => [
141575
- createVNode(unref(NInput), {
141576
- value: point.label,
141577
- "onUpdate:value": ($event) => point.label = $event,
141578
- class: "flex-1",
141579
- disabled: true,
141580
- placeholder: "Label"
141581
- }, null, 8, ["value", "onUpdate:value"])
142329
+ suffix: withCtx(() => [
142330
+ createVNode(unref(NPopover), {
142331
+ placement: "bottom",
142332
+ show: activePopoverPoint.value === point && activePopoverField.value === "value",
142333
+ trigger: "manual",
142334
+ onClickoutside: closePopover
142335
+ }, {
142336
+ trigger: withCtx(() => [
142337
+ createElementVNode("div", {
142338
+ class: "cursor-pointer flex items-center",
142339
+ onClick: ($event) => handleDynamicValueClick(point, "value")
142340
+ }, [
142341
+ createVNode(CIcon, {
142342
+ class: normalizeClass(point.dynamicValue ? "text-blue-500" : ""),
142343
+ icon: "caret-down"
142344
+ }, null, 8, ["class"])
142345
+ ], 8, _hoisted_18$6)
142346
+ ]),
142347
+ default: withCtx(() => [
142348
+ createElementVNode("div", _hoisted_19$6, [
142349
+ createElementVNode("div", _hoisted_20$5, [
142350
+ createElementVNode("div", _hoisted_21$5, [
142351
+ createElementVNode("div", _hoisted_22$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.selectDynamicValue")), 1),
142352
+ createElementVNode("div", _hoisted_23$3, [
142353
+ createVNode(unref(NTree), {
142354
+ "block-line": "",
142355
+ class: "max-h-[300px]",
142356
+ data: dynamicValueTreeData.value,
142357
+ "render-label": renderDynamicValueTreeLabel,
142358
+ "selected-keys": [point.dynamicValue?.path ?? ""],
142359
+ "onUpdate:selectedKeys": (keys) => handleDynamicValueSelect(keys, point, "value")
142360
+ }, null, 8, ["data", "selected-keys", "onUpdate:selectedKeys"])
142361
+ ])
142362
+ ]),
142363
+ point.selectedValue && point.arrayConfig && isArrayOrObject(point.selectedValue) ? (openBlock(), createElementBlock("div", _hoisted_24$3, [
142364
+ createElementVNode("div", _hoisted_25$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.configureArrayObjectFields")), 1),
142365
+ createElementVNode("div", _hoisted_26$3, [
142366
+ createElementVNode("div", null, [
142367
+ createElementVNode("label", _hoisted_27$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.labelField")), 1),
142368
+ createVNode(unref(NSelect), {
142369
+ value: point.arrayConfig.labelField,
142370
+ "onUpdate:value": [($event) => point.arrayConfig.labelField = $event, ($event) => updateDynamicValueExpression(point)],
142371
+ options: getFieldOptions(point.selectedValue)
142372
+ }, null, 8, ["value", "onUpdate:value", "options"])
142373
+ ]),
142374
+ createElementVNode("div", null, [
142375
+ createElementVNode("label", _hoisted_28$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.valueField")), 1),
142376
+ createVNode(unref(NSelect), {
142377
+ value: point.arrayConfig.valueField,
142378
+ "onUpdate:value": [($event) => point.arrayConfig.valueField = $event, ($event) => updateDynamicValueExpression(point)],
142379
+ options: getFieldOptions(point.selectedValue)
142380
+ }, null, 8, ["value", "onUpdate:value", "options"])
142381
+ ])
142382
+ ])
142383
+ ])) : createCommentVNode("", true)
142384
+ ])
142385
+ ])
142386
+ ]),
142387
+ _: 2
142388
+ }, 1032, ["show"])
141582
142389
  ]),
141583
- default: withCtx(() => [
141584
- createTextVNode(" " + toDisplayString(point.label), 1)
142390
+ _: 2
142391
+ }, 1032, ["value", "onUpdate:value", "disabled"]),
142392
+ createVNode(CButton, {
142393
+ circle: "",
142394
+ class: "bg-error2 self-center",
142395
+ size: "small",
142396
+ style: normalizeStyle(deleteButtonStyle.value),
142397
+ type: "error",
142398
+ onClick: ($event) => removeDataPoint(index)
142399
+ }, {
142400
+ icon: withCtx(() => [
142401
+ createVNode(CIcon, {
142402
+ class: "color-error",
142403
+ "fa-type": "far",
142404
+ icon: "trash",
142405
+ size: 12
142406
+ })
141585
142407
  ]),
141586
142408
  _: 2
141587
- }, 1024)) : (openBlock(), createBlock(unref(NInput), {
141588
- key: 1,
142409
+ }, 1032, ["style", "onClick"])
142410
+ ]);
142411
+ }), 128)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(activeSeries.value.dataPoints, (point, index) => {
142412
+ return openBlock(), createElementBlock("div", {
142413
+ key: index,
142414
+ class: "flex gap-2 mb-2"
142415
+ }, [
142416
+ createVNode(unref(NInput), {
141589
142417
  value: point.label,
141590
142418
  "onUpdate:value": ($event) => point.label = $event,
141591
142419
  class: "flex-1",
142420
+ disabled: !!point.arrayConfig,
141592
142421
  placeholder: "Label"
141593
- }, null, 8, ["value", "onUpdate:value"])),
141594
- createElementVNode("div", _hoisted_22$3, [
141595
- point.dynamicValue ? (openBlock(), createBlock(unref(NTooltip), {
141596
- key: 0,
141597
- trigger: "hover"
141598
- }, {
141599
- trigger: withCtx(() => [
141600
- createVNode(unref(NInput), {
141601
- value: point.value,
141602
- "onUpdate:value": ($event) => point.value = $event,
141603
- class: "flex-1",
141604
- disabled: !!point.dynamicValue,
141605
- placeholder: "Value",
141606
- type: "text"
141607
- }, {
141608
- suffix: withCtx(() => [
141609
- createVNode(unref(NPopover), {
141610
- placement: "bottom",
141611
- show: activePopoverPoint.value === point,
141612
- trigger: "manual",
141613
- onClickoutside: _cache[7] || (_cache[7] = ($event) => activePopoverPoint.value = null)
141614
- }, {
141615
- trigger: withCtx(() => [
141616
- createElementVNode("div", {
141617
- class: "cursor-pointer flex items-center",
141618
- onClick: ($event) => handleDynamicValueClick(point)
141619
- }, [
141620
- createVNode(CIcon, {
141621
- class: normalizeClass(point.dynamicValue ? "text-blue-500" : ""),
141622
- icon: "caret-down"
141623
- }, null, 8, ["class"])
141624
- ], 8, _hoisted_23$3)
141625
- ]),
141626
- default: withCtx(() => [
141627
- createElementVNode("div", _hoisted_24$3, [
141628
- createElementVNode("div", _hoisted_25$3, [
141629
- createElementVNode("div", _hoisted_26$3, [
141630
- createElementVNode("div", _hoisted_27$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.selectDynamicValue")), 1),
141631
- createElementVNode("div", _hoisted_28$3, [
141632
- createVNode(unref(NTree), {
141633
- "block-line": "",
141634
- class: "max-h-[300px]",
141635
- data: dynamicValueTreeData.value,
141636
- "render-label": renderDynamicValueTreeLabel,
141637
- "selected-keys": [point.dynamicValue?.path ?? ""],
141638
- "onUpdate:selectedKeys": (keys) => handleDynamicValueSelect(keys, point)
141639
- }, null, 8, ["data", "selected-keys", "onUpdate:selectedKeys"])
141640
- ])
141641
- ]),
141642
- point.selectedValue && point.arrayConfig && (Array.isArray(point.selectedValue) || typeof point.selectedValue === "object" && point.selectedValue !== null) ? (openBlock(), createElementBlock("div", _hoisted_29$3, [
141643
- createElementVNode("div", _hoisted_30$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.configureArrayObjectFields")), 1),
141644
- createElementVNode("div", _hoisted_31$3, [
141645
- createElementVNode("div", null, [
141646
- createElementVNode("label", _hoisted_32$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.labelField")), 1),
141647
- createVNode(unref(NSelect), {
141648
- value: point.arrayConfig.labelField,
141649
- "onUpdate:value": [($event) => point.arrayConfig.labelField = $event, ($event) => updateDynamicValueExpression(point)],
141650
- options: getFieldOptions(point.selectedValue)
141651
- }, null, 8, ["value", "onUpdate:value", "options"])
141652
- ]),
141653
- createElementVNode("div", null, [
141654
- createElementVNode("label", _hoisted_33$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.valueField")), 1),
141655
- createVNode(unref(NSelect), {
141656
- value: point.arrayConfig.valueField,
141657
- "onUpdate:value": [($event) => point.arrayConfig.valueField = $event, ($event) => updateDynamicValueExpression(point)],
141658
- options: getFieldOptions(point.selectedValue)
141659
- }, null, 8, ["value", "onUpdate:value", "options"])
141660
- ])
141661
- ])
141662
- ])) : createCommentVNode("", true)
141663
- ])
142422
+ }, null, 8, ["value", "onUpdate:value", "disabled"]),
142423
+ createVNode(unref(NInput), {
142424
+ value: point.xValue,
142425
+ "onUpdate:value": ($event) => point.xValue = $event,
142426
+ class: "flex-1",
142427
+ disabled: !!point.dynamicXValue,
142428
+ placeholder: "X Value",
142429
+ type: "text"
142430
+ }, {
142431
+ suffix: withCtx(() => [
142432
+ createVNode(unref(NPopover), {
142433
+ placement: "bottom",
142434
+ show: activePopoverPoint.value === point && activePopoverField.value === "x",
142435
+ trigger: "manual",
142436
+ onClickoutside: closePopover
142437
+ }, {
142438
+ trigger: withCtx(() => [
142439
+ createElementVNode("div", {
142440
+ class: "cursor-pointer flex items-center",
142441
+ onClick: ($event) => handleDynamicValueClick(point, "x")
142442
+ }, [
142443
+ createVNode(CIcon, {
142444
+ class: normalizeClass(point.dynamicXValue ? "text-blue-500" : ""),
142445
+ icon: "caret-down"
142446
+ }, null, 8, ["class"])
142447
+ ], 8, _hoisted_29$3)
142448
+ ]),
142449
+ default: withCtx(() => [
142450
+ createElementVNode("div", _hoisted_30$3, [
142451
+ createElementVNode("div", _hoisted_31$3, [
142452
+ createElementVNode("div", _hoisted_32$3, [
142453
+ createElementVNode("div", _hoisted_33$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.selectDynamicValue")), 1),
142454
+ createElementVNode("div", _hoisted_34$3, [
142455
+ createVNode(unref(NTree), {
142456
+ "block-line": "",
142457
+ class: "max-h-[300px]",
142458
+ data: dynamicValueTreeData.value,
142459
+ "render-label": renderDynamicValueTreeLabel,
142460
+ "selected-keys": [point.dynamicXValue?.path ?? ""],
142461
+ "onUpdate:selectedKeys": (keys) => handleDynamicValueSelect(keys, point, "x")
142462
+ }, null, 8, ["data", "selected-keys", "onUpdate:selectedKeys"])
141664
142463
  ])
141665
142464
  ]),
141666
- _: 2
141667
- }, 1032, ["show"])
141668
- ]),
141669
- _: 2
141670
- }, 1032, ["value", "onUpdate:value", "disabled"])
141671
- ]),
141672
- default: withCtx(() => [
141673
- createTextVNode(" " + toDisplayString(point.value), 1)
141674
- ]),
141675
- _: 2
141676
- }, 1024)) : (openBlock(), createBlock(unref(NInput), {
141677
- key: 1,
141678
- value: point.value,
141679
- "onUpdate:value": ($event) => point.value = $event,
141680
- class: "flex-1",
141681
- disabled: !!point.dynamicValue,
141682
- placeholder: "Value",
141683
- type: "text"
141684
- }, {
141685
- suffix: withCtx(() => [
141686
- createVNode(unref(NPopover), {
141687
- placement: "bottom",
141688
- show: activePopoverPoint.value === point,
141689
- trigger: "manual",
141690
- onClickoutside: _cache[8] || (_cache[8] = ($event) => activePopoverPoint.value = null)
141691
- }, {
141692
- trigger: withCtx(() => [
141693
- createElementVNode("div", {
141694
- class: "cursor-pointer flex items-center",
141695
- onClick: ($event) => handleDynamicValueClick(point)
141696
- }, [
141697
- createVNode(CIcon, {
141698
- class: normalizeClass(point.dynamicValue ? "text-blue-500" : ""),
141699
- icon: "caret-down"
141700
- }, null, 8, ["class"])
141701
- ], 8, _hoisted_34$3)
141702
- ]),
141703
- default: withCtx(() => [
141704
- createElementVNode("div", _hoisted_35$3, [
141705
- createElementVNode("div", _hoisted_36$3, [
142465
+ point.selectedXValue && point.arrayConfig && isArrayOrObject(point.selectedXValue) ? (openBlock(), createElementBlock("div", _hoisted_35$3, [
142466
+ createElementVNode("div", _hoisted_36$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.configureArrayObjectFields")), 1),
141706
142467
  createElementVNode("div", _hoisted_37$3, [
141707
- createElementVNode("div", _hoisted_38$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.selectDynamicValue")), 1),
141708
- createElementVNode("div", _hoisted_39$3, [
141709
- createVNode(unref(NTree), {
141710
- "block-line": "",
141711
- class: "max-h-[300px]",
141712
- data: dynamicValueTreeData.value,
141713
- "render-label": renderDynamicValueTreeLabel,
141714
- "selected-keys": [point.dynamicValue?.path ?? ""],
141715
- "onUpdate:selectedKeys": (keys) => handleDynamicValueSelect(keys, point)
141716
- }, null, 8, ["data", "selected-keys", "onUpdate:selectedKeys"])
141717
- ])
141718
- ]),
141719
- point.selectedValue && point.arrayConfig && (Array.isArray(point.selectedValue) || typeof point.selectedValue === "object" && point.selectedValue !== null) ? (openBlock(), createElementBlock("div", _hoisted_40$3, [
141720
- _cache[14] || (_cache[14] = createElementVNode("div", { class: "text-sm font-medium mb-2" }, "Configure Array/Object Fields", -1)),
141721
- createElementVNode("div", _hoisted_41$3, [
141722
- createElementVNode("div", null, [
141723
- _cache[12] || (_cache[12] = createElementVNode("label", { class: "block mb-1 text-sm" }, "Label Field", -1)),
141724
- createVNode(unref(NSelect), {
141725
- value: point.arrayConfig.labelField,
141726
- "onUpdate:value": [($event) => point.arrayConfig.labelField = $event, ($event) => updateDynamicValueExpression(point)],
141727
- options: getFieldOptions(point.selectedValue)
141728
- }, null, 8, ["value", "onUpdate:value", "options"])
141729
- ]),
141730
- createElementVNode("div", null, [
141731
- _cache[13] || (_cache[13] = createElementVNode("label", { class: "block mb-1 text-sm" }, "Value Field", -1)),
141732
- createVNode(unref(NSelect), {
141733
- value: point.arrayConfig.valueField,
141734
- "onUpdate:value": [($event) => point.arrayConfig.valueField = $event, ($event) => updateDynamicValueExpression(point)],
141735
- options: getFieldOptions(point.selectedValue)
141736
- }, null, 8, ["value", "onUpdate:value", "options"])
141737
- ])
141738
- ])
141739
- ])) : createCommentVNode("", true)
141740
- ])
142468
+ createElementVNode("div", null, [
142469
+ createElementVNode("label", _hoisted_38$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.labelField")), 1),
142470
+ createVNode(unref(NSelect), {
142471
+ value: point.arrayConfig.labelField,
142472
+ "onUpdate:value": [($event) => point.arrayConfig.labelField = $event, ($event) => updateXYDynamicValueExpression(point)],
142473
+ options: getFieldOptions(point.selectedXValue)
142474
+ }, null, 8, ["value", "onUpdate:value", "options"])
142475
+ ]),
142476
+ createElementVNode("div", null, [
142477
+ createElementVNode("label", _hoisted_39$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.xValueField")), 1),
142478
+ createVNode(unref(NSelect), {
142479
+ value: point.arrayConfig.xField,
142480
+ "onUpdate:value": [($event) => point.arrayConfig.xField = $event, ($event) => updateXYDynamicValueExpression(point)],
142481
+ options: getFieldOptions(point.selectedXValue)
142482
+ }, null, 8, ["value", "onUpdate:value", "options"])
142483
+ ]),
142484
+ createElementVNode("div", null, [
142485
+ createElementVNode("label", _hoisted_40$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.yValueField")), 1),
142486
+ createVNode(unref(NSelect), {
142487
+ value: point.arrayConfig.yField,
142488
+ "onUpdate:value": [($event) => point.arrayConfig.yField = $event, ($event) => updateXYDynamicValueExpression(point)],
142489
+ options: getFieldOptions(point.selectedXValue)
142490
+ }, null, 8, ["value", "onUpdate:value", "options"])
142491
+ ]),
142492
+ isActiveSeriesXYRChart.value ? (openBlock(), createElementBlock("div", _hoisted_41$3, [
142493
+ createElementVNode("label", _hoisted_42$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.rValueField")), 1),
142494
+ createVNode(unref(NSelect), {
142495
+ value: point.arrayConfig.rField,
142496
+ "onUpdate:value": [($event) => point.arrayConfig.rField = $event, ($event) => updateXYDynamicValueExpression(point)],
142497
+ options: getFieldOptions(point.selectedXValue)
142498
+ }, null, 8, ["value", "onUpdate:value", "options"])
142499
+ ])) : createCommentVNode("", true)
142500
+ ])
142501
+ ])) : createCommentVNode("", true)
141741
142502
  ])
141742
- ]),
141743
- _: 2
141744
- }, 1032, ["show"])
141745
- ]),
141746
- _: 2
141747
- }, 1032, ["value", "onUpdate:value", "disabled"]))
141748
- ]),
142503
+ ])
142504
+ ]),
142505
+ _: 2
142506
+ }, 1032, ["show"])
142507
+ ]),
142508
+ _: 2
142509
+ }, 1032, ["value", "onUpdate:value", "disabled"]),
142510
+ createVNode(unref(NInput), {
142511
+ value: point.yValue,
142512
+ "onUpdate:value": ($event) => point.yValue = $event,
142513
+ class: "flex-1",
142514
+ disabled: !!point.dynamicYValue,
142515
+ placeholder: "Y Value",
142516
+ type: "text"
142517
+ }, {
142518
+ suffix: withCtx(() => [
142519
+ createVNode(unref(NPopover), {
142520
+ placement: "bottom",
142521
+ show: activePopoverPoint.value === point && activePopoverField.value === "y",
142522
+ trigger: "manual",
142523
+ onClickoutside: closePopover
142524
+ }, {
142525
+ trigger: withCtx(() => [
142526
+ createElementVNode("div", {
142527
+ class: "cursor-pointer flex items-center",
142528
+ onClick: ($event) => handleDynamicValueClick(point, "y")
142529
+ }, [
142530
+ createVNode(CIcon, {
142531
+ class: normalizeClass(point.dynamicYValue ? "text-blue-500" : ""),
142532
+ icon: "caret-down"
142533
+ }, null, 8, ["class"])
142534
+ ], 8, _hoisted_43$3)
142535
+ ]),
142536
+ default: withCtx(() => [
142537
+ createElementVNode("div", _hoisted_44$3, [
142538
+ createElementVNode("div", _hoisted_45$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.selectDynamicValue")), 1),
142539
+ createVNode(unref(NTree), {
142540
+ "block-line": "",
142541
+ class: "max-h-[300px]",
142542
+ data: dynamicValueTreeData.value,
142543
+ "render-label": renderDynamicValueTreeLabel,
142544
+ "selected-keys": [point.dynamicYValue?.path ?? ""],
142545
+ "onUpdate:selectedKeys": (keys) => handleDynamicValueSelect(keys, point, "y")
142546
+ }, null, 8, ["data", "selected-keys", "onUpdate:selectedKeys"])
142547
+ ])
142548
+ ]),
142549
+ _: 2
142550
+ }, 1032, ["show"])
142551
+ ]),
142552
+ _: 2
142553
+ }, 1032, ["value", "onUpdate:value", "disabled"]),
142554
+ isActiveSeriesXYRChart.value ? (openBlock(), createBlock(unref(NInput), {
142555
+ key: 0,
142556
+ value: point.rValue,
142557
+ "onUpdate:value": ($event) => point.rValue = $event,
142558
+ class: "flex-1",
142559
+ disabled: !!point.dynamicRValue,
142560
+ placeholder: "Size (R)",
142561
+ type: "text"
142562
+ }, {
142563
+ suffix: withCtx(() => [
142564
+ createVNode(unref(NPopover), {
142565
+ placement: "bottom",
142566
+ show: activePopoverPoint.value === point && activePopoverField.value === "r",
142567
+ trigger: "manual",
142568
+ onClickoutside: closePopover
142569
+ }, {
142570
+ trigger: withCtx(() => [
142571
+ createElementVNode("div", {
142572
+ class: "cursor-pointer flex items-center",
142573
+ onClick: ($event) => handleDynamicValueClick(point, "r")
142574
+ }, [
142575
+ createVNode(CIcon, {
142576
+ class: normalizeClass(point.dynamicRValue ? "text-blue-500" : ""),
142577
+ icon: "caret-down"
142578
+ }, null, 8, ["class"])
142579
+ ], 8, _hoisted_46$3)
142580
+ ]),
142581
+ default: withCtx(() => [
142582
+ createElementVNode("div", _hoisted_47$3, [
142583
+ createElementVNode("div", _hoisted_48$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.selectDynamicValue")), 1),
142584
+ createVNode(unref(NTree), {
142585
+ "block-line": "",
142586
+ class: "max-h-[300px]",
142587
+ data: dynamicValueTreeData.value,
142588
+ "render-label": renderDynamicValueTreeLabel,
142589
+ "selected-keys": [point.dynamicRValue?.path ?? ""],
142590
+ "onUpdate:selectedKeys": (keys) => handleDynamicValueSelect(keys, point, "r")
142591
+ }, null, 8, ["data", "selected-keys", "onUpdate:selectedKeys"])
142592
+ ])
142593
+ ]),
142594
+ _: 2
142595
+ }, 1032, ["show"])
142596
+ ]),
142597
+ _: 2
142598
+ }, 1032, ["value", "onUpdate:value", "disabled"])) : createCommentVNode("", true),
141749
142599
  createVNode(CButton, {
141750
142600
  circle: "",
141751
142601
  class: "bg-error2 self-center",
141752
142602
  size: "small",
141753
- style: normalizeStyle({
141754
- "--n-border": "1px solid transparent",
141755
- "--n-border-disabled": "1px solid transparent",
141756
- "--n-border-focus": "1px solid transparent",
141757
- "--n-border-hover": "1px solid transparent",
141758
- "--n-border-pressed": "1px solid transparent",
141759
- "--n-color-focus": unref(themeVars).error2,
141760
- "--n-color-hover": unref(themeVars).error2,
141761
- "--n-color-disabled": unref(themeVars).error2,
141762
- "--n-color-pressed": unref(themeVars).error2
141763
- }),
142603
+ style: normalizeStyle(deleteButtonStyle.value),
141764
142604
  type: "error",
141765
142605
  onClick: ($event) => removeDataPoint(index)
141766
142606
  }, {
@@ -141776,7 +142616,7 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141776
142616
  }, 1032, ["style", "onClick"])
141777
142617
  ]);
141778
142618
  }), 128)),
141779
- createElementVNode("div", _hoisted_42$3, [
142619
+ createElementVNode("div", _hoisted_49$3, [
141780
142620
  createVNode(CButton, {
141781
142621
  class: "mt-2",
141782
142622
  "icon-placement": "left",
@@ -141796,11 +142636,62 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141796
142636
  })
141797
142637
  ])
141798
142638
  ]),
141799
- createElementVNode("div", _hoisted_43$3, [
141800
- createElementVNode("label", _hoisted_44$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.colorScheme")), 1),
142639
+ createElementVNode("div", _hoisted_50$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.chartSettings")), 1),
142640
+ createElementVNode("div", _hoisted_51$2, [
142641
+ createElementVNode("label", _hoisted_52$2, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.chartTitle")), 1),
142642
+ createVNode(unref(NInput), {
142643
+ value: chartTitle.value,
142644
+ "onUpdate:value": _cache[2] || (_cache[2] = ($event) => chartTitle.value = $event),
142645
+ type: "text"
142646
+ }, null, 8, ["value"])
142647
+ ]),
142648
+ ["bar", "line"].includes(primaryChartType.value) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
142649
+ createElementVNode("div", _hoisted_53$2, [
142650
+ createElementVNode("label", _hoisted_54$1, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.xAxisLabel")), 1),
142651
+ createVNode(unref(NInput), {
142652
+ value: xAxisLabel.value,
142653
+ "onUpdate:value": _cache[3] || (_cache[3] = ($event) => xAxisLabel.value = $event),
142654
+ type: "text"
142655
+ }, null, 8, ["value"])
142656
+ ]),
142657
+ createElementVNode("div", _hoisted_55$1, [
142658
+ createElementVNode("label", _hoisted_56$1, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.yAxisLabel")), 1),
142659
+ createVNode(unref(NInput), {
142660
+ value: yAxisLabel.value,
142661
+ "onUpdate:value": _cache[4] || (_cache[4] = ($event) => yAxisLabel.value = $event),
142662
+ type: "text"
142663
+ }, null, 8, ["value"])
142664
+ ]),
142665
+ createElementVNode("div", _hoisted_57$1, [
142666
+ createElementVNode("label", _hoisted_58$1, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.orientation")), 1),
142667
+ createVNode(unref(NSelect), {
142668
+ value: orientation.value,
142669
+ "onUpdate:value": _cache[5] || (_cache[5] = ($event) => orientation.value = $event),
142670
+ options: orientationOptions
142671
+ }, null, 8, ["value"])
142672
+ ])
142673
+ ], 64)) : createCommentVNode("", true),
142674
+ ["pie", "doughnut", "polarArea"].includes(primaryChartType.value) ? (openBlock(), createElementBlock("div", _hoisted_59$1, [
142675
+ createElementVNode("label", _hoisted_60$1, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.legendPosition")), 1),
142676
+ createVNode(unref(NSelect), {
142677
+ value: legendPosition.value,
142678
+ "onUpdate:value": _cache[6] || (_cache[6] = ($event) => legendPosition.value = $event),
142679
+ options: legendPositionOptions
142680
+ }, null, 8, ["value"])
142681
+ ])) : createCommentVNode("", true),
142682
+ ["line", "scatter", "area"].includes(primaryChartType.value) ? (openBlock(), createElementBlock("div", _hoisted_61$1, [
142683
+ createElementVNode("label", _hoisted_62$1, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.pointStyle")), 1),
142684
+ createVNode(unref(NSelect), {
142685
+ value: pointStyle.value,
142686
+ "onUpdate:value": _cache[7] || (_cache[7] = ($event) => pointStyle.value = $event),
142687
+ options: pointStyleOptions
142688
+ }, null, 8, ["value"])
142689
+ ])) : createCommentVNode("", true),
142690
+ createElementVNode("div", _hoisted_63$1, [
142691
+ createElementVNode("label", _hoisted_64$1, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.colorScheme")), 1),
141801
142692
  createVNode(unref(NSelect), {
141802
142693
  value: colorSchemeType.value,
141803
- "onUpdate:value": _cache[9] || (_cache[9] = ($event) => colorSchemeType.value = $event),
142694
+ "onUpdate:value": _cache[8] || (_cache[8] = ($event) => colorSchemeType.value = $event),
141804
142695
  class: "mb-2",
141805
142696
  options: [
141806
142697
  { label: unref(t)("canvasUI.canvasBuilder.dataCharts.useThemeColors"), value: "theme" },
@@ -141817,19 +142708,106 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141817
142708
  "onUpdate:palette": updateChartColors
141818
142709
  }, null, 8, ["allow-add", "allow-delete", "allow-edit", "initial-palette"]))
141819
142710
  ]),
141820
- createElementVNode("div", _hoisted_45$3, [
141821
- createElementVNode("label", _hoisted_46$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.animation")), 1),
142711
+ createElementVNode("div", _hoisted_65$1, [
142712
+ createElementVNode("label", _hoisted_66$1, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.animation")), 1),
141822
142713
  createVNode(unref(NSwitch), {
141823
142714
  value: enableAnimation.value,
141824
- "onUpdate:value": _cache[10] || (_cache[10] = ($event) => enableAnimation.value = $event)
142715
+ "onUpdate:value": _cache[9] || (_cache[9] = ($event) => enableAnimation.value = $event)
141825
142716
  }, null, 8, ["value"])
142717
+ ]),
142718
+ createElementVNode("div", _hoisted_67$1, [
142719
+ createElementVNode("label", _hoisted_68$1, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.percentDisplay")), 1),
142720
+ createElementVNode("div", _hoisted_69, [
142721
+ createVNode(unref(NSwitch), {
142722
+ value: percentDisplay.value,
142723
+ "onUpdate:value": _cache[10] || (_cache[10] = ($event) => percentDisplay.value = $event)
142724
+ }, null, 8, ["value"]),
142725
+ createElementVNode("span", _hoisted_70, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.percentDisplayHint")), 1)
142726
+ ])
142727
+ ]),
142728
+ createElementVNode("div", _hoisted_71, [
142729
+ createElementVNode("label", _hoisted_72, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.viewModeControls")), 1),
142730
+ createElementVNode("div", _hoisted_73, [
142731
+ createElementVNode("div", _hoisted_74, [
142732
+ createVNode(unref(NSwitch), {
142733
+ value: enableFullscreenBtn.value,
142734
+ "onUpdate:value": _cache[11] || (_cache[11] = ($event) => enableFullscreenBtn.value = $event)
142735
+ }, null, 8, ["value"]),
142736
+ createElementVNode("span", _hoisted_75, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.enableFullscreenBtn")), 1)
142737
+ ]),
142738
+ createVNode(unref(NTooltip), {
142739
+ disabled: !isMultiSeries.value,
142740
+ trigger: "hover"
142741
+ }, {
142742
+ trigger: withCtx(() => [
142743
+ createElementVNode("div", {
142744
+ class: normalizeClass(["flex items-center gap-2", { "opacity-50 cursor-not-allowed": isMultiSeries.value }])
142745
+ }, [
142746
+ createVNode(unref(NSwitch), {
142747
+ value: enableChartTypeSwitcher.value,
142748
+ "onUpdate:value": _cache[12] || (_cache[12] = ($event) => enableChartTypeSwitcher.value = $event),
142749
+ disabled: isMultiSeries.value
142750
+ }, null, 8, ["value", "disabled"]),
142751
+ createElementVNode("span", _hoisted_76, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.enableChartTypeSwitcher")), 1)
142752
+ ], 2)
142753
+ ]),
142754
+ default: withCtx(() => [
142755
+ createTextVNode(" " + toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.chartTypeSwitcherMultiSeriesDisabled")), 1)
142756
+ ]),
142757
+ _: 1
142758
+ }, 8, ["disabled"]),
142759
+ createElementVNode("div", _hoisted_77, [
142760
+ createVNode(unref(NSwitch), {
142761
+ value: enableDataEntry.value,
142762
+ "onUpdate:value": _cache[13] || (_cache[13] = ($event) => enableDataEntry.value = $event)
142763
+ }, null, 8, ["value"]),
142764
+ createElementVNode("span", _hoisted_78, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.enableDataEntry")), 1)
142765
+ ])
142766
+ ])
142767
+ ]),
142768
+ createElementVNode("div", _hoisted_79, [
142769
+ createElementVNode("label", _hoisted_80, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.chartSize")), 1),
142770
+ createElementVNode("div", _hoisted_81, [
142771
+ createElementVNode("div", _hoisted_82, [
142772
+ createElementVNode("label", _hoisted_83, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.height")), 1),
142773
+ createVNode(unref(NInputNumber), {
142774
+ value: chartHeight.value,
142775
+ "onUpdate:value": _cache[14] || (_cache[14] = ($event) => chartHeight.value = $event),
142776
+ class: "flex-1",
142777
+ max: 1e3,
142778
+ min: 100,
142779
+ step: 10
142780
+ }, {
142781
+ suffix: withCtx(() => _cache[17] || (_cache[17] = [
142782
+ createTextVNode("px")
142783
+ ])),
142784
+ _: 1
142785
+ }, 8, ["value"])
142786
+ ]),
142787
+ createElementVNode("div", _hoisted_84, [
142788
+ createElementVNode("label", _hoisted_85, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.width")), 1),
142789
+ createVNode(unref(NInputNumber), {
142790
+ value: chartWidth.value,
142791
+ "onUpdate:value": _cache[15] || (_cache[15] = ($event) => chartWidth.value = $event),
142792
+ class: "flex-1",
142793
+ max: 100,
142794
+ min: 10,
142795
+ step: 5
142796
+ }, {
142797
+ suffix: withCtx(() => _cache[18] || (_cache[18] = [
142798
+ createTextVNode("%")
142799
+ ])),
142800
+ _: 1
142801
+ }, 8, ["value"])
142802
+ ])
142803
+ ])
141826
142804
  ])
141827
142805
  ])
141828
142806
  ])
141829
142807
  ]),
141830
- createElementVNode("div", _hoisted_47$3, [
141831
- createElementVNode("div", _hoisted_48$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.preview")), 1),
141832
- createElementVNode("div", _hoisted_49$3, [
142808
+ createElementVNode("div", _hoisted_86, [
142809
+ createElementVNode("div", _hoisted_87, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.preview")), 1),
142810
+ createElementVNode("div", _hoisted_88, [
141833
142811
  createVNode(unref(NCard), { bordered: false }, {
141834
142812
  default: withCtx(() => [
141835
142813
  (openBlock(), createBlock(RawDataCharts, {
@@ -141837,7 +142815,8 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141837
142815
  data: {
141838
142816
  ...previewData.value,
141839
142817
  context: unref(crmShape)
141840
- }
142818
+ },
142819
+ "is-preview": ""
141841
142820
  }, null, 8, ["data"]))
141842
142821
  ]),
141843
142822
  _: 1
@@ -141894,6 +142873,12 @@ const _sfc_main$2D = /* @__PURE__ */ defineComponent({
141894
142873
  usedInSectionId,
141895
142874
  when_used_in_section
141896
142875
  });
142876
+ const canEditChart = computed(() => {
142877
+ if (mode.value === CanvasBuilderMode.ADMIN) {
142878
+ return true;
142879
+ }
142880
+ return props.data?.view_controls?.enable_data_entry ?? false;
142881
+ });
141897
142882
  onMounted(() => {
141898
142883
  if (justAddedComponentId.value === props.id) {
141899
142884
  setComponentEditMode(ComponentTypes.DataCharts, props.id);
@@ -141905,7 +142890,7 @@ const _sfc_main$2D = /* @__PURE__ */ defineComponent({
141905
142890
  unref(shouldDisplayPlaceholderComponent)(unref(isEditMode), unref(mode), _ctx.visible) ? (openBlock(), createBlock(PlaceholderComponent, {
141906
142891
  key: 0,
141907
142892
  name: _ctx.tracking_id
141908
- }, null, 8, ["name"])) : unref(isEditMode) && !unref(isViewOnlyMode) && unref(componentPermissions).hasSomethingEditable ? (openBlock(), createBlock(_sfc_main$34, {
142893
+ }, null, 8, ["name"])) : unref(isEditMode) && !unref(isViewOnlyMode) && unref(componentPermissions).hasSomethingEditable && canEditChart.value ? (openBlock(), createBlock(_sfc_main$34, {
141909
142894
  key: 1,
141910
142895
  id: unref(id),
141911
142896
  active: unref(componentEditMode) && unref(componentEditMode)?.id === unref(id),
@@ -141927,6 +142912,7 @@ const _sfc_main$2D = /* @__PURE__ */ defineComponent({
141927
142912
  key: key.value,
141928
142913
  class: "ma-1",
141929
142914
  data: _ctx.data,
142915
+ "is-edit-mode": "",
141930
142916
  style: normalizeStyle(_ctx.style)
141931
142917
  }, null, 8, ["data", "style"])) : (openBlock(), createBlock(_sfc_main$2G, {
141932
142918
  key: 1,
@@ -141938,8 +142924,9 @@ const _sfc_main$2D = /* @__PURE__ */ defineComponent({
141938
142924
  }, 8, ["id", "active", "duplicate", "edit", "remove", "selected", "settings", "stylable"])) : (openBlock(), createBlock(RawDataCharts, {
141939
142925
  key: 2,
141940
142926
  data: _ctx.data,
142927
+ "is-edit-mode": unref(isEditMode),
141941
142928
  style: normalizeStyle(_ctx.style)
141942
- }, null, 8, ["data", "style"])),
142929
+ }, null, 8, ["data", "is-edit-mode", "style"])),
141943
142930
  unref(componentEditMode) && unref(componentEditMode).id === unref(id) ? (openBlock(), createBlock(_sfc_main$2E, {
141944
142931
  key: 3,
141945
142932
  id: unref(id),
@@ -181695,5 +182682,5 @@ const localeNames = {
181695
182682
  };
181696
182683
  const localeDropdownOptions = supportedLocales.map((locale) => ({ key: locale, name: localeNames[locale] }));
181697
182684
 
181698
- 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, 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, 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 };
182685
+ 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 };
181699
182686
  //# sourceMappingURL=canvas-ui.js.map