@versoly/plugins 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,1063 @@
1
+ //#region src/config.ts
2
+ const defineConfig = (config) => {
3
+ return config;
4
+ };
5
+
6
+ //#endregion
7
+ //#region src/plugins/calendly.ts
8
+ var calendly_default = defineConfig({
9
+ name: "calendly",
10
+ cdnUrls: [{
11
+ url: "https://assets.calendly.com/assets/external/widget.js",
12
+ delay: true
13
+ }, {
14
+ url: "https://assets.calendly.com/assets/external/widget.css",
15
+ delay: true
16
+ }],
17
+ js: `
18
+ document.querySelectorAll('[data-calendly-url]').forEach(elem => {
19
+ const url = elem.dataset.calendlyUrl;
20
+
21
+ if (!url) {
22
+ return;
23
+ }
24
+
25
+ elem.addEventListener('click', e => {
26
+ e.preventDefault();
27
+ window.Calendly.initPopupWidget({ url, parentElement: elem });
28
+ })
29
+ });`,
30
+ checks: [{ plugin: "calendly" }, { html: "calendly" }],
31
+ options: {
32
+ name: "Calendly Options",
33
+ isShown: { props: { "data-calendly-url": true } },
34
+ fields: [{
35
+ name: "Calendly Url",
36
+ propsName: "data-calendly-url",
37
+ type: "TextOption"
38
+ }]
39
+ }
40
+ });
41
+
42
+ //#endregion
43
+ //#region src/plugins/swiper.ts
44
+ const js$8 = `
45
+ window.vSwipers = [];
46
+ window.vGetElementsByToggle('swiper').forEach((elem) => {
47
+ let props = window.vGetElementOptions(elem);
48
+
49
+ if (props.pagination && props.pagination.renderBullet === 'number') {
50
+ props.pagination.renderBullet = function(index, className) {
51
+ const span = document.createElement('span');
52
+ span.className = className;
53
+ span.textContent = index + 1;
54
+ return span.outerHTML;
55
+ }
56
+ }
57
+
58
+ window.vSwipers.push(new Swiper(elem, props));
59
+ });`;
60
+ var swiper_default = defineConfig({
61
+ name: "swiper",
62
+ cdnUrls: [{
63
+ url: `https://cdnjs.cloudflare.com/ajax/libs/Swiper/9.3.2/swiper-bundle.min.js`,
64
+ inline: false,
65
+ defer: true
66
+ }, { url: `https://cdnjs.cloudflare.com/ajax/libs/Swiper/9.3.2/swiper-bundle.min.css` }],
67
+ js: js$8,
68
+ checks: [{ plugin: "swiper" }]
69
+ });
70
+
71
+ //#endregion
72
+ //#region src/plugins/prism.ts
73
+ var prism_default = defineConfig({
74
+ name: "prism",
75
+ cdnUrls: [
76
+ { url: "https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/plugins/line-numbers/prism-line-numbers.min.css" },
77
+ { url: "https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/prism.min.js" },
78
+ { url: "https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/plugins/autoloader/prism-autoloader.min.js" },
79
+ { url: "https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/plugins/line-numbers/prism-line-numbers.min.js" }
80
+ ],
81
+ js: `
82
+ document.querySelectorAll("pre > code[class^='language-']").forEach((elem) => {
83
+ elem.parentNode.innerHTML = elem.parentNode.innerHTML.trim();
84
+ });
85
+
86
+ let themeLink = window.vPrismTheme !== undefined ? window.vPrismTheme : 'default';
87
+
88
+ if (themeLink === 'default') {
89
+ themeLink = 'https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/themes/prism.min.css';
90
+ } else if (themeLink && !themeLink.includes('https://')) {
91
+ themeLink = 'https://cdnjs.cloudflare.com/ajax/libs/prism-themes/1.9.0/prism-' + themeLink + '.min.css';
92
+ }
93
+
94
+ if (themeLink && themeLink.includes('https://')) {
95
+ const link = document.createElement('link');
96
+ link.rel = 'stylesheet';
97
+ link.href = themeLink;
98
+ document.head.appendChild(link);
99
+ }
100
+
101
+ window.addEventListener('load', () => {
102
+ window.Prism && window.Prism.highlightAll();
103
+ });`,
104
+ checks: [{ html: "prism" }]
105
+ });
106
+
107
+ //#endregion
108
+ //#region src/plugins/tilt.ts
109
+ const js$7 = `window.vTilts = [];
110
+ window.vGetElementsByToggle('tilt').forEach((elem) => {
111
+ VanillaTilt.init(elem, window.vGetElementOptions(elem));
112
+ window.vTilts.push(elem);
113
+ });`;
114
+ var tilt_default = defineConfig({
115
+ name: "tilt",
116
+ options: {
117
+ name: "Tilt",
118
+ previewInEditor: true,
119
+ isShown: { props: { "data-toggle": "tilt" } },
120
+ fields: [
121
+ {
122
+ name: "Speed",
123
+ type: "SliderPropOption",
124
+ propsName: "data-options.speed",
125
+ min: 0,
126
+ max: 3e3,
127
+ stepSize: 100,
128
+ defaultValue: 300
129
+ },
130
+ {
131
+ name: "Max Tilt",
132
+ type: "SliderPropOption",
133
+ propsName: "data-options.max",
134
+ min: 0,
135
+ max: 180,
136
+ stepSize: 1,
137
+ defaultValue: 35
138
+ },
139
+ {
140
+ name: "Reverse",
141
+ type: "BooleanPropOption",
142
+ propsName: "data-options.reverse",
143
+ defaultValue: false,
144
+ enabledValue: true,
145
+ inHeaderAction: true,
146
+ headerGroup: "Core"
147
+ },
148
+ {
149
+ name: "Transition",
150
+ type: "BooleanPropOption",
151
+ propsName: "data-options.transition",
152
+ defaultValue: true,
153
+ enabledValue: false,
154
+ inHeaderAction: true,
155
+ headerGroup: "Core"
156
+ },
157
+ {
158
+ label: "Easing",
159
+ name: "Easing",
160
+ propsName: "data-options.easing",
161
+ type: "TextOption",
162
+ defaultValue: "cubic-bezier(.03,.98,.52,.99)",
163
+ enabledValue: "cubic-bezier(.03,.98,.52,.99)",
164
+ inHeaderAction: true,
165
+ headerGroup: "Core"
166
+ },
167
+ {
168
+ name: "Full Page Listening",
169
+ type: "BooleanPropOption",
170
+ propsName: "data-options.full-page-listening",
171
+ defaultValue: false,
172
+ enabledValue: true,
173
+ inHeaderAction: true,
174
+ headerGroup: "Core"
175
+ },
176
+ {
177
+ name: "Start X",
178
+ type: "SliderPropOption",
179
+ propsName: "data-options.startX",
180
+ min: 0,
181
+ max: 180,
182
+ stepSize: 1,
183
+ defaultValue: 0,
184
+ enabledValue: 15,
185
+ inHeaderAction: true,
186
+ headerGroup: "Core"
187
+ },
188
+ {
189
+ name: "Start Y",
190
+ type: "SliderPropOption",
191
+ propsName: "data-options.startY",
192
+ min: 0,
193
+ max: 180,
194
+ stepSize: 1,
195
+ defaultValue: 0,
196
+ enabledValue: 15,
197
+ inHeaderAction: true,
198
+ headerGroup: "Core"
199
+ },
200
+ {
201
+ name: "Perspective",
202
+ type: "SliderPropOption",
203
+ propsName: "data-options.perspective",
204
+ min: 0,
205
+ max: 3e3,
206
+ stepSize: 1,
207
+ defaultValue: 1e3,
208
+ enabledValue: 1e3,
209
+ inHeaderAction: true,
210
+ headerGroup: "Core"
211
+ },
212
+ {
213
+ name: "Scale",
214
+ type: "SliderPropOption",
215
+ propsName: "data-options.scale",
216
+ min: .5,
217
+ max: 3,
218
+ stepSize: .1,
219
+ defaultValue: 1,
220
+ enabledValue: 1.5,
221
+ inHeaderAction: true,
222
+ headerGroup: "Core"
223
+ },
224
+ {
225
+ name: "Axis",
226
+ type: "IconButtonOption",
227
+ propsName: "data-options.axis",
228
+ options: ["x", "y"],
229
+ defaultValue: null,
230
+ enabledValue: "x",
231
+ inHeaderAction: true,
232
+ headerGroup: "Core"
233
+ },
234
+ {
235
+ name: "Glare",
236
+ type: "BooleanPropOption",
237
+ propsName: "data-options.glare",
238
+ defaultValue: false,
239
+ enabledValue: true,
240
+ inHeaderAction: true,
241
+ headerGroup: "Glare"
242
+ },
243
+ {
244
+ name: "Max Glare",
245
+ type: "SliderPropOption",
246
+ propsName: "data-options.max-glare",
247
+ min: .1,
248
+ max: 1,
249
+ stepSize: .1,
250
+ defaultValue: 1,
251
+ enabledValue: .5,
252
+ inHeaderAction: true,
253
+ headerGroup: "Glare"
254
+ },
255
+ {
256
+ name: "Reset",
257
+ type: "BooleanPropOption",
258
+ propsName: "data-options.reset",
259
+ defaultValue: true,
260
+ enabledValue: true,
261
+ inHeaderAction: true,
262
+ headerGroup: "Reset"
263
+ },
264
+ {
265
+ name: "Reset To Start",
266
+ type: "BooleanPropOption",
267
+ propsName: "data-options.reset-to-start",
268
+ defaultValue: true,
269
+ enabledValue: true,
270
+ inHeaderAction: true,
271
+ headerGroup: "Reset"
272
+ }
273
+ ]
274
+ },
275
+ cdnUrls: [{
276
+ url: "https://cdnjs.cloudflare.com/ajax/libs/vanilla-tilt/1.8.0/vanilla-tilt.js",
277
+ defer: true
278
+ }],
279
+ js: js$7,
280
+ checks: [{ plugin: "tilt" }],
281
+ components: [{
282
+ name: "Tilt Image",
283
+ category: "Plugins",
284
+ html: `<img class="w-96" src="https://dummyimage.com/1000x600/edf2f7/0f1631&text=Placeholder" data-toggle="tilt" data-options="{'max':15,'reset':true}" />`
285
+ }, {
286
+ name: "Tilt Div",
287
+ category: "Plugins",
288
+ html: `<div class="w-full h-full" data-toggle="tilt" data-options="{'max':15,'reset':true}"></div>`
289
+ }]
290
+ });
291
+
292
+ //#endregion
293
+ //#region src/plugins/typed.ts
294
+ var typed_default = defineConfig({
295
+ name: "typed",
296
+ options: {
297
+ name: "Typed Effect Options",
298
+ previewInEditor: true,
299
+ isShown: { props: { "data-toggle": "typed" } },
300
+ fields: [
301
+ {
302
+ type: "TextOption",
303
+ name: "Phrases",
304
+ tooltipProps: { content: "Use commas to add new words/phrases" },
305
+ placeholder: "second phrase., third phrase.",
306
+ propsName: "data-options.strings",
307
+ isArray: true
308
+ },
309
+ {
310
+ name: "Loop",
311
+ type: "BooleanPropOption",
312
+ propsName: "data-options.loop",
313
+ defaultValue: true,
314
+ enabledValue: true,
315
+ inHeaderAction: true,
316
+ headerGroup: "Core"
317
+ },
318
+ {
319
+ name: "Type Speed",
320
+ type: "SliderPropOption",
321
+ propsName: "data-options.typeSpeed",
322
+ min: 10,
323
+ max: 400,
324
+ stepSize: 10,
325
+ defaultValue: 100,
326
+ enabledValue: 100,
327
+ inHeaderAction: true,
328
+ headerGroup: "Core"
329
+ },
330
+ {
331
+ name: "Back Speed",
332
+ type: "SliderPropOption",
333
+ propsName: "data-options.backSpeed",
334
+ min: 10,
335
+ max: 400,
336
+ stepSize: 10,
337
+ defaultValue: 50,
338
+ enabledValue: 50,
339
+ inHeaderAction: true,
340
+ headerGroup: "Core"
341
+ },
342
+ {
343
+ name: "Start Delay",
344
+ type: "SliderPropOption",
345
+ propsName: "data-options.startDelay",
346
+ min: 50,
347
+ max: 3e3,
348
+ stepSize: 50,
349
+ defaultValue: 500,
350
+ enabledValue: 500,
351
+ inHeaderAction: true,
352
+ headerGroup: "Core"
353
+ },
354
+ {
355
+ name: "Back Delay",
356
+ type: "SliderPropOption",
357
+ propsName: "data-options.backDelay",
358
+ min: 50,
359
+ max: 3e3,
360
+ stepSize: 50,
361
+ defaultValue: 1e3,
362
+ enabledValue: 1e3,
363
+ inHeaderAction: true,
364
+ headerGroup: "Core"
365
+ }
366
+ ]
367
+ },
368
+ cdnUrls: [{
369
+ url: "https://cdnjs.cloudflare.com/ajax/libs/typed.js/2.0.11/typed.min.js",
370
+ defer: true
371
+ }],
372
+ js: `
373
+ window.vGetElementsByToggle('typed').forEach((elem) => {
374
+ let options = window.vGetElementOptions(elem);
375
+
376
+ options.strings = [elem.innerHTML, ...options.strings];
377
+ elem.innerHTML = '';
378
+
379
+ new Typed(elem, {
380
+ typeSpeed: 100,
381
+ backSpeed: 50,
382
+ startDelay: 500,
383
+ backDelay: 1000,
384
+ loop: true,
385
+ ...options
386
+ });
387
+ });`,
388
+ checks: [{ plugin: "typed" }],
389
+ components: [],
390
+ displayNames: [{
391
+ displayName: "Typed Effect",
392
+ property: "data-toggle",
393
+ value: "typed"
394
+ }]
395
+ });
396
+
397
+ //#endregion
398
+ //#region src/plugins/countup.ts
399
+ var countup_default = defineConfig({
400
+ name: "countup",
401
+ cdnUrls: [{ url: "https://cdnjs.cloudflare.com/ajax/libs/scrollReveal.js/3.4.0/scrollreveal.min.js" }, { url: "https://cdnjs.cloudflare.com/ajax/libs/countup.js/2.0.8/countUp.umd.min.js" }],
402
+ js: `window.scrollReveal = ScrollReveal();
403
+
404
+ window.countUpStart = (elem) => {
405
+ var startVal = elem.dataset.from ? +elem.dataset.from : 0
406
+ ,endVal = elem.dataset.to ? +elem.dataset.to : 0
407
+ ,duration = elem.dataset.duration ? +elem.dataset.duration : 2
408
+ ,options = window.vGetElementOptions(elem);
409
+ const up = new countUp.CountUp(elem, endVal, {...options, startVal, duration});
410
+ up.start();
411
+ }
412
+
413
+ window.vGetElementsByToggle('countup').forEach(elem => {
414
+ scrollReveal.reveal(elem, {beforeReveal: window.countUpStart, duration: 0});
415
+ });`,
416
+ checks: [{ plugin: "countup" }],
417
+ options: {
418
+ name: "Countup Options",
419
+ isShown: { props: { "data-toggle": "countup" } },
420
+ fields: [
421
+ {
422
+ name: "Count From",
423
+ propsName: "data-from",
424
+ type: "NumberOption"
425
+ },
426
+ {
427
+ name: "Count To",
428
+ propsName: "data-to",
429
+ type: "NumberOption"
430
+ },
431
+ {
432
+ name: "Duration",
433
+ propsName: "data-duration",
434
+ type: "NumberOption",
435
+ placeholder: "2",
436
+ stepSize: .1
437
+ },
438
+ {
439
+ name: "Countup when Visible",
440
+ propsName: "data-aos",
441
+ options: [false, true],
442
+ type: "BooleanPropOption",
443
+ defaultValue: false
444
+ }
445
+ ]
446
+ },
447
+ components: [{
448
+ name: "Countup",
449
+ category: "Plugins",
450
+ html: `<h2 data-toggle="countup" data-aos data-aos-id="countup:in" data-from="100" data-to="800">100</h2>`
451
+ }]
452
+ });
453
+
454
+ //#endregion
455
+ //#region src/plugins/countdown.ts
456
+ const js$6 = `window.vGetElementsByToggle('countdown').forEach(elem => {
457
+ const deadline = new Date(elem.dataset.countdown).getTime();
458
+
459
+ let elementsByType = {};
460
+ elem.querySelectorAll('[data-countdown-type]').forEach(el => {
461
+ elementsByType[el.dataset.countdownType] = el;
462
+ });
463
+
464
+ const countdownFunc = () => {
465
+ let t = (deadline - new Date().getTime()) / 1000;
466
+
467
+ if (t < 0) {
468
+ clearInterval(x);
469
+ t = 0;
470
+ }
471
+
472
+ let valuesByType = {
473
+ seconds: t % 60,
474
+ minutes: (t / 60) % 60,
475
+ hours: (t / (60 * 60)) % 24,
476
+ days: t / (60 * 60 * 24),
477
+ };
478
+
479
+ Object.keys(valuesByType).forEach(type => {
480
+ if (elementsByType[type]) {
481
+ let value = Math.floor(valuesByType[type]);
482
+ if (value < 10) {
483
+ value = '0' + value;
484
+ }
485
+
486
+ elementsByType[type].innerHTML = value;
487
+ }
488
+ });
489
+ }
490
+
491
+ var x = setInterval(countdownFunc, 1000);
492
+ countdownFunc();
493
+ });
494
+ `;
495
+ const currentDate = /* @__PURE__ */ new Date();
496
+ const ISODateIn5Days = new Date(currentDate.getTime() + 7200 * 60 * 1234).toISOString();
497
+ var countdown_default = defineConfig({
498
+ name: "countdown",
499
+ js: js$6,
500
+ checks: [{ plugin: "countdown" }],
501
+ options: {
502
+ name: "Countdown",
503
+ isShown: { props: {
504
+ "data-toggle": "countdown",
505
+ "data-countdown": true
506
+ } },
507
+ fields: [{
508
+ name: "Countdown Timer",
509
+ propsName: "data-countdown",
510
+ type: "DateTimePickerOption"
511
+ }]
512
+ },
513
+ components: [{
514
+ name: "Countdown",
515
+ category: "Plugins",
516
+ html: `<h2 class="font-semibold" data-toggle="countdown" data-countdown="${ISODateIn5Days}">
517
+ <span data-countdown-type="days">4</span>
518
+ <span class="opacity-20">:</span>
519
+ <span data-countdown-type="hours">1</span>
520
+ <span class="opacity-20">:</span>
521
+ <span data-countdown-type="minutes">0</span>
522
+ <span class="opacity-20">:</span>
523
+ <span data-countdown-type="seconds">0</span>
524
+ </h2>`
525
+ }]
526
+ });
527
+
528
+ //#endregion
529
+ //#region src/plugins/finisher-header.ts
530
+ var finisher_header_default = defineConfig({
531
+ name: "finisher-header",
532
+ cdnUrls: [{
533
+ url: "https://d1pnnwteuly8z3.cloudfront.net/js/finisher-header.es5.min.js",
534
+ defer: true
535
+ }],
536
+ js: `document.querySelectorAll('.finisher-header').forEach(elem => {
537
+ let options = window.vGetElementOptions(elem);
538
+ new FinisherHeader(options);
539
+ });`,
540
+ checks: [{ html: "finisher-header" }],
541
+ components: [{
542
+ name: "Finisher Header",
543
+ category: "Plugins",
544
+ html: `<div class="finisher-header" data-toggle="finisher-header" data-options="{'count':15,'size':{'min':2,'max':40,'pulse':0},'speed':{'x':{'min':0,'max':0.8},'y':{'min':0,'max':0.2}},'colors':{'background':'#fff','particles':['#ff926b','#87ddfe','#acaaff','#1bffc2','#f9a5fe']},'blending':'screen','opacity':{'center':1,'edge':1},'skew':-1,'shapes':['c','s','t']}"></div>`
545
+ }]
546
+ });
547
+
548
+ //#endregion
549
+ //#region src/plugins/taos.ts
550
+ const js$5 = `!function(){const e=(e,t)=>{let s=!1;return()=>{s||(e(),s=!0,setTimeout((()=>s=!1),t))}},t=e=>{e.className!==e.dataset.taosClass&&(e.className=e.dataset.taosClass)},s=e=>e.className=e.className.replaceAll("taos:",""),a=e=>(e.className.includes("taos-init")||(e.dataset.taosClass=e.className+" taos-init",t(e)),e.className+=" !duration-[0ms] !delay-[0ms]",s(e),{element:e,once:"1"===getComputedStyle(e)["animation-iteration-count"],offset:parseInt(e.dataset.taosOffset||0)});let n=[],i=window.innerWidth,o=window.scrollY;const l=e((()=>{n.forEach((e=>e.trigger=e.element.getBoundingClientRect().top-window.innerHeight+e.offset+o))}),250),r=()=>{n=[],document.querySelectorAll('[class*="taos"]').forEach((e=>n.push(a(e)))),l(),requestAnimationFrame(c)},c=()=>{o=window.scrollY,n.forEach((({element:e,trigger:a,once:n})=>{a<o?t(e):!n&&e.className.includes("taos:")&&s(e)})),l()};r(),addEventListener("scroll",e(c,32)),addEventListener("orientationchange",r),addEventListener("resize",((e,t)=>{let s=null;return()=>{clearTimeout(s),s=setTimeout(e,t)}})((()=>{i!==window.innerWidth&&(i=window.innerWidth,r())}),250)),new MutationObserver((e=>{e.forEach((({target:e})=>{e.className&&!e.className.includes("taos-init")&&e.className.includes("taos:")&&n.push(a(e))}))})).observe(document,{attributes:!0,childList:!0,subtree:!0})}();`;
551
+ var taos_default = defineConfig({
552
+ name: "taos",
553
+ css: `
554
+ html.js :where([class*="taos:"]:not(.taos-init)) {
555
+ visibility: hidden;
556
+ }`,
557
+ js: js$5,
558
+ checks: [{ plugin: "taos" }, { html: "taos:" }],
559
+ safelist: ["!duration-[0ms]", "!delay-[0ms]"]
560
+ });
561
+
562
+ //#endregion
563
+ //#region src/plugins/tailtip.ts
564
+ const js$4 = `window.vTailtips = [];
565
+
566
+ window.vGetElementsByToggle('tooltip').forEach((elem) => {
567
+ const tailtip = Tailtip(elem, window.vGetElementOptions(elem));
568
+ window.vTailtips.push(tailtip);
569
+ });`;
570
+ var tailtip_default = defineConfig({
571
+ name: "tailtip",
572
+ src: "https://d1pnnwteuly8z3.cloudfront.net/libs/tailtip/1.0.3/tailtip.js",
573
+ cdnUrls: [{
574
+ url: "https://d1pnnwteuly8z3.cloudfront.net/libs/tailtip/1.0.3/tailtip.js",
575
+ defer: true
576
+ }],
577
+ js: js$4,
578
+ checks: [{ plugin: "tailtip" }],
579
+ components: [{
580
+ name: "Info Tooltip",
581
+ category: "Plugins",
582
+ html: `<span class="flex w-4 h-4 bg-dark text-white items-center justify-center rounded-full text-xs font-medium" data-toggle="tooltip">i</span>
583
+ <div class="tooltip" role="tooltip">
584
+ <div class="tooltip-inner">
585
+ <span>This is a tooltip that is shown when hovered or clicked.</span>
586
+ </div>
587
+ <div class="tooltip-arrow"></div>
588
+ </div>`
589
+ }],
590
+ options: {
591
+ name: "Tailtip Options",
592
+ isShown: { props: { "data-toggle": "tooltip" } },
593
+ previewInEditor: true,
594
+ fields: [{
595
+ name: "tailtip",
596
+ type: "TailtipOption"
597
+ }, {
598
+ name: "Placement",
599
+ propsName: "data-options.placement",
600
+ type: "DropdownPropOption",
601
+ inline: true,
602
+ noneDisplayValue: "Default",
603
+ options: [
604
+ false,
605
+ "top",
606
+ "bottom",
607
+ "left",
608
+ "right"
609
+ ]
610
+ }]
611
+ }
612
+ });
613
+
614
+ //#endregion
615
+ //#region src/plugins/versoly-marquee.ts
616
+ const src = "https://d1pnnwteuly8z3.cloudfront.net/libs/versoly-marquee/0.0.2/versoly-marquee.iife.js";
617
+ const js$3 = `window.vMarquees = [];
618
+ window.vGetElementsByToggle('marquee').forEach((elem) => {
619
+ const marquee = new Marquee(elem, window.vGetElementOptions(elem));
620
+ window.vMarquees.push(marquee);
621
+ });`;
622
+ var versoly_marquee_default = defineConfig({
623
+ name: "versoly-marquee",
624
+ js: js$3,
625
+ options: {
626
+ name: "Marquee",
627
+ previewInEditor: true,
628
+ isShown: { props: { "data-toggle": "marquee" } },
629
+ fields: [
630
+ {
631
+ name: "Loop",
632
+ type: "BooleanPropOption",
633
+ propsName: "data-options.loop",
634
+ defaultValue: true,
635
+ enabledValue: true,
636
+ inHeaderAction: true,
637
+ headerGroup: "Core"
638
+ },
639
+ {
640
+ name: "Duration",
641
+ type: "SliderPropOption",
642
+ propsName: "data-options.duration",
643
+ min: 1,
644
+ max: 20,
645
+ stepSize: 1,
646
+ defaultValue: 5
647
+ },
648
+ {
649
+ name: "Direction",
650
+ type: "IconButtonOption",
651
+ propsName: "data-options.direction",
652
+ options: [
653
+ "ltr",
654
+ "rtl",
655
+ "ttb",
656
+ "btt"
657
+ ],
658
+ defaultValue: "ltr"
659
+ },
660
+ {
661
+ name: "Pauseable",
662
+ type: "BooleanPropOption",
663
+ propsName: "data-options.pauseable",
664
+ defaultValue: true
665
+ },
666
+ {
667
+ name: "Iterations",
668
+ type: "SliderPropOption",
669
+ propsName: "data-options.iterations",
670
+ min: 1,
671
+ max: 5,
672
+ stepSize: 1,
673
+ defaultValue: 1,
674
+ enabledValue: 1,
675
+ inHeaderAction: true,
676
+ headerGroup: "Core"
677
+ }
678
+ ]
679
+ },
680
+ checks: [{ plugin: "marquee" }],
681
+ src,
682
+ cdnUrls: [{
683
+ url: src,
684
+ defer: true
685
+ }],
686
+ displayNames: [{
687
+ displayName: "Marquee",
688
+ property: "data-toggle",
689
+ value: "marquee"
690
+ }]
691
+ });
692
+
693
+ //#endregion
694
+ //#region src/plugins/versoly-ui.ts
695
+ var versoly_ui_default = defineConfig({
696
+ name: "versoly-ui",
697
+ cdnUrls: [{
698
+ url: "https://d1pnnwteuly8z3.cloudfront.net/libs/floating-ui/1.0.1/floating-ui.min.js",
699
+ defer: true
700
+ }, {
701
+ url: "https://d1pnnwteuly8z3.cloudfront.net/libs/versoly-ui/2.2.0/versoly-ui.js",
702
+ delay: true
703
+ }]
704
+ });
705
+
706
+ //#endregion
707
+ //#region src/plugins/versoly-analytics.ts
708
+ const js$2 = `!function(e){e.versoly.event=function(t){if(!("visibilityState"in document&&"prerender"===document.visibilityState||/bot|google|baidu|bing|msn|duckduckbot|teoma|slurp|yandex/i.test(navigator.userAgent)||e._phantom||e.__nightmare||e.navigator.webdriver||e.Cypress||""===e.location.host)){var n=new XMLHttpRequest;n.open("POST",e.versoly.url,!0),n.setRequestHeader("Content-Type","application/json; charset=UTF-8"),n.send(JSON.stringify({siteId:e.versoly.id,referrer:document.referrer,paramReferrer:"",hostname:e.location.hostname,pathname:e.location.pathname+e.location.search,width:e.innerWidth,height:e.innerHeight,tz:Intl.DateTimeFormat().resolvedOptions().timeZone,...t}))}}}(window),window.versoly.event({name: 'pageview'});`;
709
+ var versoly_analytics_default = defineConfig({
710
+ name: "versoly-analytics",
711
+ js: js$2,
712
+ checks: [{ html: "/api/event" }]
713
+ });
714
+
715
+ //#endregion
716
+ //#region src/plugins/versoly-events.ts
717
+ var versoly_events_default = defineConfig({
718
+ name: "versoly-events",
719
+ js: `const eventElements = document.querySelectorAll('[data-eventid]');
720
+ for (const eventElement of eventElements) {
721
+ if (eventElement.tagName !== 'FORM') {
722
+ eventElement.addEventListener('click', function(e) {
723
+ const eventName = eventElement.getAttribute('data-eventid');
724
+
725
+ if (window.versoly) {
726
+ window.versoly.event({name: eventName})
727
+ }
728
+ if (window.gtag) {
729
+ window.gtag('event', eventName)
730
+ }
731
+ if (window.amplitude) {
732
+ window.amplitude.getInstance().logEvent(event);
733
+ }
734
+ })
735
+ }
736
+ }`,
737
+ checks: [{ html: "data-eventid" }]
738
+ });
739
+
740
+ //#endregion
741
+ //#region src/plugins/versoly-form.ts
742
+ var versoly_form_default = defineConfig({
743
+ name: "versoly-form",
744
+ checks: [{ plugin: "formid" }],
745
+ js: `window.vPageLoadedAt = Date.now();
746
+ window.vForms = window.vForms || {};
747
+
748
+ setTimeout(() => {
749
+ let inputs = [...document.getElementsByTagName("input")]
750
+ inputs.forEach(i => {
751
+ if (i.name === 'email_second' || i.name === 'name_second') {
752
+ i.setAttribute('aria-hidden', 'true')
753
+ i.setAttribute('tabindex', '-1')
754
+ i.setAttribute('autocomplete', 'false')
755
+ }
756
+ })
757
+ }, 3000)
758
+
759
+ const sendFormData = function (e, form) {
760
+ e.preventDefault();
761
+ const formId = form.dataset.formid;
762
+ let scriptsByForm = window.vForms[formId] || {}
763
+
764
+ if (window.vPageLoadedAt + 3000 > Date.now()) {
765
+ return null
766
+ }
767
+
768
+ let data = {
769
+ created: Date.now(),
770
+ url: location.pathname + location.search
771
+ }
772
+
773
+ const filteredForms = document.querySelectorAll('[data-formId="' + formId + '"]')
774
+ let formIndex = 0
775
+ filteredForms.forEach((f, index) => {
776
+ if (f === form) {
777
+ formIndex = index
778
+ }
779
+ })
780
+
781
+ const errorElement = document.querySelectorAll('[data-form-errorid="' + formId + '"]')[formIndex]
782
+ let inputs = [
783
+ ...form.getElementsByTagName("input"),
784
+ ...form.getElementsByTagName("textarea"),
785
+ ...form.getElementsByTagName("select")
786
+ ]
787
+
788
+ inputs.forEach(input => {
789
+ if (input.type === 'radio') {
790
+ if (input.checked) {
791
+ data[input.name] = input.value
792
+ }
793
+ return
794
+ }
795
+ if (input.tagName === 'SELECT') {
796
+ data[input.name] = input.options[input.selectedIndex].value
797
+ return
798
+ }
799
+ if (input.type === 'checkbox') {
800
+ data[input.name] = input.checked + ""
801
+ return
802
+ }
803
+ data[input.name] = input.value
804
+ })
805
+
806
+ if (!!data['email_second'] || !!data['name_second']) {
807
+ return null
808
+ }
809
+ delete data['email_second'];
810
+ delete data['name_second'];
811
+
812
+ if (scriptsByForm.pre) {
813
+ eval(scriptsByForm.pre)
814
+ }
815
+
816
+ const submitButton = form.querySelector(('button[type="submit"]'))
817
+ const buttonInnerHTML = submitButton.innerHTML
818
+ submitButton.disabled = true
819
+
820
+ let loadingButtonInnerHTML = '<i class="fa fa-spinner fa-spin"></i> Loading'
821
+ if (submitButton.getAttribute('data-loading-html')) {
822
+ loadingButtonInnerHTML = submitButton.getAttribute('data-loading-html')
823
+ }
824
+ submitButton.innerHTML = loadingButtonInnerHTML
825
+
826
+ data = JSON.stringify(data)
827
+ fetch('https://api.versoly.com/v1/form/submit', {
828
+ method: 'POST',
829
+ headers: {
830
+ 'Content-Type': 'application/json'
831
+ },
832
+ body: JSON.stringify({formId: formId, data: data})
833
+ })
834
+ .then(function (response){
835
+ if (!response.ok) {
836
+ throw new Error('Bad response from server');
837
+ }
838
+
839
+ if (window.versoly && form.getAttribute('data-eventid')) {
840
+ window.versoly.event({name: form.getAttribute('data-eventid')})
841
+ }
842
+
843
+ if (scriptsByForm.post) {
844
+ eval(scriptsByForm.post)
845
+ }
846
+
847
+ if (form.dataset["successUrl"]) {
848
+ window.location.replace(form.dataset["successUrl"])
849
+ return
850
+ }
851
+
852
+ const successElement = document.querySelectorAll('[data-form-successid="' + formId + '"]')[formIndex]
853
+
854
+ if (successElement) {
855
+ successElement.classList.remove("d-js");
856
+ errorElement.classList.add("d-js");
857
+ form.classList.add("d-js");
858
+
859
+ successElement.classList.remove("d-none");
860
+ errorElement.classList.add("d-none");
861
+ form.classList.add("d-none");
862
+ }
863
+
864
+ submitButton.disabled = false
865
+ submitButton.innerHTML = buttonInnerHTML
866
+ })
867
+ .catch(function (error){
868
+ console.log(error)
869
+ if (errorElement) {
870
+ errorElement.classList.remove("d-js");
871
+ errorElement.classList.remove("d-none");
872
+ }
873
+ if (scriptsByForm.failed) {
874
+ eval(scriptsByForm.failed)
875
+ }
876
+ submitButton.disabled = false
877
+ submitButton.innerHTML = buttonInnerHTML
878
+ })
879
+ }
880
+
881
+
882
+ window.addFormListener = () => {
883
+ const forms = document.querySelectorAll('[data-formid]');
884
+
885
+ for (const form of forms) {
886
+ if (!form.getAttribute('data-has-form-eventlistener')) {
887
+ form.addEventListener("submit", function (e) {
888
+ sendFormData(e, form)
889
+ });
890
+ form.setAttribute('data-has-form-eventlistener', 'true')
891
+ }
892
+ }
893
+ }
894
+ window.addFormListener && window.addFormListener()
895
+ `
896
+ });
897
+
898
+ //#endregion
899
+ //#region src/plugins/versoly-modal.ts
900
+ const js$1 = `window.vGetElementsByToggle('modal').forEach(elem => {
901
+ let options = window.vGetElementOptions(elem);
902
+
903
+ if (options.globalBlockId && window.vComponents[options.globalBlockId]) {
904
+ elem.dataset.html = window.vComponents[options.globalBlockId];
905
+
906
+ if (window.vComponents[options.globalBlockId].includes('data-formid')) {
907
+ options.beforeShown = 'addFormListener'
908
+ }
909
+ }
910
+
911
+ elem.dataset.options = JSON.stringify(options);
912
+ });`;
913
+ var versoly_modal_default = defineConfig({
914
+ name: "versoly-modal",
915
+ js: js$1,
916
+ checks: [{ plugin: "modal" }]
917
+ });
918
+
919
+ //#endregion
920
+ //#region src/plugins/versoly-pricing.ts
921
+ const js = `document.querySelectorAll('section:has([id$="-pricing-button"], [data-toggle="pricing"])').forEach(section => {
922
+ const durationButtons = section.querySelectorAll('[id$="-pricing-button"]');
923
+ const durations = [...durationButtons].map(b => b.id.replace('-pricing-button', ''));
924
+
925
+ const activeClass = durationButtons[0] && durationButtons[0].className;
926
+ const inactiveClass = durationButtons[1] && durationButtons[1].className;
927
+
928
+ durations.forEach(duration => {
929
+ const durationButton = section.querySelector('[id="' + duration + '-pricing-button"]');
930
+
931
+ if (!durationButton) {
932
+ return;
933
+ }
934
+
935
+ durationButton.addEventListener('click', function() {
936
+ section.querySelectorAll('[data-' + duration + ']').forEach((element) => {
937
+ element.innerHTML = element.dataset[duration];
938
+ })
939
+
940
+ section.querySelectorAll('[data-duration-show]').forEach(d => {
941
+ d.className = (d.className || '') + ' hidden';
942
+ })
943
+
944
+ section.querySelectorAll('[data-duration-show="' + duration + '"]').forEach(d => {
945
+ d.className = (d.className || '').split(' ').filter(c => c !== 'hidden').join(' ');
946
+ })
947
+
948
+ durationButtons.forEach(b => b.className = inactiveClass);
949
+ durationButton.className = activeClass;
950
+ });
951
+ });
952
+
953
+ const toggles = section.querySelectorAll('.pricing-toggle, [data-toggle="pricing"]');
954
+ toggles.forEach(toggleElem => {
955
+ toggleElem.addEventListener('click', function (e) {
956
+ if (e.target.tagName !== 'INPUT') {
957
+ return;
958
+ }
959
+
960
+ toggles.forEach(t => {
961
+ t.getElementsByTagName('input')[0].checked = !!e.target.checked
962
+ });
963
+
964
+ const sectionDurations = ['monthly', 'annual'];
965
+ let nextDuration = sectionDurations[0];
966
+
967
+ sectionDurations.forEach(d => {
968
+ section.querySelectorAll('[data-' + d + ']').forEach(elem => {
969
+ if (elem.innerHTML !== elem.getAttribute('data-' + d)) {
970
+ nextDuration = d
971
+ }
972
+ })
973
+ });
974
+
975
+ section.querySelectorAll('[' + 'data-' + nextDuration + ']').forEach(elem =>
976
+ elem.innerHTML = elem.getAttribute('data-' + nextDuration)
977
+ )
978
+
979
+ section.querySelectorAll('[data-duration-show]').forEach(d => {
980
+ d.className = (d.className || '') + ' hidden'
981
+ })
982
+
983
+ section.querySelectorAll('[data-duration-show="' + nextDuration + '"]').forEach(d => {
984
+ d.className = (d.className || '').split(' ').filter(c => c !== 'hidden').join(' ')
985
+ })
986
+ })
987
+ });
988
+ });`;
989
+ var versoly_pricing_default = defineConfig({
990
+ name: "versoly-pricing",
991
+ js,
992
+ checks: [
993
+ { plugin: "pricing" },
994
+ { html: "pricing-toggle" },
995
+ { html: "-pricing-button" }
996
+ ]
997
+ });
998
+
999
+ //#endregion
1000
+ //#region src/plugins/index.ts
1001
+ const plugins = {
1002
+ calendly: calendly_default,
1003
+ swiper: swiper_default,
1004
+ prism: prism_default,
1005
+ tilt: tilt_default,
1006
+ typed: typed_default,
1007
+ countup: countup_default,
1008
+ countdown: countdown_default,
1009
+ "finisher-header": finisher_header_default,
1010
+ taos: taos_default,
1011
+ tailtip: tailtip_default,
1012
+ "versoly-marquee": versoly_marquee_default,
1013
+ "versoly-ui": versoly_ui_default,
1014
+ "versoly-pricing": versoly_pricing_default,
1015
+ "versoly-analytics": versoly_analytics_default,
1016
+ "versoly-events": versoly_events_default,
1017
+ "versoly-form": versoly_form_default,
1018
+ "versoly-modal": versoly_modal_default
1019
+ };
1020
+
1021
+ //#endregion
1022
+ //#region src/getActivePlugins.ts
1023
+ const getActivePlugins = (HTML) => {
1024
+ let activePlugins = [];
1025
+ const pluginRegex = /data-toggle="([^"]+)"/g;
1026
+ let match = pluginRegex.exec(HTML);
1027
+ while (match != null) {
1028
+ activePlugins.push(match[1]);
1029
+ match = pluginRegex.exec(HTML);
1030
+ }
1031
+ const dataRegex = /data-([^=> ]+)/g;
1032
+ match = dataRegex.exec(HTML);
1033
+ while (match != null) {
1034
+ activePlugins.push(match[1]);
1035
+ match = dataRegex.exec(HTML);
1036
+ }
1037
+ activePlugins = activePlugins.filter((p) => p !== "toggle").map((p) => p.includes("taos") ? "taos" : p);
1038
+ if (!activePlugins.includes("taos") && HTML.includes("taos:")) activePlugins.push("taos");
1039
+ activePlugins = activePlugins.map((p) => {
1040
+ if (p === "tooltip") return "tailtip";
1041
+ if (p.includes("calendly")) return "calendly";
1042
+ if (p.includes("marquee")) {}
1043
+ return p;
1044
+ });
1045
+ return [...new Set(activePlugins)];
1046
+ };
1047
+ const getFilteredPlugins = ({ allPlugins = plugins, HTML, activePlugins }) => {
1048
+ if (!activePlugins) activePlugins = getActivePlugins(HTML);
1049
+ return Object.values(allPlugins).filter((p) => {
1050
+ const { checks } = p;
1051
+ if (checks) {
1052
+ if (!checks.some((check) => {
1053
+ if ("html" in check && check.html) return HTML.includes(check.html);
1054
+ if ("plugin" in check && check.plugin) return activePlugins.includes(check.plugin);
1055
+ return false;
1056
+ })) return false;
1057
+ }
1058
+ return true;
1059
+ });
1060
+ };
1061
+
1062
+ //#endregion
1063
+ export { defineConfig, getActivePlugins, getFilteredPlugins, plugins };