Wonder Woman Superhero Baby Girl Outfit - Wonder Woman Baby Shower Gift Box Set
Item# WWba678102679
(function: () { 'use strict'; if (document.querySelector('[id^="tc-v"][id$="-panel"], #tc-compact-panel, .tc-preview-buttons')) { alert('An earlier preview is still on this page. Refresh the product page once, then run Version 9.'); return; } var selects = Array.from(document.querySelectorAll('#itemPage .optionrow select')); if (!selects.length) { alert('No product option dropdowns found. Make sure you are on the live product page, then refresh and try again.'); return; } if (document.getElementById('tc-v9-panel')) { alert('Preview is already displayed. Refresh the page to reset.'); return; } var rows = selects.map(function (select) { return select.closest('.optionrow'); }).filter(Boolean); if (!rows.length) return; var css = document.createElement('style'); css.id = 'tc-v9-style'; css.textContent = ` #tc-v9-panel {box-sizing:border-box;border:1px solid #e5e5e5;border-radius:12px;padding:13px;margin:10px 0 16px;font-family:"Century Schoolbook",Georgia,serif;background:#fff;} #tc-v9-panel * {box-sizing:border-box;} #tc-v9-panel .tc-title {font-size:15px;font-weight:bold;padding-bottom:12px;border-bottom:1px solid #eee;margin-bottom:12px;} #tc-v9-panel .tc-section {padding:8px 0 13px;border-bottom:1px solid #eee;} #tc-v9-panel .tc-section:last-child {border-bottom:0;padding-bottom:0;} #tc-v9-panel .tc-label {font-size:12px;font-weight:bold;text-transform:uppercase;letter-spacing:.02em;margin:5px 0 8px;} #tc-v9-panel .tc-sub {font-size:12px;font-weight:bold;margin:11px 0 6px;} #tc-v9-panel .tc-grid {display:flex;flex-wrap:wrap;gap:5px;} #tc-v9-panel .tc-btn {font:12px/1.3 Century Schoolbook ,Georgia,serif;cursor:pointer;border:1px solid #ddd;border-radius:5px;background:#fff;color:#333;padding:6px 9px;min-height:30px;text-align:center;} #tc-v9-panel .tc-btn:hover,#tc-v9-panel .tc-btn:focus-visible {border-color:#F785CB;outline:1px solid #F785CB;} #tc-v9-panel .tc-btn[aria-pressed="true"] {background:#F785CB;border-color:#F785CB;color:#23111d;font-weight:bold;} #tc-v9-panel .tc-fields {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;} #tc-v9-panel .tc-field {min-width:0;} #tc-v9-panel .tc-field.tc-wide {grid-column:1/-1;} #tc-v9-panel .tc-field label {display:block;font-size:12px;margin-bottom:5px;} #tc-v9-panel .tc-field input {display:block;width:100%;min-width:0;height:34px;border:1px solid #ddd;border-radius:7px;padding:7px 10px;font:13px Century Schoolbook ,Georgia,serif;background:#fff;} #tc-v9-panel .tc-field input:focus {outline:2px solid #F785CB;outline-offset:1px;} @media(max-width:480px){#tc-v9-panel .tc-fields{grid-template-columns:1fr}#tc-v9-panel .tc-field.tc-wide{grid-column:auto}} #tc-v9-panel .tc-note {font-size:11px;color:#666;margin-top:8px;} #itemPage .optionrow.tc-v9-source {position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%)!important;white-space:nowrap!important;} `; document.head.appendChild(css); var panel = document.createElement('div'); panel.id = 'tc-v9-panel'; var title = document.createElement('div'); title.className = 'tc-title'; title.textContent = 'Customize Your Outfit'; panel.appendChild(title); function el(tag, cls, content) { var node = document.createElement(tag); if (cls) node.className = cls; if (content != null) node.textContent = content; return node; } function section(label) { var sec = el('div', 'tc-section'); sec.appendChild(el('div', 'tc-label', label)); panel.appendChild(sec); return sec; } function grid(parent, label) { if (label) parent.appendChild(el('div', 'tc-sub', label)); var g = el('div', 'tc-grid'); parent.appendChild(g); return g; } var fieldItems = []; selects.forEach(function (select) { var row = select.closest('.optionrow'); if (!row) return; var originalLabel = row.querySelector('label'); var name = originalLabel ? originalLabel.textContent.trim().replace(/:$/, '') : (select.name || 'Options'); var options = Array.from(select.options).filter(function (o) { return o.value && !/^select$/i.test(o.text.trim()); }); if (!options.length) return; var sec = section(name); var isSize = /size/i.test(name); var isPackage = /options?/i.test(name) && options.some(function (o) { return /onesie|bodysuit|gift set/i.test(o.text); }); var allButtons = []; function addButton(option, target, label) { var b = el('button', 'tc-btn', label); b.type = 'button'; b.title = option.text.trim(); b.setAttribute('aria-pressed', 'false'); b.addEventListener('click', function () { select.value = option.value; select.dispatchEvent(new Event('input', {bubbles:true})); select.dispatchEvent(new Event('change', {bubbles:true})); sync(); }); target.appendChild(b); allButtons.push({button:b, value:option.value}); } function sync() { allButtons.forEach(function (item) { item.button.setAttribute('aria-pressed', String(item.value === select.value)); }); } function noPrice(s) { return s.replace(/\s*\(\+\d+(?:\.\d+)?\)\s*$/, '').trim(); } if (isSize && options.some(function (o) { return /short sleeve|long sleeve/i.test(o.text); })) { ['Short Sleeve','Long Sleeve'].forEach(function (type) { var subset = options.filter(function (o) { return new RegExp(type, 'i').test(o.text); }); if (!subset.length) return; var g = grid(sec, type); subset.forEach(function (o) { addButton(o, g, noPrice(o.text).replace(/\s*(?:short|long) sleeve\s*$/i, '').trim()); }); }); } else { var g = grid(sec, isPackage ? 'Choose outfit or gift set' : ''); options.forEach(function (o) { var full = noPrice(o.text); var short = full; if (isPackage) { var map = { 'Bodysuit Only':'Bodysuit Only', 'Cluster Hat + Onesie + Leg Warmers':'Cluster Hat Set', 'Cluster Hat + Onesie + Leg Warmers + Bloomers':'Cluster Hat + Bloomers', 'Bow Hat + Onesie + Leg Warmers + Bloomers':'Bow Hat + Bloomers', 'Bow Headband + Onesie + Leg Warmers Set':'Bow Headband Set', 'Cluster Headband + Onesie + Leg Warmers Set':'Cluster Headband Set', 'Bow Headband + Onesie + Leg Warmers + Bloomers':'Headband + Bloomers' }; short = map[full.replace(/\s+/g,' ')] || full; } addButton(o, g, short); }); } select.addEventListener('change', sync); sync(); row.classList.add('tc-v9-source'); }); var form = selects[0].form; if (form) { var textRows = Array.from(form.querySelectorAll('.optionrow')).filter(function (row) { return !row.querySelector('select') && row.querySelector('input:not([type=hidden]):not([type=submit])'); }); if (textRows.length) { var personal = section('Personalization'); var fields = el('div', 'tc-fields'); personal.appendChild(fields); textRows.forEach(function (row, index) { var input = row.querySelector('input:not([type=hidden]):not([type=submit])'); if (!input) return; var label = row.querySelector('label'); var rawName = label ? label.textContent.trim().replace(/:$/, '') : ''; var isMachine = !rawName || /(?:vw-inscription|inscription[-_][a-f0-9]{6,})/i.test(rawName) || !/^(?:wording|name|message|age|initials|date|text|monogram|personalization|custom wording)$/i.test(rawName); var fallbackNames = ['Wording', 'Name', 'Message']; var name = isMachine ? (fallbackNames[index] || 'Personalization ' + (index + 1)) : rawName; var cell = el('div', 'tc-field'); if (name === 'Message' || (textRows.length % 2 && index === textRows.length - 1)) cell.classList.add('tc-wide'); var visibleLabel = el('label', '', name); input.setAttribute('placeholder', name); if (input.id) visibleLabel.htmlFor = input.id; cell.appendChild(visibleLabel); fields.appendChild(cell); cell.appendChild(input); fieldItems.push({row:row, input:input}); }); fieldItems.forEach(function (item) { item.row.classList.add('tc-v9-source'); }); } } panel.appendChild(el('div', 'tc-note', 'Temporary design test checkout has not been verified.')); rows[0].parentNode.insertBefore(panel, rows[0]); alert('Design preview ready. Refresh to undo. Do not place an order during testing.'); })();