@builder.io/sdk-react 4.2.1 → 4.2.3

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 (90) hide show
  1. package/lib/browser/blocks-exports.cjs +37 -37
  2. package/lib/browser/blocks-exports.mjs +1238 -1168
  3. package/lib/browser/index.cjs +1 -1
  4. package/lib/browser/index.mjs +1 -1
  5. package/lib/browser/server-entry-0817de95.cjs +2 -0
  6. package/lib/browser/{server-entry-5e98a993.js → server-entry-331e2fd4.js} +248 -246
  7. package/lib/browser/server-entry.cjs +1 -1
  8. package/lib/browser/server-entry.mjs +1 -1
  9. package/lib/edge/{accordion-4bab42b1.cjs → accordion-1559ca68.cjs} +1 -1
  10. package/lib/edge/{accordion-a8a363e4.js → accordion-3e9ee224.js} +1 -1
  11. package/lib/edge/{blocks-d07d0261.cjs → blocks-4f20c19a.cjs} +14 -14
  12. package/lib/edge/{blocks-e1f5b0d0.js → blocks-b9be7dc1.js} +749 -736
  13. package/lib/edge/blocks-exports.cjs +1 -1
  14. package/lib/edge/blocks-exports.mjs +2 -2
  15. package/lib/edge/{button-6734c0bb.cjs → button-0a632d4f.cjs} +1 -1
  16. package/lib/edge/{button-bbcadacf.js → button-ba852235.js} +2 -2
  17. package/lib/edge/{columns-821cba14.cjs → columns-66170ac9.cjs} +1 -1
  18. package/lib/edge/{columns-cf3081c6.js → columns-ee2fba7b.js} +3 -3
  19. package/lib/edge/content-variants-4f54d98a.cjs +302 -0
  20. package/lib/edge/{content-variants-a704e35c.js → content-variants-c013569a.js} +489 -444
  21. package/lib/edge/{custom-code-f6c30129.js → custom-code-38e2c9d5.js} +1 -1
  22. package/lib/edge/{custom-code-8fcaa31e.cjs → custom-code-48579935.cjs} +1 -1
  23. package/lib/edge/{embed-3c0b5564.js → embed-1ce0435c.js} +1 -1
  24. package/lib/edge/{embed-666d3cc4.cjs → embed-9a7f29ff.cjs} +1 -1
  25. package/lib/edge/form-d9b6dea6.cjs +1 -0
  26. package/lib/edge/{form-8b068721.js → form-f558f5d4.js} +24 -21
  27. package/lib/edge/{get-class-prop-name-d6d821d6.js → get-class-prop-name-35ccd32a.js} +1 -1
  28. package/lib/edge/{get-class-prop-name-2869a960.cjs → get-class-prop-name-d2be9a48.cjs} +1 -1
  29. package/lib/edge/image-cce92f6c.cjs +17 -0
  30. package/lib/edge/image-d87761af.js +123 -0
  31. package/lib/edge/img-a1e0f10e.js +33 -0
  32. package/lib/edge/img-b21eb075.cjs +1 -0
  33. package/lib/edge/index.cjs +1 -1
  34. package/lib/edge/index.mjs +1 -1
  35. package/lib/edge/{input-665ef328.js → input-5c0d3350.js} +1 -1
  36. package/lib/edge/{input-d31d6451.cjs → input-6854bc85.cjs} +1 -1
  37. package/lib/edge/{personalization-container-e784836e.js → personalization-container-adf9e0bd.js} +4 -4
  38. package/lib/edge/{personalization-container-d12566e8.cjs → personalization-container-f7fdc090.cjs} +1 -1
  39. package/lib/edge/{select-c3085265.cjs → select-6c4637ae.cjs} +1 -1
  40. package/lib/edge/{select-5fe49bd4.js → select-713e73f6.js} +1 -1
  41. package/lib/edge/server-entry-0bef3cb1.cjs +2 -0
  42. package/lib/{node/server-entry-48724189.js → edge/server-entry-71badd34.js} +307 -307
  43. package/lib/edge/server-entry.cjs +1 -1
  44. package/lib/edge/server-entry.mjs +1 -1
  45. package/lib/edge/{slot-cbbbb02e.cjs → slot-59a86f46.cjs} +1 -1
  46. package/lib/edge/{slot-a17ee2d7.js → slot-a3c27352.js} +3 -3
  47. package/lib/edge/symbol-3d81a9de.cjs +1 -0
  48. package/lib/edge/{symbol-9f960685.js → symbol-86e5a3f0.js} +26 -23
  49. package/lib/edge/tabs-0d914e5c.cjs +1 -0
  50. package/lib/edge/{tabs-26ac5b2f.js → tabs-60f8bb61.js} +24 -23
  51. package/lib/node/blocks-exports.cjs +38 -38
  52. package/lib/node/blocks-exports.mjs +1375 -1305
  53. package/lib/node/index.cjs +1 -1
  54. package/lib/node/index.mjs +3 -3
  55. package/lib/node/init.cjs +1 -1
  56. package/lib/node/init.mjs +3 -3
  57. package/lib/node/server-entry-05b0f263.cjs +2 -0
  58. package/lib/{edge/server-entry-c9d5300f.js → node/server-entry-68823bb0.js} +346 -342
  59. package/lib/node/server-entry.cjs +1 -1
  60. package/lib/node/server-entry.mjs +1 -1
  61. package/lib/node/{setIvm-a7aba6d2.js → setIvm-bb3d0e32.js} +1 -1
  62. package/lib/node/{setIvm-3b6199a0.cjs → setIvm-bec8f1ed.cjs} +1 -1
  63. package/lib/node/setIvm.cjs +1 -1
  64. package/lib/node/setIvm.mjs +2 -2
  65. package/lib/node/{should-force-browser-runtime-in-node-fdc70f22.js → should-force-browser-runtime-in-node-a4c71d14.js} +1 -1
  66. package/lib/node/{should-force-browser-runtime-in-node-cbe0ef14.cjs → should-force-browser-runtime-in-node-bbbdf124.cjs} +1 -1
  67. package/package.json +1 -1
  68. package/types/blocks/img/img.d.ts +2 -0
  69. package/types/blocks/symbol/symbol.types.d.ts +1 -2
  70. package/types/components/awaiter.d.ts +1 -11
  71. package/types/components/awaiter.types.d.ts +7 -0
  72. package/types/components/block/components/live-edit-block-styles.d.ts +8 -0
  73. package/types/components/block/components/style-wrapper.d.ts +9 -0
  74. package/types/components/live-edit.d.ts +9 -0
  75. package/types/constants/sdk-version.d.ts +1 -1
  76. package/types/helpers/find-block.d.ts +18 -0
  77. package/types/helpers/subscribe-to-editor.d.ts +3 -2
  78. package/lib/browser/server-entry-4cf669a1.cjs +0 -2
  79. package/lib/edge/content-variants-ec180883.cjs +0 -302
  80. package/lib/edge/form-51f639ab.cjs +0 -1
  81. package/lib/edge/image-209835f4.js +0 -94
  82. package/lib/edge/image-87a4e006.cjs +0 -17
  83. package/lib/edge/image.helpers-3e926d47.js +0 -33
  84. package/lib/edge/image.helpers-dba8a869.cjs +0 -1
  85. package/lib/edge/img-b04b9b6d.cjs +0 -1
  86. package/lib/edge/img-dfbd4080.js +0 -28
  87. package/lib/edge/server-entry-acf5ce7d.cjs +0 -2
  88. package/lib/edge/symbol-b56b5675.cjs +0 -1
  89. package/lib/edge/tabs-bf6643d7.cjs +0 -1
  90. package/lib/node/server-entry-562c0663.cjs +0 -2
@@ -1,302 +0,0 @@
1
- "use strict";const h=require("react/jsx-runtime"),s=require("react"),r=require("./server-entry-acf5ce7d.cjs"),P=require("./blocks-exports.cjs"),F=require("./blocks-d07d0261.cjs");function re(e,t,n,o){function l(b){return typeof b=="string"}function u(b){return typeof b=="number"}function a(b,f){return(()=>{const C=f.property,R=f.operator;let m=f.value;if(f&&f.property==="urlPath"&&f.value&&typeof f.value=="string"&&f.value!=="/"&&f.value.endsWith("/")&&(m=f.value.slice(0,-1)),!(C&&R))return!0;if(Array.isArray(m))return R==="isNot"?m.every(E=>a(b,{property:C,operator:R,value:E})):!!m.find(E=>a(b,{property:C,operator:R,value:E}));const c=b[C];if(Array.isArray(c))return c.includes(m);switch(R){case"is":return c===m;case"isNot":return c!==m;case"contains":return(l(c)||Array.isArray(c))&&c.includes(String(m));case"startsWith":return l(c)&&c.startsWith(String(m));case"endsWith":return l(c)&&c.endsWith(String(m));case"greaterThan":return u(c)&&u(m)&&c>m;case"lessThan":return u(c)&&u(m)&&c<m;case"greaterThanOrEqualTo":return u(c)&&u(m)&&c>=m;case"lessThanOrEqualTo":return u(c)&&u(m)&&c<=m;default:return!1}})()}const i={query:t,startDate:n,endDate:o},d=e.date&&new Date(e.date)||new Date;return i.startDate&&new Date(i.startDate)>d||i.endDate&&new Date(i.endDate)<d?!1:!i.query||!i.query.length?!0:i.query.every(b=>a(e,b))}const se=`function getPersonalizedVariant(variants, blockId, isHydrationTarget, locale) {
2
- if (!navigator.cookieEnabled) {
3
- return;
4
- }
5
- function getCookie(name) {
6
- const nameEQ = name + '=';
7
- const ca = document.cookie.split(';');
8
- for (let i = 0; i < ca.length; i++) {
9
- let c = ca[i];
10
- while (c.charAt(0) == ' ') c = c.substring(1, c.length);
11
- if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
12
- }
13
- return null;
14
- }
15
- const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');
16
- if (locale) {
17
- attributes.locale = locale;
18
- }
19
- const winningVariantIndex = variants?.findIndex(function (variant) {
20
- return window.filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);
21
- });
22
- const parentDiv = document.currentScript?.parentElement;
23
- const variantId = parentDiv?.getAttribute('data-variant-id');
24
- const isDefaultVariant = variantId === \`\${blockId}-default\`;
25
- const isWinningVariant = winningVariantIndex !== -1 && variantId === \`\${blockId}-\${winningVariantIndex}\` || winningVariantIndex === -1 && isDefaultVariant;
26
- if (isWinningVariant && !isDefaultVariant) {
27
- parentDiv?.removeAttribute('hidden');
28
- parentDiv?.removeAttribute('aria-hidden');
29
- } else if (!isWinningVariant && isDefaultVariant) {
30
- parentDiv?.setAttribute('hidden', 'true');
31
- parentDiv?.setAttribute('aria-hidden', 'true');
32
- }
33
- if (isHydrationTarget) {
34
- if (!isWinningVariant) {
35
- const itsStyleEl = parentDiv?.previousElementSibling;
36
- if (itsStyleEl) {
37
- itsStyleEl.remove();
38
- }
39
- parentDiv?.remove();
40
- }
41
- const thisScript = document.currentScript;
42
- if (thisScript) {
43
- thisScript.remove();
44
- }
45
- }
46
- }`,le=`function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
47
- function isString(val) {
48
- return typeof val === 'string';
49
- }
50
- function isNumber(val) {
51
- return typeof val === 'number';
52
- }
53
- function objectMatchesQuery(userattr, query) {
54
- const result = (() => {
55
- const property = query.property;
56
- const operator = query.operator;
57
- let testValue = query.value;
58
- if (query && query.property === 'urlPath' && query.value && typeof query.value === 'string' && query.value !== '/' && query.value.endsWith('/')) {
59
- testValue = query.value.slice(0, -1);
60
- }
61
- if (!(property && operator)) {
62
- return true;
63
- }
64
- if (Array.isArray(testValue)) {
65
- if (operator === 'isNot') {
66
- return testValue.every(val => objectMatchesQuery(userattr, {
67
- property,
68
- operator,
69
- value: val
70
- }));
71
- }
72
- return !!testValue.find(val => objectMatchesQuery(userattr, {
73
- property,
74
- operator,
75
- value: val
76
- }));
77
- }
78
- const value = userattr[property];
79
- if (Array.isArray(value)) {
80
- return value.includes(testValue);
81
- }
82
- switch (operator) {
83
- case 'is':
84
- return value === testValue;
85
- case 'isNot':
86
- return value !== testValue;
87
- case 'contains':
88
- return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));
89
- case 'startsWith':
90
- return isString(value) && value.startsWith(String(testValue));
91
- case 'endsWith':
92
- return isString(value) && value.endsWith(String(testValue));
93
- case 'greaterThan':
94
- return isNumber(value) && isNumber(testValue) && value > testValue;
95
- case 'lessThan':
96
- return isNumber(value) && isNumber(testValue) && value < testValue;
97
- case 'greaterThanOrEqualTo':
98
- return isNumber(value) && isNumber(testValue) && value >= testValue;
99
- case 'lessThanOrEqualTo':
100
- return isNumber(value) && isNumber(testValue) && value <= testValue;
101
- default:
102
- return false;
103
- }
104
- })();
105
- return result;
106
- }
107
- const item = {
108
- query,
109
- startDate,
110
- endDate
111
- };
112
- const now = userAttributes.date && new Date(userAttributes.date) || new Date();
113
- if (item.startDate && new Date(item.startDate) > now) {
114
- return false;
115
- } else if (item.endDate && new Date(item.endDate) < now) {
116
- return false;
117
- }
118
- if (!item.query || !item.query.length) {
119
- return true;
120
- }
121
- return item.query.every(filter => {
122
- return objectMatchesQuery(userAttributes, filter);
123
- });
124
- }`,ue=`function updateVisibilityStylesScript(variants, blockId, isHydrationTarget, locale) {
125
- function getCookie(name) {
126
- const nameEQ = name + '=';
127
- const ca = document.cookie.split(';');
128
- for (let i = 0; i < ca.length; i++) {
129
- let c = ca[i];
130
- while (c.charAt(0) == ' ') c = c.substring(1, c.length);
131
- if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
132
- }
133
- return null;
134
- }
135
- const visibilityStylesEl = document.currentScript?.previousElementSibling;
136
- if (!visibilityStylesEl) {
137
- return;
138
- }
139
- if (isHydrationTarget) {
140
- visibilityStylesEl.remove();
141
- const currentScript = document.currentScript;
142
- if (currentScript) {
143
- currentScript.remove();
144
- }
145
- } else {
146
- const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');
147
- if (locale) {
148
- attributes.locale = locale;
149
- }
150
- const winningVariantIndex = variants?.findIndex(function (variant) {
151
- return window.filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);
152
- });
153
- if (winningVariantIndex !== -1) {
154
- let newStyleStr = variants?.map((_, index) => {
155
- if (index === winningVariantIndex) return '';
156
- return \`div[data-variant-id="\${blockId}-\${index}"] { display: none !important; } \`;
157
- }).join('') || '';
158
- newStyleStr += \`div[data-variant-id="\${blockId}-default"] { display: none !important; } \`;
159
- visibilityStylesEl.innerHTML = newStyleStr;
160
- }
161
- }
162
- }`,Y="default",de="filterWithCustomTargeting",X="builderIoPersonalization",Z="updateVisibilityStylesScript",ee=["react","vue","svelte","qwik"],te=["vue","svelte","qwik"];function ce(e,t){return!(e&&e.length>0)||!t?!1:te.includes(r.TARGET)?!0:!r.isBrowser()}function me({variants:e,previewingIndex:t,isHydrated:n,filteredVariants:o,fallbackBlocks:l}){var a;const u={blocks:l!=null?l:[],path:"this.children",index:Y};if(n&&r.isEditing()){if(typeof t=="number"&&t<((a=e==null?void 0:e.length)!=null?a:0)){const i=e==null?void 0:e[t];if(i)return{blocks:i.blocks,path:`variants.${t}.blocks`,index:t}}return u}if(r.isBrowser()){const i=o==null?void 0:o[0];if(i&&e){const d=e.indexOf(i);if(d!==-1)return{blocks:i.blocks,path:`variants.${d}.blocks`,index:d}}}return u}const pe=()=>`
163
- window.${de} = ${le}
164
- window.${X} = ${se}
165
- window.${Z} = ${ue}
166
- `,ne=r.TARGET==="react",fe=(e,t,n)=>`window.${X}(${JSON.stringify(e)}, "${t}", ${ne}${n?`, "${n}"`:""})`,ge=(e,t,n)=>`window.${Z}(${JSON.stringify(e)}, "${t}", ${ne}${n?`, "${n}"`:""})`,U={"@type":"@builder.io/sdk:Element",layerName:"Accordion item title",responsiveStyles:{large:{marginTop:"10px",position:"relative",display:"flex",alignItems:"stretch",flexDirection:"column",paddingBottom:"10px"}},children:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{textAlign:"left",display:"flex",flexDirection:"column"}},component:{name:"Text",options:{text:"I am an accordion title. Click me!"}}}]},L={"@type":"@builder.io/sdk:Element",layerName:"Accordion item detail",responsiveStyles:{large:{position:"relative",display:"flex",alignItems:"stretch",flexDirection:"column",marginTop:"10px",paddingBottom:"10px"}},children:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{paddingTop:"50px",textAlign:"left",display:"flex",flexDirection:"column",paddingBottom:"50px"}},component:{name:"Text",options:{text:"I am an accordion detail, hello!"}}}]},he={name:"Builder:Accordion",canHaveChildren:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",defaultStyles:{display:"flex",flexDirection:"column",alignItems:"stretch"},inputs:[{name:"items",type:"list",broadcast:!0,subFields:[{name:"title",type:"uiBlocks",hideFromUI:!0,defaultValue:[U]},{name:"detail",type:"uiBlocks",hideFromUI:!0,defaultValue:[L]}],defaultValue:[{title:[U],detail:[L]},{title:[U],detail:[L]}],showIf:e=>!e.get("useChildrenForItems")},{name:"oneAtATime",helperText:"Only allow opening one at a time (collapse all others when new item openned)",type:"boolean",defaultValue:!1},{name:"grid",helperText:"Display as a grid",type:"boolean",defaultValue:!1},{name:"gridRowWidth",helperText:"Display as a grid",type:"string",showIf:e=>e.get("grid"),defaultValue:"25%"},{name:"useChildrenForItems",type:"boolean",helperText:"Use child elements for each slide, instead of the array. Useful for dynamically repeating items",advanced:!0,defaultValue:!1,onChange:e=>{e.get("useChildrenForItems")===!0&&e.set("items",[])}}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},be=s.lazy(()=>Promise.resolve().then(()=>require("./accordion-4bab42b1.cjs"))),ye={name:"Core:Button",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#000000",color:"white",borderRadius:"4px",textAlign:"center",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me!",bubble:!0},{name:"link",type:"url",bubble:!0},{name:"openLinkInNewTab",type:"boolean",defaultValue:!1,friendlyName:"Open link in new tab"}],static:!0,noWrap:!0,shouldReceiveBuilderProps:{builderLinkComponent:!0}},ve={name:"Columns",isRSC:!0,inputs:[{name:"columns",type:"array",broadcast:!0,subFields:[{name:"blocks",type:"array",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{name:"width",type:"number",hideFromUI:!0,helperText:"Width %, e.g. set to 50 to fill half of the space"},{name:"link",type:"url",helperText:"Optionally set a url that clicking this column will link to"}],defaultValue:[{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]}],onChange:e=>{function t(){n.forEach(o=>{o.delete("width")})}const n=e.get("columns");Array.isArray(n)&&n.find(l=>l.get("width"))&&(n.find(u=>!u.get("width"))||n.reduce((i,d)=>i+d.get("width"),0)!==100)&&t()}},{name:"space",type:"number",defaultValue:20,helperText:"Size of gap between columns",advanced:!0},{name:"stackColumnsAt",type:"string",defaultValue:"tablet",helperText:"Convert horizontal columns to vertical at what device size",enum:["tablet","mobile","never"],advanced:!0},{name:"reverseColumnsWhenStacked",type:"boolean",defaultValue:!1,helperText:"When stacking columns for mobile devices, reverse the ordering",advanced:!0}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},xe={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},O=["jpeg","jpg","png","svg","webp","gif","jfif","pjpeg","pjp","apng","avif","tif","tiff","heif","bmp","eps","raw","cr2","nef","orf","sr2","psd","heic","dib","ai"],Se=["mp4","webm","mkv","flv","vob","ogv","ogg","drc","gif","gifv","mng","avi","mov","qt","mts","m2ts","ts","wmv","yuv","rm","rmvb","viv","asf","amv","m4p","mpeg","mpe","m2v","m4v","svi","3gp","3g2","mxf","roq","nsv","f4v","f4p","f4a","f4b"],Te={name:"Image",static:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",defaultStyles:{position:"relative",minHeight:"20px",minWidth:"20px",overflow:"hidden"},canHaveChildren:!0,inputs:[{name:"image",type:"file",bubble:!0,allowedFileTypes:O,required:!0,defaultValue:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",onChange:e=>{e.delete("srcset"),e.delete("noWebp");function n(a,i=6e4){return new Promise((d,b)=>{const f=document.createElement("img");let W=!1;f.onload=()=>{W=!0,d(f)},f.addEventListener("error",C=>{console.warn("Image load failed",C.error),b(C.error)}),f.src=a,setTimeout(()=>{W||b(new Error("Image load timed out"))},i)})}function o(a){return Math.round(a*1e3)/1e3}const l=e.get("image"),u=e.get("aspectRatio");if(fetch(l).then(a=>a.blob()).then(a=>{a.type.includes("svg")&&e.set("noWebp",!0)}),l&&(!u||u===.7041))return n(l).then(a=>{const i=e.get("aspectRatio");e.get("image")===l&&(!i||i===.7041)&&a.width&&a.height&&(e.set("aspectRatio",o(a.height/a.width)),e.set("height",a.height),e.set("width",a.width))})}},{name:"backgroundSize",type:"text",defaultValue:"cover",enum:[{label:"contain",value:"contain",helperText:"The image should never get cropped"},{label:"cover",value:"cover",helperText:"The image should fill it's box, cropping when needed"}]},{name:"backgroundPosition",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"altText",type:"string",helperText:"Text to display when the user has images off"},{name:"title",type:"string",helperText:"Text to display when hovering over the asset"},{name:"height",type:"number",hideFromUI:!0},{name:"width",type:"number",hideFromUI:!0},{name:"sizes",type:"string",hideFromUI:!0},{name:"srcset",type:"string",hideFromUI:!0},{name:"lazy",type:"boolean",defaultValue:!0,hideFromUI:!0},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the image's aspect ratio",defaultValue:!0},{name:"highPriority",type:"boolean",advanced:!0,helperText:"Mark this image as high priority compared to other images on the page. This prevents lazy loading of the image and tells the browser to load this image before others on the page."},{name:"aspectRatio",type:"number",helperText:"This is the ratio of height/width, e.g. set to 1.5 for a 300px wide and 200px tall photo. Set to 0 to not force the image to maintain it's aspect ratio",advanced:!0,defaultValue:.7041}],shouldReceiveBuilderProps:{builderBlock:!0}},Ie={name:"PersonalizationContainer",shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0},noWrap:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F37229ed30d8c41dfb10b8cca1992053a",canHaveChildren:!0,inputs:[{name:"variants",defaultValue:[],behavior:"personalizationVariantList",type:"list",subFields:[{name:"name",type:"text"},{name:"query",friendlyName:"Targeting rules",type:"BuilderQuery",defaultValue:[]},{name:"startDate",type:"date"},{name:"endDate",type:"date"},{name:"blocks",type:"uiBlocks",hideFromUI:!0,defaultValue:[]}]}]},ke=s.lazy(()=>Promise.resolve().then(()=>require("./personalization-container-d12566e8.cjs"))),Ce={name:"Core:Section",static:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",inputs:[{name:"maxWidth",type:"number",defaultValue:1200},{name:"lazyLoad",type:"boolean",defaultValue:!1,advanced:!0,description:"Only render this section when in view"}],defaultStyles:{paddingLeft:"20px",paddingRight:"20px",paddingTop:"50px",paddingBottom:"50px",marginTop:"0px",width:"100vw",marginLeft:"calc(50% - 50vw)"},canHaveChildren:!0,defaultChildren:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{textAlign:"center"}},component:{name:"Text",options:{text:"<p><b>I am a section! My content keeps from getting too wide, so that it's easy to read even on big screens.</b></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</p>"}}}]},we={name:"Slot",isRSC:!0,description:"Allow child blocks to be inserted into this content when used as a Symbol",docsLink:"https://www.builder.io/c/docs/symbols-with-blocks",image:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",inputs:[{name:"name",type:"string",required:!0,defaultValue:"children"}],shouldReceiveBuilderProps:{builderContext:!0,builderComponents:!0}},Ee=s.lazy(()=>Promise.resolve().then(()=>require("./slot-cbbbb02e.cjs"))),Ve={name:"Symbol",noWrap:!0,static:!0,isRSC:!0,inputs:[{name:"symbol",type:"uiSymbol"},{name:"dataOnly",helperText:"Make this a data symbol that doesn't display any UI",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"inheritState",helperText:"Inherit the parent component state and data",type:"boolean",defaultValue:!1,advanced:!0},{name:"renderToLiquid",helperText:"Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"useChildren",hideFromUI:!0,type:"boolean"}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},H={"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{paddingLeft:"20px",paddingRight:"20px",paddingTop:"10px",paddingBottom:"10px",minWidth:"100px",textAlign:"center",display:"flex",flexDirection:"column",cursor:"pointer",userSelect:"none"}},component:{name:"Text",options:{text:"New tab"}}},j={"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{height:"200px",display:"flex",marginTop:"20px",flexDirection:"column"}},component:{name:"Text",options:{text:"New tab content "}}},Re={name:"Builder: Tabs",inputs:[{name:"tabs",type:"list",broadcast:!0,subFields:[{name:"label",type:"uiBlocks",hideFromUI:!0,defaultValue:[H]},{name:"content",type:"uiBlocks",hideFromUI:!0,defaultValue:[j]}],defaultValue:[{label:[{...H,component:{name:"Text",options:{text:"Tab 1"}}}],content:[{...j,component:{name:"Text",options:{text:"Tab 1 content"}}}]},{label:[{...H,component:{name:"Text",options:{text:"Tab 2"}}}],content:[{...j,component:{name:"Text",options:{text:"Tab 2 content"}}}]}]},{name:"activeTabStyle",type:"uiStyle",helperText:"CSS styles for the active tab",defaultValue:{backgroundColor:"rgba(0, 0, 0, 0.1)"}},{name:"defaultActiveTab",type:"number",helperText:'Default tab to open to. Set to "1" for the first tab, "2" for the second, or choose "0" for none',defaultValue:1,advanced:!0},{name:"collapsible",type:"boolean",helperText:"If on, clicking an open tab closes it so no tabs are active",defaultValue:!1,advanced:!0},{name:"tabHeaderLayout",type:"enum",helperText:"Change the layout of the tab headers (uses justify-content)",defaultValue:"flex-start",enum:[{label:"Center",value:"center"},{label:"Space between",value:"space-between"},{label:"Space around",value:"space-around"},{label:"Left",value:"flex-start"},{label:"Right",value:"flex-end"}]}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},Ae=s.lazy(()=>Promise.resolve().then(()=>require("./tabs-bf6643d7.cjs"))),Pe={shouldReceiveBuilderProps:{},name:"Text",static:!0,isRSC:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",inputs:[{name:"text",type:"html",required:!0,autoFocus:!0,bubble:!0,defaultValue:"Enter some text..."}],defaultStyles:{lineHeight:"normal",height:"auto",textAlign:"center"}},De={name:"Custom Code",static:!0,requiredPermissions:["editCode"],inputs:[{name:"code",type:"html",required:!0,defaultValue:"<p>Hello there, I am custom HTML code!</p>",code:!0},{name:"replaceNodes",type:"boolean",helperText:"Preserve server rendered dom nodes",advanced:!0},{name:"scriptsClientOnly",type:"boolean",defaultValue:!1,helperText:"Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",advanced:!0}]},Fe=s.lazy(()=>Promise.resolve().then(()=>require("./custom-code-8fcaa31e.cjs"))),We={name:"Embed",static:!0,inputs:[{name:"url",type:"url",required:!0,defaultValue:"",helperText:"e.g. enter a youtube url, google map, etc"},{name:"content",type:"html",defaultValue:'<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',hideFromUI:!0}]},Ne=s.lazy(()=>Promise.resolve().then(()=>require("./embed-666d3cc4.cjs"))),qe={name:"Form:Form",defaults:{responsiveStyles:{large:{marginTop:"15px",paddingBottom:"15px"}}},image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fef36d2a846134910b64b88e6d18c5ca5",inputs:[{name:"sendSubmissionsTo",type:"string",enum:[{label:"Send to email",value:"email",helperText:"Send form submissions to the email address of your choosing"},{label:"Custom",value:"custom",helperText:"Handle where the form requests go manually with a little code, e.g. to your own custom backend"}],defaultValue:"email"},{name:"sendSubmissionsToEmail",type:"string",required:!0,defaultValue:"your@email.com",showIf:'options.get("sendSubmissionsTo") === "email"'},{name:"sendWithJs",type:"boolean",helperText:"Set to false to use basic html form action",defaultValue:!0,showIf:'options.get("sendSubmissionsTo") === "custom"'},{name:"name",type:"string",defaultValue:"My form"},{name:"action",type:"string",helperText:"URL to send the form data to",showIf:'options.get("sendSubmissionsTo") === "custom"'},{name:"contentType",type:"string",defaultValue:"application/json",advanced:!0,enum:["application/json","multipart/form-data","application/x-www-form-urlencoded"],showIf:'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'},{name:"method",type:"string",showIf:'options.get("sendSubmissionsTo") === "custom"',defaultValue:"POST",advanced:!0},{name:"previewState",type:"string",enum:["unsubmitted","sending","success","error"],defaultValue:"unsubmitted",helperText:'Choose a state to edit, e.g. choose "success" to show what users see on success and edit the message',showIf:'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'},{name:"successUrl",type:"url",helperText:"Optional URL to redirect the user to on form submission success",showIf:'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'},{name:"resetFormOnSubmit",type:"boolean",showIf:"options.get('sendSubmissionsTo') === 'custom' && options.get('sendWithJs') === true",advanced:!0},{name:"successMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Thanks!</span>"}}}]},{name:"validate",type:"boolean",defaultValue:!0,advanced:!0},{name:"errorMessagePath",type:"text",advanced:!0,helperText:'Path to where to get the error message from in a JSON response to display to the user, e.g. "error.message" for a response like { "error": { "message": "this username is taken" }}'},{name:"errorMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},bindings:{"component.options.text":"state.formErrorMessage || block.component.options.text"},component:{name:"Text",options:{text:"<span>Form submission error :( Please check your answers and try again</span>"}}}]},{name:"sendingMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Sending...</span>"}}}]},{name:"customHeaders",type:"map",valueType:{type:"string"},advanced:!0,showIf:'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'}],noWrap:!0,canHaveChildren:!0,defaultChildren:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Enter your name</span>"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:Input",options:{name:"name",placeholder:"Jane Doe"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Enter your email</span>"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:Input",options:{name:"email",placeholder:"jane@doe.com"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:SubmitButton",options:{text:"Submit"}}}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},_e=s.lazy(()=>Promise.resolve().then(()=>require("./form-51f639ab.cjs"))),$e={name:"Form:Input",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",inputs:[{name:"type",type:"text",enum:["text","number","email","url","checkbox","radio","range","date","datetime-local","search","tel","time","file","month","week","password","color","hidden"],defaultValue:"text"},{name:"name",type:"string",required:!0,helperText:'Every input in a form needs a unique name describing what it takes, e.g. "email"'},{name:"placeholder",type:"string",defaultValue:"Hello there",helperText:"Text to display when there is no value"},{name:"defaultValue",type:"string"},{name:"value",type:"string",advanced:!0},{name:"required",type:"boolean",helperText:"Is this input required to be filled out to submit a form",defaultValue:!1}],noWrap:!0,static:!0,defaultStyles:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",borderRadius:"3px",borderWidth:"1px",borderStyle:"solid",borderColor:"#ccc"}},Be=s.lazy(()=>Promise.resolve().then(()=>require("./input-d31d6451.cjs"))),Ue={name:"Form:Select",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",defaultStyles:{alignSelf:"flex-start"},inputs:[{name:"options",type:"list",required:!0,subFields:[{name:"value",type:"text",required:!0},{name:"name",type:"text"}],defaultValue:[{value:"option 1"},{value:"option 2"}]},{name:"name",type:"string",required:!0,helperText:'Every select in a form needs a unique name describing what it gets, e.g. "email"'},{name:"defaultValue",type:"string"},{name:"value",type:"string",advanced:!0},{name:"required",type:"boolean",defaultValue:!1}],static:!0,noWrap:!0},Le=s.lazy(()=>Promise.resolve().then(()=>require("./select-c3085265.cjs"))),He={name:"Form:SubmitButton",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#3898EC",color:"white",borderRadius:"4px",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me"}],static:!0,noWrap:!0},je=s.lazy(()=>Promise.resolve().then(()=>require("./submit-button-b363e0ed.cjs"))),Oe={name:"Form:TextArea",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",inputs:[{advanced:!0,name:"value",type:"string"},{name:"name",type:"string",required:!0,helperText:'Every input in a form needs a unique name describing what it gets, e.g. "email"'},{name:"defaultValue",type:"string"},{name:"placeholder",type:"string",defaultValue:"Hello there"},{name:"required",type:"boolean",defaultValue:!1}],defaultStyles:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",borderRadius:"3px",borderWidth:"1px",borderStyle:"solid",borderColor:"#ccc"},static:!0,noWrap:!0},ze=s.lazy(()=>Promise.resolve().then(()=>require("./textarea-56a875bc.cjs"))),Ke={name:"Raw:Img",hideFromInsertMenu:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",inputs:[{name:"image",bubble:!0,type:"file",allowedFileTypes:O,required:!0}],noWrap:!0,static:!0},Me=s.lazy(()=>Promise.resolve().then(()=>require("./img-b04b9b6d.cjs"))),Je={name:"Video",canHaveChildren:!0,defaultStyles:{minHeight:"20px",minWidth:"20px"},image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",inputs:[{name:"video",type:"file",allowedFileTypes:Se,bubble:!0,defaultValue:"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fd27731a526464deba0016216f5f9e570%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=d27731a526464deba0016216f5f9e570&alt=media&optimized=true",required:!0},{name:"posterImage",type:"file",allowedFileTypes:O,helperText:"Image to show before the video plays"},{name:"autoPlay",type:"boolean",defaultValue:!0},{name:"controls",type:"boolean",defaultValue:!1},{name:"muted",type:"boolean",defaultValue:!0},{name:"loop",type:"boolean",defaultValue:!0},{name:"playsInline",type:"boolean",defaultValue:!0},{name:"fit",type:"text",defaultValue:"cover",enum:["contain","cover","fill","auto"]},{name:"preload",type:"text",defaultValue:"metadata",enum:["auto","metadata","none"]},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the aspect ratio",defaultValue:!0,advanced:!0},{name:"position",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"height",type:"number",advanced:!0},{name:"width",type:"number",advanced:!0},{name:"aspectRatio",type:"number",advanced:!0,defaultValue:.7004048582995948},{name:"lazyLoad",type:"boolean",helperText:'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',defaultValue:!0,advanced:!0}],shouldReceiveBuilderProps:{builderBlock:!0}},Ge=()=>[{component:Fe,...De},{component:Ne,...We},{component:_e,...qe},{component:Be,...$e},{component:je,...He},{component:Le,...Ue},{component:ze,...Oe},{component:Me,...Ke},{component:P.Video,...Je}],K=()=>[{component:P.Button,...ye},{component:P.Columns,...ve},{component:P.Fragment,...xe},{component:P.Image,...Te},{component:P.Section,...Ce},{component:Ee,...we},{component:P.Symbol,...Ve},{component:P.Text,...Pe},...ee.includes(r.TARGET)?[{component:ke,...Ie}]:[],{component:Ae,...Re},{component:be,...he},...Ge()],Qe=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget, isAngularSDK) {
167
- function getAndSetVariantId() {
168
- function setCookie(name, value, days) {
169
- let expires = '';
170
- if (days) {
171
- const date = new Date();
172
- date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
173
- expires = '; expires=' + date.toUTCString();
174
- }
175
- document.cookie = name + '=' + (value || '') + expires + '; path=/' + '; Secure; SameSite=None';
176
- }
177
- function getCookie(name) {
178
- const nameEQ = name + '=';
179
- const ca = document.cookie.split(';');
180
- for (let i = 0; i < ca.length; i++) {
181
- let c = ca[i];
182
- while (c.charAt(0) === ' ') c = c.substring(1, c.length);
183
- if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
184
- }
185
- return null;
186
- }
187
- const cookieName = \`builder.tests.\${contentId}\`;
188
- const variantInCookie = getCookie(cookieName);
189
- const availableIDs = variants.map(vr => vr.id).concat(contentId);
190
- if (variantInCookie && availableIDs.includes(variantInCookie)) {
191
- return variantInCookie;
192
- }
193
- let n = 0;
194
- const random = Math.random();
195
- for (let i = 0; i < variants.length; i++) {
196
- const variant = variants[i];
197
- const testRatio = variant.testRatio;
198
- n += testRatio;
199
- if (random < n) {
200
- setCookie(cookieName, variant.id);
201
- return variant.id;
202
- }
203
- }
204
- setCookie(cookieName, contentId);
205
- return contentId;
206
- }
207
- const winningVariantId = getAndSetVariantId();
208
- let styleEl = document.currentScript?.previousElementSibling;
209
- if (isAngularSDK) {
210
- styleEl = document.currentScript?.parentElement?.previousElementSibling?.querySelector('style');
211
- }
212
- if (isHydrationTarget) {
213
- styleEl.remove();
214
- const thisScriptEl = document.currentScript;
215
- thisScriptEl?.remove();
216
- } else {
217
- const newStyleStr = variants.concat({
218
- id: contentId
219
- }).filter(variant => variant.id !== winningVariantId).map(value => {
220
- return \`.variant-\${value.id} { display: none; }
221
- \`;
222
- }).join('');
223
- styleEl.innerHTML = newStyleStr;
224
- }
225
- }`,Ye=`function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
226
- if (!navigator.cookieEnabled) {
227
- return;
228
- }
229
- function getCookie(name) {
230
- const nameEQ = name + '=';
231
- const ca = document.cookie.split(';');
232
- for (let i = 0; i < ca.length; i++) {
233
- let c = ca[i];
234
- while (c.charAt(0) === ' ') c = c.substring(1, c.length);
235
- if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
236
- }
237
- return null;
238
- }
239
- const cookieName = \`builder.tests.\${defaultContentId}\`;
240
- const winningVariant = getCookie(cookieName);
241
- const parentDiv = document.currentScript?.parentElement;
242
- const isDefaultContent = variantContentId === defaultContentId;
243
- const isWinningVariant = winningVariant === variantContentId;
244
- if (isWinningVariant && !isDefaultContent) {
245
- parentDiv?.removeAttribute('hidden');
246
- parentDiv?.removeAttribute('aria-hidden');
247
- } else if (!isWinningVariant && isDefaultContent) {
248
- parentDiv?.setAttribute('hidden', 'true');
249
- parentDiv?.setAttribute('aria-hidden', 'true');
250
- }
251
- if (isHydrationTarget) {
252
- if (!isWinningVariant) {
253
- parentDiv?.remove();
254
- }
255
- const thisScriptEl = document.currentScript;
256
- thisScriptEl?.remove();
257
- }
258
- return;
259
- }`,ie="builderIoAbTest",ae="builderIoRenderContent",B=e=>Object.values((e==null?void 0:e.variations)||{}).map(t=>({...t,testVariationId:t.id,id:e==null?void 0:e.id})),Xe=({canTrack:e,content:t})=>!(!(B(t).length>0)||!e||r.isBrowser()),Ze=e=>e==="react"||e==="reactNative",et=r.TARGET==="angular",oe=Ze(r.TARGET),tt=()=>`
260
- window.${ie} = ${Qe}
261
- window.${ae} = ${Ye}
262
- `,nt=(e,t)=>`
263
- window.${ie}(
264
- "${t}",${JSON.stringify(e)}, ${oe}, ${et}
265
- )`,it=({contentId:e,variationId:t})=>`window.${ae}(
266
- "${t}", "${e}", ${oe}
267
- )`;function $(e){return h.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},"data-id":e.id,nonce:e.nonce||""})}function M(e){return Math.round(e*1e3)/1e3}const at=(e,t,n=!0)=>{if(!(e instanceof HTMLElement))return null;let o=n?e:e.parentElement;do{if(!o)return null;if(t(o))return o}while(o=o.parentElement);return null},ot=e=>at(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),J=({event:e,target:t})=>{const n=t.getBoundingClientRect(),o=e.clientX-n.left,l=e.clientY-n.top,u=M(o/n.width),a=M(l/n.height);return{x:u,y:a}},rt=e=>{const t=e.target,n=t&&ot(t),o=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:o||void 0,metadata:{targetOffset:t?J({event:e,target:t}):void 0,builderTargetOffset:n?J({event:e,target:n}):void 0,builderElementIndex:n&&o?[].slice.call(document.getElementsByClassName(o)).indexOf(n):void 0}}},st=["svelte","qwik","vue"],G=()=>st.includes(r.TARGET)&&(r.isEditing()||r.isPreviewing()),lt=e=>{var u,a;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],o=(a=e.fileUrl)!=null?a:(u=e==null?void 0:e.files)==null?void 0:u.regular;let l="";if(o&&t&&n&&(l+=`
268
- @font-face {
269
- font-family: "${t}";
270
- src: local("${n}"), url('${o}') format('woff2');
271
- font-display: fallback;
272
- font-weight: 400;
273
- }
274
- `.trim()),e.files)for(const i in e.files){if(!(String(Number(i))===i))continue;const b=e.files[i];b&&b!==o&&(l+=`
275
- @font-face {
276
- font-family: "${t}";
277
- src: url('${b}') format('woff2');
278
- font-display: fallback;
279
- font-weight: ${i};
280
- }
281
- `.trim())}return l},ut=({customFonts:e})=>{var t;return((t=e==null?void 0:e.map(n=>lt(n)))==null?void 0:t.join(" "))||""},dt=({cssCode:e,contentId:t})=>e?t?(e==null?void 0:e.replace(/&/g,`div[builder-content-id="${t}"]`))||"":e:"",ct=`
282
- .builder-button {
283
- all: unset;
284
- }
285
-
286
- .builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
287
- margin: 0;
288
- }
289
- .builder-text > p, .builder-text > .builder-paragraph {
290
- color: inherit;
291
- line-height: inherit;
292
- letter-spacing: inherit;
293
- font-weight: inherit;
294
- font-size: inherit;
295
- text-align: inherit;
296
- font-family: inherit;
297
- }
298
- `,mt=e=>e?"":ct,pt=e=>`variant-${e}`;function ft(e){var T,w,D;const t=s.useRef(null);s.useState(()=>!1);function n(p){var v,x;const g={...e.builderContextSignal.rootState,...p};e.builderContextSignal.rootSetState?(x=(v=e.builderContextSignal).rootSetState)==null||x.call(v,g):e.setBuilderContextSignal(y=>({...y,rootState:g}))}function o(p){var v,x,y,I,A;const g={...e.builderContextSignal.content,...p,data:{...(v=e.builderContextSignal.content)==null?void 0:v.data,...p==null?void 0:p.data},meta:{...(x=e.builderContextSignal.content)==null?void 0:x.meta,...p==null?void 0:p.meta,breakpoints:((y=p==null?void 0:p.meta)==null?void 0:y.breakpoints)||((A=(I=e.builderContextSignal.content)==null?void 0:I.meta)==null?void 0:A.breakpoints)}};e.setBuilderContextSignal(q=>({...q,content:g}))}function l(){return e.showContent?{}:{hidden:!0,"aria-hidden":!0}}const[u,a]=s.useState(()=>e.contentWrapper||"div");function i(p){return r.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:g=>{var y;const{breakpoints:v,contentId:x}=g;!x||x!==((y=e.builderContextSignal.content)==null?void 0:y.id)||v&&o({meta:{breakpoints:v}})},animation:g=>{F.triggerAnimation(g)},contentUpdate:g=>{o(g)},stateUpdate:g=>{n(g)}}})(p)}const[d,b]=s.useState(()=>({})),[f,W]=s.useState(()=>({})),[C,R]=s.useState(()=>!1);function m(p){var g,v;if(e.builderContextSignal.content){const x=(g=e.builderContextSignal.content)==null?void 0:g.testVariationId,y=(v=e.builderContextSignal.content)==null?void 0:v.id;r._track({apiHost:e.apiHost,type:"click",canTrack:r.getDefaultCanTrack(e.canTrack),contentId:y,apiKey:e.apiKey,variationId:x!==y?x:void 0,...rt(p),unique:!C})}C||R(!0)}function c(){var g,v,x;const p=(x=(v=(g=e.builderContextSignal.content)==null?void 0:g.data)==null?void 0:v.httpRequests)!=null?x:{};Object.entries(p).forEach(([y,I])=>{if(!I)return;const A=typeof I=="object"&&I["@type"]==="@builder.io/core:Request";if(f[y]||d[y]&&!r.isEditing())return;const q=A?I.request.url:I;f[y]=!0;const k=q.replace(/{{([^}]+)}}/g,(V,_)=>String(F.evaluate({code:_,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState}))),S=A?{url:k,method:I.request.method,headers:I.request.headers,body:I.request.body}:{url:k,method:"GET"};r.logFetch(JSON.stringify(S)),fetch(S.url,{method:S.method,headers:S.headers,body:S.body}).then(V=>V.json()).then(V=>{n({[y]:V}),d[y]=!0}).catch(V=>{console.error("error fetching dynamic data",JSON.stringify(I),V)}).finally(()=>{f[y]=!1})})}function E(){r.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:F.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}const N=s.useRef(!1);return N.current||(c(),E(),N.current=!0),s.useEffect(()=>{var p,g,v,x,y;if(r.isBrowser()){r.isEditing()&&!e.isNestedRender&&(window.addEventListener("message",i),r.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{},modelName:(p=e.model)!=null?p:"",apiKey:e.apiKey}),Object.values(e.builderContextSignal.componentInfos).forEach(k=>{var S,V;if(!((S=k.models)!=null&&S.length)||k.models.includes(e.model)){const _=r.createRegisterComponentMessage(k);(V=window.parent)==null||V.postMessage(_,"*")}}),window.addEventListener("builder:component:stateChangeListenerActivated",E));const I=e.builderContextSignal.content&&r.getDefaultCanTrack(e.canTrack),A=r.getCookieSync({name:`builder.tests.${(g=e.builderContextSignal.content)==null?void 0:g.id}`,canTrack:!0}),q=(v=e.builderContextSignal.content)==null?void 0:v.testVariationId;if(I&&q===A){const k=(x=e.builderContextSignal.content)==null?void 0:x.id,S=e.apiKey;r._track({apiHost:e.apiHost,type:"impression",canTrack:!0,contentId:k,apiKey:S,variationId:A!==k?A:void 0})}if(r.isPreviewing()&&!r.isEditing()){const k=new URL(location.href).searchParams,S=k.get("builder.preview"),V=k.get(`builder.overrides.${S}`),_=k.get("apiKey")||k.get("builder.space");(S==="BUILDER_STUDIO"||S===e.model&&_===e.apiKey&&(!e.content||V===e.content.id))&&r.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion,...S==="BUILDER_STUDIO"&&((y=e.context)!=null&&y.symbolId)?{query:{id:e.context.symbolId}}:{}}).then(z=>{z&&o(z)})}}},[]),s.useEffect(()=>{e.content&&o(e.content)},[e.content]),s.useEffect(()=>{E()},[e.builderContextSignal.rootState]),s.useEffect(()=>{e.data&&n(e.data)},[e.data]),s.useEffect(()=>{e.locale&&n({locale:e.locale})},[e.locale]),s.useEffect(()=>()=>{r.isBrowser()&&(window.removeEventListener("message",i),window.removeEventListener("builder:component:stateChangeListenerActivated",E))},[]),h.jsx(P.BuilderContext.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content||G()?h.jsx(u,{ref:t,onClick:p=>m(p),"builder-content-id":(T=e.builderContextSignal.content)==null?void 0:T.id,"builder-model":e.model,className:pt(((w=e.content)==null?void 0:w.testVariationId)||((D=e.content)==null?void 0:D.id)),style:{display:!e.builderContextSignal.content&&G()?"none":void 0},...l(),...e.contentWrapperProps,children:e.children}):null})}function gt(e){const[t,n]=s.useState(()=>`
299
- ${dt({cssCode:e.cssCode,contentId:e.contentId})}
300
- ${ut({customFonts:e.customFonts})}
301
- ${mt(e.isNestedRender)}
302
- `.trim());return h.jsx(F.InlinedStyles,{id:"builderio-content",styles:t,nonce:e.nonce})}const ht=({content:e,data:t,locale:n})=>{var u,a,i;const o={},l=((u=e==null?void 0:e.data)==null?void 0:u.state)||{};return(i=(a=e==null?void 0:e.data)==null?void 0:a.inputs)==null||i.forEach(d=>{d.name&&d.defaultValue!==void 0&&(o[d.name]=d.defaultValue)}),{...o,...l,...t,...n?{locale:n}:{}}},bt=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function Q(e){var b,f,W,C,R,m,c,E,N;const[t,n]=s.useState(()=>{var T,w;return it({variationId:(T=e.content)==null?void 0:T.testVariationId,contentId:(w=e.content)==null?void 0:w.id})});function o(T){i(w=>({...w,rootState:T}))}const[l,u]=s.useState(()=>[...K(),...e.customComponents||[]].reduce((T,{component:w,...D})=>({...T,[D.name]:{component:w,...r.serializeIncludingFunctions(D)}}),{})),[a,i]=s.useState(()=>({content:bt({content:e.content,data:e.data}),localState:void 0,rootState:ht({content:e.content,data:e.data,locale:e.locale}),rootSetState:o,context:e.context||{},canTrack:e.canTrack,apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...K(),...e.customComponents||[]].reduce((T,{component:w,...D})=>({...T,[D.name]:r.serializeIncludingFunctions(D)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{},nonce:e.nonce||"",model:e.model})),d=s.useRef(!1);if(!d.current){e.apiKey||r.logger.error("No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop.");const T=(f=(b=a.content)==null?void 0:b.data)==null?void 0:f.jsCode;T&&F.evaluate({code:T,context:e.context||{},localState:void 0,rootState:a.rootState,rootSetState:w=>{Object.assign(a.rootState,w)},isExpression:!1}),d.current=!0}return h.jsx(F.ComponentsContext.Provider,{value:{registeredComponents:l},children:h.jsxs(ft,{apiHost:e.apiHost,nonce:e.nonce,content:e.content,data:e.data,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,showContent:e.showContent,builderContextSignal:a,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts,isNestedRender:e.isNestedRender,setBuilderContextSignal:i,children:[e.isSsrAbTest?h.jsx($,{id:"builderio-variant-visibility",scriptStr:t,nonce:e.nonce||""}):null,h.jsx(gt,{nonce:e.nonce||"",isNestedRender:e.isNestedRender,contentId:(W=a.content)==null?void 0:W.id,cssCode:(R=(C=a.content)==null?void 0:C.data)==null?void 0:R.cssCode,customFonts:(c=(m=a.content)==null?void 0:m.data)==null?void 0:c.customFonts}),h.jsx(F.Blocks,{blocks:(N=(E=a.content)==null?void 0:E.data)==null?void 0:N.blocks,context:a,registeredComponents:l,linkComponent:e.linkComponent})]})})}function yt(e){var a;const[t,n]=s.useState(()=>Xe({canTrack:r.getDefaultCanTrack(e.canTrack),content:e.content}));function o(){var i;return nt(B(e.content).map(d=>({id:d.testVariationId,testRatio:d.testRatio})),((i=e.content)==null?void 0:i.id)||"")}function l(){return B(e.content).map(i=>`.variant-${i.testVariationId} { display: none; } `).join("")}function u(){var i;return t?{...e.content,testVariationId:(i=e.content)==null?void 0:i.id}:r.handleABTestingSync({item:e.content,canTrack:r.getDefaultCanTrack(e.canTrack)})}return s.useEffect(()=>{},[]),h.jsxs(h.Fragment,{children:[!e.isNestedRender&&r.TARGET!=="reactNative"?h.jsxs(h.Fragment,{children:[h.jsx($,{id:"builderio-init-variants-fns",scriptStr:tt(),nonce:e.nonce||""}),ee.includes(r.TARGET)?h.jsx($,{id:"builderio-init-personalization-variants-fns",nonce:e.nonce||"",scriptStr:pe()}):null]}):null,t?h.jsxs(h.Fragment,{children:[h.jsx(F.InlinedStyles,{id:"builderio-variants",styles:l(),nonce:e.nonce||""}),h.jsx($,{id:"builderio-variants-visibility",scriptStr:o(),nonce:e.nonce||""}),(a=B(e.content))==null?void 0:a.map(i=>h.jsx(Q,{apiHost:e.apiHost,isNestedRender:e.isNestedRender,nonce:e.nonce,content:i,showContent:!1,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts},i.testVariationId))]}):null,h.jsx(Q,{apiHost:e.apiHost,nonce:e.nonce,isNestedRender:e.isNestedRender,content:u(),showContent:!0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts})]})}const vt=Object.freeze(Object.defineProperty({__proto__:null,default:yt},Symbol.toStringTag,{value:"Module"}));exports.DEFAULT_INDEX=Y;exports.InlinedScript=$;exports.SDKS_REQUIRING_RESET_APPROACH=te;exports.checkShouldRenderVariants=ce;exports.contentVariants=vt;exports.filterWithCustomTargeting=re;exports.getBlocksToRender=me;exports.getPersonalizationScript=fe;exports.getUpdateVisibilityStylesScript=ge;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),S=require("react"),h=require("./blocks-d07d0261.cjs"),q=require("./server-entry-acf5ce7d.cjs");require("./blocks-exports.cjs");require("./get-class-prop-name-2869a960.cjs");require("./dynamic-renderer-b29b45ca.cjs");const A=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],O=()=>{const e=process.env.NODE_ENV||"production";return A.includes(e)?e:"production"};function R(e){const r=S.useRef(null),[w,u]=S.useState(()=>"unsubmitted"),[y,E]=S.useState(()=>null),[J,F]=S.useState(()=>"");function x(s){var d,m;const l={...e.builderContext.rootState,...s};e.builderContext.rootSetState?(m=(d=e.builderContext).rootSetState)==null||m.call(d,l):e.builderContext.rootState=l}function g(){return q.isEditing()&&e.previewState||w}function N(s){var d;const l=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")s.preventDefault();else if(l){if(!(e.action||e.sendSubmissionsTo==="email")){s.preventDefault();return}s.preventDefault();const m=s.currentTarget||s.target,T=e.customHeaders||{};let v;const P=new FormData(m),C=Array.from(m.querySelectorAll("input,select,textarea")).filter(t=>!!t.name).filter(t=>!!t.name&&(t.type!=="radio"||t.checked)).map(t=>{let n;const a=t.name;if(t instanceof HTMLInputElement)if(t.type==="radio"){if(t.checked)return n=t.value,{key:a,value:n}}else if(t.type==="checkbox")n=t.checked;else if(t.type==="number"||t.type==="range"){const f=t.valueAsNumber;isNaN(f)||(n=f)}else t.type==="file"?n=t.files:n=t.value;else n=t.value;return{key:a,value:n}});let c=e.contentType;if(e.sendSubmissionsTo==="email"&&(c="multipart/form-data"),Array.from(C).forEach(({value:t})=>{(t instanceof File||Array.isArray(t)&&t[0]instanceof File||t instanceof FileList)&&(c="multipart/form-data")}),c!=="application/json")v=P;else{const t={};Array.from(C).forEach(({value:n,key:a})=>{h.set(t,a,n)}),v=JSON.stringify(t)}c&&c!=="multipart/form-data"&&(l&&((d=e.action)!=null&&d.includes("zapier.com"))||(T["content-type"]=c));const k=new CustomEvent("presubmit",{detail:{body:v}});if(r.current&&(r.current.dispatchEvent(k),k.defaultPrevented))return;if(u("sending"),e.sendSubmissionsTo==="email"&&(e.sendSubmissionsToEmail==="your@email.com"||!e.sendSubmissionsToEmail)){const t="SubmissionsToEmail is required when sendSubmissionsTo is set to email";console.error(t),u("error"),x({formErrorMessage:t});return}const D=`${O()==="dev"?"http://localhost:5000":"https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(e.sendSubmissionsToEmail||"")}&name=${encodeURIComponent(e.name||"")}`,M=e.sendSubmissionsTo==="email"?D:e.action;q.logFetch(M),fetch(M,{body:v,headers:T,method:e.method||"post"}).then(async t=>{var f,j;let n;const a=t.headers.get("content-type");if(a&&a.indexOf("application/json")!==-1?n=await t.json():n=await t.text(),!t.ok){const b=new CustomEvent("submit:error",{detail:{error:n,status:t.status}});if((f=r.current)!=null&&f.nativeElement&&((j=r.current)==null||j.nativeElement.dispatchEvent(b),b.defaultPrevented))return;E(n),u("error");let i=e.errorMessagePath?h.get(n,e.errorMessagePath):n.message||n.error||n;typeof i!="string"&&(i=JSON.stringify(i)),F(i),x({formErrorMessage:i});return}if(E(n),u(t.ok?"success":"error"),t.ok){const b=new CustomEvent("submit:success",{detail:{res:t,body:n}});if(r.current){if(r.current.dispatchEvent(b),b.defaultPrevented)return;e.resetFormOnSubmit!==!1&&r.current.reset()}if(e.successUrl)if(r.current){const i=new CustomEvent("route",{detail:{url:e.successUrl}});r.current.dispatchEvent(i),i.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},t=>{const n=new CustomEvent("submit:error",{detail:{error:t}});r.current&&(r.current.dispatchEvent(n),n.defaultPrevented)||(E(t),u("error"))})}}return o.jsxs(o.Fragment,{children:[" ",o.jsx("style",{children:".pre-26f6d56a { padding: 10px; color: red; text-align: center; }"})," ",o.jsxs("form",{validate:e.validate,ref:r,action:!e.sendWithJs&&e.action,method:e.method,name:e.name,onSubmit:s=>N(s),...e.attributes,children:[e.children,g()==="error"?o.jsx(h.Blocks,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext}):null,g()==="sending"?o.jsx(h.Blocks,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext}):null,g()==="error"&&y?o.jsx("pre",{className:"builder-form-error-text pre-26f6d56a",children:JSON.stringify(y,null,2)}):null,g()==="success"?o.jsx(h.Blocks,{path:"successMessage",blocks:e.successMessage,context:e.builderContext}):null]})," "]})}exports.default=R;
@@ -1,94 +0,0 @@
1
- import { jsxs as l, Fragment as a, jsx as t } from "react/jsx-runtime";
2
- import { useEffect as v } from "react";
3
- import { getSrcSet as d } from "./image.helpers-3e926d47.js";
4
- function w(e) {
5
- var r, u, s, g, m, h;
6
- function c() {
7
- var f;
8
- const i = e.image || e.src;
9
- if (!i || // We can auto add srcset for cdn.builder.io and shopify
10
- // images, otherwise you can supply this prop manually
11
- !(typeof i == "string" && (i.match(/builder\.io/) || i.match(/cdn\.shopify\.com/))))
12
- return e.srcset;
13
- if (!e.noWebp) {
14
- if (e.srcset && ((f = e.image) != null && f.includes("builder.io/api/v1/image"))) {
15
- if (!e.srcset.includes(e.image.split("?")[0]))
16
- return console.debug("Removed given srcset"), d(i);
17
- } else if (e.image && !e.srcset)
18
- return d(i);
19
- return d(i);
20
- }
21
- }
22
- function o() {
23
- var n;
24
- return (n = c == null ? void 0 : c()) != null && n.match(/builder\.io/) && !e.noWebp ? c().replace(/\?/g, "?format=webp&") : "";
25
- }
26
- function b() {
27
- const n = {
28
- position: "absolute",
29
- height: "100%",
30
- width: "100%",
31
- left: "0px",
32
- top: "0px"
33
- };
34
- return e.aspectRatio ? n : void 0;
35
- }
36
- return v(() => {
37
- }, []), /* @__PURE__ */ l(a, { children: [
38
- /* @__PURE__ */ t("style", { children: `.img-3cc22d08 {
39
- opacity: 1;
40
- transition: opacity 0.2s ease-in-out;
41
- }.div-3cc22d08 {
42
- width: 100%;
43
- pointer-events: none;
44
- font-size: 0;
45
- }.div-3cc22d08-2 {
46
- display: flex;
47
- flex-direction: column;
48
- align-items: stretch;
49
- position: absolute;
50
- top: 0;
51
- left: 0;
52
- width: 100%;
53
- height: 100%;
54
- }` }),
55
- /* @__PURE__ */ l(a, { children: [
56
- /* @__PURE__ */ l("picture", { children: [
57
- o() ? /* @__PURE__ */ t("source", { type: "image/webp", srcSet: o() }) : null,
58
- /* @__PURE__ */ t(
59
- "img",
60
- {
61
- loading: e.highPriority ? "eager" : "lazy",
62
- fetchPriority: e.highPriority ? "high" : "auto",
63
- alt: e.altText,
64
- title: e.title,
65
- role: e.altText ? void 0 : "presentation",
66
- style: {
67
- objectPosition: e.backgroundPosition || "center",
68
- objectFit: e.backgroundSize || "cover",
69
- ...b()
70
- },
71
- className: "builder-image" + (e.className ? " " + e.className : "") + " img-3cc22d08",
72
- src: e.image,
73
- srcSet: c(),
74
- sizes: e.sizes
75
- }
76
- )
77
- ] }),
78
- e.aspectRatio && !((u = (r = e.builderBlock) == null ? void 0 : r.children) != null && u.length && e.fitContent) ? /* @__PURE__ */ t(
79
- "div",
80
- {
81
- className: "builder-image-sizer div-3cc22d08",
82
- style: {
83
- paddingTop: e.aspectRatio * 100 + "%"
84
- }
85
- }
86
- ) : null,
87
- (g = (s = e.builderBlock) == null ? void 0 : s.children) != null && g.length && e.fitContent ? /* @__PURE__ */ t(a, { children: e.children }) : null,
88
- !e.fitContent && ((h = (m = e.builderBlock) == null ? void 0 : m.children) != null && h.length) ? /* @__PURE__ */ t("div", { className: "div-3cc22d08-2", children: e.children }) : null
89
- ] })
90
- ] });
91
- }
92
- export {
93
- w as default
94
- };
@@ -1,17 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),f=require("react"),l=require("./image.helpers-dba8a869.cjs");function b(e){var s,r,d,u,o,g;function c(){var h;const i=e.image||e.src;if(!i||!(typeof i=="string"&&(i.match(/builder\.io/)||i.match(/cdn\.shopify\.com/))))return e.srcset;if(!e.noWebp){if(e.srcset&&((h=e.image)!=null&&h.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),l.getSrcSet(i)}else if(e.image&&!e.srcset)return l.getSrcSet(i);return l.getSrcSet(i)}}function a(){var n;return(n=c==null?void 0:c())!=null&&n.match(/builder\.io/)&&!e.noWebp?c().replace(/\?/g,"?format=webp&"):""}function m(){const n={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?n:void 0}return f.useEffect(()=>{},[]),t.jsxs(t.Fragment,{children:[t.jsx("style",{children:`.img-3cc22d08 {
2
- opacity: 1;
3
- transition: opacity 0.2s ease-in-out;
4
- }.div-3cc22d08 {
5
- width: 100%;
6
- pointer-events: none;
7
- font-size: 0;
8
- }.div-3cc22d08-2 {
9
- display: flex;
10
- flex-direction: column;
11
- align-items: stretch;
12
- position: absolute;
13
- top: 0;
14
- left: 0;
15
- width: 100%;
16
- height: 100%;
17
- }`}),t.jsxs(t.Fragment,{children:[t.jsxs("picture",{children:[a()?t.jsx("source",{type:"image/webp",srcSet:a()}):null,t.jsx("img",{loading:e.highPriority?"eager":"lazy",fetchPriority:e.highPriority?"high":"auto",alt:e.altText,title:e.title,role:e.altText?void 0:"presentation",style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...m()},className:"builder-image"+(e.className?" "+e.className:"")+" img-3cc22d08",src:e.image,srcSet:c(),sizes:e.sizes})]}),e.aspectRatio&&!((r=(s=e.builderBlock)==null?void 0:s.children)!=null&&r.length&&e.fitContent)?t.jsx("div",{className:"builder-image-sizer div-3cc22d08",style:{paddingTop:e.aspectRatio*100+"%"}}):null,(u=(d=e.builderBlock)==null?void 0:d.children)!=null&&u.length&&e.fitContent?t.jsx(t.Fragment,{children:e.children}):null,!e.fitContent&&((g=(o=e.builderBlock)==null?void 0:o.children)!=null&&g.length)?t.jsx("div",{className:"div-3cc22d08-2",children:e.children}):null]})]})}exports.default=b;
@@ -1,33 +0,0 @@
1
- function c(t) {
2
- return t.replace(/http(s)?:/, "");
3
- }
4
- function p(t = "", e, n) {
5
- const o = new RegExp("([?&])" + e + "=.*?(&|$)", "i"), i = t.indexOf("?") !== -1 ? "&" : "?";
6
- return t.match(o) ? t.replace(o, "$1" + e + "=" + encodeURIComponent(n) + "$2") : t + i + e + "=" + encodeURIComponent(n);
7
- }
8
- function a(t, e) {
9
- if (!t || !(t != null && t.match(/cdn\.shopify\.com/)) || !e)
10
- return t;
11
- if (e === "master")
12
- return c(t);
13
- const n = t.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
14
- if (n) {
15
- const o = t.split(n[0]), i = n[3], f = e.match("x") ? e : `${e}x`;
16
- return c(`${o[0]}_${f}${i}`);
17
- }
18
- return null;
19
- }
20
- function r(t) {
21
- if (!t)
22
- return t;
23
- const e = [100, 200, 400, 800, 1200, 1600, 2e3];
24
- if (t.match(/builder\.io/)) {
25
- let n = t;
26
- const o = Number(t.split("?width=")[1]);
27
- return isNaN(o) || (n = `${n} ${o}w`), e.filter((i) => i !== o).map((i) => `${p(t, "width", i)} ${i}w`).concat([n]).join(", ");
28
- }
29
- return t.match(/cdn\.shopify\.com/) ? e.map((n) => [a(t, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, o]) => `${n} ${o}w`).concat([t]).join(", ") : t;
30
- }
31
- export {
32
- r as getSrcSet
33
- };
@@ -1 +0,0 @@
1
- "use strict";function c(t){return t.replace(/http(s)?:/,"")}function r(t="",e,n){const o=new RegExp("([?&])"+e+"=.*?(&|$)","i"),i=t.indexOf("?")!==-1?"&":"?";return t.match(o)?t.replace(o,"$1"+e+"="+encodeURIComponent(n)+"$2"):t+i+e+"="+encodeURIComponent(n)}function a(t,e){if(!t||!(t!=null&&t.match(/cdn\.shopify\.com/))||!e)return t;if(e==="master")return c(t);const n=t.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);if(n){const o=t.split(n[0]),i=n[3],f=e.match("x")?e:`${e}x`;return c(`${o[0]}_${f}${i}`)}return null}function p(t){if(!t)return t;const e=[100,200,400,800,1200,1600,2e3];if(t.match(/builder\.io/)){let n=t;const o=Number(t.split("?width=")[1]);return isNaN(o)||(n=`${n} ${o}w`),e.filter(i=>i!==o).map(i=>`${r(t,"width",i)} ${i}w`).concat([n]).join(", ")}return t.match(/cdn\.shopify\.com/)?e.map(n=>[a(t,`${n}x${n}`),n]).filter(([n])=>!!n).map(([n,o])=>`${n} ${o}w`).concat([t]).join(", "):t}exports.getSrcSet=p;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),n=require("./server-entry-acf5ce7d.cjs"),c=require("./image.helpers-dba8a869.cjs");function u(e){function i(){const t=e.imgSrc||e.image;if(!(!t||typeof t!="string")&&t.match(/builder\.io/))return c.getSrcSet(t)}return r.jsx("img",{loading:"lazy",style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,srcSet:i(),...e.attributes},n.isEditing()&&e.imgSrc||"default-key")}exports.default=u;
@@ -1,28 +0,0 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { isEditing as n } from "./server-entry-c9d5300f.js";
3
- import { getSrcSet as o } from "./image.helpers-3e926d47.js";
4
- function g(t) {
5
- function e() {
6
- const i = t.imgSrc || t.image;
7
- if (!(!i || typeof i != "string") && i.match(/builder\.io/))
8
- return o(i);
9
- }
10
- return /* @__PURE__ */ r(
11
- "img",
12
- {
13
- loading: "lazy",
14
- style: {
15
- objectFit: t.backgroundSize || "cover",
16
- objectPosition: t.backgroundPosition || "center"
17
- },
18
- alt: t.altText,
19
- src: t.imgSrc || t.image,
20
- srcSet: e(),
21
- ...t.attributes
22
- },
23
- n() && t.imgSrc || "default-key"
24
- );
25
- }
26
- export {
27
- g as default
28
- };