@customviews-js/customviews 1.1.5 → 1.1.7

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @customviews-js/customviews v1.1.4
2
+ * @customviews-js/customviews v1.1.7
3
3
  * (c) 2025 Chan Ger Teck
4
4
  * Released under the MIT License.
5
5
  */
@@ -273,102 +273,6 @@
273
273
  }
274
274
  }
275
275
 
276
- /** --- Icon utilities --- */
277
- function ensureFontAwesomeInjected() {
278
- const isFontAwesomeLoaded = Array.from(document.styleSheets).some(sheet => sheet.href && (sheet.href.includes('font-awesome') || sheet.href.includes('fontawesome')));
279
- if (isFontAwesomeLoaded)
280
- return;
281
- const link = document.createElement('link');
282
- link.rel = 'stylesheet';
283
- link.href = 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css';
284
- link.setAttribute('data-customviews-fontawesome', 'true');
285
- document.head.appendChild(link);
286
- }
287
- function replaceIconShortcodes(text) {
288
- // Matches :fa-*, :fas-*, :fab-* etc.
289
- return text.replace(/:(fa[b|s|r]?)-([\w-]+):/g, (_, style, icon) => {
290
- // style = fa, fas, fab, far, etc.
291
- // Default to "fa" if only "fa-" is given
292
- return `<i class="${style} fa-${icon}"></i>`;
293
- });
294
- }
295
- /** --- Basic renderers --- */
296
- function renderImage(el, asset) {
297
- if (!asset.src)
298
- return;
299
- el.innerHTML = '';
300
- const img = document.createElement('img');
301
- img.src = asset.src;
302
- img.alt = asset.alt || '';
303
- // Apply custom styling if provided
304
- if (asset.className) {
305
- img.className = asset.className;
306
- }
307
- if (asset.style) {
308
- img.setAttribute('style', asset.style);
309
- }
310
- // Default styles (can be overridden by asset.style)
311
- img.style.maxWidth = img.style.maxWidth || '100%';
312
- img.style.height = img.style.height || 'auto';
313
- img.style.display = img.style.display || 'block';
314
- el.appendChild(img);
315
- }
316
- function renderText(el, asset) {
317
- if (asset.content != null) {
318
- el.textContent = asset.content;
319
- }
320
- // Apply custom styling if provided
321
- if (asset.className) {
322
- el.className = asset.className;
323
- }
324
- if (asset.style) {
325
- el.setAttribute('style', asset.style);
326
- }
327
- }
328
- function renderHtml(el, asset) {
329
- if (asset.content != null) {
330
- el.innerHTML = asset.content;
331
- }
332
- // Apply custom styling if provided
333
- if (asset.className) {
334
- el.className = asset.className;
335
- }
336
- if (asset.style) {
337
- el.setAttribute('style', asset.style);
338
- }
339
- }
340
- /** --- Unified asset renderer --- */
341
- function detectAssetType(asset) {
342
- // If src exists, it's an image
343
- if (asset.src)
344
- return 'image';
345
- // If content contains HTML tags, it's HTML
346
- if (asset.content && /<[^>]+>/.test(asset.content)) {
347
- return 'html';
348
- }
349
- return 'text';
350
- }
351
- function renderAssetInto(el, assetId, assetsManager) {
352
- const asset = assetsManager.get(assetId);
353
- if (!asset)
354
- return;
355
- const type = asset.type || detectAssetType(asset);
356
- switch (type) {
357
- case 'image':
358
- renderImage(el, asset);
359
- break;
360
- case 'text':
361
- renderText(el, asset);
362
- break;
363
- case 'html':
364
- renderHtml(el, asset);
365
- break;
366
- default:
367
- el.innerHTML = asset.content || String(asset);
368
- console.warn('[CustomViews] Unknown asset type:', type);
369
- }
370
- }
371
-
372
276
  // Constants for selectors
373
277
  const TABGROUP_SELECTOR = 'cv-tabgroup';
374
278
  const TAB_SELECTOR = 'cv-tab';
@@ -455,37 +359,35 @@
455
359
  tabEl.classList.remove('cv-visible');
456
360
  }
457
361
  }
362
+ /**
363
+ * Extract header and body content from header component syntax: <cv-tab-header> and <cv-tab-body>
364
+ * Returns null if using old attribute-based syntax.
365
+ *
366
+ * @param tabEl The <cv-tab> element to inspect
367
+ * @returns Object with extracted content, or null if new syntax not used
368
+ */
369
+ static extractTabContent(tabEl) {
370
+ // Look for direct children
371
+ let headerEl = tabEl.querySelector(':scope > cv-tab-header');
372
+ if (!headerEl) {
373
+ return null;
374
+ }
375
+ const headerHTML = headerEl.innerHTML.trim();
376
+ // Find body element
377
+ let bodyEl = tabEl.querySelector(':scope > cv-tab-body');
378
+ // Fallback: try finding both header and body
379
+ // without :scope (in case of DOM manipulation) by iterating through tabEl.children if needed
380
+ return {
381
+ headerHTML,
382
+ bodyEl
383
+ };
384
+ }
458
385
  /**
459
386
  * Build navigation for tab groups with nav="auto" (one-time setup)
460
387
  */
461
388
  static buildNavs(rootEl, cfgGroups, onTabClick, onTabDoubleClick) {
462
389
  // Find all cv-tabgroup elements with nav="auto" or no nav attribute
463
390
  const tabGroups = rootEl.querySelectorAll(NAV_AUTO_SELECTOR);
464
- // Check if any tab headers contain Font Awesome shortcodes
465
- // Inject Font Awesome CSS only if needed
466
- let hasFontAwesomeShortcodes = false;
467
- tabGroups.forEach((groupEl) => {
468
- const groupId = groupEl.getAttribute('id');
469
- if (!groupId)
470
- return;
471
- const tabElements = Array.from(groupEl.children).filter((child) => child.tagName.toLowerCase() === 'cv-tab');
472
- // Check for Font Awesome shortcodes in tab headers
473
- tabElements.forEach((tabEl) => {
474
- const tabId = tabEl.getAttribute('id');
475
- if (!tabId)
476
- return;
477
- const splitIds = this.splitTabIds(tabId);
478
- const firstId = splitIds[0] || tabId;
479
- const header = tabEl.getAttribute('header') || this.getTabLabel(firstId, groupId, cfgGroups) || firstId || '';
480
- if (/:fa-[\w-]+:/.test(header)) {
481
- hasFontAwesomeShortcodes = true;
482
- }
483
- });
484
- });
485
- // Inject Font Awesome only if shortcodes are found
486
- if (hasFontAwesomeShortcodes) {
487
- ensureFontAwesomeInjected();
488
- }
489
391
  tabGroups.forEach((groupEl) => {
490
392
  const groupId = groupEl.getAttribute('id');
491
393
  if (!groupId)
@@ -514,78 +416,71 @@
514
416
  groupEl.insertBefore(navContainer, groupEl.firstChild);
515
417
  // Build nav items
516
418
  tabElements.forEach((tabEl) => {
517
- const tabId = tabEl.getAttribute('id');
518
- if (!tabId)
419
+ const rawTabId = tabEl.getAttribute('id');
420
+ if (!rawTabId)
519
421
  return;
520
- const splitIds = this.splitTabIds(tabId);
521
- // Header demarcation: if header contains |, split and use per tab.
522
- // If header attribute is present and not demarcated, use it as the fallback header.
523
- const headerAttr = tabEl.getAttribute('header') || '';
524
- let headerParts = [];
525
- if (headerAttr && headerAttr.includes('|')) {
526
- headerParts = headerAttr.split('|').map(h => h.trim());
527
- }
528
- const firstId = splitIds[0] || tabId;
529
- let fallbackHeader = '';
530
- if (headerAttr && !headerAttr.includes('|')) {
531
- // Single header provided on the element: use for all split IDs
532
- fallbackHeader = headerAttr;
422
+ const splitIds = this.splitTabIds(rawTabId);
423
+ // If multiple IDs, use the first as primary
424
+ const tabId = splitIds[0] || rawTabId;
425
+ // Get header for this tab - prefer new syntax over old attribute syntax
426
+ const extractedHeaderAndBody = this.extractTabContent(tabEl);
427
+ let header = '';
428
+ // use <cv-tab-header> content if available
429
+ if (extractedHeaderAndBody && extractedHeaderAndBody.headerHTML) {
430
+ header = extractedHeaderAndBody.headerHTML;
533
431
  }
534
432
  else {
535
- // No header attribute or multi-part header: use config label or id as fallback
536
- fallbackHeader = this.getTabLabel(firstId, groupId, cfgGroups) || firstId || '';
537
- }
538
- // Create nav links for each split ID
539
- splitIds.forEach((splitId, idx) => {
540
- const listItem = document.createElement('li');
541
- listItem.className = 'nav-item';
542
- const navLink = document.createElement('a');
543
- navLink.className = 'nav-link';
544
- // Use demarcated header if available, else prefer config label for this specific splitId
545
- let header = fallbackHeader;
546
- if (headerParts.length === splitIds.length) {
547
- header = headerParts[idx] ?? fallbackHeader;
548
- }
549
- else if (!headerAttr || headerAttr.includes('|')) {
550
- // Prefer the config label for the individual splitId over using firstId
551
- header = this.getTabLabel(splitId, groupId, cfgGroups) || splitId || '';
552
- }
553
- navLink.innerHTML = replaceIconShortcodes(header);
554
- navLink.href = '#';
555
- navLink.setAttribute('data-tab-id', splitId);
556
- navLink.setAttribute('data-group-id', groupId);
557
- navLink.setAttribute('role', 'tab');
558
- // Check if this split ID is active (same logic as applySelections)
559
- const activeTabId = this.resolveActiveTabForGroup(groupId, {}, cfgGroups, groupEl); // Pass empty tabs for initial state
560
- const isActive = splitIds.includes(activeTabId || '');
561
- if (isActive) {
562
- navLink.classList.add('active');
563
- navLink.setAttribute('aria-selected', 'true');
433
+ // use header attribute if available
434
+ const headerAttr = tabEl.getAttribute('header') || '';
435
+ if (headerAttr) {
436
+ header = headerAttr;
564
437
  }
565
438
  else {
566
- navLink.setAttribute('aria-selected', 'false');
439
+ // Use config label or id as fallback
440
+ header = this.getTabLabel(tabId, groupId, cfgGroups) || tabId || '';
567
441
  }
568
- // Add click handler for local tab switch
569
- if (onTabClick) {
570
- navLink.addEventListener('click', (e) => {
571
- e.preventDefault();
572
- // console.log("Single-click detected");
573
- onTabClick(groupId, splitId, groupEl);
574
- });
575
- }
576
- // Add double-click handler for sync
577
- if (onTabDoubleClick) {
578
- navLink.addEventListener('dblclick', (e) => {
579
- e.preventDefault();
580
- // console.log("Double-click detected");
581
- onTabDoubleClick(groupId, splitId, groupEl);
582
- });
583
- }
584
- // Add tooltip for UX feedback (use native title attribute)
585
- navLink.setAttribute('title', 'Double click to change switch tabs across all groups');
586
- listItem.appendChild(navLink);
587
- navContainer.appendChild(listItem);
588
- });
442
+ }
443
+ // Create a single nav link for this tab element
444
+ const listItem = document.createElement('li');
445
+ listItem.className = 'nav-item';
446
+ const navLink = document.createElement('a');
447
+ navLink.className = 'nav-link';
448
+ navLink.innerHTML = header;
449
+ navLink.href = '#';
450
+ navLink.setAttribute('data-tab-id', tabId);
451
+ navLink.setAttribute('data-raw-tab-id', rawTabId);
452
+ navLink.setAttribute('data-group-id', groupId);
453
+ navLink.setAttribute('role', 'tab');
454
+ // Check if any of the split IDs is active
455
+ const activeTabId = this.resolveActiveTabForGroup(groupId, {}, cfgGroups, groupEl); // Pass empty tabs for initial state
456
+ const isActive = splitIds.includes(activeTabId || '');
457
+ if (isActive) {
458
+ navLink.classList.add('active');
459
+ navLink.setAttribute('aria-selected', 'true');
460
+ }
461
+ else {
462
+ navLink.setAttribute('aria-selected', 'false');
463
+ }
464
+ // Add click handler for local tab switch (if split id, switches to default first ID)
465
+ if (onTabClick) {
466
+ navLink.addEventListener('click', (e) => {
467
+ e.preventDefault();
468
+ // console.log("Single-click detected");
469
+ onTabClick(groupId, tabId, groupEl);
470
+ });
471
+ }
472
+ // Add double-click handler for sync
473
+ if (onTabDoubleClick) {
474
+ navLink.addEventListener('dblclick', (e) => {
475
+ e.preventDefault();
476
+ // console.log("Double-click detected");
477
+ onTabDoubleClick(groupId, tabId, groupEl);
478
+ });
479
+ }
480
+ // Add tooltip for UX feedback (use native title attribute)
481
+ navLink.setAttribute('title', 'Double click to change switch tabs across all groups');
482
+ listItem.appendChild(navLink);
483
+ navContainer.appendChild(listItem);
589
484
  });
590
485
  // Add bottom border line at the end of the tab group
591
486
  const bottomBorder = document.createElement('div');
@@ -649,12 +544,12 @@
649
544
  static updateNavActiveState(groupEl, activeTabId) {
650
545
  const navLinks = groupEl.querySelectorAll('.nav-link');
651
546
  navLinks.forEach((link) => {
652
- const linkTabId = link.getAttribute('data-tab-id');
653
- if (!linkTabId)
547
+ const rawTabId = link.getAttribute('data-raw-tab-id');
548
+ if (!rawTabId)
654
549
  return;
655
- // Check if activeTabId matches or is in the split IDs of this link
656
- const splitIds = this.splitTabIds(linkTabId);
657
- const isActive = linkTabId === activeTabId || splitIds.includes(activeTabId);
550
+ // Check if activeTabId is in the split IDs of this link
551
+ const splitIds = this.splitTabIds(rawTabId);
552
+ const isActive = splitIds.includes(activeTabId);
658
553
  if (isActive) {
659
554
  link.classList.add('active');
660
555
  link.setAttribute('aria-selected', 'true');
@@ -681,12 +576,12 @@
681
576
  // Update nav links for this group
682
577
  const navLinks = groupEl.querySelectorAll('.nav-link');
683
578
  navLinks.forEach((link) => {
684
- const linkTabId = link.getAttribute('data-tab-id');
685
- if (!linkTabId)
579
+ const rawTabId = link.getAttribute('data-raw-tab-id');
580
+ if (!rawTabId)
686
581
  return;
687
- // Check if activeTabId matches or is in the split IDs of this link
688
- const splitIds = this.splitTabIds(linkTabId);
689
- const isActive = linkTabId === activeTabId || splitIds.includes(activeTabId);
582
+ // Check if activeTabId is in the split IDs of this link
583
+ const splitIds = this.splitTabIds(rawTabId);
584
+ const isActive = splitIds.includes(activeTabId);
690
585
  if (isActive) {
691
586
  link.classList.add('active');
692
587
  link.setAttribute('aria-selected', 'true');
@@ -787,6 +682,83 @@
787
682
  }
788
683
  }
789
684
 
685
+ /** --- Basic renderers --- */
686
+ function renderImage(el, asset) {
687
+ if (!asset.src)
688
+ return;
689
+ el.innerHTML = '';
690
+ const img = document.createElement('img');
691
+ img.src = asset.src;
692
+ img.alt = asset.alt || '';
693
+ // Apply custom styling if provided
694
+ if (asset.className) {
695
+ img.className = asset.className;
696
+ }
697
+ if (asset.style) {
698
+ img.setAttribute('style', asset.style);
699
+ }
700
+ // Default styles (can be overridden by asset.style)
701
+ img.style.maxWidth = img.style.maxWidth || '100%';
702
+ img.style.height = img.style.height || 'auto';
703
+ img.style.display = img.style.display || 'block';
704
+ el.appendChild(img);
705
+ }
706
+ function renderText(el, asset) {
707
+ if (asset.content != null) {
708
+ el.textContent = asset.content;
709
+ }
710
+ // Apply custom styling if provided
711
+ if (asset.className) {
712
+ el.className = asset.className;
713
+ }
714
+ if (asset.style) {
715
+ el.setAttribute('style', asset.style);
716
+ }
717
+ }
718
+ function renderHtml(el, asset) {
719
+ if (asset.content != null) {
720
+ el.innerHTML = asset.content;
721
+ }
722
+ // Apply custom styling if provided
723
+ if (asset.className) {
724
+ el.className = asset.className;
725
+ }
726
+ if (asset.style) {
727
+ el.setAttribute('style', asset.style);
728
+ }
729
+ }
730
+ /** --- Unified asset renderer --- */
731
+ function detectAssetType(asset) {
732
+ // If src exists, it's an image
733
+ if (asset.src)
734
+ return 'image';
735
+ // If content contains HTML tags, it's HTML
736
+ if (asset.content && /<[^>]+>/.test(asset.content)) {
737
+ return 'html';
738
+ }
739
+ return 'text';
740
+ }
741
+ function renderAssetInto(el, assetId, assetsManager) {
742
+ const asset = assetsManager.get(assetId);
743
+ if (!asset)
744
+ return;
745
+ const type = asset.type || detectAssetType(asset);
746
+ switch (type) {
747
+ case 'image':
748
+ renderImage(el, asset);
749
+ break;
750
+ case 'text':
751
+ renderText(el, asset);
752
+ break;
753
+ case 'html':
754
+ renderHtml(el, asset);
755
+ break;
756
+ default:
757
+ el.innerHTML = asset.content || String(asset);
758
+ console.warn('[CustomViews] Unknown asset type:', type);
759
+ }
760
+ }
761
+
790
762
  // Constants for selectors
791
763
  const TOGGLE_DATA_SELECTOR = "[data-cv-toggle], [data-customviews-toggle]";
792
764
  const TOGGLE_ELEMENT_SELECTOR = "cv-toggle";
@@ -854,166 +826,188 @@
854
826
  /**
855
827
  * Styles for toggle visibility and animations
856
828
  */
857
- const TOGGLE_STYLES = `
858
- /* Core toggle visibility transitions */
859
- [data-cv-toggle], [data-customviews-toggle], cv-toggle {
860
- transition: opacity 150ms ease,
861
- transform 150ms ease,
862
- max-height 200ms ease,
863
- margin 150ms ease;
864
- will-change: opacity, transform, max-height, margin;
865
- }
866
-
867
- .cv-visible {
868
- opacity: 1 !important;
869
- transform: translateY(0) !important;
870
- max-height: var(--cv-max-height, 9999px) !important;
871
- }
872
-
873
- .cv-hidden {
874
- opacity: 0 !important;
875
- transform: translateY(-4px) !important;
876
- pointer-events: none !important;
877
- padding-top: 0 !important;
878
- padding-bottom: 0 !important;
879
- border-top-width: 0 !important;
880
- border-bottom-width: 0 !important;
881
- max-height: 0 !important;
882
- margin-top: 0 !important;
883
- margin-bottom: 0 !important;
884
- overflow: hidden !important;
885
- }
829
+ const TOGGLE_STYLES = `
830
+ /* Core toggle visibility transitions */
831
+ [data-cv-toggle], [data-customviews-toggle], cv-toggle {
832
+ transition: opacity 150ms ease,
833
+ transform 150ms ease,
834
+ max-height 200ms ease,
835
+ margin 150ms ease;
836
+ will-change: opacity, transform, max-height, margin;
837
+ }
838
+
839
+ .cv-visible {
840
+ opacity: 1 !important;
841
+ transform: translateY(0) !important;
842
+ max-height: var(--cv-max-height, 9999px) !important;
843
+ }
844
+
845
+ .cv-hidden {
846
+ opacity: 0 !important;
847
+ transform: translateY(-4px) !important;
848
+ pointer-events: none !important;
849
+ padding-top: 0 !important;
850
+ padding-bottom: 0 !important;
851
+ border-top-width: 0 !important;
852
+ border-bottom-width: 0 !important;
853
+ max-height: 0 !important;
854
+ margin-top: 0 !important;
855
+ margin-bottom: 0 !important;
856
+ overflow: hidden !important;
857
+ }
886
858
  `;
887
859
 
888
860
  /**
889
861
  * Styles for tab groups and tab navigation
890
862
  */
891
- const TAB_STYLES = `
892
- /* Tab navigation styles - Bootstrap-style tabs matching MarkBind */
893
- .cv-tabs-nav {
894
- display: flex;
895
- flex-wrap: wrap;
896
- padding-left: 0;
897
- margin-top: 0.5rem;
898
- margin-bottom: 1rem;
899
- list-style: none;
900
- border-bottom: 1px solid #dee2e6;
901
- }
902
-
903
- .cv-tabs-nav .nav-item {
904
- margin-bottom: -1px;
905
- list-style: none;
906
- display: inline-block;
907
- }
908
-
909
- .cv-tabs-nav .nav-link {
910
- display: block;
911
- padding: 0.5rem 1rem;
912
- color: #495057;
913
- text-decoration: none;
914
- background-color: transparent;
915
- border: 1px solid transparent;
916
- border-top-left-radius: 0.25rem;
917
- border-top-right-radius: 0.25rem;
918
- transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
919
- cursor: pointer;
920
- }
921
-
922
- .cv-tabs-nav .nav-link:hover,
923
- .cv-tabs-nav .nav-link:focus {
924
- border-color: #e9ecef #e9ecef #dee2e6;
925
- isolation: isolate;
926
- }
927
-
928
- .cv-tabs-nav .nav-link.active {
929
- color: #495057;
930
- background-color: #fff;
931
- border-color: #dee2e6 #dee2e6 #fff;
932
- }
933
-
934
- .cv-tabs-nav .nav-link:focus {
935
- outline: 0;
936
- box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
937
- }
938
-
939
- /* Legacy button-based nav (deprecated, kept for compatibility) */
940
- .cv-tabs-nav-item {
941
- background: none;
942
- border: none;
943
- border-bottom: 2px solid transparent;
944
- padding: 0.5rem 1rem;
945
- cursor: pointer;
946
- font-size: 1rem;
947
- color: #6c757d;
948
- transition: color 150ms ease, border-color 150ms ease;
949
- }
950
-
951
- .cv-tabs-nav-item:hover {
952
- color: #495057;
953
- border-bottom-color: #dee2e6;
954
- }
955
-
956
- .cv-tabs-nav-item.active {
957
- color: #007bff;
958
- border-bottom-color: #007bff;
959
- font-weight: 500;
960
- }
961
-
962
- .cv-tabs-nav-item:focus {
963
- outline: 2px solid #007bff;
964
- outline-offset: 2px;
965
- }
966
-
967
- /* Tab panel base styles */
968
- cv-tab {
969
- display: block;
970
- }
971
-
972
- /* Override visibility for tab panels - use display instead of collapse animation */
973
- cv-tab.cv-hidden {
974
- display: none !important;
975
- }
976
-
977
- cv-tab.cv-visible {
978
- display: block !important;
979
- }
980
-
981
- cv-tabgroup {
982
- display: block;
983
- margin-bottom: 1.5rem;
984
- }
985
-
986
- /* Bottom border line for tab groups */
987
- .cv-tabgroup-bottom-border {
988
- border-bottom: 1px solid #dee2e6;
989
- margin-top: 1rem;
990
- }
991
-
992
- /* Tab content wrapper */
993
- .cv-tab-content {
994
- padding: 1rem 0;
995
- }
996
-
997
- /* Viewer-controlled nav visibility: hide nav containers when requested */
998
- .cv-tabs-nav-hidden {
999
- display: none !important;
1000
- }
1001
-
1002
- /* Print-friendly: hide tab navigation when printing to reduce clutter */
1003
- @media print {
1004
- .cv-tabs-nav {
1005
- display: none !important;
1006
- }
1007
- }
863
+ const TAB_STYLES = `
864
+ /* Tab navigation styles - Bootstrap-style tabs matching MarkBind */
865
+ .cv-tabs-nav {
866
+ display: flex;
867
+ flex-wrap: wrap;
868
+ padding-left: 0;
869
+ margin-top: 0.5rem;
870
+ margin-bottom: 1rem;
871
+ list-style: none;
872
+ border-bottom: 1px solid #dee2e6;
873
+
874
+ align-items: stretch;
875
+ }
876
+
877
+ .cv-tabs-nav .nav-item {
878
+ margin-bottom: -1px;
879
+ list-style: none;
880
+ display: flex; /* was inline-block → make flex to stretch height */
881
+ align-items: stretch; /* stretch link to full height */
882
+ }
883
+
884
+ .cv-tabs-nav .nav-link {
885
+ display: flex;
886
+ align-items: center;
887
+ justify-content: center;
888
+ padding: 0.5rem 1rem;
889
+ color: #495057;
890
+ text-decoration: none;
891
+ background-color: transparent;
892
+ border: 1px solid transparent;
893
+ border-top-left-radius: 0.25rem;
894
+ border-top-right-radius: 0.25rem;
895
+ transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
896
+ cursor: pointer;
897
+ min-height: 2.5rem;
898
+ box-sizing: border-box;
899
+ }
900
+
901
+ .cv-tabs-nav .nav-link p {
902
+ margin: 0; /* remove default margins */
903
+ display: inline; /* or inline-block */
904
+ }
905
+
906
+ .cv-tabs-nav .nav-link:hover,
907
+ .cv-tabs-nav .nav-link:focus {
908
+ border-color: #e9ecef #e9ecef #dee2e6;
909
+ isolation: isolate;
910
+ }
911
+
912
+ .cv-tabs-nav .nav-link.active {
913
+ color: #495057;
914
+ background-color: #fff;
915
+ border-color: #dee2e6 #dee2e6 #fff;
916
+ }
917
+
918
+ .cv-tabs-nav .nav-link:focus {
919
+ outline: 0;
920
+ box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
921
+ }
922
+
923
+ /* Legacy button-based nav (deprecated, kept for compatibility) */
924
+ .cv-tabs-nav-item {
925
+ background: none;
926
+ border: none;
927
+ border-bottom: 2px solid transparent;
928
+ padding: 0.5rem 1rem;
929
+ cursor: pointer;
930
+ font-size: 1rem;
931
+ color: #6c757d;
932
+ transition: color 150ms ease, border-color 150ms ease;
933
+ }
934
+
935
+ .cv-tabs-nav-item:hover {
936
+ color: #495057;
937
+ border-bottom-color: #dee2e6;
938
+ }
939
+
940
+ .cv-tabs-nav-item.active {
941
+ color: #007bff;
942
+ border-bottom-color: #007bff;
943
+ font-weight: 500;
944
+ }
945
+
946
+ .cv-tabs-nav-item:focus {
947
+ outline: 2px solid #007bff;
948
+ outline-offset: 2px;
949
+ }
950
+
951
+ /* Tab panel base styles */
952
+ cv-tab {
953
+ display: block;
954
+ }
955
+
956
+ /* Hide cv-tab-header source element; content is extracted to nav link */
957
+ cv-tab-header {
958
+ display: none !important;
959
+ }
960
+
961
+ /* Allow cv-tab-body to flow naturally */
962
+ cv-tab-body {
963
+ display: block;
964
+ }
965
+
966
+ /* Override visibility for tab panels - use display instead of collapse animation */
967
+ cv-tab.cv-hidden {
968
+ display: none !important;
969
+ }
970
+
971
+ cv-tab.cv-visible {
972
+ display: block !important;
973
+ }
974
+
975
+ cv-tabgroup {
976
+ display: block;
977
+ margin-bottom: 1.5rem;
978
+ }
979
+
980
+ /* Bottom border line for tab groups */
981
+ .cv-tabgroup-bottom-border {
982
+ border-bottom: 1px solid #dee2e6;
983
+ margin-top: 1rem;
984
+ }
985
+
986
+ /* Tab content wrapper */
987
+ .cv-tab-content {
988
+ padding: 1rem 0;
989
+ }
990
+
991
+ /* Viewer-controlled nav visibility: hide nav containers when requested */
992
+ .cv-tabs-nav-hidden {
993
+ display: none !important;
994
+ }
995
+
996
+ /* Print-friendly: hide tab navigation when printing to reduce clutter */
997
+ @media print {
998
+ .cv-tabs-nav {
999
+ display: none !important;
1000
+ }
1001
+ }
1008
1002
  `;
1009
1003
 
1010
1004
  /**
1011
1005
  * Combined core styles for toggles and tabs
1012
1006
  */
1013
- const CORE_STYLES = `
1014
- ${TOGGLE_STYLES}
1015
-
1016
- ${TAB_STYLES}
1007
+ const CORE_STYLES = `
1008
+ ${TOGGLE_STYLES}
1009
+
1010
+ ${TAB_STYLES}
1017
1011
  `;
1018
1012
  /**
1019
1013
  * Add styles for hiding and showing toggles animations and transitions to the document head
@@ -1331,6 +1325,24 @@ ${TAB_STYLES}
1331
1325
  // Element is managed by Core
1332
1326
  }
1333
1327
  }
1328
+ /**
1329
+ * <cv-tab-header> element - represents tab header with rich HTML formatting
1330
+ * Content is extracted and used in the navigation link
1331
+ */
1332
+ class CVTabHeader extends HTMLElement {
1333
+ connectedCallback() {
1334
+ // Element is a semantic container; TabManager extracts its content
1335
+ }
1336
+ }
1337
+ /**
1338
+ * <cv-tab-body> element - represents tab body content
1339
+ * Semantic container for tab panel content
1340
+ */
1341
+ class CVTabBody extends HTMLElement {
1342
+ connectedCallback() {
1343
+ // Element is a semantic container; visibility managed by TabManager
1344
+ }
1345
+ }
1334
1346
  /**
1335
1347
  * Register custom elements
1336
1348
  */
@@ -1345,6 +1357,12 @@ ${TAB_STYLES}
1345
1357
  if (!customElements.get('cv-toggle')) {
1346
1358
  customElements.define('cv-toggle', CVToggle);
1347
1359
  }
1360
+ if (!customElements.get('cv-tab-header')) {
1361
+ customElements.define('cv-tab-header', CVTabHeader);
1362
+ }
1363
+ if (!customElements.get('cv-tab-body')) {
1364
+ customElements.define('cv-tab-body', CVTabBody);
1365
+ }
1348
1366
  }
1349
1367
 
1350
1368
  /**
@@ -1407,993 +1425,993 @@ ${TAB_STYLES}
1407
1425
  * Note: Styles are kept as a TypeScript string for compatibility with the build system.
1408
1426
  * This approach ensures the styles are properly bundled and don't require separate CSS file handling.
1409
1427
  */
1410
- const WIDGET_STYLES = `
1411
- /* Rounded rectangle widget icon styles */
1412
- .cv-widget-icon {
1413
- position: fixed;
1414
- /* Slightly transparent by default so the widget is subtle at the page edge */
1415
- background: rgba(255, 255, 255, 0.92);
1416
- color: rgba(0, 0, 0, 0.9);
1417
- opacity: 0.6;
1418
- display: flex;
1419
- align-items: center;
1420
- justify-content: center;
1421
- font-size: 18px;
1422
- font-weight: bold;
1423
- cursor: pointer;
1424
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
1425
- z-index: 9998;
1426
- transition: all 0.3s ease;
1427
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
1428
- }
1429
-
1430
- .cv-widget-icon:hover {
1431
- /* Become fully opaque on hover to improve readability */
1432
- background: rgba(255, 255, 255, 1);
1433
- color: rgba(0, 0, 0, 1);
1434
- opacity: 1;
1435
- }
1436
-
1437
- /* Top-right: rounded end on left, sticks out leftward on hover */
1438
- .cv-widget-top-right {
1439
- top: 20px;
1440
- right: 0;
1441
- border-radius: 18px 0 0 18px;
1442
- padding-left: 8px;
1443
- justify-content: flex-start;
1444
- }
1445
-
1446
- /* Top-left: rounded end on right, sticks out rightward on hover */
1447
- .cv-widget-top-left {
1448
- top: 20px;
1449
- left: 0;
1450
- border-radius: 0 18px 18px 0;
1451
- padding-right: 8px;
1452
- justify-content: flex-end;
1453
- }
1454
-
1455
- /* Bottom-right: rounded end on left, sticks out leftward on hover */
1456
- .cv-widget-bottom-right {
1457
- bottom: 20px;
1458
- right: 0;
1459
- border-radius: 18px 0 0 18px;
1460
- padding-left: 8px;
1461
- justify-content: flex-start;
1462
- }
1463
-
1464
- /* Bottom-left: rounded end on right, sticks out rightward on hover */
1465
- .cv-widget-bottom-left {
1466
- bottom: 20px;
1467
- left: 0;
1468
- border-radius: 0 18px 18px 0;
1469
- padding-right: 8px;
1470
- justify-content: flex-end;
1471
- }
1472
-
1473
- /* Middle-left: rounded end on right, sticks out rightward on hover */
1474
- .cv-widget-middle-left {
1475
- top: 50%;
1476
- left: 0;
1477
- transform: translateY(-50%);
1478
- border-radius: 0 18px 18px 0;
1479
- padding-right: 8px;
1480
- justify-content: flex-end;
1481
- }
1482
-
1483
- /* Middle-right: rounded end on left, sticks out leftward on hover */
1484
- .cv-widget-middle-right {
1485
- top: 50%;
1486
- right: 0;
1487
- transform: translateY(-50%);
1488
- border-radius: 18px 0 0 18px;
1489
- padding-left: 8px;
1490
- justify-content: flex-start;
1491
- }
1492
-
1493
- .cv-widget-top-right,
1494
- .cv-widget-middle-right,
1495
- .cv-widget-bottom-right,
1496
- .cv-widget-top-left,
1497
- .cv-widget-middle-left,
1498
- .cv-widget-bottom-left {
1499
- height: 36px;
1500
- width: 36px;
1501
- }
1502
-
1503
- .cv-widget-middle-right:hover,
1504
- .cv-widget-top-right:hover,
1505
- .cv-widget-bottom-right:hover,
1506
- .cv-widget-top-left:hover,
1507
- .cv-widget-middle-left:hover,
1508
- .cv-widget-bottom-left:hover {
1509
- width: 55px;
1510
- }
1511
-
1512
- /* Modal content styles */
1513
- .cv-widget-section {
1514
- margin-bottom: 16px;
1515
- }
1516
-
1517
- .cv-widget-section:last-child {
1518
- margin-bottom: 0;
1519
- }
1520
-
1521
- .cv-widget-section label {
1522
- display: block;
1523
- margin-bottom: 4px;
1524
- font-weight: 500;
1525
- color: #555;
1526
- }
1527
-
1528
- .cv-widget-profile-select,
1529
- .cv-widget-state-select {
1530
- width: 100%;
1531
- padding: 8px 12px;
1532
- border: 1px solid #ddd;
1533
- border-radius: 4px;
1534
- background: white;
1535
- font-size: 14px;
1536
- }
1537
-
1538
- .cv-widget-profile-select:focus,
1539
- .cv-widget-state-select:focus {
1540
- outline: none;
1541
- border-color: #007bff;
1542
- box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
1543
- }
1544
-
1545
- .cv-widget-profile-select:disabled,
1546
- .cv-widget-state-select:disabled {
1547
- background: #f8f9fa;
1548
- color: #6c757d;
1549
- cursor: not-allowed;
1550
- }
1551
-
1552
- .cv-widget-current {
1553
- margin: 16px 0;
1554
- padding: 12px;
1555
- background: #f8f9fa;
1556
- border-radius: 4px;
1557
- border-left: 4px solid #007bff;
1558
- }
1559
-
1560
- .cv-widget-current label {
1561
- font-size: 12px;
1562
- text-transform: uppercase;
1563
- letter-spacing: 0.5px;
1564
- color: #666;
1565
- margin-bottom: 4px;
1566
- }
1567
-
1568
- .cv-widget-current-view {
1569
- font-weight: 500;
1570
- color: #333;
1571
- }
1572
-
1573
- .cv-widget-reset {
1574
- width: 100%;
1575
- padding: 8px 16px;
1576
- background: #dc3545;
1577
- color: white;
1578
- border: none;
1579
- border-radius: 4px;
1580
- cursor: pointer;
1581
- font-size: 14px;
1582
- font-weight: 500;
1583
- }
1584
-
1585
- .cv-widget-reset:hover {
1586
- background: #c82333;
1587
- }
1588
-
1589
- .cv-widget-reset:active {
1590
- background: #bd2130;
1591
- }
1592
-
1593
- /* Responsive design for mobile */
1594
- @media (max-width: 768px) {
1595
- .cv-widget-top-right,
1596
- .cv-widget-top-left {
1597
- top: 10px;
1598
- }
1599
-
1600
- .cv-widget-bottom-right,
1601
- .cv-widget-bottom-left {
1602
- bottom: 10px;
1603
- }
1604
-
1605
- /* All widgets stay flush with screen edges */
1606
- .cv-widget-top-right,
1607
- .cv-widget-bottom-right,
1608
- .cv-widget-middle-right {
1609
- right: 0;
1610
- }
1611
-
1612
- .cv-widget-top-left,
1613
- .cv-widget-bottom-left,
1614
- .cv-widget-middle-left {
1615
- left: 0;
1616
- }
1617
-
1618
- /* Slightly smaller on mobile */
1619
- .cv-widget-icon {
1620
- width: 60px;
1621
- height: 32px;
1622
- }
1623
-
1624
- .cv-widget-icon:hover {
1625
- width: 75px;
1626
- }
1627
- }
1628
-
1629
- /* Modal styles */
1630
- .cv-widget-modal-overlay {
1631
- position: fixed;
1632
- top: 0;
1633
- left: 0;
1634
- right: 0;
1635
- bottom: 0;
1636
- background: rgba(0, 0, 0, 0.5);
1637
- display: flex;
1638
- align-items: center;
1639
- justify-content: center;
1640
- z-index: 10002;
1641
- animation: fadeIn 0.2s ease;
1642
- }
1643
-
1644
- @keyframes fadeIn {
1645
- from { opacity: 0; }
1646
- to { opacity: 1; }
1647
- }
1648
-
1649
- .cv-widget-modal {
1650
- background: white;
1651
- border-radius: 0.75rem;
1652
- box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
1653
- max-width: 32rem;
1654
- width: 90vw;
1655
- max-height: 80vh;
1656
- animation: slideIn 0.2s ease;
1657
- display: flex;
1658
- flex-direction: column;
1659
- }
1660
-
1661
- @keyframes slideIn {
1662
- from {
1663
- opacity: 0;
1664
- transform: scale(0.9) translateY(-20px);
1665
- }
1666
- to {
1667
- opacity: 1;
1668
- transform: scale(1) translateY(0);
1669
- }
1670
- }
1671
-
1672
- .cv-modal-header {
1673
- display: flex;
1674
- align-items: center;
1675
- justify-content: space-between;
1676
- padding: 0.5rem 1rem;
1677
- border-bottom: 1px solid rgba(0, 0, 0, 0.1);
1678
- }
1679
-
1680
- .cv-modal-header-content {
1681
- display: flex;
1682
- align-items: center;
1683
- gap: 0.75rem;
1684
- }
1685
-
1686
- .cv-modal-icon {
1687
- position: relative;
1688
- width: 1rem;
1689
- height: 1rem;
1690
- display: flex;
1691
- align-items: center;
1692
- justify-content: center;
1693
- border-radius: 9999px;
1694
- }
1695
-
1696
- .cv-modal-icon-svg {
1697
- width: 100%;
1698
- height: 100%;
1699
- opacity: 1;
1700
- }
1701
-
1702
- .cv-modal-title {
1703
- font-size: 1.125rem;
1704
- font-weight: bold;
1705
- color: rgba(0, 0, 0, 0.9);
1706
- margin: 0;
1707
- }
1708
-
1709
- .cv-modal-close {
1710
- width: 2rem;
1711
- height: 2rem;
1712
- display: flex;
1713
- align-items: center;
1714
- justify-content: center;
1715
- border-radius: 9999px;
1716
- background: transparent;
1717
- border: none;
1718
- color: rgba(0, 0, 0, 0.6);
1719
- cursor: pointer;
1720
- transition: all 0.2s ease;
1721
- }
1722
-
1723
- .cv-modal-close:hover {
1724
- background: rgba(62, 132, 244, 0.1);
1725
- color: #3e84f4;
1726
- }
1727
-
1728
- .cv-modal-close-icon {
1729
- width: 1.25rem;
1730
- height: 1.25rem;
1731
- }
1732
-
1733
- .cv-modal-main {
1734
- padding: 1rem;
1735
- flex: 1;
1736
- display: flex;
1737
- flex-direction: column;
1738
- gap: 1rem;
1739
- overflow-y: auto;
1740
- max-height: calc(80vh - 8rem);
1741
- }
1742
-
1743
- .cv-modal-description {
1744
- font-size: 0.875rem;
1745
- color: rgba(0, 0, 0, 0.8);
1746
- margin: 0;
1747
- line-height: 1.4;
1748
- }
1749
-
1750
- .cv-content-section,
1751
- .cv-tab-groups-section {
1752
- display: flex;
1753
- flex-direction: column;
1754
- gap: 0.75rem;
1755
- }
1756
-
1757
- .cv-section-heading {
1758
- font-size: 1rem;
1759
- font-weight: bold;
1760
- color: rgba(0, 0, 0, 0.9);
1761
- margin: 0;
1762
- }
1763
-
1764
- .cv-widget-modal-actions {
1765
- margin-top: 20px;
1766
- padding-top: 16px;
1767
- border-top: 1px solid #e9ecef;
1768
- }
1769
-
1770
- .cv-widget-restore {
1771
- width: 100%;
1772
- padding: 10px 16px;
1773
- background: #28a745;
1774
- color: white;
1775
- border: none;
1776
- border-radius: 4px;
1777
- cursor: pointer;
1778
- font-size: 14px;
1779
- font-weight: 500;
1780
- }
1781
-
1782
- .cv-widget-restore:hover {
1783
- background: #218838;
1784
- }
1785
-
1786
- .cv-widget-create-state {
1787
- width: 100%;
1788
- padding: 10px 16px;
1789
- background: #007bff;
1790
- color: white;
1791
- border: none;
1792
- border-radius: 4px;
1793
- cursor: pointer;
1794
- font-size: 14px;
1795
- font-weight: 500;
1796
- margin-bottom: 10px;
1797
- }
1798
-
1799
- .cv-widget-create-state:hover {
1800
- background: #0056b3;
1801
- }
1802
-
1803
- .cv-widget-theme-dark .cv-widget-modal {
1804
- background: #101722;
1805
- color: #e2e8f0;
1806
- }
1807
-
1808
- .cv-widget-theme-dark .cv-modal-header {
1809
- border-color: rgba(255, 255, 255, 0.1);
1810
- }
1811
-
1812
- .cv-widget-theme-dark .cv-modal-title {
1813
- color: #e2e8f0;
1814
- }
1815
-
1816
- .cv-widget-theme-dark .cv-modal-close {
1817
- color: rgba(255, 255, 255, 0.6);
1818
- }
1819
-
1820
- .cv-widget-theme-dark .cv-modal-close:hover {
1821
- background: rgba(62, 132, 244, 0.2);
1822
- color: #3e84f4;
1823
- }
1824
-
1825
- .cv-widget-theme-dark .cv-modal-description {
1826
- color: rgba(255, 255, 255, 0.8);
1827
- }
1828
-
1829
- .cv-widget-theme-dark .cv-section-heading {
1830
- color: #e2e8f0;
1831
- }
1832
-
1833
- .cv-widget-theme-dark .cv-toggles-container
1834
- .cv-widget-theme-dark .cv-tabgroups-container {
1835
- border-color: rgba(255, 255, 255, 0.1);
1836
- }
1837
-
1838
- .cv-widget-theme-dark .cv-toggle-card,
1839
- .cv-widget-theme-dark .cv-tabgroup-card {
1840
- background: #101722;
1841
- border-color: rgba(255, 255, 255, 0.1);
1842
- }
1843
-
1844
- .cv-widget-theme-dark .cv-toggle-title,
1845
- .cv-widget-theme-dark .cv-tabgroup-title {
1846
- color: #e2e8f0;
1847
- }
1848
-
1849
- .cv-widget-theme-dark .cv-toggle-description,
1850
- .cv-widget-theme-dark .cv-tabgroup-description {
1851
- color: rgba(255, 255, 255, 0.6);
1852
- }
1853
-
1854
- .cv-widget-theme-dark .cv-toggle-slider {
1855
- background: rgba(255, 255, 255, 0.2);
1856
- }
1857
-
1858
- .cv-widget-theme-dark .cv-tab-group-description {
1859
- color: rgba(255, 255, 255, 0.8);
1860
- }
1861
-
1862
- .cv-widget-theme-dark .cv-tabgroup-select {
1863
- background: #101722;
1864
- border-color: rgba(255, 255, 255, 0.2);
1865
- color: #e2e8f0;
1866
- }
1867
-
1868
- .cv-widget-theme-dark .cv-modal-footer {
1869
- border-color: rgba(255, 255, 255, 0.1);
1870
- background: #101722;
1871
- }
1872
-
1873
- .cv-widget-theme-dark .cv-reset-btn {
1874
- color: #e2e8f0;
1875
- background: rgba(255, 255, 255, 0.1);
1876
- }
1877
-
1878
- .cv-widget-theme-dark .cv-reset-btn:hover {
1879
- background: rgba(255, 255, 255, 0.2);
1880
- }
1881
-
1882
- /* Custom state creator styles */
1883
- .cv-custom-state-modal {
1884
- max-width: 500px;
1885
- }
1886
-
1887
- .cv-custom-state-form .cv-section-header {
1888
- font-size: 16px;
1889
- font-weight: 600;
1890
- color: #333;
1891
- border-bottom: 1px solid #e9ecef;
1892
- padding-bottom: 5px;
1893
- }
1894
-
1895
- .cv-custom-state-form p {
1896
- font-size: 15px;
1897
- line-height: 1.6;
1898
- color: #555;
1899
- margin-bottom: 24px;
1900
- text-align: justify;
1901
- }
1902
-
1903
- .cv-custom-state-section {
1904
- margin-bottom: 16px;
1905
- }
1906
-
1907
- .cv-custom-state-section label {
1908
- display: block;
1909
- margin-bottom: 4px;
1910
- font-weight: 500;
1911
- color: #555;
1912
- }
1913
-
1914
- .cv-custom-state-input {
1915
- width: 100%;
1916
- padding: 8px 12px;
1917
- border: 1px solid #ddd;
1918
- border-radius: 4px;
1919
- background: white;
1920
- font-size: 14px;
1921
- }
1922
-
1923
- .cv-custom-state-input:focus {
1924
- outline: none;
1925
- border-color: #007bff;
1926
- box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
1927
- }
1928
-
1929
- /* Toggles Container */
1930
- .cv-toggles-container {
1931
- display: flex;
1932
- flex-direction: column;
1933
- gap: 0.5rem;
1934
- border-radius: 0.5rem;
1935
- border: 1px solid rgba(0, 0, 0, 0.1);
1936
- overflow: hidden;
1937
- }
1938
-
1939
- .cv-toggle-card,
1940
- .cv-tabgroup-card {
1941
- background: white;
1942
- border-bottom: 1px solid rgba(0, 0, 0, 0.1);
1943
- }
1944
-
1945
- .cv-toggle-card:last-child {
1946
- border-bottom: none;
1947
- }
1948
-
1949
- .cv-toggle-content {
1950
- display: flex;
1951
- align-items: center;
1952
- justify-content: space-between;
1953
- padding: 0.75rem;
1954
- }
1955
-
1956
- .cv-toggle-title {
1957
- font-weight: 500;
1958
- font-size: 0.875rem;
1959
- color: rgba(0, 0, 0, 0.9);
1960
- margin: 0 0 0.125rem 0;
1961
- }
1962
-
1963
- .cv-toggle-description {
1964
- font-size: 0.75rem;
1965
- color: rgba(0, 0, 0, 0.6);
1966
- margin: 0;
1967
- }
1968
-
1969
- .cv-toggle-label{
1970
- position: relative;
1971
- display: inline-block;
1972
- width: 2.75rem;
1973
- height: 1.5rem;
1974
- cursor: pointer;
1975
- }
1976
-
1977
- .cv-toggle-input {
1978
- opacity: 0;
1979
- width: 0;
1980
- height: 0;
1981
- }
1982
-
1983
- .cv-toggle-slider {
1984
- position: absolute;
1985
- top: 0;
1986
- left: 0;
1987
- right: 0;
1988
- bottom: 0;
1989
- background: rgba(0, 0, 0, 0.2);
1990
- border-radius: 9999px;
1991
- transition: background-color 0.2s ease;
1992
- }
1993
-
1994
- .cv-toggle-slider:before {
1995
- position: absolute;
1996
- content: "";
1997
- height: 1rem;
1998
- width: 1rem;
1999
- left: 0.25rem;
2000
- bottom: 0.25rem;
2001
- background: white;
2002
- border-radius: 50%;
2003
- transition: transform 0.2s ease;
2004
- }
2005
-
2006
- .cv-toggle-input:checked + .cv-toggle-slider {
2007
- background: #3e84f4;
2008
- }
2009
-
2010
- .cv-toggle-input:checked + .cv-toggle-slider:before {
2011
- transform: translateX(1.25rem);
2012
- }
2013
-
2014
- /* Dark theme toggle switch styles */
2015
- .cv-widget-theme-dark .cv-toggle-switch {
2016
- background: #4a5568;
2017
- }
2018
-
2019
- .cv-widget-theme-dark .cv-toggle-switch:hover {
2020
- background: #5a6578;
2021
- }
2022
-
2023
- .cv-widget-theme-dark .cv-toggle-switch.cv-toggle-active {
2024
- background: #63b3ed;
2025
- }
2026
-
2027
- .cv-widget-theme-dark .cv-toggle-switch.cv-toggle-active:hover {
2028
- background: #4299e1;
2029
- }
2030
-
2031
- /* Tab Groups Container */
2032
- .cv-tab-groups-list {
2033
- display: flex;
2034
- flex-direction: column;
2035
- gap: 1px;
2036
- border: 1px solid rgba(0, 0, 0, 0.1);
2037
- border-radius: 0.5rem;
2038
- overflow: hidden;
2039
- }
2040
-
2041
- /* Tab Group Card - Header (Navigation Headers toggle) */
2042
- .cv-tabgroup-card.cv-tabgroup-header {
2043
- display: flex;
2044
- align-items: center;
2045
- justify-content: space-between;
2046
- padding: 0.75rem;
2047
- border-bottom: 0px;
2048
- }
2049
-
2050
- .cv-tabgroup-card.cv-tabgroup-header .cv-tabgroup-row {
2051
- display: flex;
2052
- align-items: center;
2053
- justify-content: space-between;
2054
- width: 100%;
2055
- gap: 1rem;
2056
- }
2057
-
2058
- /* Tab Group Card - Items */
2059
- .cv-tabgroup-card.cv-tabgroup-item {
2060
- display: flex;
2061
- flex-direction: column;
2062
- gap: 0.5rem;
2063
- padding: 0.75rem;
2064
- background: white;
2065
- border-bottom: 1px solid rgba(0, 0, 0, 0.05);
2066
- }
2067
-
2068
- .cv-tabgroup-card.cv-tabgroup-item:last-child {
2069
- border-bottom: none;
2070
- }
2071
-
2072
- /* Tab Group Info */
2073
- .cv-tabgroup-info {
2074
- flex: 1;
2075
- }
2076
-
2077
- .cv-tabgroup-title {
2078
- font-weight: 500;
2079
- font-size: 0.875rem;
2080
- color: rgba(0, 0, 0, 0.9);
2081
- margin: 0 0 0.25rem 0;
2082
- }
2083
-
2084
- .cv-tabgroup-description {
2085
- font-size: 0.75rem;
2086
- color: rgba(0, 0, 0, 0.6);
2087
- margin: 0;
2088
- line-height: 1.3;
2089
- }
2090
-
2091
- /* Tab Group Label (for select dropdowns) */
2092
- .cv-tabgroup-label {
2093
- font-size: 0.875rem;
2094
- color: rgba(0, 0, 0, 0.8);
2095
- margin: 0;
2096
- line-height: 1.4;
2097
- font-weight: 500;
2098
- display: block;
2099
- cursor: pointer;
2100
- }
2101
-
2102
- /* Tab Group Select */
2103
- .cv-tabgroup-select {
2104
- width: 100%;
2105
- border-radius: 0.5rem;
2106
- background: white;
2107
- border: 1px solid rgba(0, 0, 0, 0.15);
2108
- color: rgba(0, 0, 0, 0.9);
2109
- padding: 0.5rem 0.75rem;
2110
- font-size: 0.875rem;
2111
- cursor: pointer;
2112
- transition: all 0.15s ease;
2113
- font-family: inherit;
2114
- }
2115
-
2116
- .cv-tabgroup-select:hover {
2117
- border-color: rgba(0, 0, 0, 0.25);
2118
- }
2119
-
2120
- .cv-tabgroup-select:focus {
2121
- outline: none;
2122
- border-color: #3e84f4;
2123
- box-shadow: 0 0 0 2px rgba(62, 132, 244, 0.2);
2124
- }
2125
-
2126
- /* Modern Toggle Switch */
2127
- .cv-toggle-switch {
2128
- position: relative;
2129
- display: inline-flex;
2130
- align-items: center;
2131
- width: 44px;
2132
- height: 24px;
2133
- background: rgba(0, 0, 0, 0.1);
2134
- border-radius: 9999px;
2135
- padding: 2px;
2136
- box-sizing: border-box;
2137
- cursor: pointer;
2138
- transition: background-color 0.2s ease;
2139
- border: none;
2140
- }
2141
-
2142
- .cv-toggle-switch input {
2143
- display: none;
2144
- }
2145
-
2146
- .cv-toggle-switch .cv-switch-bg {
2147
- position: absolute;
2148
- inset: 0;
2149
- border-radius: 9999px;
2150
- background: rgba(0, 0, 0, 0.1);
2151
- transition: background-color 0.2s ease;
2152
- pointer-events: none;
2153
- }
2154
-
2155
- .cv-toggle-switch .cv-switch-knob {
2156
- position: relative;
2157
- width: 20px;
2158
- height: 20px;
2159
- background: white;
2160
- border-radius: 50%;
2161
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
2162
- transition: transform 0.2s ease;
2163
- z-index: 1;
2164
- }
2165
-
2166
- .cv-toggle-switch input:checked + .cv-switch-bg {
2167
- background: #3e84f4;
2168
- }
2169
-
2170
- .cv-toggle-switch input:checked ~ .cv-switch-knob {
2171
- transform: translateX(20px);
2172
- }
2173
-
2174
- /* Dark Theme - Tab Groups */
2175
- .cv-widget-theme-dark .cv-tabgroup-card.cv-tabgroup-header {
2176
- background: #101722;
2177
- border-bottom-color: rgba(255, 255, 255, 0.1);
2178
- }
2179
-
2180
- .cv-widget-theme-dark .cv-tabgroup-card.cv-tabgroup-item {
2181
- background: #101722;
2182
- border-bottom-color: rgba(255, 255, 255, 0.05);
2183
- }
2184
-
2185
- .cv-widget-theme-dark .cv-tabgroup-title {
2186
- color: #e2e8f0;
2187
- }
2188
-
2189
- .cv-widget-theme-dark .cv-tabgroup-description {
2190
- color: rgba(255, 255, 255, 0.6);
2191
- }
2192
-
2193
- .cv-widget-theme-dark .cv-tabgroup-label {
2194
- color: rgba(255, 255, 255, 0.8);
2195
- }
2196
-
2197
- .cv-widget-theme-dark .cv-tab-groups-list {
2198
- border-color: rgba(255, 255, 255, 0.1);
2199
- }
2200
-
2201
- .cv-widget-theme-dark .cv-tabgroup-select {
2202
- background: #101722;
2203
- border-color: rgba(255, 255, 255, 0.15);
2204
- color: #e2e8f0;
2205
- }
2206
-
2207
- .cv-widget-theme-dark .cv-tabgroup-select:hover {
2208
- border-color: rgba(255, 255, 255, 0.25);
2209
- }
2210
-
2211
- .cv-widget-theme-dark .cv-tabgroup-select:focus {
2212
- border-color: #60a5fa;
2213
- box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
2214
- }
2215
-
2216
- /* Dark Theme - Toggle Switch */
2217
- .cv-widget-theme-dark .cv-toggle-switch .cv-switch-bg {
2218
- background: rgba(255, 255, 255, 0.1);
2219
- }
2220
-
2221
- .cv-widget-theme-dark .cv-toggle-switch .cv-switch-knob {
2222
- background: #e2e8f0;
2223
- }
2224
-
2225
- .cv-widget-theme-dark .cv-toggle-switch input:checked + .cv-switch-bg {
2226
- background: #63b3ed;
2227
- }
2228
-
2229
- .cv-modal-footer {
2230
- display: flex;
2231
- justify-content: space-between;
2232
- align-items: center;
2233
- padding: 0.75rem;
2234
- border-top: 1px solid rgba(0, 0, 0, 0.1);
2235
- }
2236
-
2237
- .cv-reset-btn,
2238
- .cv-share-btn {
2239
- display: flex;
2240
- align-items: center;
2241
- gap: 0.5rem;
2242
- padding: 0.375rem 0.75rem;
2243
- border-radius: 0.5rem;
2244
- font-weight: 600;
2245
- font-size: 0.875rem;
2246
- cursor: pointer;
2247
- transition: all 0.2s ease;
2248
- border: none;
2249
- }
2250
-
2251
- .cv-reset-btn {
2252
- color: rgba(0, 0, 0, 0.9);
2253
- background: rgba(0, 0, 0, 0.1);
2254
- }
2255
-
2256
- .cv-reset-btn:hover {
2257
- background: rgba(0, 0, 0, 0.2);
2258
- }
2259
-
2260
- .cv-share-btn {
2261
- color: white;
2262
- background: #3e84f4;
2263
- }
2264
-
2265
- .cv-share-btn:hover {
2266
- background: rgba(62, 132, 244, 0.9);
2267
- }
2268
-
2269
- .cv-btn-icon {
2270
- width: 1rem;
2271
- height: 1rem;
2272
- }
2273
-
2274
- /* Dark theme custom state styles */
2275
- /* Welcome modal styles */
2276
- .cv-welcome-modal {
2277
- max-width: 32rem;
2278
- width: 90vw;
2279
- background: white;
2280
- border-radius: 0.75rem;
2281
- box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
2282
- animation: slideIn 0.2s ease;
2283
- display: flex;
2284
- flex-direction: column;
2285
- }
2286
-
2287
- .cv-modal-main {
2288
- padding: 1rem;
2289
- flex: 1;
2290
- display: flex;
2291
- flex-direction: column;
2292
- gap: 1rem;
2293
- overflow-y: auto;
2294
- max-height: calc(80vh - 8rem);
2295
- }
2296
-
2297
- .cv-welcome-message {
2298
- font-size: 0.875rem;
2299
- color: rgba(0, 0, 0, 0.8);
2300
- margin: 0;
2301
- line-height: 1.4;
2302
- text-align: center;
2303
- }
2304
-
2305
- .cv-welcome-message a {
2306
- color: #3e84f4;
2307
- text-align: justify;
2308
- text-decoration: none;
2309
- }
2310
-
2311
- .cv-welcome-message a:hover {
2312
- text-decoration: underline;
2313
- }
2314
-
2315
- .cv-welcome-widget-preview {
2316
- display: flex;
2317
- align-items: center;
2318
- justify-content: center;
2319
- gap: 1rem;
2320
- padding: 1rem;
2321
- background: #f8f9fa;
2322
- border-radius: 0.5rem;
2323
- margin: 1rem 0;
2324
- }
2325
-
2326
- .cv-welcome-widget-icon {
2327
- width: 2rem;
2328
- height: 2rem;
2329
- background: rgba(62, 132, 244, 0.1);
2330
- border-radius: 9999px;
2331
- display: flex;
2332
- align-items: center;
2333
- justify-content: center;
2334
- animation: cv-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
2335
- color: #3e84f4;
2336
- }
2337
-
2338
- .cv-welcome-widget-label {
2339
- font-size: 0.875rem;
2340
- font-weight: 500;
2341
- color: rgba(0, 0, 0, 0.8);
2342
- margin: 0;
2343
- }
2344
-
2345
- .cv-welcome-got-it {
2346
- width: 100%;
2347
- background: #3e84f4;
2348
- color: white;
2349
- font-weight: 600;
2350
- padding: 0.75rem 1rem;
2351
- border-radius: 0.5rem;
2352
- border: none;
2353
- cursor: pointer;
2354
- font-size: 0.875rem;
2355
- transition: background-color 0.2s ease;
2356
- outline: none;
2357
- }
2358
-
2359
- .cv-welcome-got-it:hover {
2360
- background: rgba(62, 132, 244, 0.9);
2361
- }
2362
-
2363
- .cv-welcome-got-it:focus {
2364
- box-shadow: 0 0 0 2px rgba(62, 132, 244, 0.5);
2365
- }
2366
-
2367
- /* Animations */
2368
- @keyframes cv-pulse {
2369
- 0%, 100% {
2370
- opacity: 1;
2371
- }
2372
- 50% {
2373
- opacity: 0.5;
2374
- }
2375
- }
2376
-
2377
- /* Dark theme welcome modal styles */
2378
- .cv-widget-theme-dark .cv-welcome-modal {
2379
- background: #101722;
2380
- }
2381
-
2382
- .cv-widget-theme-dark .cv-welcome-message {
2383
- color: rgba(255, 255, 255, 0.8);
2384
- }
2385
-
2386
- .cv-widget-theme-dark .cv-welcome-message a {
2387
- color: #60a5fa;
2388
- }
2389
-
2390
- .cv-widget-theme-dark .cv-welcome-widget-preview {
2391
- background: rgba(255, 255, 255, 0.1);
2392
- }
2393
-
2394
- .cv-widget-theme-dark .cv-welcome-widget-label {
2395
- color: #e2e8f0;
2396
- }
1428
+ const WIDGET_STYLES = `
1429
+ /* Rounded rectangle widget icon styles */
1430
+ .cv-widget-icon {
1431
+ position: fixed;
1432
+ /* Slightly transparent by default so the widget is subtle at the page edge */
1433
+ background: rgba(255, 255, 255, 0.92);
1434
+ color: rgba(0, 0, 0, 0.9);
1435
+ opacity: 0.6;
1436
+ display: flex;
1437
+ align-items: center;
1438
+ justify-content: center;
1439
+ font-size: 18px;
1440
+ font-weight: bold;
1441
+ cursor: pointer;
1442
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
1443
+ z-index: 9998;
1444
+ transition: all 0.3s ease;
1445
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
1446
+ }
1447
+
1448
+ .cv-widget-icon:hover {
1449
+ /* Become fully opaque on hover to improve readability */
1450
+ background: rgba(255, 255, 255, 1);
1451
+ color: rgba(0, 0, 0, 1);
1452
+ opacity: 1;
1453
+ }
1454
+
1455
+ /* Top-right: rounded end on left, sticks out leftward on hover */
1456
+ .cv-widget-top-right {
1457
+ top: 20px;
1458
+ right: 0;
1459
+ border-radius: 18px 0 0 18px;
1460
+ padding-left: 8px;
1461
+ justify-content: flex-start;
1462
+ }
1463
+
1464
+ /* Top-left: rounded end on right, sticks out rightward on hover */
1465
+ .cv-widget-top-left {
1466
+ top: 20px;
1467
+ left: 0;
1468
+ border-radius: 0 18px 18px 0;
1469
+ padding-right: 8px;
1470
+ justify-content: flex-end;
1471
+ }
1472
+
1473
+ /* Bottom-right: rounded end on left, sticks out leftward on hover */
1474
+ .cv-widget-bottom-right {
1475
+ bottom: 20px;
1476
+ right: 0;
1477
+ border-radius: 18px 0 0 18px;
1478
+ padding-left: 8px;
1479
+ justify-content: flex-start;
1480
+ }
1481
+
1482
+ /* Bottom-left: rounded end on right, sticks out rightward on hover */
1483
+ .cv-widget-bottom-left {
1484
+ bottom: 20px;
1485
+ left: 0;
1486
+ border-radius: 0 18px 18px 0;
1487
+ padding-right: 8px;
1488
+ justify-content: flex-end;
1489
+ }
1490
+
1491
+ /* Middle-left: rounded end on right, sticks out rightward on hover */
1492
+ .cv-widget-middle-left {
1493
+ top: 50%;
1494
+ left: 0;
1495
+ transform: translateY(-50%);
1496
+ border-radius: 0 18px 18px 0;
1497
+ padding-right: 8px;
1498
+ justify-content: flex-end;
1499
+ }
1500
+
1501
+ /* Middle-right: rounded end on left, sticks out leftward on hover */
1502
+ .cv-widget-middle-right {
1503
+ top: 50%;
1504
+ right: 0;
1505
+ transform: translateY(-50%);
1506
+ border-radius: 18px 0 0 18px;
1507
+ padding-left: 8px;
1508
+ justify-content: flex-start;
1509
+ }
1510
+
1511
+ .cv-widget-top-right,
1512
+ .cv-widget-middle-right,
1513
+ .cv-widget-bottom-right,
1514
+ .cv-widget-top-left,
1515
+ .cv-widget-middle-left,
1516
+ .cv-widget-bottom-left {
1517
+ height: 36px;
1518
+ width: 36px;
1519
+ }
1520
+
1521
+ .cv-widget-middle-right:hover,
1522
+ .cv-widget-top-right:hover,
1523
+ .cv-widget-bottom-right:hover,
1524
+ .cv-widget-top-left:hover,
1525
+ .cv-widget-middle-left:hover,
1526
+ .cv-widget-bottom-left:hover {
1527
+ width: 55px;
1528
+ }
1529
+
1530
+ /* Modal content styles */
1531
+ .cv-widget-section {
1532
+ margin-bottom: 16px;
1533
+ }
1534
+
1535
+ .cv-widget-section:last-child {
1536
+ margin-bottom: 0;
1537
+ }
1538
+
1539
+ .cv-widget-section label {
1540
+ display: block;
1541
+ margin-bottom: 4px;
1542
+ font-weight: 500;
1543
+ color: #555;
1544
+ }
1545
+
1546
+ .cv-widget-profile-select,
1547
+ .cv-widget-state-select {
1548
+ width: 100%;
1549
+ padding: 8px 12px;
1550
+ border: 1px solid #ddd;
1551
+ border-radius: 4px;
1552
+ background: white;
1553
+ font-size: 14px;
1554
+ }
1555
+
1556
+ .cv-widget-profile-select:focus,
1557
+ .cv-widget-state-select:focus {
1558
+ outline: none;
1559
+ border-color: #007bff;
1560
+ box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
1561
+ }
1562
+
1563
+ .cv-widget-profile-select:disabled,
1564
+ .cv-widget-state-select:disabled {
1565
+ background: #f8f9fa;
1566
+ color: #6c757d;
1567
+ cursor: not-allowed;
1568
+ }
1569
+
1570
+ .cv-widget-current {
1571
+ margin: 16px 0;
1572
+ padding: 12px;
1573
+ background: #f8f9fa;
1574
+ border-radius: 4px;
1575
+ border-left: 4px solid #007bff;
1576
+ }
1577
+
1578
+ .cv-widget-current label {
1579
+ font-size: 12px;
1580
+ text-transform: uppercase;
1581
+ letter-spacing: 0.5px;
1582
+ color: #666;
1583
+ margin-bottom: 4px;
1584
+ }
1585
+
1586
+ .cv-widget-current-view {
1587
+ font-weight: 500;
1588
+ color: #333;
1589
+ }
1590
+
1591
+ .cv-widget-reset {
1592
+ width: 100%;
1593
+ padding: 8px 16px;
1594
+ background: #dc3545;
1595
+ color: white;
1596
+ border: none;
1597
+ border-radius: 4px;
1598
+ cursor: pointer;
1599
+ font-size: 14px;
1600
+ font-weight: 500;
1601
+ }
1602
+
1603
+ .cv-widget-reset:hover {
1604
+ background: #c82333;
1605
+ }
1606
+
1607
+ .cv-widget-reset:active {
1608
+ background: #bd2130;
1609
+ }
1610
+
1611
+ /* Responsive design for mobile */
1612
+ @media (max-width: 768px) {
1613
+ .cv-widget-top-right,
1614
+ .cv-widget-top-left {
1615
+ top: 10px;
1616
+ }
1617
+
1618
+ .cv-widget-bottom-right,
1619
+ .cv-widget-bottom-left {
1620
+ bottom: 10px;
1621
+ }
1622
+
1623
+ /* All widgets stay flush with screen edges */
1624
+ .cv-widget-top-right,
1625
+ .cv-widget-bottom-right,
1626
+ .cv-widget-middle-right {
1627
+ right: 0;
1628
+ }
1629
+
1630
+ .cv-widget-top-left,
1631
+ .cv-widget-bottom-left,
1632
+ .cv-widget-middle-left {
1633
+ left: 0;
1634
+ }
1635
+
1636
+ /* Slightly smaller on mobile */
1637
+ .cv-widget-icon {
1638
+ width: 60px;
1639
+ height: 32px;
1640
+ }
1641
+
1642
+ .cv-widget-icon:hover {
1643
+ width: 75px;
1644
+ }
1645
+ }
1646
+
1647
+ /* Modal styles */
1648
+ .cv-widget-modal-overlay {
1649
+ position: fixed;
1650
+ top: 0;
1651
+ left: 0;
1652
+ right: 0;
1653
+ bottom: 0;
1654
+ background: rgba(0, 0, 0, 0.5);
1655
+ display: flex;
1656
+ align-items: center;
1657
+ justify-content: center;
1658
+ z-index: 10002;
1659
+ animation: fadeIn 0.2s ease;
1660
+ }
1661
+
1662
+ @keyframes fadeIn {
1663
+ from { opacity: 0; }
1664
+ to { opacity: 1; }
1665
+ }
1666
+
1667
+ .cv-widget-modal {
1668
+ background: white;
1669
+ border-radius: 0.75rem;
1670
+ box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
1671
+ max-width: 32rem;
1672
+ width: 90vw;
1673
+ max-height: 80vh;
1674
+ animation: slideIn 0.2s ease;
1675
+ display: flex;
1676
+ flex-direction: column;
1677
+ }
1678
+
1679
+ @keyframes slideIn {
1680
+ from {
1681
+ opacity: 0;
1682
+ transform: scale(0.9) translateY(-20px);
1683
+ }
1684
+ to {
1685
+ opacity: 1;
1686
+ transform: scale(1) translateY(0);
1687
+ }
1688
+ }
1689
+
1690
+ .cv-modal-header {
1691
+ display: flex;
1692
+ align-items: center;
1693
+ justify-content: space-between;
1694
+ padding: 0.5rem 1rem;
1695
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
1696
+ }
1697
+
1698
+ .cv-modal-header-content {
1699
+ display: flex;
1700
+ align-items: center;
1701
+ gap: 0.75rem;
1702
+ }
1703
+
1704
+ .cv-modal-icon {
1705
+ position: relative;
1706
+ width: 1rem;
1707
+ height: 1rem;
1708
+ display: flex;
1709
+ align-items: center;
1710
+ justify-content: center;
1711
+ border-radius: 9999px;
1712
+ }
1713
+
1714
+ .cv-modal-icon-svg {
1715
+ width: 100%;
1716
+ height: 100%;
1717
+ opacity: 1;
1718
+ }
1719
+
1720
+ .cv-modal-title {
1721
+ font-size: 1.125rem;
1722
+ font-weight: bold;
1723
+ color: rgba(0, 0, 0, 0.9);
1724
+ margin: 0;
1725
+ }
1726
+
1727
+ .cv-modal-close {
1728
+ width: 2rem;
1729
+ height: 2rem;
1730
+ display: flex;
1731
+ align-items: center;
1732
+ justify-content: center;
1733
+ border-radius: 9999px;
1734
+ background: transparent;
1735
+ border: none;
1736
+ color: rgba(0, 0, 0, 0.6);
1737
+ cursor: pointer;
1738
+ transition: all 0.2s ease;
1739
+ }
1740
+
1741
+ .cv-modal-close:hover {
1742
+ background: rgba(62, 132, 244, 0.1);
1743
+ color: #3e84f4;
1744
+ }
1745
+
1746
+ .cv-modal-close-icon {
1747
+ width: 1.25rem;
1748
+ height: 1.25rem;
1749
+ }
1750
+
1751
+ .cv-modal-main {
1752
+ padding: 1rem;
1753
+ flex: 1;
1754
+ display: flex;
1755
+ flex-direction: column;
1756
+ gap: 1rem;
1757
+ overflow-y: auto;
1758
+ max-height: calc(80vh - 8rem);
1759
+ }
1760
+
1761
+ .cv-modal-description {
1762
+ font-size: 0.875rem;
1763
+ color: rgba(0, 0, 0, 0.8);
1764
+ margin: 0;
1765
+ line-height: 1.4;
1766
+ }
1767
+
1768
+ .cv-content-section,
1769
+ .cv-tab-groups-section {
1770
+ display: flex;
1771
+ flex-direction: column;
1772
+ gap: 0.75rem;
1773
+ }
1774
+
1775
+ .cv-section-heading {
1776
+ font-size: 1rem;
1777
+ font-weight: bold;
1778
+ color: rgba(0, 0, 0, 0.9);
1779
+ margin: 0;
1780
+ }
1781
+
1782
+ .cv-widget-modal-actions {
1783
+ margin-top: 20px;
1784
+ padding-top: 16px;
1785
+ border-top: 1px solid #e9ecef;
1786
+ }
1787
+
1788
+ .cv-widget-restore {
1789
+ width: 100%;
1790
+ padding: 10px 16px;
1791
+ background: #28a745;
1792
+ color: white;
1793
+ border: none;
1794
+ border-radius: 4px;
1795
+ cursor: pointer;
1796
+ font-size: 14px;
1797
+ font-weight: 500;
1798
+ }
1799
+
1800
+ .cv-widget-restore:hover {
1801
+ background: #218838;
1802
+ }
1803
+
1804
+ .cv-widget-create-state {
1805
+ width: 100%;
1806
+ padding: 10px 16px;
1807
+ background: #007bff;
1808
+ color: white;
1809
+ border: none;
1810
+ border-radius: 4px;
1811
+ cursor: pointer;
1812
+ font-size: 14px;
1813
+ font-weight: 500;
1814
+ margin-bottom: 10px;
1815
+ }
1816
+
1817
+ .cv-widget-create-state:hover {
1818
+ background: #0056b3;
1819
+ }
1820
+
1821
+ .cv-widget-theme-dark .cv-widget-modal {
1822
+ background: #101722;
1823
+ color: #e2e8f0;
1824
+ }
1825
+
1826
+ .cv-widget-theme-dark .cv-modal-header {
1827
+ border-color: rgba(255, 255, 255, 0.1);
1828
+ }
1829
+
1830
+ .cv-widget-theme-dark .cv-modal-title {
1831
+ color: #e2e8f0;
1832
+ }
1833
+
1834
+ .cv-widget-theme-dark .cv-modal-close {
1835
+ color: rgba(255, 255, 255, 0.6);
1836
+ }
1837
+
1838
+ .cv-widget-theme-dark .cv-modal-close:hover {
1839
+ background: rgba(62, 132, 244, 0.2);
1840
+ color: #3e84f4;
1841
+ }
1842
+
1843
+ .cv-widget-theme-dark .cv-modal-description {
1844
+ color: rgba(255, 255, 255, 0.8);
1845
+ }
1846
+
1847
+ .cv-widget-theme-dark .cv-section-heading {
1848
+ color: #e2e8f0;
1849
+ }
1850
+
1851
+ .cv-widget-theme-dark .cv-toggles-container
1852
+ .cv-widget-theme-dark .cv-tabgroups-container {
1853
+ border-color: rgba(255, 255, 255, 0.1);
1854
+ }
1855
+
1856
+ .cv-widget-theme-dark .cv-toggle-card,
1857
+ .cv-widget-theme-dark .cv-tabgroup-card {
1858
+ background: #101722;
1859
+ border-color: rgba(255, 255, 255, 0.1);
1860
+ }
1861
+
1862
+ .cv-widget-theme-dark .cv-toggle-title,
1863
+ .cv-widget-theme-dark .cv-tabgroup-title {
1864
+ color: #e2e8f0;
1865
+ }
1866
+
1867
+ .cv-widget-theme-dark .cv-toggle-description,
1868
+ .cv-widget-theme-dark .cv-tabgroup-description {
1869
+ color: rgba(255, 255, 255, 0.6);
1870
+ }
1871
+
1872
+ .cv-widget-theme-dark .cv-toggle-slider {
1873
+ background: rgba(255, 255, 255, 0.2);
1874
+ }
1875
+
1876
+ .cv-widget-theme-dark .cv-tab-group-description {
1877
+ color: rgba(255, 255, 255, 0.8);
1878
+ }
1879
+
1880
+ .cv-widget-theme-dark .cv-tabgroup-select {
1881
+ background: #101722;
1882
+ border-color: rgba(255, 255, 255, 0.2);
1883
+ color: #e2e8f0;
1884
+ }
1885
+
1886
+ .cv-widget-theme-dark .cv-modal-footer {
1887
+ border-color: rgba(255, 255, 255, 0.1);
1888
+ background: #101722;
1889
+ }
1890
+
1891
+ .cv-widget-theme-dark .cv-reset-btn {
1892
+ color: #e2e8f0;
1893
+ background: rgba(255, 255, 255, 0.1);
1894
+ }
1895
+
1896
+ .cv-widget-theme-dark .cv-reset-btn:hover {
1897
+ background: rgba(255, 255, 255, 0.2);
1898
+ }
1899
+
1900
+ /* Custom state creator styles */
1901
+ .cv-custom-state-modal {
1902
+ max-width: 500px;
1903
+ }
1904
+
1905
+ .cv-custom-state-form .cv-section-header {
1906
+ font-size: 16px;
1907
+ font-weight: 600;
1908
+ color: #333;
1909
+ border-bottom: 1px solid #e9ecef;
1910
+ padding-bottom: 5px;
1911
+ }
1912
+
1913
+ .cv-custom-state-form p {
1914
+ font-size: 15px;
1915
+ line-height: 1.6;
1916
+ color: #555;
1917
+ margin-bottom: 24px;
1918
+ text-align: justify;
1919
+ }
1920
+
1921
+ .cv-custom-state-section {
1922
+ margin-bottom: 16px;
1923
+ }
1924
+
1925
+ .cv-custom-state-section label {
1926
+ display: block;
1927
+ margin-bottom: 4px;
1928
+ font-weight: 500;
1929
+ color: #555;
1930
+ }
1931
+
1932
+ .cv-custom-state-input {
1933
+ width: 100%;
1934
+ padding: 8px 12px;
1935
+ border: 1px solid #ddd;
1936
+ border-radius: 4px;
1937
+ background: white;
1938
+ font-size: 14px;
1939
+ }
1940
+
1941
+ .cv-custom-state-input:focus {
1942
+ outline: none;
1943
+ border-color: #007bff;
1944
+ box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
1945
+ }
1946
+
1947
+ /* Toggles Container */
1948
+ .cv-toggles-container {
1949
+ display: flex;
1950
+ flex-direction: column;
1951
+ gap: 0.5rem;
1952
+ border-radius: 0.5rem;
1953
+ border: 1px solid rgba(0, 0, 0, 0.1);
1954
+ overflow: hidden;
1955
+ }
1956
+
1957
+ .cv-toggle-card,
1958
+ .cv-tabgroup-card {
1959
+ background: white;
1960
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
1961
+ }
1962
+
1963
+ .cv-toggle-card:last-child {
1964
+ border-bottom: none;
1965
+ }
1966
+
1967
+ .cv-toggle-content {
1968
+ display: flex;
1969
+ align-items: center;
1970
+ justify-content: space-between;
1971
+ padding: 0.75rem;
1972
+ }
1973
+
1974
+ .cv-toggle-title {
1975
+ font-weight: 500;
1976
+ font-size: 0.875rem;
1977
+ color: rgba(0, 0, 0, 0.9);
1978
+ margin: 0 0 0.125rem 0;
1979
+ }
1980
+
1981
+ .cv-toggle-description {
1982
+ font-size: 0.75rem;
1983
+ color: rgba(0, 0, 0, 0.6);
1984
+ margin: 0;
1985
+ }
1986
+
1987
+ .cv-toggle-label{
1988
+ position: relative;
1989
+ display: inline-block;
1990
+ width: 2.75rem;
1991
+ height: 1.5rem;
1992
+ cursor: pointer;
1993
+ }
1994
+
1995
+ .cv-toggle-input {
1996
+ opacity: 0;
1997
+ width: 0;
1998
+ height: 0;
1999
+ }
2000
+
2001
+ .cv-toggle-slider {
2002
+ position: absolute;
2003
+ top: 0;
2004
+ left: 0;
2005
+ right: 0;
2006
+ bottom: 0;
2007
+ background: rgba(0, 0, 0, 0.2);
2008
+ border-radius: 9999px;
2009
+ transition: background-color 0.2s ease;
2010
+ }
2011
+
2012
+ .cv-toggle-slider:before {
2013
+ position: absolute;
2014
+ content: "";
2015
+ height: 1rem;
2016
+ width: 1rem;
2017
+ left: 0.25rem;
2018
+ bottom: 0.25rem;
2019
+ background: white;
2020
+ border-radius: 50%;
2021
+ transition: transform 0.2s ease;
2022
+ }
2023
+
2024
+ .cv-toggle-input:checked + .cv-toggle-slider {
2025
+ background: #3e84f4;
2026
+ }
2027
+
2028
+ .cv-toggle-input:checked + .cv-toggle-slider:before {
2029
+ transform: translateX(1.25rem);
2030
+ }
2031
+
2032
+ /* Dark theme toggle switch styles */
2033
+ .cv-widget-theme-dark .cv-toggle-switch {
2034
+ background: #4a5568;
2035
+ }
2036
+
2037
+ .cv-widget-theme-dark .cv-toggle-switch:hover {
2038
+ background: #5a6578;
2039
+ }
2040
+
2041
+ .cv-widget-theme-dark .cv-toggle-switch.cv-toggle-active {
2042
+ background: #63b3ed;
2043
+ }
2044
+
2045
+ .cv-widget-theme-dark .cv-toggle-switch.cv-toggle-active:hover {
2046
+ background: #4299e1;
2047
+ }
2048
+
2049
+ /* Tab Groups Container */
2050
+ .cv-tab-groups-list {
2051
+ display: flex;
2052
+ flex-direction: column;
2053
+ gap: 1px;
2054
+ border: 1px solid rgba(0, 0, 0, 0.1);
2055
+ border-radius: 0.5rem;
2056
+ overflow: hidden;
2057
+ }
2058
+
2059
+ /* Tab Group Card - Header (Navigation Headers toggle) */
2060
+ .cv-tabgroup-card.cv-tabgroup-header {
2061
+ display: flex;
2062
+ align-items: center;
2063
+ justify-content: space-between;
2064
+ padding: 0.75rem;
2065
+ border-bottom: 0px;
2066
+ }
2067
+
2068
+ .cv-tabgroup-card.cv-tabgroup-header .cv-tabgroup-row {
2069
+ display: flex;
2070
+ align-items: center;
2071
+ justify-content: space-between;
2072
+ width: 100%;
2073
+ gap: 1rem;
2074
+ }
2075
+
2076
+ /* Tab Group Card - Items */
2077
+ .cv-tabgroup-card.cv-tabgroup-item {
2078
+ display: flex;
2079
+ flex-direction: column;
2080
+ gap: 0.5rem;
2081
+ padding: 0.75rem;
2082
+ background: white;
2083
+ border-bottom: 1px solid rgba(0, 0, 0, 0.05);
2084
+ }
2085
+
2086
+ .cv-tabgroup-card.cv-tabgroup-item:last-child {
2087
+ border-bottom: none;
2088
+ }
2089
+
2090
+ /* Tab Group Info */
2091
+ .cv-tabgroup-info {
2092
+ flex: 1;
2093
+ }
2094
+
2095
+ .cv-tabgroup-title {
2096
+ font-weight: 500;
2097
+ font-size: 0.875rem;
2098
+ color: rgba(0, 0, 0, 0.9);
2099
+ margin: 0 0 0.25rem 0;
2100
+ }
2101
+
2102
+ .cv-tabgroup-description {
2103
+ font-size: 0.75rem;
2104
+ color: rgba(0, 0, 0, 0.6);
2105
+ margin: 0;
2106
+ line-height: 1.3;
2107
+ }
2108
+
2109
+ /* Tab Group Label (for select dropdowns) */
2110
+ .cv-tabgroup-label {
2111
+ font-size: 0.875rem;
2112
+ color: rgba(0, 0, 0, 0.8);
2113
+ margin: 0;
2114
+ line-height: 1.4;
2115
+ font-weight: 500;
2116
+ display: block;
2117
+ cursor: pointer;
2118
+ }
2119
+
2120
+ /* Tab Group Select */
2121
+ .cv-tabgroup-select {
2122
+ width: 100%;
2123
+ border-radius: 0.5rem;
2124
+ background: white;
2125
+ border: 1px solid rgba(0, 0, 0, 0.15);
2126
+ color: rgba(0, 0, 0, 0.9);
2127
+ padding: 0.5rem 0.75rem;
2128
+ font-size: 0.875rem;
2129
+ cursor: pointer;
2130
+ transition: all 0.15s ease;
2131
+ font-family: inherit;
2132
+ }
2133
+
2134
+ .cv-tabgroup-select:hover {
2135
+ border-color: rgba(0, 0, 0, 0.25);
2136
+ }
2137
+
2138
+ .cv-tabgroup-select:focus {
2139
+ outline: none;
2140
+ border-color: #3e84f4;
2141
+ box-shadow: 0 0 0 2px rgba(62, 132, 244, 0.2);
2142
+ }
2143
+
2144
+ /* Modern Toggle Switch */
2145
+ .cv-toggle-switch {
2146
+ position: relative;
2147
+ display: inline-flex;
2148
+ align-items: center;
2149
+ width: 44px;
2150
+ height: 24px;
2151
+ background: rgba(0, 0, 0, 0.1);
2152
+ border-radius: 9999px;
2153
+ padding: 2px;
2154
+ box-sizing: border-box;
2155
+ cursor: pointer;
2156
+ transition: background-color 0.2s ease;
2157
+ border: none;
2158
+ }
2159
+
2160
+ .cv-toggle-switch input {
2161
+ display: none;
2162
+ }
2163
+
2164
+ .cv-toggle-switch .cv-switch-bg {
2165
+ position: absolute;
2166
+ inset: 0;
2167
+ border-radius: 9999px;
2168
+ background: rgba(0, 0, 0, 0.1);
2169
+ transition: background-color 0.2s ease;
2170
+ pointer-events: none;
2171
+ }
2172
+
2173
+ .cv-toggle-switch .cv-switch-knob {
2174
+ position: relative;
2175
+ width: 20px;
2176
+ height: 20px;
2177
+ background: white;
2178
+ border-radius: 50%;
2179
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
2180
+ transition: transform 0.2s ease;
2181
+ z-index: 1;
2182
+ }
2183
+
2184
+ .cv-toggle-switch input:checked + .cv-switch-bg {
2185
+ background: #3e84f4;
2186
+ }
2187
+
2188
+ .cv-toggle-switch input:checked ~ .cv-switch-knob {
2189
+ transform: translateX(20px);
2190
+ }
2191
+
2192
+ /* Dark Theme - Tab Groups */
2193
+ .cv-widget-theme-dark .cv-tabgroup-card.cv-tabgroup-header {
2194
+ background: #101722;
2195
+ border-bottom-color: rgba(255, 255, 255, 0.1);
2196
+ }
2197
+
2198
+ .cv-widget-theme-dark .cv-tabgroup-card.cv-tabgroup-item {
2199
+ background: #101722;
2200
+ border-bottom-color: rgba(255, 255, 255, 0.05);
2201
+ }
2202
+
2203
+ .cv-widget-theme-dark .cv-tabgroup-title {
2204
+ color: #e2e8f0;
2205
+ }
2206
+
2207
+ .cv-widget-theme-dark .cv-tabgroup-description {
2208
+ color: rgba(255, 255, 255, 0.6);
2209
+ }
2210
+
2211
+ .cv-widget-theme-dark .cv-tabgroup-label {
2212
+ color: rgba(255, 255, 255, 0.8);
2213
+ }
2214
+
2215
+ .cv-widget-theme-dark .cv-tab-groups-list {
2216
+ border-color: rgba(255, 255, 255, 0.1);
2217
+ }
2218
+
2219
+ .cv-widget-theme-dark .cv-tabgroup-select {
2220
+ background: #101722;
2221
+ border-color: rgba(255, 255, 255, 0.15);
2222
+ color: #e2e8f0;
2223
+ }
2224
+
2225
+ .cv-widget-theme-dark .cv-tabgroup-select:hover {
2226
+ border-color: rgba(255, 255, 255, 0.25);
2227
+ }
2228
+
2229
+ .cv-widget-theme-dark .cv-tabgroup-select:focus {
2230
+ border-color: #60a5fa;
2231
+ box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
2232
+ }
2233
+
2234
+ /* Dark Theme - Toggle Switch */
2235
+ .cv-widget-theme-dark .cv-toggle-switch .cv-switch-bg {
2236
+ background: rgba(255, 255, 255, 0.1);
2237
+ }
2238
+
2239
+ .cv-widget-theme-dark .cv-toggle-switch .cv-switch-knob {
2240
+ background: #e2e8f0;
2241
+ }
2242
+
2243
+ .cv-widget-theme-dark .cv-toggle-switch input:checked + .cv-switch-bg {
2244
+ background: #63b3ed;
2245
+ }
2246
+
2247
+ .cv-modal-footer {
2248
+ display: flex;
2249
+ justify-content: space-between;
2250
+ align-items: center;
2251
+ padding: 0.75rem;
2252
+ border-top: 1px solid rgba(0, 0, 0, 0.1);
2253
+ }
2254
+
2255
+ .cv-reset-btn,
2256
+ .cv-share-btn {
2257
+ display: flex;
2258
+ align-items: center;
2259
+ gap: 0.5rem;
2260
+ padding: 0.375rem 0.75rem;
2261
+ border-radius: 0.5rem;
2262
+ font-weight: 600;
2263
+ font-size: 0.875rem;
2264
+ cursor: pointer;
2265
+ transition: all 0.2s ease;
2266
+ border: none;
2267
+ }
2268
+
2269
+ .cv-reset-btn {
2270
+ color: rgba(0, 0, 0, 0.9);
2271
+ background: rgba(0, 0, 0, 0.1);
2272
+ }
2273
+
2274
+ .cv-reset-btn:hover {
2275
+ background: rgba(0, 0, 0, 0.2);
2276
+ }
2277
+
2278
+ .cv-share-btn {
2279
+ color: white;
2280
+ background: #3e84f4;
2281
+ }
2282
+
2283
+ .cv-share-btn:hover {
2284
+ background: rgba(62, 132, 244, 0.9);
2285
+ }
2286
+
2287
+ .cv-btn-icon {
2288
+ width: 1rem;
2289
+ height: 1rem;
2290
+ }
2291
+
2292
+ /* Dark theme custom state styles */
2293
+ /* Welcome modal styles */
2294
+ .cv-welcome-modal {
2295
+ max-width: 32rem;
2296
+ width: 90vw;
2297
+ background: white;
2298
+ border-radius: 0.75rem;
2299
+ box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
2300
+ animation: slideIn 0.2s ease;
2301
+ display: flex;
2302
+ flex-direction: column;
2303
+ }
2304
+
2305
+ .cv-modal-main {
2306
+ padding: 1rem;
2307
+ flex: 1;
2308
+ display: flex;
2309
+ flex-direction: column;
2310
+ gap: 1rem;
2311
+ overflow-y: auto;
2312
+ max-height: calc(80vh - 8rem);
2313
+ }
2314
+
2315
+ .cv-welcome-message {
2316
+ font-size: 0.875rem;
2317
+ color: rgba(0, 0, 0, 0.8);
2318
+ margin: 0;
2319
+ line-height: 1.4;
2320
+ text-align: center;
2321
+ }
2322
+
2323
+ .cv-welcome-message a {
2324
+ color: #3e84f4;
2325
+ text-align: justify;
2326
+ text-decoration: none;
2327
+ }
2328
+
2329
+ .cv-welcome-message a:hover {
2330
+ text-decoration: underline;
2331
+ }
2332
+
2333
+ .cv-welcome-widget-preview {
2334
+ display: flex;
2335
+ align-items: center;
2336
+ justify-content: center;
2337
+ gap: 1rem;
2338
+ padding: 1rem;
2339
+ background: #f8f9fa;
2340
+ border-radius: 0.5rem;
2341
+ margin: 1rem 0;
2342
+ }
2343
+
2344
+ .cv-welcome-widget-icon {
2345
+ width: 2rem;
2346
+ height: 2rem;
2347
+ background: rgba(62, 132, 244, 0.1);
2348
+ border-radius: 9999px;
2349
+ display: flex;
2350
+ align-items: center;
2351
+ justify-content: center;
2352
+ animation: cv-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
2353
+ color: #3e84f4;
2354
+ }
2355
+
2356
+ .cv-welcome-widget-label {
2357
+ font-size: 0.875rem;
2358
+ font-weight: 500;
2359
+ color: rgba(0, 0, 0, 0.8);
2360
+ margin: 0;
2361
+ }
2362
+
2363
+ .cv-welcome-got-it {
2364
+ width: 100%;
2365
+ background: #3e84f4;
2366
+ color: white;
2367
+ font-weight: 600;
2368
+ padding: 0.75rem 1rem;
2369
+ border-radius: 0.5rem;
2370
+ border: none;
2371
+ cursor: pointer;
2372
+ font-size: 0.875rem;
2373
+ transition: background-color 0.2s ease;
2374
+ outline: none;
2375
+ }
2376
+
2377
+ .cv-welcome-got-it:hover {
2378
+ background: rgba(62, 132, 244, 0.9);
2379
+ }
2380
+
2381
+ .cv-welcome-got-it:focus {
2382
+ box-shadow: 0 0 0 2px rgba(62, 132, 244, 0.5);
2383
+ }
2384
+
2385
+ /* Animations */
2386
+ @keyframes cv-pulse {
2387
+ 0%, 100% {
2388
+ opacity: 1;
2389
+ }
2390
+ 50% {
2391
+ opacity: 0.5;
2392
+ }
2393
+ }
2394
+
2395
+ /* Dark theme welcome modal styles */
2396
+ .cv-widget-theme-dark .cv-welcome-modal {
2397
+ background: #101722;
2398
+ }
2399
+
2400
+ .cv-widget-theme-dark .cv-welcome-message {
2401
+ color: rgba(255, 255, 255, 0.8);
2402
+ }
2403
+
2404
+ .cv-widget-theme-dark .cv-welcome-message a {
2405
+ color: #60a5fa;
2406
+ }
2407
+
2408
+ .cv-widget-theme-dark .cv-welcome-widget-preview {
2409
+ background: rgba(255, 255, 255, 0.1);
2410
+ }
2411
+
2412
+ .cv-widget-theme-dark .cv-welcome-widget-label {
2413
+ color: #e2e8f0;
2414
+ }
2397
2415
  `;
2398
2416
  /**
2399
2417
  * Inject widget styles into the document head
@@ -2416,34 +2434,34 @@ ${TAB_STYLES}
2416
2434
  * Settings gear icon for modal header
2417
2435
  */
2418
2436
  function getGearIcon() {
2419
- return `<svg class="cv-modal-icon-svg" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
2420
- <path xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" d="M12 8.00002C9.79085 8.00002 7.99999 9.79088 7.99999 12C7.99999 14.2092 9.79085 16 12 16C14.2091 16 16 14.2092 16 12C16 9.79088 14.2091 8.00002 12 8.00002ZM9.99999 12C9.99999 10.8955 10.8954 10 12 10C13.1046 10 14 10.8955 14 12C14 13.1046 13.1046 14 12 14C10.8954 14 9.99999 13.1046 9.99999 12Z" fill="#0F1729"/>
2421
- <path xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" d="M10.7673 1.01709C10.9925 0.999829 11.2454 0.99993 11.4516 1.00001L12.5484 1.00001C12.7546 0.99993 13.0075 0.999829 13.2327 1.01709C13.4989 1.03749 13.8678 1.08936 14.2634 1.26937C14.7635 1.49689 15.1915 1.85736 15.5007 2.31147C15.7454 2.67075 15.8592 3.0255 15.9246 3.2843C15.9799 3.50334 16.0228 3.75249 16.0577 3.9557L16.1993 4.77635L16.2021 4.77788C16.2369 4.79712 16.2715 4.81659 16.306 4.8363L16.3086 4.83774L17.2455 4.49865C17.4356 4.42978 17.6693 4.34509 17.8835 4.28543C18.1371 4.2148 18.4954 4.13889 18.9216 4.17026C19.4614 4.20998 19.9803 4.39497 20.4235 4.70563C20.7734 4.95095 21.0029 5.23636 21.1546 5.4515C21.2829 5.63326 21.4103 5.84671 21.514 6.02029L22.0158 6.86003C22.1256 7.04345 22.2594 7.26713 22.3627 7.47527C22.4843 7.7203 22.6328 8.07474 22.6777 8.52067C22.7341 9.08222 22.6311 9.64831 22.3803 10.1539C22.1811 10.5554 21.9171 10.8347 21.7169 11.0212C21.5469 11.1795 21.3428 11.3417 21.1755 11.4746L20.5 12L21.1755 12.5254C21.3428 12.6584 21.5469 12.8205 21.7169 12.9789C21.9171 13.1653 22.1811 13.4446 22.3802 13.8461C22.631 14.3517 22.7341 14.9178 22.6776 15.4794C22.6328 15.9253 22.4842 16.2797 22.3626 16.5248C22.2593 16.7329 22.1255 16.9566 22.0158 17.14L21.5138 17.9799C21.4102 18.1535 21.2828 18.3668 21.1546 18.5485C21.0028 18.7637 20.7734 19.0491 20.4234 19.2944C19.9803 19.6051 19.4613 19.7901 18.9216 19.8298C18.4954 19.8612 18.1371 19.7852 17.8835 19.7146C17.6692 19.6549 17.4355 19.5703 17.2454 19.5014L16.3085 19.1623L16.306 19.1638C16.2715 19.1835 16.2369 19.2029 16.2021 19.2222L16.1993 19.2237L16.0577 20.0443C16.0228 20.2475 15.9799 20.4967 15.9246 20.7157C15.8592 20.9745 15.7454 21.3293 15.5007 21.6886C15.1915 22.1427 14.7635 22.5032 14.2634 22.7307C13.8678 22.9107 13.4989 22.9626 13.2327 22.983C13.0074 23.0002 12.7546 23.0001 12.5484 23H11.4516C11.2454 23.0001 10.9925 23.0002 10.7673 22.983C10.5011 22.9626 10.1322 22.9107 9.73655 22.7307C9.23648 22.5032 8.80849 22.1427 8.49926 21.6886C8.25461 21.3293 8.14077 20.9745 8.07542 20.7157C8.02011 20.4967 7.97723 20.2475 7.94225 20.0443L7.80068 19.2237L7.79791 19.2222C7.7631 19.2029 7.72845 19.1835 7.69396 19.1637L7.69142 19.1623L6.75458 19.5014C6.5645 19.5702 6.33078 19.6549 6.11651 19.7146C5.86288 19.7852 5.50463 19.8611 5.07841 19.8298C4.53866 19.7901 4.01971 19.6051 3.57654 19.2944C3.2266 19.0491 2.99714 18.7637 2.84539 18.5485C2.71718 18.3668 2.58974 18.1534 2.4861 17.9798L1.98418 17.14C1.87447 16.9566 1.74067 16.7329 1.63737 16.5248C1.51575 16.2797 1.36719 15.9253 1.32235 15.4794C1.26588 14.9178 1.36897 14.3517 1.61976 13.8461C1.81892 13.4446 2.08289 13.1653 2.28308 12.9789C2.45312 12.8205 2.65717 12.6584 2.82449 12.5254L3.47844 12.0054V11.9947L2.82445 11.4746C2.65712 11.3417 2.45308 11.1795 2.28304 11.0212C2.08285 10.8347 1.81888 10.5554 1.61972 10.1539C1.36893 9.64832 1.26584 9.08224 1.3223 8.52069C1.36714 8.07476 1.51571 7.72032 1.63732 7.47528C1.74062 7.26715 1.87443 7.04347 1.98414 6.86005L2.48605 6.02026C2.58969 5.84669 2.71714 5.63326 2.84534 5.45151C2.9971 5.23637 3.22655 4.95096 3.5765 4.70565C4.01966 4.39498 4.53862 4.20999 5.07837 4.17027C5.50458 4.1389 5.86284 4.21481 6.11646 4.28544C6.33072 4.34511 6.56444 4.4298 6.75451 4.49867L7.69141 4.83775L7.69394 4.8363C7.72844 4.8166 7.7631 4.79712 7.79791 4.77788L7.80068 4.77635L7.94225 3.95571C7.97723 3.7525 8.02011 3.50334 8.07542 3.2843C8.14077 3.0255 8.25461 2.67075 8.49926 2.31147C8.80849 1.85736 9.23648 1.49689 9.73655 1.26937C10.1322 1.08936 10.5011 1.03749 10.7673 1.01709ZM14.0938 4.3363C14.011 3.85634 13.9696 3.61637 13.8476 3.43717C13.7445 3.2858 13.6019 3.16564 13.4352 3.0898C13.2378 3.00002 12.9943 3.00002 12.5073 3.00002H11.4927C11.0057 3.00002 10.7621 3.00002 10.5648 3.0898C10.3981 3.16564 10.2555 3.2858 10.1524 3.43717C10.0304 3.61637 9.98895 3.85634 9.90615 4.3363L9.75012 5.24064C9.69445 5.56333 9.66662 5.72467 9.60765 5.84869C9.54975 5.97047 9.50241 6.03703 9.40636 6.13166C9.30853 6.22804 9.12753 6.3281 8.76554 6.52822C8.73884 6.54298 8.71227 6.55791 8.68582 6.57302C8.33956 6.77078 8.16643 6.86966 8.03785 6.90314C7.91158 6.93602 7.83293 6.94279 7.70289 6.93196C7.57049 6.92094 7.42216 6.86726 7.12551 6.7599L6.11194 6.39308C5.66271 6.2305 5.43809 6.14921 5.22515 6.16488C5.04524 6.17811 4.87225 6.23978 4.72453 6.34333C4.5497 6.46589 4.42715 6.67094 4.18206 7.08103L3.72269 7.84965C3.46394 8.2826 3.33456 8.49907 3.31227 8.72078C3.29345 8.90796 3.32781 9.09665 3.41141 9.26519C3.51042 9.4648 3.7078 9.62177 4.10256 9.9357L4.82745 10.5122C5.07927 10.7124 5.20518 10.8126 5.28411 10.9199C5.36944 11.036 5.40583 11.1114 5.44354 11.2504C5.47844 11.379 5.47844 11.586 5.47844 12C5.47844 12.414 5.47844 12.621 5.44354 12.7497C5.40582 12.8887 5.36944 12.9641 5.28413 13.0801C5.20518 13.1875 5.07927 13.2876 4.82743 13.4879L4.10261 14.0643C3.70785 14.3783 3.51047 14.5352 3.41145 14.7349C3.32785 14.9034 3.29349 15.0921 3.31231 15.2793C3.33461 15.501 3.46398 15.7174 3.72273 16.1504L4.1821 16.919C4.4272 17.3291 4.54974 17.5342 4.72457 17.6567C4.8723 17.7603 5.04528 17.8219 5.2252 17.8352C5.43813 17.8508 5.66275 17.7695 6.11199 17.607L7.12553 17.2402C7.42216 17.1328 7.5705 17.0791 7.7029 17.0681C7.83294 17.0573 7.91159 17.064 8.03786 17.0969C8.16644 17.1304 8.33956 17.2293 8.68582 17.427C8.71228 17.4421 8.73885 17.4571 8.76554 17.4718C9.12753 17.6719 9.30853 17.772 9.40635 17.8684C9.50241 17.963 9.54975 18.0296 9.60765 18.1514C9.66662 18.2754 9.69445 18.4367 9.75012 18.7594L9.90615 19.6637C9.98895 20.1437 10.0304 20.3837 10.1524 20.5629C10.2555 20.7142 10.3981 20.8344 10.5648 20.9102C10.7621 21 11.0057 21 11.4927 21H12.5073C12.9943 21 13.2378 21 13.4352 20.9102C13.6019 20.8344 13.7445 20.7142 13.8476 20.5629C13.9696 20.3837 14.011 20.1437 14.0938 19.6637L14.2499 18.7594C14.3055 18.4367 14.3334 18.2754 14.3923 18.1514C14.4502 18.0296 14.4976 17.963 14.5936 17.8684C14.6915 17.772 14.8725 17.6719 15.2344 17.4718C15.2611 17.4571 15.2877 17.4421 15.3141 17.427C15.6604 17.2293 15.8335 17.1304 15.9621 17.0969C16.0884 17.064 16.167 17.0573 16.2971 17.0681C16.4295 17.0791 16.5778 17.1328 16.8744 17.2402L17.888 17.607C18.3372 17.7696 18.5619 17.8509 18.7748 17.8352C18.9547 17.8219 19.1277 17.7603 19.2754 17.6567C19.4502 17.5342 19.5728 17.3291 19.8179 16.919L20.2773 16.1504C20.536 15.7175 20.6654 15.501 20.6877 15.2793C20.7065 15.0921 20.6721 14.9034 20.5885 14.7349C20.4895 14.5353 20.2921 14.3783 19.8974 14.0643L19.1726 13.4879C18.9207 13.2876 18.7948 13.1875 18.7159 13.0801C18.6306 12.9641 18.5942 12.8887 18.5564 12.7497C18.5215 12.6211 18.5215 12.414 18.5215 12C18.5215 11.586 18.5215 11.379 18.5564 11.2504C18.5942 11.1114 18.6306 11.036 18.7159 10.9199C18.7948 10.8126 18.9207 10.7124 19.1725 10.5122L19.8974 9.9357C20.2922 9.62176 20.4896 9.46479 20.5886 9.26517C20.6722 9.09664 20.7065 8.90795 20.6877 8.72076C20.6654 8.49906 20.5361 8.28259 20.2773 7.84964L19.8179 7.08102C19.5728 6.67093 19.4503 6.46588 19.2755 6.34332C19.1277 6.23977 18.9548 6.1781 18.7748 6.16486C18.5619 6.14919 18.3373 6.23048 17.888 6.39307L16.8745 6.75989C16.5778 6.86725 16.4295 6.92093 16.2971 6.93195C16.167 6.94278 16.0884 6.93601 15.9621 6.90313C15.8335 6.86965 15.6604 6.77077 15.3142 6.57302C15.2877 6.55791 15.2611 6.54298 15.2345 6.52822C14.8725 6.3281 14.6915 6.22804 14.5936 6.13166C14.4976 6.03703 14.4502 5.97047 14.3923 5.84869C14.3334 5.72467 14.3055 5.56332 14.2499 5.24064L14.0938 4.3363Z" fill="#0F1729"/>
2437
+ return `<svg class="cv-modal-icon-svg" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
2438
+ <path xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" d="M12 8.00002C9.79085 8.00002 7.99999 9.79088 7.99999 12C7.99999 14.2092 9.79085 16 12 16C14.2091 16 16 14.2092 16 12C16 9.79088 14.2091 8.00002 12 8.00002ZM9.99999 12C9.99999 10.8955 10.8954 10 12 10C13.1046 10 14 10.8955 14 12C14 13.1046 13.1046 14 12 14C10.8954 14 9.99999 13.1046 9.99999 12Z" fill="#0F1729"/>
2439
+ <path xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" d="M10.7673 1.01709C10.9925 0.999829 11.2454 0.99993 11.4516 1.00001L12.5484 1.00001C12.7546 0.99993 13.0075 0.999829 13.2327 1.01709C13.4989 1.03749 13.8678 1.08936 14.2634 1.26937C14.7635 1.49689 15.1915 1.85736 15.5007 2.31147C15.7454 2.67075 15.8592 3.0255 15.9246 3.2843C15.9799 3.50334 16.0228 3.75249 16.0577 3.9557L16.1993 4.77635L16.2021 4.77788C16.2369 4.79712 16.2715 4.81659 16.306 4.8363L16.3086 4.83774L17.2455 4.49865C17.4356 4.42978 17.6693 4.34509 17.8835 4.28543C18.1371 4.2148 18.4954 4.13889 18.9216 4.17026C19.4614 4.20998 19.9803 4.39497 20.4235 4.70563C20.7734 4.95095 21.0029 5.23636 21.1546 5.4515C21.2829 5.63326 21.4103 5.84671 21.514 6.02029L22.0158 6.86003C22.1256 7.04345 22.2594 7.26713 22.3627 7.47527C22.4843 7.7203 22.6328 8.07474 22.6777 8.52067C22.7341 9.08222 22.6311 9.64831 22.3803 10.1539C22.1811 10.5554 21.9171 10.8347 21.7169 11.0212C21.5469 11.1795 21.3428 11.3417 21.1755 11.4746L20.5 12L21.1755 12.5254C21.3428 12.6584 21.5469 12.8205 21.7169 12.9789C21.9171 13.1653 22.1811 13.4446 22.3802 13.8461C22.631 14.3517 22.7341 14.9178 22.6776 15.4794C22.6328 15.9253 22.4842 16.2797 22.3626 16.5248C22.2593 16.7329 22.1255 16.9566 22.0158 17.14L21.5138 17.9799C21.4102 18.1535 21.2828 18.3668 21.1546 18.5485C21.0028 18.7637 20.7734 19.0491 20.4234 19.2944C19.9803 19.6051 19.4613 19.7901 18.9216 19.8298C18.4954 19.8612 18.1371 19.7852 17.8835 19.7146C17.6692 19.6549 17.4355 19.5703 17.2454 19.5014L16.3085 19.1623L16.306 19.1638C16.2715 19.1835 16.2369 19.2029 16.2021 19.2222L16.1993 19.2237L16.0577 20.0443C16.0228 20.2475 15.9799 20.4967 15.9246 20.7157C15.8592 20.9745 15.7454 21.3293 15.5007 21.6886C15.1915 22.1427 14.7635 22.5032 14.2634 22.7307C13.8678 22.9107 13.4989 22.9626 13.2327 22.983C13.0074 23.0002 12.7546 23.0001 12.5484 23H11.4516C11.2454 23.0001 10.9925 23.0002 10.7673 22.983C10.5011 22.9626 10.1322 22.9107 9.73655 22.7307C9.23648 22.5032 8.80849 22.1427 8.49926 21.6886C8.25461 21.3293 8.14077 20.9745 8.07542 20.7157C8.02011 20.4967 7.97723 20.2475 7.94225 20.0443L7.80068 19.2237L7.79791 19.2222C7.7631 19.2029 7.72845 19.1835 7.69396 19.1637L7.69142 19.1623L6.75458 19.5014C6.5645 19.5702 6.33078 19.6549 6.11651 19.7146C5.86288 19.7852 5.50463 19.8611 5.07841 19.8298C4.53866 19.7901 4.01971 19.6051 3.57654 19.2944C3.2266 19.0491 2.99714 18.7637 2.84539 18.5485C2.71718 18.3668 2.58974 18.1534 2.4861 17.9798L1.98418 17.14C1.87447 16.9566 1.74067 16.7329 1.63737 16.5248C1.51575 16.2797 1.36719 15.9253 1.32235 15.4794C1.26588 14.9178 1.36897 14.3517 1.61976 13.8461C1.81892 13.4446 2.08289 13.1653 2.28308 12.9789C2.45312 12.8205 2.65717 12.6584 2.82449 12.5254L3.47844 12.0054V11.9947L2.82445 11.4746C2.65712 11.3417 2.45308 11.1795 2.28304 11.0212C2.08285 10.8347 1.81888 10.5554 1.61972 10.1539C1.36893 9.64832 1.26584 9.08224 1.3223 8.52069C1.36714 8.07476 1.51571 7.72032 1.63732 7.47528C1.74062 7.26715 1.87443 7.04347 1.98414 6.86005L2.48605 6.02026C2.58969 5.84669 2.71714 5.63326 2.84534 5.45151C2.9971 5.23637 3.22655 4.95096 3.5765 4.70565C4.01966 4.39498 4.53862 4.20999 5.07837 4.17027C5.50458 4.1389 5.86284 4.21481 6.11646 4.28544C6.33072 4.34511 6.56444 4.4298 6.75451 4.49867L7.69141 4.83775L7.69394 4.8363C7.72844 4.8166 7.7631 4.79712 7.79791 4.77788L7.80068 4.77635L7.94225 3.95571C7.97723 3.7525 8.02011 3.50334 8.07542 3.2843C8.14077 3.0255 8.25461 2.67075 8.49926 2.31147C8.80849 1.85736 9.23648 1.49689 9.73655 1.26937C10.1322 1.08936 10.5011 1.03749 10.7673 1.01709ZM14.0938 4.3363C14.011 3.85634 13.9696 3.61637 13.8476 3.43717C13.7445 3.2858 13.6019 3.16564 13.4352 3.0898C13.2378 3.00002 12.9943 3.00002 12.5073 3.00002H11.4927C11.0057 3.00002 10.7621 3.00002 10.5648 3.0898C10.3981 3.16564 10.2555 3.2858 10.1524 3.43717C10.0304 3.61637 9.98895 3.85634 9.90615 4.3363L9.75012 5.24064C9.69445 5.56333 9.66662 5.72467 9.60765 5.84869C9.54975 5.97047 9.50241 6.03703 9.40636 6.13166C9.30853 6.22804 9.12753 6.3281 8.76554 6.52822C8.73884 6.54298 8.71227 6.55791 8.68582 6.57302C8.33956 6.77078 8.16643 6.86966 8.03785 6.90314C7.91158 6.93602 7.83293 6.94279 7.70289 6.93196C7.57049 6.92094 7.42216 6.86726 7.12551 6.7599L6.11194 6.39308C5.66271 6.2305 5.43809 6.14921 5.22515 6.16488C5.04524 6.17811 4.87225 6.23978 4.72453 6.34333C4.5497 6.46589 4.42715 6.67094 4.18206 7.08103L3.72269 7.84965C3.46394 8.2826 3.33456 8.49907 3.31227 8.72078C3.29345 8.90796 3.32781 9.09665 3.41141 9.26519C3.51042 9.4648 3.7078 9.62177 4.10256 9.9357L4.82745 10.5122C5.07927 10.7124 5.20518 10.8126 5.28411 10.9199C5.36944 11.036 5.40583 11.1114 5.44354 11.2504C5.47844 11.379 5.47844 11.586 5.47844 12C5.47844 12.414 5.47844 12.621 5.44354 12.7497C5.40582 12.8887 5.36944 12.9641 5.28413 13.0801C5.20518 13.1875 5.07927 13.2876 4.82743 13.4879L4.10261 14.0643C3.70785 14.3783 3.51047 14.5352 3.41145 14.7349C3.32785 14.9034 3.29349 15.0921 3.31231 15.2793C3.33461 15.501 3.46398 15.7174 3.72273 16.1504L4.1821 16.919C4.4272 17.3291 4.54974 17.5342 4.72457 17.6567C4.8723 17.7603 5.04528 17.8219 5.2252 17.8352C5.43813 17.8508 5.66275 17.7695 6.11199 17.607L7.12553 17.2402C7.42216 17.1328 7.5705 17.0791 7.7029 17.0681C7.83294 17.0573 7.91159 17.064 8.03786 17.0969C8.16644 17.1304 8.33956 17.2293 8.68582 17.427C8.71228 17.4421 8.73885 17.4571 8.76554 17.4718C9.12753 17.6719 9.30853 17.772 9.40635 17.8684C9.50241 17.963 9.54975 18.0296 9.60765 18.1514C9.66662 18.2754 9.69445 18.4367 9.75012 18.7594L9.90615 19.6637C9.98895 20.1437 10.0304 20.3837 10.1524 20.5629C10.2555 20.7142 10.3981 20.8344 10.5648 20.9102C10.7621 21 11.0057 21 11.4927 21H12.5073C12.9943 21 13.2378 21 13.4352 20.9102C13.6019 20.8344 13.7445 20.7142 13.8476 20.5629C13.9696 20.3837 14.011 20.1437 14.0938 19.6637L14.2499 18.7594C14.3055 18.4367 14.3334 18.2754 14.3923 18.1514C14.4502 18.0296 14.4976 17.963 14.5936 17.8684C14.6915 17.772 14.8725 17.6719 15.2344 17.4718C15.2611 17.4571 15.2877 17.4421 15.3141 17.427C15.6604 17.2293 15.8335 17.1304 15.9621 17.0969C16.0884 17.064 16.167 17.0573 16.2971 17.0681C16.4295 17.0791 16.5778 17.1328 16.8744 17.2402L17.888 17.607C18.3372 17.7696 18.5619 17.8509 18.7748 17.8352C18.9547 17.8219 19.1277 17.7603 19.2754 17.6567C19.4502 17.5342 19.5728 17.3291 19.8179 16.919L20.2773 16.1504C20.536 15.7175 20.6654 15.501 20.6877 15.2793C20.7065 15.0921 20.6721 14.9034 20.5885 14.7349C20.4895 14.5353 20.2921 14.3783 19.8974 14.0643L19.1726 13.4879C18.9207 13.2876 18.7948 13.1875 18.7159 13.0801C18.6306 12.9641 18.5942 12.8887 18.5564 12.7497C18.5215 12.6211 18.5215 12.414 18.5215 12C18.5215 11.586 18.5215 11.379 18.5564 11.2504C18.5942 11.1114 18.6306 11.036 18.7159 10.9199C18.7948 10.8126 18.9207 10.7124 19.1725 10.5122L19.8974 9.9357C20.2922 9.62176 20.4896 9.46479 20.5886 9.26517C20.6722 9.09664 20.7065 8.90795 20.6877 8.72076C20.6654 8.49906 20.5361 8.28259 20.2773 7.84964L19.8179 7.08102C19.5728 6.67093 19.4503 6.46588 19.2755 6.34332C19.1277 6.23977 18.9548 6.1781 18.7748 6.16486C18.5619 6.14919 18.3373 6.23048 17.888 6.39307L16.8745 6.75989C16.5778 6.86725 16.4295 6.92093 16.2971 6.93195C16.167 6.94278 16.0884 6.93601 15.9621 6.90313C15.8335 6.86965 15.6604 6.77077 15.3142 6.57302C15.2877 6.55791 15.2611 6.54298 15.2345 6.52822C14.8725 6.3281 14.6915 6.22804 14.5936 6.13166C14.4976 6.03703 14.4502 5.97047 14.3923 5.84869C14.3334 5.72467 14.3055 5.56332 14.2499 5.24064L14.0938 4.3363Z" fill="#0F1729"/>
2422
2440
  </svg>`;
2423
2441
  }
2424
2442
  /**
2425
2443
  * Close/X icon for modal close button
2426
2444
  */
2427
2445
  function getCloseIcon() {
2428
- return `<svg class="cv-modal-close-icon" fill="currentColor" height="20px" viewBox="0 0 256 256" width="20px" xmlns="http://www.w3.org/2000/svg">
2429
- <path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path>
2446
+ return `<svg class="cv-modal-close-icon" fill="currentColor" height="20px" viewBox="0 0 256 256" width="20px" xmlns="http://www.w3.org/2000/svg">
2447
+ <path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path>
2430
2448
  </svg>`;
2431
2449
  }
2432
2450
  /**
2433
2451
  * Reset/refresh icon for reset button
2434
2452
  */
2435
2453
  function getResetIcon() {
2436
- return `<svg class="cv-btn-icon" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
2437
- <path d="M22.719 12A10.719 10.719 0 0 1 1.28 12h.838a9.916 9.916 0 1 0 1.373-5H8v1H2V2h1v4.2A10.71 10.71 0 0 1 22.719 12z"/><path fill="none" d="M0 0h24v24H0z"/>
2454
+ return `<svg class="cv-btn-icon" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
2455
+ <path d="M22.719 12A10.719 10.719 0 0 1 1.28 12h.838a9.916 9.916 0 1 0 1.373-5H8v1H2V2h1v4.2A10.71 10.71 0 0 1 22.719 12z"/><path fill="none" d="M0 0h24v24H0z"/>
2438
2456
  </svg>`;
2439
2457
  }
2440
2458
  /**
2441
2459
  * Share icon for share button
2442
2460
  */
2443
2461
  function getShareIcon() {
2444
- return `<svg class="cv-btn-icon" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
2445
- <path xmlns="http://www.w3.org/2000/svg" d="M6 11C6 8.17157 6 6.75736 6.87868 5.87868C7.75736 5 9.17157 5 12 5H15C17.8284 5 19.2426 5 20.1213 5.87868C21 6.75736 21 8.17157 21 11V16C21 18.8284 21 20.2426 20.1213 21.1213C19.2426 22 17.8284 22 15 22H12C9.17157 22 7.75736 22 6.87868 21.1213C6 20.2426 6 18.8284 6 16V11Z" stroke="#1C274C" stroke-width="1.5"/>
2446
- <path xmlns="http://www.w3.org/2000/svg" opacity="0.5" d="M6 19C4.34315 19 3 17.6569 3 16V10C3 6.22876 3 4.34315 4.17157 3.17157C5.34315 2 7.22876 2 11 2H15C16.6569 2 18 3.34315 18 5" stroke="#1C274C" stroke-width="1.5"/>
2462
+ return `<svg class="cv-btn-icon" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
2463
+ <path xmlns="http://www.w3.org/2000/svg" d="M6 11C6 8.17157 6 6.75736 6.87868 5.87868C7.75736 5 9.17157 5 12 5H15C17.8284 5 19.2426 5 20.1213 5.87868C21 6.75736 21 8.17157 21 11V16C21 18.8284 21 20.2426 20.1213 21.1213C19.2426 22 17.8284 22 15 22H12C9.17157 22 7.75736 22 6.87868 21.1213C6 20.2426 6 18.8284 6 16V11Z" stroke="#1C274C" stroke-width="1.5"/>
2464
+ <path xmlns="http://www.w3.org/2000/svg" opacity="0.5" d="M6 19C4.34315 19 3 17.6569 3 16V10C3 6.22876 3 4.34315 4.17157 3.17157C5.34315 2 7.22876 2 11 2H15C16.6569 2 18 3.34315 18 5" stroke="#1C274C" stroke-width="1.5"/>
2447
2465
  </svg>`;
2448
2466
  }
2449
2467
 
@@ -2547,123 +2565,101 @@ ${TAB_STYLES}
2547
2565
  this.modal = document.createElement('div');
2548
2566
  this.modal.className = 'cv-widget-modal-overlay';
2549
2567
  this.applyThemeToModal();
2550
- const toggleControlsHtml = toggles.map(toggle => `
2551
- <div class="cv-toggle-card">
2552
- <div class="cv-toggle-content">
2553
- <div>
2554
- <p class="cv-toggle-title">${this.formatToggleName(toggle)}</p>
2555
- </div>
2556
- <label class="cv-toggle-label">
2557
- <input class="cv-toggle-input" type="checkbox" data-toggle="${toggle}"/>
2558
- <span class="cv-toggle-slider"></span>
2559
- </label>
2560
- </div>
2561
- </div>
2568
+ const toggleControlsHtml = toggles.map(toggle => `
2569
+ <div class="cv-toggle-card">
2570
+ <div class="cv-toggle-content">
2571
+ <div>
2572
+ <p class="cv-toggle-title">${this.formatToggleName(toggle)}</p>
2573
+ </div>
2574
+ <label class="cv-toggle-label">
2575
+ <input class="cv-toggle-input" type="checkbox" data-toggle="${toggle}"/>
2576
+ <span class="cv-toggle-slider"></span>
2577
+ </label>
2578
+ </div>
2579
+ </div>
2562
2580
  `).join('');
2563
2581
  // Todo: Re-add description if needed (Line 168, add label field to toggles if needed change structure)
2564
2582
  // <p class="cv-toggle-description">Show or hide the ${this.formatToggleName(toggle).toLowerCase()} area </p>
2565
2583
  // Get tab groups
2566
2584
  const tabGroups = this.core.getTabGroups();
2567
2585
  let tabGroupControlsHTML = '';
2568
- // Check if any tab group or tab labels contain Font Awesome shortcodes
2569
- let hasFontAwesomeShortcodes = false;
2570
2586
  if (this.options.showTabGroups && tabGroups && tabGroups.length > 0) {
2571
- for (const group of tabGroups) {
2572
- if (group.label && /:fa-[\w-]+:/.test(group.label)) {
2573
- hasFontAwesomeShortcodes = true;
2574
- break;
2575
- }
2576
- for (const tab of group.tabs) {
2577
- if (tab.label && /:fa-[\w-]+:/.test(tab.label)) {
2578
- hasFontAwesomeShortcodes = true;
2579
- break;
2580
- }
2581
- }
2582
- if (hasFontAwesomeShortcodes)
2583
- break;
2584
- }
2585
- }
2586
- // Inject Font Awesome only if shortcodes are found
2587
- if (hasFontAwesomeShortcodes) {
2588
- ensureFontAwesomeInjected();
2589
- }
2590
- if (this.options.showTabGroups && tabGroups && tabGroups.length > 0) {
2591
- tabGroupControlsHTML = `
2592
- <div class="cv-tabgroup-card cv-tabgroup-header">
2593
- <div class="cv-tabgroup-row">
2594
- <div class="cv-tabgroup-info">
2595
- <p class="cv-tabgroup-title">Navigation Headers</p>
2596
- <p class="cv-tabgroup-description">Show or hide navigation headers</p>
2597
- </div>
2598
- <label class="cv-toggle-switch cv-nav-toggle">
2599
- <input class="cv-nav-pref-input" type="checkbox" aria-label="Show or hide navigation headers" />
2600
- <span class="cv-switch-bg"></span>
2601
- <span class="cv-switch-knob"></span>
2602
- </label>
2603
- </div>
2604
- </div>
2605
- <div class="cv-tab-groups-list">
2606
- ${tabGroups.map(group => `
2607
- <div class="cv-tabgroup-card cv-tabgroup-item">
2608
- <label class="cv-tabgroup-label" for="tab-group-${group.id}">
2609
- ${replaceIconShortcodes(group.label || group.id)}
2610
- </label>
2611
- <select id="tab-group-${group.id}" class="cv-tabgroup-select" data-group-id="${group.id}">
2612
- ${group.tabs.map(tab => `<option value="${tab.id}">${replaceIconShortcodes(tab.label || tab.id)}</option>`).join('')}
2613
- </select>
2614
- </div>
2615
- `).join('')}
2616
- </div>
2587
+ tabGroupControlsHTML = `
2588
+ <div class="cv-tabgroup-card cv-tabgroup-header">
2589
+ <div class="cv-tabgroup-row">
2590
+ <div class="cv-tabgroup-info">
2591
+ <p class="cv-tabgroup-title">Navigation Headers</p>
2592
+ <p class="cv-tabgroup-description">Show or hide navigation headers</p>
2593
+ </div>
2594
+ <label class="cv-toggle-switch cv-nav-toggle">
2595
+ <input class="cv-nav-pref-input" type="checkbox" aria-label="Show or hide navigation headers" />
2596
+ <span class="cv-switch-bg"></span>
2597
+ <span class="cv-switch-knob"></span>
2598
+ </label>
2599
+ </div>
2600
+ </div>
2601
+ <div class="cv-tab-groups-list">
2602
+ ${tabGroups.map(group => `
2603
+ <div class="cv-tabgroup-card cv-tabgroup-item">
2604
+ <label class="cv-tabgroup-label" for="tab-group-${group.id}">
2605
+ ${group.label || group.id}
2606
+ </label>
2607
+ <select id="tab-group-${group.id}" class="cv-tabgroup-select" data-group-id="${group.id}">
2608
+ ${group.tabs.map(tab => `<option value="${tab.id}">${tab.label || tab.id}</option>`).join('')}
2609
+ </select>
2610
+ </div>
2611
+ `).join('')}
2612
+ </div>
2617
2613
  `;
2618
2614
  }
2619
- this.modal.innerHTML = `
2620
- <div class="cv-widget-modal cv-custom-state-modal">
2621
- <header class="cv-modal-header">
2622
- <div class="cv-modal-header-content">
2623
- <div class="cv-modal-icon">
2624
- ${getGearIcon()}
2625
- </div>
2626
- <div class="cv-modal-title">${this.options.title}</div>
2627
- </div>
2628
- <button class="cv-modal-close" aria-label="Close modal">
2629
- ${getCloseIcon()}
2630
- </button>
2631
- </header>
2632
- <main class="cv-modal-main">
2633
- ${this.options.description ? `<p class="cv-modal-description">${this.options.description}</p>` : ''}
2634
-
2635
- ${toggles.length ? `
2636
- <div class="cv-content-section">
2637
- <div class="cv-section-heading">Toggles</div>
2638
- <div class="cv-toggles-container">
2639
- ${toggleControlsHtml}
2640
- </div>
2641
- </div>
2642
- ` : ''}
2643
-
2644
- ${this.options.showTabGroups && tabGroups && tabGroups.length > 0 ? `
2645
- <div class="cv-content-section">
2646
- <div class="cv-section-heading">Tab Groups</div>
2647
- <div class="cv-tabgroups-container">
2648
- ${tabGroupControlsHTML}
2649
- </div>
2650
- </div>
2651
- ` : ''}
2652
- </main>
2653
-
2654
- <footer class="cv-modal-footer">
2655
- ${this.options.showReset ? `
2656
- <button class="cv-reset-btn">
2657
- ${getResetIcon()}
2658
- <span>Reset to Default</span>
2659
- </button>
2660
- ` : ''}
2661
- <button class="cv-share-btn">
2662
- ${getShareIcon()}
2663
- <span>Copy Shareable URL</span>
2664
- </button>
2665
- </footer>
2666
- </div>
2615
+ this.modal.innerHTML = `
2616
+ <div class="cv-widget-modal cv-custom-state-modal">
2617
+ <header class="cv-modal-header">
2618
+ <div class="cv-modal-header-content">
2619
+ <div class="cv-modal-icon">
2620
+ ${getGearIcon()}
2621
+ </div>
2622
+ <div class="cv-modal-title">${this.options.title}</div>
2623
+ </div>
2624
+ <button class="cv-modal-close" aria-label="Close modal">
2625
+ ${getCloseIcon()}
2626
+ </button>
2627
+ </header>
2628
+ <main class="cv-modal-main">
2629
+ ${this.options.description ? `<p class="cv-modal-description">${this.options.description}</p>` : ''}
2630
+
2631
+ ${toggles.length ? `
2632
+ <div class="cv-content-section">
2633
+ <div class="cv-section-heading">Toggles</div>
2634
+ <div class="cv-toggles-container">
2635
+ ${toggleControlsHtml}
2636
+ </div>
2637
+ </div>
2638
+ ` : ''}
2639
+
2640
+ ${this.options.showTabGroups && tabGroups && tabGroups.length > 0 ? `
2641
+ <div class="cv-content-section">
2642
+ <div class="cv-section-heading">Tab Groups</div>
2643
+ <div class="cv-tabgroups-container">
2644
+ ${tabGroupControlsHTML}
2645
+ </div>
2646
+ </div>
2647
+ ` : ''}
2648
+ </main>
2649
+
2650
+ <footer class="cv-modal-footer">
2651
+ ${this.options.showReset ? `
2652
+ <button class="cv-reset-btn">
2653
+ ${getResetIcon()}
2654
+ <span>Reset to Default</span>
2655
+ </button>
2656
+ ` : ''}
2657
+ <button class="cv-share-btn">
2658
+ ${getShareIcon()}
2659
+ <span>Copy Shareable URL</span>
2660
+ </button>
2661
+ </footer>
2662
+ </div>
2667
2663
  `;
2668
2664
  document.body.appendChild(this.modal);
2669
2665
  this.attachStateModalEventListeners();
@@ -2839,7 +2835,7 @@ ${TAB_STYLES}
2839
2835
  });
2840
2836
  // Load tab group selections
2841
2837
  const activeTabs = this.core.getCurrentActiveTabs();
2842
- const tabGroupSelects = this.modal.querySelectorAll('.cv-tab-groupselect');
2838
+ const tabGroupSelects = this.modal.querySelectorAll('.cv-tabgroup-select');
2843
2839
  tabGroupSelects.forEach(select => {
2844
2840
  const groupId = select.dataset.groupId;
2845
2841
  if (groupId && activeTabs[groupId]) {
@@ -2897,29 +2893,29 @@ ${TAB_STYLES}
2897
2893
  this.modal = document.createElement('div');
2898
2894
  this.modal.className = 'cv-widget-modal-overlay cv-welcome-modal-overlay';
2899
2895
  this.applyThemeToModal();
2900
- this.modal.innerHTML = `
2901
- <div class="cv-widget-modal cv-welcome-modal">
2902
- <header class="cv-modal-header">
2903
- <div class="cv-modal-header-content">
2904
- <div class="cv-modal-icon">
2905
- ${getGearIcon()}
2906
- </div>
2907
- <h1 class="cv-modal-title">${this.options.welcomeTitle}</h1>
2908
- </div>
2909
- </header>
2910
- <div class="cv-modal-main">
2911
- <p class="cv-welcome-message">${this.options.welcomeMessage}</p>
2912
-
2913
- <div class="cv-welcome-widget-preview">
2914
- <div class="cv-welcome-widget-icon">
2915
- ${getGearIcon()}
2916
- </div>
2917
- <p class="cv-welcome-widget-label">Look for this widget</p>
2918
- </div>
2919
-
2920
- <button class="cv-welcome-got-it">Got it!</button>
2921
- </div>
2922
- </div>
2896
+ this.modal.innerHTML = `
2897
+ <div class="cv-widget-modal cv-welcome-modal">
2898
+ <header class="cv-modal-header">
2899
+ <div class="cv-modal-header-content">
2900
+ <div class="cv-modal-icon">
2901
+ ${getGearIcon()}
2902
+ </div>
2903
+ <h1 class="cv-modal-title">${this.options.welcomeTitle}</h1>
2904
+ </div>
2905
+ </header>
2906
+ <div class="cv-modal-main">
2907
+ <p class="cv-welcome-message">${this.options.welcomeMessage}</p>
2908
+
2909
+ <div class="cv-welcome-widget-preview">
2910
+ <div class="cv-welcome-widget-icon">
2911
+ ${getGearIcon()}
2912
+ </div>
2913
+ <p class="cv-welcome-widget-label">Look for this widget</p>
2914
+ </div>
2915
+
2916
+ <button class="cv-welcome-got-it">Got it!</button>
2917
+ </div>
2918
+ </div>
2923
2919
  `;
2924
2920
  document.body.appendChild(this.modal);
2925
2921
  this.attachWelcomeModalEventListeners();
@@ -2987,22 +2983,13 @@ ${TAB_STYLES}
2987
2983
  let scriptTag = document.currentScript;
2988
2984
  // Fallback if currentScript is not available (executed after page load)
2989
2985
  if (!scriptTag) {
2990
- // Try to find the script tag by looking for our script
2991
- const scripts = document.querySelectorAll('script[src*="@customviews-js"]');
2992
- if (scripts.length > 0) {
2993
- // Find the most specific match (to avoid matching other custom-views scripts)
2994
- for (let i = 0; i < scripts.length; i++) {
2995
- const script = scripts[i];
2996
- const src = script.getAttribute('src') || '';
2997
- // Look for .min.js or .js at the end, or the package root
2998
- if (src.match(/@customviews-js\/customviews(\.min)?\.js($|\?)/) || src.includes('@customviews-js/customviews')) {
2999
- scriptTag = script;
3000
- break;
3001
- }
3002
- }
3003
- // If no specific match found, use the first one
3004
- if (!scriptTag) {
3005
- scriptTag = scripts[0];
2986
+ // Match the actual CustomViews bundle files (e.g., custom-views.min.js, custom-views.js)
2987
+ for (const script of document.scripts) {
2988
+ const src = script.src || '';
2989
+ // Match filenames like: custom-views.min.js, custom-views.js, custom-views.esm.js
2990
+ if (/custom-views(?:\.min)?\.(?:esm\.)?js($|\?)/i.test(src)) {
2991
+ scriptTag = script;
2992
+ break;
3006
2993
  }
3007
2994
  }
3008
2995
  }