@builder.io/sdk-vue 5.2.11 → 5.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/lib/browser/{awaiter-MAyQwJUp.cjs → awaiter-Ja_QJKsd.cjs} +1 -1
  2. package/lib/browser/{awaiter-quz2SFrg.js → awaiter-PAIWzl07.js} +1 -1
  3. package/lib/browser/{block-wrapper-vBu_Ygm8.cjs → block-wrapper-CeRmNoq0.cjs} +1 -1
  4. package/lib/browser/{block-wrapper-SCckT0M5.js → block-wrapper-b4XqsSBv.js} +3 -3
  5. package/lib/browser/blocks/personalization-container/helpers/inlined-fns.d.ts +8 -2
  6. package/lib/browser/blocks/personalization-container/personalization-container.vue.d.ts +3 -1
  7. package/lib/browser/{component-ref-HWBSC66Y.cjs → component-ref-MNrE4dOw.cjs} +1 -1
  8. package/lib/browser/{component-ref-owc3e0h8.js → component-ref-RNH8q_Ct.js} +4 -4
  9. package/lib/browser/constants/sdk-version.d.ts +1 -1
  10. package/lib/browser/{get-block-properties-odFddSWh.cjs → get-block-properties-C1S41sZd.cjs} +1 -1
  11. package/lib/browser/{get-block-properties-Hny6jqGG.js → get-block-properties-aY0jarAY.js} +1 -1
  12. package/lib/browser/helpers/css.d.ts +2 -0
  13. package/lib/browser/helpers/studio-user-attributes.d.ts +6 -0
  14. package/lib/browser/helpers/user-attributes.d.ts +6 -2
  15. package/lib/browser/{index-7bXAC1Q8.js → index-Q7tlS2c1.js} +768 -716
  16. package/lib/browser/{index-uDRmkrr4.cjs → index-ohjTQ4ru.cjs} +53 -35
  17. package/lib/browser/index.cjs +1 -1
  18. package/lib/browser/index.mjs +4 -4
  19. package/lib/browser/{live-edit-x4eHrcJh.js → live-edit-zIE57v1M.js} +1 -1
  20. package/lib/browser/{live-edit-AUagAEej.cjs → live-edit-zUS6r7uc.cjs} +1 -1
  21. package/lib/browser/{repeated-block-ZGXPYgA8.cjs → repeated-block-XFgvkCPh.cjs} +1 -1
  22. package/lib/browser/{repeated-block-uVi8A50N.js → repeated-block-qKqkpCg_.js} +2 -2
  23. package/lib/browser/{style-wrapper-usFESjt5.js → style-wrapper-nYNv2BeU.js} +72 -66
  24. package/lib/browser/style-wrapper-zgP9Exwf.cjs +1 -0
  25. package/lib/browser/style.css +1 -1
  26. package/lib/edge/{awaiter-RSfMls5f.js → awaiter-Mugw26Wi.js} +1 -1
  27. package/lib/edge/{awaiter-zow2zgzw.cjs → awaiter-N8Gr0F79.cjs} +1 -1
  28. package/lib/{node/block-wrapper-PUFgSKq_.js → edge/block-wrapper-0c3wPm9h.js} +3 -3
  29. package/lib/edge/{block-wrapper-4qKpWsP8.cjs → block-wrapper-KQrzy0mA.cjs} +1 -1
  30. package/lib/edge/blocks/personalization-container/helpers/inlined-fns.d.ts +8 -2
  31. package/lib/edge/blocks/personalization-container/personalization-container.vue.d.ts +3 -1
  32. package/lib/edge/{component-ref-1iPK0xOE.js → component-ref-R_Q4TOb7.js} +4 -4
  33. package/lib/edge/{component-ref-WdOIbmOU.cjs → component-ref-e3xYDpNG.cjs} +1 -1
  34. package/lib/edge/constants/sdk-version.d.ts +1 -1
  35. package/lib/edge/{get-block-properties-bMVCvUX0.js → get-block-properties-TtYKEgAO.js} +1 -1
  36. package/lib/edge/{get-block-properties-2E03ld67.cjs → get-block-properties-d0E5ZkZj.cjs} +1 -1
  37. package/lib/edge/helpers/css.d.ts +2 -0
  38. package/lib/edge/helpers/studio-user-attributes.d.ts +6 -0
  39. package/lib/edge/helpers/user-attributes.d.ts +6 -2
  40. package/lib/edge/{index-Bgm0yCrN.js → index-5jMXhHfs.js} +1310 -1258
  41. package/lib/edge/{index-LWGIJNVx.cjs → index-_dQKp9LH.cjs} +61 -43
  42. package/lib/edge/index.cjs +1 -1
  43. package/lib/edge/index.mjs +3 -3
  44. package/lib/edge/{live-edit-tegdYGJO.js → live-edit-7Dc7Q2yS.js} +1 -1
  45. package/lib/{node/live-edit-xPik2aUh.cjs → edge/live-edit-oGxYZa_V.cjs} +1 -1
  46. package/lib/edge/{repeated-block-yZJM5I60.js → repeated-block-GESRSjst.js} +2 -2
  47. package/lib/edge/{repeated-block--MhEsXmR.cjs → repeated-block-K9b4UbOC.cjs} +1 -1
  48. package/lib/edge/style-wrapper-dmNB8lmp.cjs +1 -0
  49. package/lib/edge/{style-wrapper-i8R7NpdY.js → style-wrapper-rh9YxCiw.js} +72 -66
  50. package/lib/edge/style.css +1 -1
  51. package/lib/node/{awaiter-Vwjft2v-.cjs → awaiter-0EtumND-.cjs} +1 -1
  52. package/lib/node/{awaiter-o3ynOQKr.js → awaiter-9zCUlZB9.js} +1 -1
  53. package/lib/node/{block-wrapper-KX1-Y2Oq.cjs → block-wrapper-c0gZ4j4I.cjs} +1 -1
  54. package/lib/{edge/block-wrapper-GT2d4luN.js → node/block-wrapper-s8zLAxlL.js} +3 -3
  55. package/lib/node/blocks/personalization-container/helpers/inlined-fns.d.ts +8 -2
  56. package/lib/node/blocks/personalization-container/personalization-container.vue.d.ts +3 -1
  57. package/lib/node/{component-ref-HmJKie9z.js → component-ref-PPsTcld8.js} +5 -5
  58. package/lib/node/{component-ref-o3vjSyAQ.cjs → component-ref-lWzA5guw.cjs} +1 -1
  59. package/lib/node/constants/sdk-version.d.ts +1 -1
  60. package/lib/node/{get-block-properties-DGfMhs4M.js → get-block-properties-AwCMGMPi.js} +2 -2
  61. package/lib/node/{get-block-properties-2yGkQVh7.cjs → get-block-properties-DKvJS4pV.cjs} +1 -1
  62. package/lib/node/helpers/css.d.ts +2 -0
  63. package/lib/node/helpers/studio-user-attributes.d.ts +6 -0
  64. package/lib/node/helpers/user-attributes.d.ts +6 -2
  65. package/lib/node/{index-JQgNoVXs.js → index-DWznrY3w.js} +675 -623
  66. package/lib/node/{index-7xT7wMXt.cjs → index-funKFPCj.cjs} +53 -35
  67. package/lib/node/index.cjs +1 -1
  68. package/lib/node/index.mjs +6 -6
  69. package/lib/node/init.cjs +1 -1
  70. package/lib/node/init.mjs +1 -1
  71. package/lib/{edge/live-edit-oLYhcuYs.cjs → node/live-edit-Bw84zZeV.cjs} +1 -1
  72. package/lib/node/{live-edit-hxNZMHld.js → live-edit-GVvl4apL.js} +1 -1
  73. package/lib/node/{repeated-block-PvGSbsHD.js → repeated-block-SP8WaEQp.js} +2 -2
  74. package/lib/node/{repeated-block-LHiXlO3e.cjs → repeated-block-ux8wkluB.cjs} +1 -1
  75. package/lib/node/{should-force-browser-runtime-in-node-aeKfQiEQ.cjs → should-force-browser-runtime-in-node-5MPjjLJt.cjs} +1 -1
  76. package/lib/node/{should-force-browser-runtime-in-node-ooRgTwqs.js → should-force-browser-runtime-in-node-nOG6zu2k.js} +1 -1
  77. package/lib/node/{style-wrapper-U-7exIwN.js → style-wrapper-5BoLwggo.js} +70 -64
  78. package/lib/node/style-wrapper-aKufn4zn.cjs +1 -0
  79. package/lib/node/style.css +1 -1
  80. package/package.json +1 -1
  81. package/lib/browser/style-wrapper-C_c9B5_Y.cjs +0 -1
  82. package/lib/edge/style-wrapper-8JiLG-FF.cjs +0 -1
  83. package/lib/node/style-wrapper-3l8xaVr4.cjs +0 -1
@@ -1 +1 @@
1
- var t=require("./style.css");Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-uDRmkrr4.cjs");exports.Blocks=e.Blocks;exports.BuilderContext=e.BuilderContext;exports.Button=e.Button;exports.Columns=e.Columns;exports.Content=e.ContentVariants;exports.Fragment=e.Fragment;exports.Image=e.Image;exports.Section=e.Section;exports.Symbol=e.Symbol;exports.Text=e.Text;exports.Video=e.Video;exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.registerAction=e.registerAction;exports.setClientUserAttributes=e.setClientUserAttributes;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
1
+ var t=require("./style.css");Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-ohjTQ4ru.cjs");exports.Blocks=e.Blocks;exports.BuilderContext=e.BuilderContext;exports.Button=e.Button;exports.Columns=e.Columns;exports.Content=e.ContentVariants;exports.Fragment=e.Fragment;exports.Image=e.Image;exports.Section=e.Section;exports.Symbol=e.Symbol;exports.Text=e.Text;exports.Video=e.Video;exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.registerAction=e.registerAction;exports.setClientUserAttributes=e.setClientUserAttributes;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
@@ -1,5 +1,5 @@
1
1
  import "./style.css";
2
- import { p as a, b as r, m as i, C as o, q as n, F as c, I as g, S as m, n as u, o as l, V as d, E as C, t as p, D as E, G as b, H as B, y as S, i as f, r as h, u as x, v as y, s as A, x as P, A as k, z as v } from "./index-7bXAC1Q8.js";
2
+ import { q as a, b as r, n as i, C as o, r as n, F as c, I as g, S as u, o as l, p as m, V as d, G as C, u as p, E, H as b, J as B, z as S, i as f, t as h, v as x, x as y, s as A, y as P, D as k, A as v } from "./index-Q7tlS2c1.js";
3
3
  export {
4
4
  a as Blocks,
5
5
  r as BuilderContext,
@@ -8,9 +8,9 @@ export {
8
8
  n as Content,
9
9
  c as Fragment,
10
10
  g as Image,
11
- m as Section,
12
- u as Symbol,
13
- l as Text,
11
+ u as Section,
12
+ l as Symbol,
13
+ m as Text,
14
14
  d as Video,
15
15
  C as _processContentResult,
16
16
  p as createRegisterComponentMessage,
@@ -1,7 +1,7 @@
1
1
  import "./style.css";
2
2
  import { defineComponent as o, openBlock as r, createBlock as n, resolveDynamicComponent as i, mergeProps as s, withCtx as p, renderSlot as a } from "vue";
3
3
  import { f as c } from "./find-block-4FksmtpZ.js";
4
- import { b as d, _ as m } from "./index-7bXAC1Q8.js";
4
+ import { b as d, _ as m } from "./index-Q7tlS2c1.js";
5
5
  const l = o({
6
6
  name: "live-edit",
7
7
  props: ["id", "attributes", "Wrapper"],
@@ -1 +1 @@
1
- var l=require("./style.css");Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),r=require("./find-block-FHyxDYzT.cjs"),n=require("./index-uDRmkrr4.cjs"),i=t.defineComponent({name:"live-edit",props:["id","attributes","Wrapper"],inject:{context:n.BuilderContext.key},computed:{block(){return r.findBlockById(this.context.content,this.id)},options(){var e,o;return((o=(e=this.block)==null?void 0:e.component)==null?void 0:o.options)||{}}}});function s(e,o,p,u,d,a){return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.Wrapper),t.mergeProps({attributes:e.attributes},e.options),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16,["attributes"])}const c=n._export_sfc(i,[["render",s]]);exports.default=c;
1
+ var l=require("./style.css");Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),r=require("./find-block-FHyxDYzT.cjs"),n=require("./index-ohjTQ4ru.cjs"),i=t.defineComponent({name:"live-edit",props:["id","attributes","Wrapper"],inject:{context:n.BuilderContext.key},computed:{block(){return r.findBlockById(this.context.content,this.id)},options(){var e,o;return((o=(e=this.block)==null?void 0:e.component)==null?void 0:o.options)||{}}}});function s(e,o,p,u,d,a){return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.Wrapper),t.mergeProps({attributes:e.attributes},e.options),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16,["attributes"])}const c=n._export_sfc(i,[["render",s]]);exports.default=c;
@@ -1 +1 @@
1
- var k=require("./style.css");Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),t=require("./index-uDRmkrr4.cjs"),r=()=>Promise.resolve().then(()=>require("./index-uDRmkrr4.cjs")).then(e=>e.block).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component Block at ../block.vue",e),e}),c=o.defineComponent({name:"repeated-block",components:{Block:o.defineAsyncComponent(r)},props:["repeatContext","block","registeredComponents","linkComponent"],data(){return{store:this.repeatContext}},provide(){const e=this;return{[t.BuilderContext.key]:e.store}},watch:{onUpdateHook0:{handler(){this.store=this.repeatContext},immediate:!0}},computed:{onUpdateHook0(){return{0:this.repeatContext}}}});function s(e,p,l,a,d,m){const n=o.resolveComponent("Block");return o.openBlock(),o.createBlock(n,{block:e.block,context:e.store,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},null,8,["block","context","registeredComponents","linkComponent"])}const i=t._export_sfc(c,[["render",s]]);exports.default=i;
1
+ var k=require("./style.css");Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),t=require("./index-ohjTQ4ru.cjs"),r=()=>Promise.resolve().then(()=>require("./index-ohjTQ4ru.cjs")).then(e=>e.block).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component Block at ../block.vue",e),e}),c=o.defineComponent({name:"repeated-block",components:{Block:o.defineAsyncComponent(r)},props:["repeatContext","block","registeredComponents","linkComponent"],data(){return{store:this.repeatContext}},provide(){const e=this;return{[t.BuilderContext.key]:e.store}},watch:{onUpdateHook0:{handler(){this.store=this.repeatContext},immediate:!0}},computed:{onUpdateHook0(){return{0:this.repeatContext}}}});function s(e,p,l,a,d,m){const n=o.resolveComponent("Block");return o.openBlock(),o.createBlock(n,{block:e.block,context:e.store,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},null,8,["block","context","registeredComponents","linkComponent"])}const i=t._export_sfc(c,[["render",s]]);exports.default=i;
@@ -1,7 +1,7 @@
1
1
  import "./style.css";
2
2
  import { defineComponent as t, defineAsyncComponent as n, resolveComponent as r, openBlock as p, createBlock as s } from "vue";
3
- import { b as c, _ as i } from "./index-7bXAC1Q8.js";
4
- const a = () => import("./index-7bXAC1Q8.js").then((e) => e.K).then((e) => e.default).catch((e) => {
3
+ import { b as c, _ as i } from "./index-Q7tlS2c1.js";
4
+ const a = () => import("./index-Q7tlS2c1.js").then((e) => e.L).then((e) => e.default).catch((e) => {
5
5
  throw console.error(
6
6
  "Error while attempting to dynamically import component Block at ../block.vue",
7
7
  e
@@ -1,10 +1,10 @@
1
1
  import "./style.css";
2
- import { defineComponent as E, resolveComponent as x, openBlock as y, createBlock as $, createCommentVNode as Q, createElementBlock as z, Fragment as G } from "vue";
3
- import { c as A, T as w, d as C, f as N, h as l, j as u, k as j, _ as I, l as H, b as R } from "./index-7bXAC1Q8.js";
4
- import { f as U } from "./find-block-4FksmtpZ.js";
5
- const W = E({
2
+ import { defineComponent as E, resolveComponent as x, openBlock as y, createBlock as g, createCommentVNode as N, createElementBlock as G, Fragment as H } from "vue";
3
+ import { c as R, T as w, d as C, f as W, h as j, j as l, k as u, l as z, _ as Q, m as U, b as D } from "./index-Q7tlS2c1.js";
4
+ import { f as F } from "./find-block-4FksmtpZ.js";
5
+ const L = E({
6
6
  name: "block-styles",
7
- components: { InlinedStyles: A },
7
+ components: { InlinedStyles: R },
8
8
  props: ["block", "context"],
9
9
  data() {
10
10
  return { TARGET: w };
@@ -15,85 +15,88 @@ const W = E({
15
15
  return C(e.hide) ? !e.hide : C(e.show) ? e.show : !0;
16
16
  },
17
17
  css() {
18
- var h, B, f, v, b;
19
- const e = this.block, s = e.responsiveStyles, t = this.context.content, o = N(
20
- ((h = t == null ? void 0 : t.meta) == null ? void 0 : h.breakpoints) || {}
21
- ), p = !!((f = (B = t == null ? void 0 : t.meta) == null ? void 0 : B.breakpoints) != null && f.xsmall), i = s == null ? void 0 : s.large, n = s == null ? void 0 : s.medium, a = s == null ? void 0 : s.small, r = s == null ? void 0 : s.xsmall, d = e.id;
18
+ var S, B, f, v, b, $;
19
+ const e = this.block, s = W(
20
+ e.responsiveStyles,
21
+ ((S = e.component) == null ? void 0 : S.name) === "Image"
22
+ ), t = this.context.content, o = j(
23
+ ((B = t == null ? void 0 : t.meta) == null ? void 0 : B.breakpoints) || {}
24
+ ), p = !!((v = (f = t == null ? void 0 : t.meta) == null ? void 0 : f.breakpoints) != null && v.xsmall), i = s == null ? void 0 : s.large, n = s == null ? void 0 : s.medium, a = s == null ? void 0 : s.small, c = s == null ? void 0 : s.xsmall, d = e.id;
22
25
  if (!d)
23
26
  return "";
24
- const g = i ? l({
27
+ const P = i ? l({
25
28
  className: d,
26
29
  styles: i
27
- }) : "", P = n ? l({
30
+ }) : "", T = n ? l({
28
31
  className: d,
29
32
  styles: n,
30
33
  mediaQuery: u(
31
34
  "medium",
32
35
  o
33
36
  )
34
- }) : "", T = a ? l({
37
+ }) : "", _ = a ? l({
35
38
  className: d,
36
39
  styles: a,
37
40
  mediaQuery: u(
38
41
  "small",
39
42
  o
40
43
  )
41
- }) : "", m = r && p ? l({
44
+ }) : "", m = c && p ? l({
42
45
  className: d,
43
- styles: r,
46
+ styles: c,
44
47
  mediaQuery: u(
45
48
  "xsmall",
46
49
  o
47
50
  )
48
- }) : "", c = e.animations && e.animations.find((k) => k.trigger === "hover");
49
- let S = "";
50
- if (c) {
51
- const k = ((b = (v = c.steps) == null ? void 0 : v[1]) == null ? void 0 : b.styles) || {};
52
- S = l({
51
+ }) : "", r = e.animations && e.animations.find((k) => k.trigger === "hover");
52
+ let h = "";
53
+ if (r) {
54
+ const k = (($ = (b = r.steps) == null ? void 0 : b[1]) == null ? void 0 : $.styles) || {};
55
+ h = l({
53
56
  className: `${d}:hover`,
54
57
  styles: {
55
58
  ...k,
56
- transition: `all ${c.duration}s ${j(
57
- c.easing
59
+ transition: `all ${r.duration}s ${z(
60
+ r.easing
58
61
  )}`,
59
- transitionDelay: c.delay ? `${c.delay}s` : "0s"
62
+ transitionDelay: r.delay ? `${r.delay}s` : "0s"
60
63
  }
61
64
  }) || "";
62
65
  }
63
66
  return [
64
- g,
65
67
  P,
66
68
  T,
69
+ _,
67
70
  m,
68
- S
71
+ h
69
72
  ].join(" ");
70
73
  }
71
74
  }
72
75
  });
73
- function D(e, s, t, o, p, i) {
76
+ function X(e, s, t, o, p, i) {
74
77
  const n = x("InlinedStyles");
75
- return e.TARGET !== "reactNative" && e.css && e.canShowBlock ? (y(), $(n, {
78
+ return e.TARGET !== "reactNative" && e.css && e.canShowBlock ? (y(), g(n, {
76
79
  key: 0,
77
80
  id: "builderio-block",
78
81
  styles: e.css,
79
82
  nonce: e.context.nonce
80
- }, null, 8, ["styles", "nonce"])) : Q("", !0);
83
+ }, null, 8, ["styles", "nonce"])) : N("", !0);
81
84
  }
82
- const F = /* @__PURE__ */ I(W, [["render", D]]), L = E({
85
+ const K = /* @__PURE__ */ Q(L, [["render", X]]), M = E({
83
86
  name: "live-edit-block-styles",
84
- components: { InlinedStyles: A },
87
+ components: { InlinedStyles: R },
85
88
  props: ["contextProvider", "id"],
86
89
  data() {
87
90
  return { TARGET: w };
88
91
  },
89
92
  computed: {
90
93
  block() {
91
- return U(this.contextProvider.content, this.id);
94
+ return F(this.contextProvider.content, this.id);
92
95
  },
93
96
  processedBlock() {
94
97
  var t;
95
98
  const e = this.block;
96
- return e ? (t = e.repeat) != null && t.collection ? e : H({
99
+ return e ? (t = e.repeat) != null && t.collection ? e : U({
97
100
  block: e,
98
101
  localState: this.contextProvider.localState,
99
102
  rootState: this.contextProvider.rootState,
@@ -106,45 +109,48 @@ const F = /* @__PURE__ */ I(W, [["render", D]]), L = E({
106
109
  return C((e = this.processedBlock) == null ? void 0 : e.hide) ? !((s = this.processedBlock) != null && s.hide) : C((t = this.processedBlock) == null ? void 0 : t.show) ? (o = this.processedBlock) == null ? void 0 : o.show : !0;
107
110
  },
108
111
  css() {
109
- var S, h, B, f, v, b, k;
110
- const e = (S = this.processedBlock) == null ? void 0 : S.responsiveStyles, s = this.contextProvider.content, t = N(
111
- ((h = s == null ? void 0 : s.meta) == null ? void 0 : h.breakpoints) || {}
112
- ), o = !!((f = (B = s == null ? void 0 : s.meta) == null ? void 0 : B.breakpoints) != null && f.xsmall), p = e == null ? void 0 : e.large, i = e == null ? void 0 : e.medium, n = e == null ? void 0 : e.small, a = e == null ? void 0 : e.xsmall, r = (v = this.processedBlock) == null ? void 0 : v.id;
113
- if (!r)
112
+ var h, S, B, f, v, b, $, k, A;
113
+ const e = W(
114
+ (h = this.processedBlock) == null ? void 0 : h.responsiveStyles,
115
+ ((B = (S = this.processedBlock) == null ? void 0 : S.component) == null ? void 0 : B.name) === "Image"
116
+ ), s = this.contextProvider.content, t = j(
117
+ ((f = s == null ? void 0 : s.meta) == null ? void 0 : f.breakpoints) || {}
118
+ ), o = !!((b = (v = s == null ? void 0 : s.meta) == null ? void 0 : v.breakpoints) != null && b.xsmall), p = e == null ? void 0 : e.large, i = e == null ? void 0 : e.medium, n = e == null ? void 0 : e.small, a = e == null ? void 0 : e.xsmall, c = ($ = this.processedBlock) == null ? void 0 : $.id;
119
+ if (!c)
114
120
  return "";
115
121
  const d = p ? l({
116
- className: r,
122
+ className: c,
117
123
  styles: p
118
- }) : "", g = i ? l({
119
- className: r,
124
+ }) : "", P = i ? l({
125
+ className: c,
120
126
  styles: i,
121
127
  mediaQuery: u(
122
128
  "medium",
123
129
  t
124
130
  )
125
- }) : "", P = n ? l({
126
- className: r,
131
+ }) : "", T = n ? l({
132
+ className: c,
127
133
  styles: n,
128
134
  mediaQuery: u(
129
135
  "small",
130
136
  t
131
137
  )
132
- }) : "", T = a && o ? l({
133
- className: r,
138
+ }) : "", _ = a && o ? l({
139
+ className: c,
134
140
  styles: a,
135
141
  mediaQuery: u(
136
142
  "xsmall",
137
143
  t
138
144
  )
139
- }) : "", m = this.processedBlock.animations && this.processedBlock.animations.find((_) => _.trigger === "hover");
140
- let c = "";
145
+ }) : "", m = this.processedBlock.animations && this.processedBlock.animations.find((I) => I.trigger === "hover");
146
+ let r = "";
141
147
  if (m) {
142
- const _ = ((k = (b = m.steps) == null ? void 0 : b[1]) == null ? void 0 : k.styles) || {};
143
- c = l({
144
- className: `${r}:hover`,
148
+ const I = ((A = (k = m.steps) == null ? void 0 : k[1]) == null ? void 0 : A.styles) || {};
149
+ r = l({
150
+ className: `${c}:hover`,
145
151
  styles: {
146
- ..._,
147
- transition: `all ${m.duration}s ${j(
152
+ ...I,
153
+ transition: `all ${m.duration}s ${z(
148
154
  m.easing
149
155
  )}`,
150
156
  transitionDelay: m.delay ? `${m.delay}s` : "0s"
@@ -153,58 +159,58 @@ const F = /* @__PURE__ */ I(W, [["render", D]]), L = E({
153
159
  }
154
160
  return [
155
161
  d,
156
- g,
157
162
  P,
158
163
  T,
159
- c
164
+ _,
165
+ r
160
166
  ].join(" ");
161
167
  }
162
168
  }
163
169
  });
164
- function X(e, s, t, o, p, i) {
170
+ function V(e, s, t, o, p, i) {
165
171
  const n = x("InlinedStyles");
166
- return e.TARGET === "rsc" && e.css && e.canShowBlock ? (y(), $(n, {
172
+ return e.TARGET === "rsc" && e.css && e.canShowBlock ? (y(), g(n, {
167
173
  key: 0,
168
174
  id: "builderio-block",
169
175
  styles: e.css,
170
176
  nonce: e.contextProvider.nonce
171
- }, null, 8, ["styles", "nonce"])) : Q("", !0);
177
+ }, null, 8, ["styles", "nonce"])) : N("", !0);
172
178
  }
173
- const K = /* @__PURE__ */ I(L, [["render", X]]), M = E({
179
+ const q = /* @__PURE__ */ Q(M, [["render", V]]), J = E({
174
180
  name: "style-wrapper",
175
181
  components: {
176
- BlockStyles: F,
177
- LiveEditBlockStyles: K
182
+ BlockStyles: K,
183
+ LiveEditBlockStyles: q
178
184
  },
179
185
  props: ["block", "context"],
180
186
  data() {
181
187
  return { isClientEditing: !1, isHydrated: !1, TARGET: w };
182
188
  },
183
189
  inject: {
184
- contextProvider: R.key
190
+ contextProvider: D.key
185
191
  },
186
192
  mounted() {
187
193
  }
188
194
  });
189
- function V(e, s, t, o, p, i) {
195
+ function O(e, s, t, o, p, i) {
190
196
  const n = x("LiveEditBlockStyles"), a = x("BlockStyles");
191
- return e.isHydrated ? (y(), z(G, { key: 0 }, [
192
- e.TARGET === "rsc" && e.isClientEditing ? (y(), $(n, {
197
+ return e.isHydrated ? (y(), G(H, { key: 0 }, [
198
+ e.TARGET === "rsc" && e.isClientEditing ? (y(), g(n, {
193
199
  key: 0,
194
200
  id: e.block.id,
195
201
  contextProvider: e.contextProvider
196
- }, null, 8, ["id", "contextProvider"])) : (y(), $(a, {
202
+ }, null, 8, ["id", "contextProvider"])) : (y(), g(a, {
197
203
  key: 1,
198
204
  block: e.block,
199
205
  context: e.context
200
206
  }, null, 8, ["block", "context"]))
201
- ], 64)) : (y(), $(a, {
207
+ ], 64)) : (y(), g(a, {
202
208
  key: 1,
203
209
  block: e.block,
204
210
  context: e.context
205
211
  }, null, 8, ["block", "context"]));
206
212
  }
207
- const Z = /* @__PURE__ */ I(M, [["render", V]]);
213
+ const te = /* @__PURE__ */ Q(J, [["render", O]]);
208
214
  export {
209
- Z as default
215
+ te as default
210
216
  };
@@ -0,0 +1 @@
1
+ var F=require("./style.css");Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),s=require("./index-ohjTQ4ru.cjs"),_=require("./find-block-FHyxDYzT.cjs"),P=o.defineComponent({name:"block-styles",components:{InlinedStyles:s._sfc_main},props:["block","context"],data(){return{TARGET:s.TARGET}},computed:{canShowBlock(){const e=this.block;return s.checkIsDefined(e.hide)?!e.hide:s.checkIsDefined(e.show)?e.show:!0},css(){var S,h,B,C,f,v;const e=this.block,t=s.getResponsiveStylesWithImagePosition(e.responsiveStyles,((S=e.component)==null?void 0:S.name)==="Image"),n=this.context.content,l=s.getSizesForBreakpoints(((h=n==null?void 0:n.meta)==null?void 0:h.breakpoints)||{}),k=!!((C=(B=n==null?void 0:n.meta)==null?void 0:B.breakpoints)!=null&&C.xsmall),a=t==null?void 0:t.large,c=t==null?void 0:t.medium,d=t==null?void 0:t.small,r=t==null?void 0:t.xsmall,m=e.id;if(!m)return"";const b=a?s.createCssClass({className:m,styles:a}):"",g=c?s.createCssClass({className:m,styles:c,mediaQuery:s.getMaxWidthQueryForSize("medium",l)}):"",x=d?s.createCssClass({className:m,styles:d,mediaQuery:s.getMaxWidthQueryForSize("small",l)}):"",p=r&&k?s.createCssClass({className:m,styles:r,mediaQuery:s.getMaxWidthQueryForSize("xsmall",l)}):"",i=e.animations&&e.animations.find(u=>u.trigger==="hover");let y="";if(i){const u=((v=(f=i.steps)==null?void 0:f[1])==null?void 0:v.styles)||{};y=s.createCssClass({className:`${m}:hover`,styles:{...u,transition:`all ${i.duration}s ${s.camelToKebabCase(i.easing)}`,transitionDelay:i.delay?`${i.delay}s`:"0s"}})||""}return[b,g,x,p,y].join(" ")}}});function E(e,t,n,l,k,a){const c=o.resolveComponent("InlinedStyles");return e.TARGET!=="reactNative"&&e.css&&e.canShowBlock?(o.openBlock(),o.createBlock(c,{key:0,id:"builderio-block",styles:e.css,nonce:e.context.nonce},null,8,["styles","nonce"])):o.createCommentVNode("",!0)}const I=s._export_sfc(P,[["render",E]]),Q=o.defineComponent({name:"live-edit-block-styles",components:{InlinedStyles:s._sfc_main},props:["contextProvider","id"],data(){return{TARGET:s.TARGET}},computed:{block(){return _.findBlockById(this.contextProvider.content,this.id)},processedBlock(){var n;const e=this.block;return e?(n=e.repeat)!=null&&n.collection?e:s.getProcessedBlock({block:e,localState:this.contextProvider.localState,rootState:this.contextProvider.rootState,rootSetState:this.contextProvider.rootSetState,context:this.contextProvider.context}):null},canShowBlock(){var e,t,n,l;return s.checkIsDefined((e=this.processedBlock)==null?void 0:e.hide)?!((t=this.processedBlock)!=null&&t.hide):s.checkIsDefined((n=this.processedBlock)==null?void 0:n.show)?(l=this.processedBlock)==null?void 0:l.show:!0},css(){var y,S,h,B,C,f,v,u,T;const e=s.getResponsiveStylesWithImagePosition((y=this.processedBlock)==null?void 0:y.responsiveStyles,((h=(S=this.processedBlock)==null?void 0:S.component)==null?void 0:h.name)==="Image"),t=this.contextProvider.content,n=s.getSizesForBreakpoints(((B=t==null?void 0:t.meta)==null?void 0:B.breakpoints)||{}),l=!!((f=(C=t==null?void 0:t.meta)==null?void 0:C.breakpoints)!=null&&f.xsmall),k=e==null?void 0:e.large,a=e==null?void 0:e.medium,c=e==null?void 0:e.small,d=e==null?void 0:e.xsmall,r=(v=this.processedBlock)==null?void 0:v.id;if(!r)return"";const m=k?s.createCssClass({className:r,styles:k}):"",b=a?s.createCssClass({className:r,styles:a,mediaQuery:s.getMaxWidthQueryForSize("medium",n)}):"",g=c?s.createCssClass({className:r,styles:c,mediaQuery:s.getMaxWidthQueryForSize("small",n)}):"",x=d&&l?s.createCssClass({className:r,styles:d,mediaQuery:s.getMaxWidthQueryForSize("xsmall",n)}):"",p=this.processedBlock.animations&&this.processedBlock.animations.find($=>$.trigger==="hover");let i="";if(p){const $=((T=(u=p.steps)==null?void 0:u[1])==null?void 0:T.styles)||{};i=s.createCssClass({className:`${r}:hover`,styles:{...$,transition:`all ${p.duration}s ${s.camelToKebabCase(p.easing)}`,transitionDelay:p.delay?`${p.delay}s`:"0s"}})||""}return[m,b,g,x,i].join(" ")}}});function A(e,t,n,l,k,a){const c=o.resolveComponent("InlinedStyles");return e.TARGET==="rsc"&&e.css&&e.canShowBlock?(o.openBlock(),o.createBlock(c,{key:0,id:"builderio-block",styles:e.css,nonce:e.contextProvider.nonce},null,8,["styles","nonce"])):o.createCommentVNode("",!0)}const R=s._export_sfc(Q,[["render",A]]),W=o.defineComponent({name:"style-wrapper",components:{BlockStyles:I,LiveEditBlockStyles:R},props:["block","context"],data(){return{isClientEditing:!1,isHydrated:!1,TARGET:s.TARGET}},inject:{contextProvider:s.BuilderContext.key},mounted(){}});function z(e,t,n,l,k,a){const c=o.resolveComponent("LiveEditBlockStyles"),d=o.resolveComponent("BlockStyles");return e.isHydrated?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[e.TARGET==="rsc"&&e.isClientEditing?(o.openBlock(),o.createBlock(c,{key:0,id:e.block.id,contextProvider:e.contextProvider},null,8,["id","contextProvider"])):(o.openBlock(),o.createBlock(d,{key:1,block:e.block,context:e.context},null,8,["block","context"]))],64)):(o.openBlock(),o.createBlock(d,{key:1,block:e.block,context:e.context},null,8,["block","context"]))}const w=s._export_sfc(W,[["render",z]]);exports.default=w;
@@ -1 +1 @@
1
- .component-5vz8uirn7sc[data-v-82fc93d6]{display:flex;flex-direction:column;align-items:stretch}.div-1be3j8m9ewb[data-v-ab15749a]{display:flex;line-height:normal;height:100%}.img-t43jfuqn6g[data-v-bb2384ad]{opacity:1;transition:opacity .2s ease-in-out}.div-t43jfuqn6g[data-v-bb2384ad]{width:100%;pointer-events:none;font-size:0}.div-t43jfuqn6g-2[data-v-bb2384ad]{display:flex;flex-direction:column;align-items:stretch;position:absolute;top:0;left:0;width:100%;height:100%}.pre-2oa2wtipkzk[data-v-77c7888c]{padding:10px;color:red;text-align:center}
1
+ .component-5vz8uirn7sc[data-v-82fc93d6]{display:flex;flex-direction:column;align-items:stretch}.div-1be3j8m9ewb[data-v-ab15749a]{display:flex;line-height:normal;height:100%}.img-t43jfuqn6g[data-v-f109a7da]{opacity:1;transition:opacity .2s ease-in-out}.div-t43jfuqn6g[data-v-f109a7da]{width:100%;pointer-events:none;font-size:0}.div-t43jfuqn6g-2[data-v-f109a7da]{display:flex;flex-direction:column;align-items:stretch;position:absolute;top:0;left:0;width:100%;height:100%}.pre-2oa2wtipkzk[data-v-77c7888c]{padding:10px;color:red;text-align:center}
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as t, renderSlot as o } from "vue";
2
- import { _ as r } from "./index-Bgm0yCrN.js";
2
+ import { _ as r } from "./index-5jMXhHfs.js";
3
3
  const n = t({
4
4
  name: "awaiter",
5
5
  props: [],
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-LWGIJNVx.cjs"),n=e.defineComponent({name:"awaiter",props:[],mounted(){}});function o(t,a,c,i,u,d){return e.renderSlot(t.$slots,"default")}const s=r._export_sfc(n,[["render",o]]);exports.default=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-_dQKp9LH.cjs"),n=e.defineComponent({name:"awaiter",props:[],mounted(){}});function o(t,a,c,i,u,d){return e.renderSlot(t.$slots,"default")}const s=r._export_sfc(n,[["render",o]]);exports.default=s;
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as r, defineAsyncComponent as a, resolveComponent as c, openBlock as i, createBlock as p, withCtx as s, renderSlot as l } from "vue";
2
- import { g as m, a as d } from "./get-block-properties-DGfMhs4M.js";
3
- import { _ as k } from "./index-JQgNoVXs.js";
4
- const u = () => import("./index-JQgNoVXs.js").then((t) => t.D).then((t) => t.default).catch((t) => {
2
+ import { g as m, a as d } from "./get-block-properties-TtYKEgAO.js";
3
+ import { _ as k } from "./index-5jMXhHfs.js";
4
+ const u = () => import("./index-5jMXhHfs.js").then((t) => t.K).then((t) => t.default).catch((t) => {
5
5
  throw console.error(
6
6
  "Error while attempting to dynamically import component DynamicRenderer at ../../dynamic-renderer/dynamic-renderer.vue",
7
7
  t
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),r=require("./get-block-properties-2E03ld67.cjs"),a=require("./index-LWGIJNVx.cjs"),i=()=>Promise.resolve().then(()=>require("./index-LWGIJNVx.cjs")).then(e=>e.dynamicRenderer).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component DynamicRenderer at ../../dynamic-renderer/dynamic-renderer.vue",e),e}),s=t.defineComponent({name:"block-wrapper",components:{DynamicRenderer:t.defineAsyncComponent(i)},props:["Wrapper","block","context"],data(){return{getBlockActions:r.getBlockActions,getBlockProperties:r.getBlockProperties}}});function l(e,d,m,u,k,y){var o,n;const c=t.resolveComponent("DynamicRenderer");return t.openBlock(),t.createBlock(c,{TagName:e.Wrapper,attributes:e.getBlockProperties({block:e.block,context:e.context}),actionAttributes:e.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0,trackingContext:{apiKey:e.context.apiKey,canTrack:e.context.canTrack??!0,contentId:(o=e.context.content)==null?void 0:o.id,variationId:(n=e.context.content)==null?void 0:n.testVariationId}})},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},8,["TagName","attributes","actionAttributes"])}const p=a._export_sfc(s,[["render",l]]);exports.default=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),r=require("./get-block-properties-d0E5ZkZj.cjs"),a=require("./index-_dQKp9LH.cjs"),i=()=>Promise.resolve().then(()=>require("./index-_dQKp9LH.cjs")).then(e=>e.dynamicRenderer).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component DynamicRenderer at ../../dynamic-renderer/dynamic-renderer.vue",e),e}),s=t.defineComponent({name:"block-wrapper",components:{DynamicRenderer:t.defineAsyncComponent(i)},props:["Wrapper","block","context"],data(){return{getBlockActions:r.getBlockActions,getBlockProperties:r.getBlockProperties}}});function l(e,d,m,u,k,y){var o,n;const c=t.resolveComponent("DynamicRenderer");return t.openBlock(),t.createBlock(c,{TagName:e.Wrapper,attributes:e.getBlockProperties({block:e.block,context:e.context}),actionAttributes:e.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0,trackingContext:{apiKey:e.context.apiKey,canTrack:e.context.canTrack??!0,contentId:(o=e.context.content)==null?void 0:o.id,variationId:(n=e.context.content)==null?void 0:n.testVariationId}})},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},8,["TagName","attributes","actionAttributes"])}const p=a._export_sfc(s,[["render",l]]);exports.default=p;
@@ -4,8 +4,14 @@
4
4
  */
5
5
  import type { Query, UserAttributes } from '../helpers';
6
6
  import { type PersonalizationContainerProps } from '../personalization-container.types';
7
+ /**
8
+ * Mirrors helpers/studio-user-attributes.ts; stringification rules out sharing the code.
9
+ * Anything referenced from module scope becomes an undefined global at runtime.
10
+ */
11
+ export declare function getStudioUserAttributes(): Record<string, unknown>;
7
12
  export declare function filterWithCustomTargeting(userAttributes: UserAttributes, query: Query[], startDate?: string, endDate?: string): boolean;
8
13
  export declare function updateVisibilityStylesScript(variants: PersonalizationContainerProps['variants'], blockId: string, isHydrationTarget: boolean, locale?: string): void;
9
- export declare const PERSONALIZATION_SCRIPT = "function getPersonalizedVariant(variants, blockId, isHydrationTarget, locale) {\n if (!navigator.cookieEnabled) {\n return;\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) == ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');\n if (locale) {\n attributes.locale = locale;\n }\n const winningVariantIndex = variants?.findIndex(function (variant) {\n return window.filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);\n });\n const parentDiv = document.currentScript?.parentElement;\n const variantId = parentDiv?.getAttribute('data-variant-id');\n const isDefaultVariant = variantId === `${blockId}-default`;\n const isWinningVariant = winningVariantIndex !== -1 && variantId === `${blockId}-${winningVariantIndex}` || winningVariantIndex === -1 && isDefaultVariant;\n if (isWinningVariant && !isDefaultVariant) {\n parentDiv?.removeAttribute('hidden');\n parentDiv?.removeAttribute('aria-hidden');\n } else if (!isWinningVariant && isDefaultVariant) {\n parentDiv?.setAttribute('hidden', 'true');\n parentDiv?.setAttribute('aria-hidden', 'true');\n }\n if (isHydrationTarget) {\n if (!isWinningVariant) {\n const itsStyleEl = parentDiv?.previousElementSibling;\n if (itsStyleEl) {\n itsStyleEl.remove();\n }\n parentDiv?.remove();\n }\n const thisScript = document.currentScript;\n if (thisScript) {\n thisScript.remove();\n }\n }\n}";
14
+ export declare const STUDIO_USER_ATTRIBUTES_SCRIPT = "function getStudioUserAttributes() {\n const params = new URLSearchParams(window.location.search);\n if (params.get('builder.preview') !== 'BUILDER_STUDIO') {\n return {};\n }\n const prefix = 'builder.userAttributes.';\n const attributes = {};\n params.forEach(function (value, key) {\n if (key.indexOf(prefix) === 0) {\n attributes[key.slice(prefix.length)] = value === 'true' ? true : value === 'false' ? false : value;\n }\n });\n return attributes;\n}";
15
+ export declare const PERSONALIZATION_SCRIPT = "function getPersonalizedVariant(variants, blockId, isHydrationTarget, locale) {\n if (!navigator.cookieEnabled) {\n return;\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) == ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');\n if (locale) {\n attributes.locale = locale;\n }\n Object.assign(attributes, window.builderIoStudioUserAttributes());\n const winningVariantIndex = variants?.findIndex(function (variant) {\n return window.filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);\n });\n const parentDiv = document.currentScript?.parentElement;\n const variantId = parentDiv?.getAttribute('data-variant-id');\n const isDefaultVariant = variantId === `${blockId}-default`;\n const isWinningVariant = winningVariantIndex !== -1 && variantId === `${blockId}-${winningVariantIndex}` || winningVariantIndex === -1 && isDefaultVariant;\n if (isWinningVariant && !isDefaultVariant) {\n parentDiv?.removeAttribute('hidden');\n parentDiv?.removeAttribute('aria-hidden');\n } else if (!isWinningVariant && isDefaultVariant) {\n parentDiv?.setAttribute('hidden', 'true');\n parentDiv?.setAttribute('aria-hidden', 'true');\n }\n if (isHydrationTarget) {\n if (!isWinningVariant) {\n const itsStyleEl = parentDiv?.previousElementSibling;\n if (itsStyleEl) {\n itsStyleEl.remove();\n }\n parentDiv?.remove();\n }\n const thisScript = document.currentScript;\n if (thisScript) {\n thisScript.remove();\n }\n }\n}";
10
16
  export declare const FILTER_WITH_CUSTOM_TARGETING_SCRIPT = "function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {\n function isString(val) {\n return typeof val === 'string';\n }\n function isNumber(val) {\n return typeof val === 'number';\n }\n function objectMatchesQuery(userattr, query) {\n const result = (() => {\n const property = query.property;\n const operator = query.operator;\n let testValue = query.value;\n if (query && query.property === 'urlPath' && query.value && typeof query.value === 'string' && query.value !== '/' && query.value.endsWith('/')) {\n testValue = query.value.slice(0, -1);\n }\n if (!(property && operator)) {\n return true;\n }\n if (Array.isArray(testValue)) {\n if (operator === 'isNot') {\n return testValue.every(val => objectMatchesQuery(userattr, {\n property,\n operator,\n value: val\n }));\n }\n return !!testValue.find(val => objectMatchesQuery(userattr, {\n property,\n operator,\n value: val\n }));\n }\n const value = userattr[property];\n if (Array.isArray(value)) {\n return value.includes(testValue);\n }\n switch (operator) {\n case 'is':\n return value === testValue;\n case 'isNot':\n return value !== testValue;\n case 'contains':\n return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));\n case 'startsWith':\n return isString(value) && value.startsWith(String(testValue));\n case 'endsWith':\n return isString(value) && value.endsWith(String(testValue));\n case 'greaterThan':\n return isNumber(value) && isNumber(testValue) && value > testValue;\n case 'lessThan':\n return isNumber(value) && isNumber(testValue) && value < testValue;\n case 'greaterThanOrEqualTo':\n return isNumber(value) && isNumber(testValue) && value >= testValue;\n case 'lessThanOrEqualTo':\n return isNumber(value) && isNumber(testValue) && value <= testValue;\n default:\n return false;\n }\n })();\n return result;\n }\n const item = {\n query,\n startDate,\n endDate\n };\n const now = userAttributes.date && new Date(userAttributes.date) || new Date();\n if (item.startDate && new Date(item.startDate) > now) {\n return false;\n } else if (item.endDate && new Date(item.endDate) < now) {\n return false;\n }\n if (!item.query || !item.query.length) {\n return true;\n }\n return item.query.every(filter => {\n return objectMatchesQuery(userAttributes, filter);\n });\n}";
11
- export declare const UPDATE_VISIBILITY_STYLES_SCRIPT = "function updateVisibilityStylesScript(variants, blockId, isHydrationTarget, locale) {\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) == ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const visibilityStylesEl = document.currentScript?.previousElementSibling;\n if (!visibilityStylesEl) {\n return;\n }\n if (isHydrationTarget) {\n visibilityStylesEl.remove();\n const currentScript = document.currentScript;\n if (currentScript) {\n currentScript.remove();\n }\n } else {\n const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');\n if (locale) {\n attributes.locale = locale;\n }\n const winningVariantIndex = variants?.findIndex(function (variant) {\n return window.filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);\n });\n if (winningVariantIndex !== -1) {\n let newStyleStr = variants?.map((_, index) => {\n if (index === winningVariantIndex) return '';\n return `div[data-variant-id=\"${blockId}-${index}\"] { display: none !important; } `;\n }).join('') || '';\n newStyleStr += `div[data-variant-id=\"${blockId}-default\"] { display: none !important; } `;\n visibilityStylesEl.innerHTML = newStyleStr;\n }\n }\n}";
17
+ export declare const UPDATE_VISIBILITY_STYLES_SCRIPT = "function updateVisibilityStylesScript(variants, blockId, isHydrationTarget, locale) {\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) == ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const visibilityStylesEl = document.currentScript?.previousElementSibling;\n if (!visibilityStylesEl) {\n return;\n }\n if (isHydrationTarget) {\n visibilityStylesEl.remove();\n const currentScript = document.currentScript;\n if (currentScript) {\n currentScript.remove();\n }\n } else {\n const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');\n if (locale) {\n attributes.locale = locale;\n }\n Object.assign(attributes, window.builderIoStudioUserAttributes());\n const winningVariantIndex = variants?.findIndex(function (variant) {\n return window.filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);\n });\n if (winningVariantIndex !== -1) {\n let newStyleStr = variants?.map((_, index) => {\n if (index === winningVariantIndex) return '';\n return `div[data-variant-id=\"${blockId}-${index}\"] { display: none !important; } `;\n }).join('') || '';\n newStyleStr += `div[data-variant-id=\"${blockId}-default\"] { display: none !important; } `;\n visibilityStylesEl.innerHTML = newStyleStr;\n }\n }\n}";
@@ -6,7 +6,9 @@ declare const _default: import("vue").DefineComponent<Readonly<{
6
6
  variants?: any;
7
7
  previewingIndex?: any;
8
8
  }>, unknown, {
9
- userAttributes: any;
9
+ userAttributes: {
10
+ [x: string]: any;
11
+ };
10
12
  scriptStr: string;
11
13
  updateVisibilityStylesScript: string;
12
14
  unsubscribers: never[];
@@ -1,12 +1,12 @@
1
1
  import { defineComponent as h, defineAsyncComponent as u, resolveComponent as m, openBlock as o, createBlock as i, withCtx as p, renderSlot as d, createElementBlock as b, Fragment as f, resolveDynamicComponent as C, mergeProps as w, normalizeProps as W, renderList as y, createCommentVNode as B } from "vue";
2
- import { T as E, i as R, _ as g, B as $, w as A } from "./index-Bgm0yCrN.js";
3
- import { a as v, g as S } from "./get-block-properties-bMVCvUX0.js";
4
- const T = () => import("./awaiter-RSfMls5f.js").then((t) => t.default).catch((t) => {
2
+ import { T as E, i as R, _ as g, B as $, w as A } from "./index-5jMXhHfs.js";
3
+ import { a as v, g as S } from "./get-block-properties-TtYKEgAO.js";
4
+ const T = () => import("./awaiter-Mugw26Wi.js").then((t) => t.default).catch((t) => {
5
5
  throw console.error(
6
6
  "Error while attempting to dynamically import component Awaiter at ../../awaiter.vue",
7
7
  t
8
8
  ), t;
9
- }), I = () => import("./live-edit-tegdYGJO.js").then((t) => t.default).catch((t) => {
9
+ }), I = () => import("./live-edit-7Dc7Q2yS.js").then((t) => t.default).catch((t) => {
10
10
  throw console.error(
11
11
  "Error while attempting to dynamically import component LiveEdit at ../../live-edit.vue",
12
12
  t
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),r=require("./index-LWGIJNVx.cjs"),l=require("./get-block-properties-2E03ld67.cjs"),u=()=>Promise.resolve().then(()=>require("./awaiter-zow2zgzw.cjs")).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component Awaiter at ../../awaiter.vue",e),e}),k=()=>Promise.resolve().then(()=>require("./live-edit-oLYhcuYs.cjs")).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component LiveEdit at ../../live-edit.vue",e),e}),h=t.defineComponent({name:"interactive-element",components:{LiveEdit:t.defineAsyncComponent(k),Awaiter:t.defineAsyncComponent(u)},props:["wrapperProps","block","includeBlockProps","context","Wrapper"],data(){return{forceRenderCount:0,TARGET:r.TARGET,isEditing:r.isEditing}},watch:{onUpdateHook0:{handler(){},immediate:!0}},computed:{attributes(){var e,o;return this.includeBlockProps?{...l.getBlockProperties({block:this.block,context:this.context}),...l.getBlockActions({block:this.block,rootState:this.context.rootState,rootSetState:this.context.rootSetState,localState:this.context.localState,context:this.context.context,trackingContext:{apiKey:this.context.apiKey,canTrack:this.context.canTrack??!0,contentId:(e=this.context.content)==null?void 0:e.id,variationId:(o=this.context.content)==null?void 0:o.testVariationId}})}:{}},targetWrapperProps(){return{...this.wrapperProps,...Object.keys(this.attributes).length>0?{attributes:this.attributes}:{}}},onUpdateHook0(){var e,o;return{0:this.wrapperProps,1:(o=(e=this.block)==null?void 0:e.component)==null?void 0:o.options}}}});function b(e,o,a,s,p,c){const i=t.resolveComponent("Awaiter"),n=t.resolveComponent("LiveEdit");return e.Wrapper.load?(t.openBlock(),t.createBlock(i,{key:0,load:e.Wrapper.load,fallback:e.Wrapper.fallback,props:e.wrapperProps,attributes:e.attributes},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},8,["load","fallback","props","attributes"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[e.TARGET==="rsc"&&e.isEditing()?(t.openBlock(),t.createBlock(n,{key:0,Wrapper:e.Wrapper,id:e.block.id||"",attributes:e.attributes},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},8,["Wrapper","id","attributes"])):(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.Wrapper),t.mergeProps({key:1,attributes:e.attributes},e.targetWrapperProps),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16,["attributes"]))],64))}const d=r._export_sfc(h,[["render",b]]),f=({componentOptions:e,builderBlock:o,context:a,componentRef:s,includeBlockProps:p,isInteractive:c,contextValue:i})=>{const n={...e,...p?{attributes:l.getBlockProperties({block:o,context:i})}:{}};return c?{Wrapper:s,block:o,context:a,wrapperProps:e,includeBlockProps:p}:n},C=t.defineComponent({name:"component-ref",components:{Block:r.Block,InteractiveElement:d},props:["isInteractive","componentRef","blockChildren","componentOptions","builderBlock","context","linkComponent","includeBlockProps","registeredComponents"],data(){return{shouldUpdate:!1,Wrapper:this.isInteractive?r.wrapComponentRef(d):this.componentRef,getWrapperProps:f}},computed:{blockChildrenToRender(){return this.componentRef?this.blockChildren:[]}}});function B(e,o,a,s,p,c){const i=t.resolveComponent("Block");return e.componentRef?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.Wrapper),t.normalizeProps(t.mergeProps({key:0},e.getWrapperProps({componentOptions:e.componentOptions,builderBlock:e.builderBlock,context:e.context,componentRef:e.componentRef,linkComponent:e.linkComponent,includeBlockProps:e.includeBlockProps,isInteractive:e.isInteractive,contextValue:e.context}))),{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.blockChildrenToRender,(n,m)=>(t.openBlock(),t.createBlock(i,{key:n.id,block:n,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},null,8,["block","context","registeredComponents","linkComponent"]))),128))]),_:1},16)):t.createCommentVNode("",!0)}const v=r._export_sfc(C,[["render",B]]);exports.default=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),r=require("./index-_dQKp9LH.cjs"),l=require("./get-block-properties-d0E5ZkZj.cjs"),u=()=>Promise.resolve().then(()=>require("./awaiter-N8Gr0F79.cjs")).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component Awaiter at ../../awaiter.vue",e),e}),k=()=>Promise.resolve().then(()=>require("./live-edit-oGxYZa_V.cjs")).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component LiveEdit at ../../live-edit.vue",e),e}),h=t.defineComponent({name:"interactive-element",components:{LiveEdit:t.defineAsyncComponent(k),Awaiter:t.defineAsyncComponent(u)},props:["wrapperProps","block","includeBlockProps","context","Wrapper"],data(){return{forceRenderCount:0,TARGET:r.TARGET,isEditing:r.isEditing}},watch:{onUpdateHook0:{handler(){},immediate:!0}},computed:{attributes(){var e,o;return this.includeBlockProps?{...l.getBlockProperties({block:this.block,context:this.context}),...l.getBlockActions({block:this.block,rootState:this.context.rootState,rootSetState:this.context.rootSetState,localState:this.context.localState,context:this.context.context,trackingContext:{apiKey:this.context.apiKey,canTrack:this.context.canTrack??!0,contentId:(e=this.context.content)==null?void 0:e.id,variationId:(o=this.context.content)==null?void 0:o.testVariationId}})}:{}},targetWrapperProps(){return{...this.wrapperProps,...Object.keys(this.attributes).length>0?{attributes:this.attributes}:{}}},onUpdateHook0(){var e,o;return{0:this.wrapperProps,1:(o=(e=this.block)==null?void 0:e.component)==null?void 0:o.options}}}});function b(e,o,a,s,p,c){const i=t.resolveComponent("Awaiter"),n=t.resolveComponent("LiveEdit");return e.Wrapper.load?(t.openBlock(),t.createBlock(i,{key:0,load:e.Wrapper.load,fallback:e.Wrapper.fallback,props:e.wrapperProps,attributes:e.attributes},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},8,["load","fallback","props","attributes"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[e.TARGET==="rsc"&&e.isEditing()?(t.openBlock(),t.createBlock(n,{key:0,Wrapper:e.Wrapper,id:e.block.id||"",attributes:e.attributes},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},8,["Wrapper","id","attributes"])):(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.Wrapper),t.mergeProps({key:1,attributes:e.attributes},e.targetWrapperProps),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16,["attributes"]))],64))}const d=r._export_sfc(h,[["render",b]]),f=({componentOptions:e,builderBlock:o,context:a,componentRef:s,includeBlockProps:p,isInteractive:c,contextValue:i})=>{const n={...e,...p?{attributes:l.getBlockProperties({block:o,context:i})}:{}};return c?{Wrapper:s,block:o,context:a,wrapperProps:e,includeBlockProps:p}:n},C=t.defineComponent({name:"component-ref",components:{Block:r.Block,InteractiveElement:d},props:["isInteractive","componentRef","blockChildren","componentOptions","builderBlock","context","linkComponent","includeBlockProps","registeredComponents"],data(){return{shouldUpdate:!1,Wrapper:this.isInteractive?r.wrapComponentRef(d):this.componentRef,getWrapperProps:f}},computed:{blockChildrenToRender(){return this.componentRef?this.blockChildren:[]}}});function B(e,o,a,s,p,c){const i=t.resolveComponent("Block");return e.componentRef?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.Wrapper),t.normalizeProps(t.mergeProps({key:0},e.getWrapperProps({componentOptions:e.componentOptions,builderBlock:e.builderBlock,context:e.context,componentRef:e.componentRef,linkComponent:e.linkComponent,includeBlockProps:e.includeBlockProps,isInteractive:e.isInteractive,contextValue:e.context}))),{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.blockChildrenToRender,(n,m)=>(t.openBlock(),t.createBlock(i,{key:n.id,block:n,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},null,8,["block","context","registeredComponents","linkComponent"]))),128))]),_:1},16)):t.createCommentVNode("",!0)}const v=r._export_sfc(C,[["render",B]]);exports.default=v;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "5.2.11";
1
+ export declare const SDK_VERSION = "5.2.13";
@@ -1,4 +1,4 @@
1
- import { e as s, T as c, g as i, a as l } from "./index-Bgm0yCrN.js";
1
+ import { e as s, T as c, g as i, a as l } from "./index-5jMXhHfs.js";
2
2
  const f = (e) => `v-on:${e.toLowerCase()}`, u = (e, t) => (r) => s({
3
3
  code: e,
4
4
  context: t.context,
@@ -1 +1 @@
1
- "use strict";const a=require("./index-LWGIJNVx.cjs"),c=e=>`v-on:${e.toLowerCase()}`,i=(e,t)=>r=>a.evaluate({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:r,isExpression:!1,trackingContext:t.trackingContext});function l(e){const t={},r=e.block.actions??{};for(const o in r){if(!r.hasOwnProperty(o))continue;const s=r[o];let n=c(o);if(e.stripPrefix)switch(a.TARGET){case"vue":n=n.replace("v-on:","");break;case"svelte":n=n.replace("on:","");break}t[n]=i(s,e)}return t}function u({properties:e}){return e}const f=e=>({href:e.href});function p({block:e,context:t}){var o;const r={...f(e),...e.properties,"builder-id":e.id,style:a.getStyle({block:e,context:t}),[a.getClassPropName()]:[e.id,"builder-block",e.class,(o=e.properties)==null?void 0:o.class].filter(Boolean).join(" ")};return u({properties:r,context:t,block:e})}exports.getBlockActions=l;exports.getBlockProperties=p;
1
+ "use strict";const a=require("./index-_dQKp9LH.cjs"),c=e=>`v-on:${e.toLowerCase()}`,i=(e,t)=>r=>a.evaluate({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:r,isExpression:!1,trackingContext:t.trackingContext});function l(e){const t={},r=e.block.actions??{};for(const o in r){if(!r.hasOwnProperty(o))continue;const s=r[o];let n=c(o);if(e.stripPrefix)switch(a.TARGET){case"vue":n=n.replace("v-on:","");break;case"svelte":n=n.replace("on:","");break}t[n]=i(s,e)}return t}function u({properties:e}){return e}const f=e=>({href:e.href});function p({block:e,context:t}){var o;const r={...f(e),...e.properties,"builder-id":e.id,style:a.getStyle({block:e,context:t}),[a.getClassPropName()]:[e.id,"builder-block",e.class,(o=e.properties)==null?void 0:o.class].filter(Boolean).join(" ")};return u({properties:r,context:t,block:e})}exports.getBlockActions=l;exports.getBlockProperties=p;
@@ -1,3 +1,5 @@
1
+ import type { BuilderBlock } from '../types/builder-block';
2
+ export declare const getResponsiveStylesWithImagePosition: (styles: BuilderBlock['responsiveStyles'], isBuilderImage: boolean) => BuilderBlock['responsiveStyles'];
1
3
  export declare const convertStyleMapToCSSArray: (style: Partial<CSSStyleDeclaration>) => string[];
2
4
  export declare const convertStyleMapToCSS: (style: Partial<CSSStyleDeclaration>) => string;
3
5
  export declare const createCssClass: ({ mediaQuery, className, styles }: {
@@ -0,0 +1,6 @@
1
+ import type { UserAttributes } from './user-attributes';
2
+ /**
3
+ * Studio passes its targeting overrides as query params because it cannot write the
4
+ * builder.userAttributes cookie on the previewed site's origin.
5
+ */
6
+ export declare const getStudioUserAttributes: () => UserAttributes;
@@ -4,7 +4,9 @@ export interface UserAttributes {
4
4
  export declare const USER_ATTRIBUTES_COOKIE_NAME = "builder.userAttributes";
5
5
  export declare function createUserAttributesService(): {
6
6
  setUserAttributes(newAttrs: UserAttributes): void;
7
- getUserAttributes(): any;
7
+ getUserAttributes(): {
8
+ [x: string]: any;
9
+ };
8
10
  subscribeOnUserAttributesChange(callback: (attrs: UserAttributes) => void, { fireImmediately }?: {
9
11
  fireImmediately?: boolean | undefined;
10
12
  }): () => void;
@@ -12,7 +14,9 @@ export declare function createUserAttributesService(): {
12
14
  };
13
15
  export declare const userAttributesService: {
14
16
  setUserAttributes(newAttrs: UserAttributes): void;
15
- getUserAttributes(): any;
17
+ getUserAttributes(): {
18
+ [x: string]: any;
19
+ };
16
20
  subscribeOnUserAttributesChange(callback: (attrs: UserAttributes) => void, { fireImmediately }?: {
17
21
  fireImmediately?: boolean | undefined;
18
22
  }): () => void;