PageSourceSearch

https://www.hy96.com.cn/upload/js/723b5897bb4a4363aed73c0b62fadf6e.js?v=2.0.3

js hy96.com.cn collected 2026-10-06 13:16:05 UTC 73,182 bytes, 341 lines download raw bytes

1(function () {
2  document.addEventListener("DOMContentLoaded", function () {
3    //给body添加类名作为跨境的标识
4    document.body.id = 'Cross-border';
5
6    //banner苹果手机端:静音 + 允许内联播放(不强制全屏)
7    (function () { document.querySelectorAll('[id^="c_banner_"] .videoContent .video').forEach(v => { v.muted = true; v.setAttribute('muted', ''); v.setAttribute('playsinline', ''); v.setAttribute('webkit-playsinline', ''); v.setAttribute('autoplay', ''); const tryPlay = () => v.play().catch(() => { }); tryPlay(); const unlock = () => tryPlay(); window.addEventListener('touchstart', unlock, { once: true, passive: true }); window.addEventListener('click', unlock, { once: true, passive: true }); }); })();
8
9
10    //识别测试环境/生产环境
11    !function () { const e = location.hostname || "", t = "dc.thefastmake.com" === e || e.startsWith("dc."); let o = !1; try { const e = top && top.location && top.location.hostname || ""; o = /(^|\.)dc\.thefastmake\.com$/i.test(e) } catch (_) { } if (t || o) return; "function" == typeof isFrontEnv && isFrontEnv() && (function () { const e = document.querySelector('[id^="c_static_001"] #Global_Code'); if (!e) return; const t = e.closest('[id^="c_static_001"]'); t && t.classList.add("hide") }()) }();
12
13    // 将文本邮箱转为 mailto 链接
14    (function () { const emailRegGlobal = /([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})/g; const emailRegTest = /([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})/; const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT, { acceptNode(node) { const text = node.nodeValue; if (!text || !text.trim()) return NodeFilter.FILTER_REJECT; const parent = node.parentNode; if (parent && /^(a|script|style|input|textarea)$/i.test(parent.nodeName)) { return NodeFilter.FILTER_REJECT; } return emailRegTest.test(text) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT; } }, false); const nodes = []; while (walker.nextNode()) { nodes.push(walker.currentNode); } nodes.forEach(textNode => { const text = textNode.nodeValue; const frag = document.createDocumentFragment(); let lastIndex = 0; text.replace(emailRegGlobal, (match, email, offset) => { if (offset > lastIndex) { frag.appendChild(document.createTextNode(text.slice(lastIndex, offset))); } const a = document.createElement('a'); a.href = 'mailto:' + email; a.textContent = email; frag.appendChild(a); lastIndex = offset + match.length; return match; }); if (lastIndex < text.length) { frag.appendChild(document.createTextNode(text.slice(lastIndex))); } textNode.parentNode.replaceChild(frag, textNode); }); })();
15
16    //邮件链接处理 + 外链优化
17    const Language_Query = { 'zh_CN': '询盘邮件', 'zh_HN': '詢盤郵件', 'en': 'Inquiry email', 'de': 'Anfrage-E-Mail', 'fr': 'E-mail de demande', 'ru': 'Запрос по электронной почте', 'pt': 'E-mail de consulta', 'ko': '문의 메일', 'ja': 'お問い合わせメール', 'es': 'Correo electrónico de consulta', 'ar': 'البريد الإلكتروني للاستفسار', 'it': 'E-mail di richiesta', 'bn': 'তদন্ত ইমেল', 'da': 'Forespørgselsmail', 'idn': 'Email pertanyaan', 'th': 'อีเมลสอบถาม', 'vi': 'Email yêu cầu', 'tr': 'Soruşturma e-postası', 'nl': 'E-mail voor aanvraag', 'pl': 'Zapytanie e-mailowe', 'cs': 'Email s dotazem', 'ee': 'Päringu email', 'fi': 'Tiedustelu sähköposti', 'el': 'Επικοινωνία email', 'hu': 'Érdeklődő email', 'gg': 'Имейл за запитване', 'hr': 'E-pošta za upit', 'ga': 'Ríomhphost fiosrúcháin', 'ro': 'E-mail de întrebare', 'lv': 'Uzziņas e-pasts', 'mt': 'Email tal-Inkjesta', 'sk': 'E-mail s dopytom', 'si': 'E-pošta za povpraševanje', 'sv': 'Förfrågningsmail', 'lt': 'Užklausos el', 'ml': 'E-mel pertanyaan', 'bur': 'စုံစမ်းမေးမြန်းရန်အီးမေးလ်', 'kh': 'អ៊ីមែលសាកសួរ', 'la': 'ສອບຖາມອີເມລ໌', 'ph': 'Email ng pagtatanong', 'fa': 'ایمیل استعلام', 'uk': 'Електронна пошта для запиту', 'ta': 'விசாரணை மின்னஞ்சல்', 'mn': 'Лавлагааны имэйл', 'kk': 'Сұрау электрондық поштасы' };
18
19    const language = window.tenant?.language || 'en'; const inquirySubjectText = Language_Query[language] || Language_Query['en']; const currentHost = (window.location.hostname || '').replace(/^www\./i, ''); const emailRegTextOnly = /[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/; function mergeRel(link, extraRels) { const existing = (link.rel || '').split(/\s+/).filter(
19Boolean); const set = new Set(existing); extraRels.forEach(r => set.add(r)); link.rel = Array.from(set).join(' '); } function enhanceLinks(scope = document) { scope.querySelectorAll('a[href^="mailto:"]').forEach(link => { let rawHref = link.getAttribute('href') || ''; let [base, query = ''] = rawHref.split('?', 2); base = base.trim(); let hrefEmail = base.replace(/^mailto:/i, '').trim(); const text = (link.textContent || '').trim(); const textEmailMatch = text.match(emailRegTextOnly); const textEmail = textEmailMatch ? textEmailMatch[0].trim() : ''; if (textEmail && hrefEmail && textEmail.toLowerCase() !== hrefEmail.toLowerCase()) { hrefEmail = textEmail; base = 'mailto:' + hrefEmail; } if (!hrefEmail && textEmail) { hrefEmail = textEmail; base = 'mailto:' + hrefEmail; } const subject = inquirySubjectText.trim().replace(/\s+/g, ' '); const encodedSubject = encodeURIComponent(subject).replace(/%20/g, '%20'); const newHref = `${base}?subject=${encodedSubject}`; link.setAttribute('href', newHref); mergeRel(link, ['nofollow']); }); scope.querySelectorAll('a[href^="tel:"]').forEach(link => { mergeRel(link, ['nofollow']); }); scope.querySelectorAll('a').forEach(link => { const hrefAttr = link.getAttribute('href') || ''; if (!hrefAttr || /^mailto:/i.test(hrefAttr) || /^tel:/i.test(hrefAttr) || /^javascript:/i.test(hrefAttr)) { return; } let url; try { url = new URL(hrefAttr, window.location.origin); } catch (e) { return; } const protocol = url.protocol; if (protocol !== 'http:' && protocol !== 'https:') { return; } const host = url.hostname.replace(/^www\./i, ''); const isExternal = host && host !== currentHost; if (isExternal) { mergeRel(link, ['nofollow', 'noopener', 'noreferrer']); } }); } enhanceLinks(); const waitForServiceGroup = new MutationObserver(mutations => { for (const mutation of mutations) { for (const node of mutation.addedNodes) { if (node.nodeType !== 1) continue; if (node.matches('.service_group') || node.querySelector('.service_group')) { const group = node.matches('.service_group') ? node : node.querySelector('.service_group'); if (!group) continue; const groupObserver = new MutationObserver(muts => { muts.forEach(mut => { mut.addedNodes.forEach(n => { if (n.nodeType === 1) { enhanceLinks(n); } }); }); }); groupObserver.observe(group, { childList: true, subtree: true }); enhanceLinks(group); waitForServiceGroup.disconnect(); } } } }); waitForServiceGroup.observe(document.body, { childList: true, subtree: true });
20
21
22
23    //电话号码自动添加链接
24    (() => { const SKIP_TAGS = new Set(['A', 'SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT', 'OPTION', 'CODE', 'PRE']); const MASTER = /(^|[^0-9A-Za-z])(\+?\d[\d\s\-()]{5,}\d)(?![0-9A-Za-z])/g; function hasNoTel(el) { return !!(el && el.nodeType === 1 && (el.closest('.no-tel') || el.closest('[data-whatsapp],[data-WhatsApp],[data-WHATSAPP]'))); } function cleanRaw(raw) { return String(raw || '').replace(/\u00A0/g, ' ').trim(); } function compactDigits(raw) { const s = cleanRaw(raw); const plus = s.startsWith('+') ? '+' : ''; const digits = s.replace(/[^\d]/g, ''); return plus ? ('+' + digits) : digits; } function isSupportedNumber(raw) { const c = compactDigits(raw); const noPlus = c.replace(/^\+/, ''); if (/^(?:86)?1\d{10}$/.test(noPlus)) return true; if (/^00861\d{10}$/.test(noPlus)) return true; if (/^(?:400|800)\d{7,8}$/.test(noPlus)) return true; if (/^(?:86)?0\d{2,3}\d{7,8}$/.test(noPlus)) return true; if (/^(?:86)\d{2,3}\d{7,8}$/.test(noPlus)) return true; if (/^00860?\d{2,3}\d{7,8}$/.test(noPlus)) return true; if (/^0\d{2,3}\d{7,8}$/.test(noPlus)) return true; if (/^\+\d{6,15}$/.test(c)) return true; return false; } function toTelHref(raw) { const c = compactDigits(raw); const noPlus = c.replace(/^\+/, ''); const digits = noPlus; if (/^861\d{10}$/.test(digits)) return `tel:+${digits}`; if (/^00861\d{10}$/.test(digits)) return `tel:${digits}`; if (/^1\d{10}$/.test(digits)) return `tel:${digits}`; if (/^86\d{2,3}\d{7,8}$/.test(digits)) return `tel:+${digits}`; if (/^860\d{2,3}\d{7,8}$/.test(digits)) { const rest = digits.slice(2).replace(/^0/, ''); return `tel:+86${rest}`; } if (/^0086\d{2,3}\d{7,8}$/.test(digits)) return `tel:${digits}`; if (/^00860\d{2,3}\d{7,8}$/.test(digits)) { const rest = digits.slice(4).replace(/^0/, ''); return `tel:0086${rest}`; } if (/^0\d{2,3}\d{7,8}$/.test(digits)) return `tel:${digits}`; if (/^(?:400|800)\d{7,8}$/.test(digits)) return `tel:${digits}`; if (/^\+\d{6,15}$/.test(c)) return `tel:${c}`; return null; } function shouldSkipElement(el) { if (!el || el.nodeType !== 1) return true; if (hasNoTel(el)) return true; if (SKIP_TAGS.has(el.tagName)) return true; if (el.isContentEditable) return true; return false; } function pickFirstNumberFromText(text) { let found = null; cleanRaw(text).replace(MASTER, (_, p1, p2) => { if (!found && isSupportedNumber(p2)) found = p2; return _; }); return found; } function fixExistingTelLinks(root = document) { root.querySelectorAll('a[href^="tel:"]').forEach(a => { if (hasNoTel(a)) return; const textNum = pickFirstNumberFromText(a.textContent); if (!textNum) return; const want = toTelHref(textNum); if (!want) return; const cur = cleanRaw(a.getAttribute('href')); if (cur !== want) a.setAttribute('href', want); }); } function linkifyTextNode(textNode) { const parent = textNode.parentElement; if (!parent || shouldSkipElement(parent)) return; if (parent.closest('a')) return; const text = textNode.nodeValue; if (!text || !/\d/.test(text)) return; MASTER.lastIndex = 0; let m, last = 0, hit = false; const frag = document.createDocumentFragment(); while ((m = MASTER.exec(text))) { const prefix = m[1]; const rawNum = m[2]; if (!isSupportedNumber(rawNum)) continue; const start = m.index + prefix.length; const end = start + rawNum.length; frag.appendChild(document.createTextNode(text.slice(last, start))); const href = toTelHref(rawNum); if (!href) { frag.appendChild(document.createTextNode(text.slice(start, end))); } else { const a = document.createElement('a'); a.href = href; a.textContent = text.slice(start, end); a.className = 'auto-tel'; a.rel = 'nofollow'; frag.appendChild(a); hit = true; } last = end; } if (!hit) return; frag.appendChild(document.createTextNode(text.slice(last))); textNode.parentNode.replaceChild(frag, textNode); } function linkifyInRoot(root) { if (!root) return; if (root.nodeType === 9) fixExistingTelLinks(root); else if (root.nodeType === 1) { if (hasNoTel(root)) return; fixExistingTelLinks(root); } const walker = document.createTreeWalker(root.nodeType === 9 ? root.body : root, NodeFilter.SHOW_TEXT, { acceptNode(node) { const p = node.parentElement; if (!p) return NodeFilter.FILTER_REJECT; if (shouldSkipElement(p)) return NodeFilter.FILTER_REJECT; if (p.closest('a')) return NodeFilter.FILTER_REJECT; if (!node.nodeValue || node.nodeValue.length < 7) return NodeFilter.FILTER_REJECT; if (!/\d/.test(node.nodeValue)) return NodeFilter.FILTER_REJECT; return NodeFilter.FILTER_ACCEPT; } }); const nodes = []; while (walker.nextNode()) nodes.push(walker.currentNode);
24 nodes.forEach(linkifyTextNode); } linkifyInRoot(document); const mo = new MutationObserver(muts => { for (const m of muts) { for (const n of m.addedNodes) { if (!n) continue; if (n.nodeType === 3) linkifyTextNode(n); else if (n.nodeType === 1) { if (!hasNoTel(n)) linkifyInRoot(n); } } if (m.type === 'characterData' && m.target) { const p = m.target.parentElement; if (p && !shouldSkipElement(p)) linkifyInRoot(p); } } }); mo.observe(document.documentElement, { childList: true, subtree: true, characterData: true }); })();
25
26
27
28    //WhatsApp号码自动添加链接/修改错误的号码
29    (function () { const master = /([^\dA-Za-z]|^)((?:(?:\+?86|0086)[-\s]?(?:1\d{10}|1\d{2}[-\s]?\d{4}[-\s]?\d{4}))|(?:0\d{2,3}[-\s]?\d{7,8})|(?:(?:\+86|0086)[-\s]?(?:[1-9]\d{1,2})[-\s]?\d{7,8})|(?:(?:\+?86|0086)?\s*(?:400|800)(?:[-\s]?\d){7})|(?:\+(?!86)\d{1,3}(?:[-\s]?\d){6,14}))(?!\d)/g; const CC = '86'; const TXT = 'Hello'; const hasDigits = s => /\d/.test(String(s || '')); function norm(s) { return String(s || '').replace(/&nbsp;/gi, ' ').replace(/[\u200B-\u200D\uFEFF]/g, '').replace(/[()]/g, m => m === '(' ? '(' : ')').replace(/\s+/g, ' '); } function toE164(raw, cc = CC) { if (!raw) return null; let s = raw.trim().replace(/^00/, '+'); if (/^\+86/.test(s)) return s.replace(/[^\d+]/g, ''); const plusDigits = s.replace(/[^\d+]/g, ''); if (/^\+\d{6,15}$/.test(plusDigits)) return plusDigits; let digits = plusDigits.replace(/[^\d]/g, ''); if (!digits) return null; if (cc === '86' && /^86(1\d{10})$/.test(digits)) return '+86' + RegExp.$1; if (cc === '86' && /^1\d{10}$/.test(digits)) return '+86' + digits; if (/^0\d+/.test(digits)) return '+' + cc + digits.replace(/^0+/, ''); if (/^\d{6,15}$/.test(digits)) return '+' + cc + digits; return null; } function buildHref(e164) { const num = String(e164 || '').replace(/^\+/, ''); return `https://api.whatsapp.com/send?phone=${num}&text=${encodeURIComponent(TXT)}`; } function firstTextHit(root) { const SKIP = new Set(['A', 'SCRIPT', 'STYLE', 'TEXTAREA', 'CODE', 'PRE', 'INPUT']); const tw = document.createTreeWalker(root, NodeFilter.SHOW_TEXT, { acceptNode(n) { if (!n.nodeValue || !n.nodeValue.trim()) return NodeFilter.FILTER_REJECT; const p = n.parentElement; if (!p) return NodeFilter.FILTER_REJECT; if (SKIP.has(p.tagName)) return NodeFilter.FILTER_REJECT; if (p.closest('a')) return NodeFilter.FILTER_REJECT; return NodeFilter.FILTER_ACCEPT; } }); let t; while ((t = tw.nextNode())) { const orig = t.nodeValue; master.lastIndex = 0; const m = master.exec(orig); master.lastIndex = 0; if (!m) continue; const lead = m[1] || ''; const full = m[2] || ''; let s = m.index + lead.length; let e = s + full.length; if (s > 0 && orig[s - 1] === '+' && full[0] !== '+') { s = s - 1; } const raw = orig.slice(s, e); return { node: t, start: s, end: e, raw }; } return null; } function wrap(textNode, s, e, href, text) { const whole = textNode.nodeValue; const b = document.createTextNode(whole.slice(0, s)); const a = document.createElement('a'); a.href = href; a.target = '_blank'; a.rel = 'noopener noreferrer nofollow'; a.textContent = text; a.setAttribute('data-wa-made', '1'); const af = document.createTextNode(whole.slice(e)); const p = textNode.parentNode; p.insertBefore(b, textNode); p.insertBefore(a, textNode); p.insertBefore(af, textNode); p.removeChild(textNode); return a; } function renderDataWA(scope = document) { const hosts = scope.querySelectorAll('[data-whatsapp]'); let created = 0; hosts.forEach(h => { if (h.querySelector('a[data-wa-made="1"]')) return; const hit = firstTextHit(h); if (!hit) return; const e164 = toE164(hit.raw); if (!e164) return; wrap(hit.node, hit.start, hit.end, buildHref(e164), hit.raw); created++; }); return created; } function textToE164ByRegex(txt) { master.lastIndex = 0; const m = master.exec(txt); master.lastIndex = 0; if (!m) return null; let s = m.index + (m[1] ? m[1].length : 0); let e = s + (m[2] ? m[2].length : 0); if (s > 0 && txt[s - 1] === '+' && txt.slice(s, e)[0] !== '+') { s = s - 1; } const raw = txt.slice(s, e); return toE164(raw); } function reconcileAll(scope = document) { const links = scope.querySelectorAll('a[href*="wa.me"],a[href*="api.whatsapp.com"]'); let fixed = 0; links.forEach(a => { const txt = (a.textContent || '').trim(); if (!hasDigits(txt)) return; const e164 = textToE164ByRegex(txt); if (!e164) return; const need = buildHref(e164); if (a.getAttribute('href') !== need) { a.setAttribute('href', need); fixed++; } }); return fixed; } function runAll(scope) { return { created: renderDataWA(scope), corrected: re
29concileAll(scope) }; } if (!window.WAHelper) window.WAHelper = {}; window.WAHelper.runAll = runAll; function observe() { const deb = new WeakMap(); const run = h => { clearTimeout(deb.get(h)); deb.set(h, setTimeout(() => runAll(h), 120)); }; const oh = new MutationObserver(ms => { const set = new Set(); ms.forEach(m => { if (m.target && m.target.nodeType === 1) { const h = m.target.closest('[data-whatsapp]'); if (h) set.add(h); } }); set.forEach(run); }); document.querySelectorAll('[data-whatsapp]').forEach(h => { oh.observe(h, { childList: true, subtree: true, characterData: true }); run(h); }); const ob = new MutationObserver(ms => { let needGlobal = false; ms.forEach(m => { if (m.addedNodes && m.addedNodes.length) needGlobal = true; }); if (needGlobal) runAll(document); }); ob.observe(document.body, { childList: true, subtree: true }); } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', () => { runAll(document); observe(); }); } else { runAll(document); observe(); } })();
30
31    //检测页面是否包含了H1如果没有自动添加一个H1标签
32    (function () { if (document.querySelector('h1')) return; const sourceEl = document.querySelector('#Image_Keywords .Global-right'); if (!sourceEl) return; const text = sourceEl.textContent.trim(); if (!text) return; const h1 = document.createElement('h1'); h1.textContent = text; h1.classList.add('hide'); const body = document.body; if (body.firstChild) { body.insertBefore(h1, body.firstChild); } else { body.appendChild(h1); } })();
33
34
35    //屏蔽A标签的链接
36    if (document.querySelector('#Block_links .Global-right')) { document.querySelectorAll('a').forEach(a => { a.setAttribute('href', 'javascript:void(0)'); }); }
37
38    //屏蔽A标签的链接(保存原链接的存在)
39    // if (document.querySelector('#Block_links .Global-right')) { document.body.addEventListener('click', function (e) { const a = e.target.closest('a'); if (a) e.preventDefault(); }); }
40
41
42    //SVG调取
43    if (!customElements.get('svg-icon')) { customElements.define('svg-icon', class extends HTMLElement { connectedCallback() { const name = this.getAttribute('name'); if (!name) { return; } const sourceSvg = document.querySelector(`svg[data-icon="${name}"]`); if (sourceSvg) { this.innerHTML = sourceSvg.outerHTML; } } }); }
44
45    // 替换表单验证提示文本
46    function replaceFeedbackTexts() { if (language === 'zh_CN') return; const right = document.querySelector("#Form_Validation .Global-right"); const msg = right ? right.textContent.trim() : ""; document.querySelectorAll(".invalid-feedback").forEach(el => { const txt = el.textContent.trim(); if (el.dataset.fixed === "1") return; if (txt.includes("内容不能为空") || txt.includes("请输入内容")) { const newTxt = msg || "请输入内容"; if (txt !== newTxt) { el.textContent = newTxt; } el.dataset.fixed = "1"; } }); } replaceFeedbackTexts(); new MutationObserver(replaceFeedbackTexts).observe(document.body, { childList: true, subtree: true });
47
48  });
49
50  //Tab切换(支持 hover 和 click 两组)(#tab-hover #tab-click)
51  function bindSyncEvent(e, t) { const n = document.getElementById(e); if (!n) return; const c = n.querySelectorAll(".p_list"); c.forEach(e => { const t = e.querySelectorAll(".p_loopitem"); t[0] && t[0].classList.add("active") }), n.querySelectorAll(".p_loopitem").forEach(e => { e.addEventListener(t, () => { const n = Array.from(e.parentElement.children).indexOf(e); c.forEach(e => { const t = e.querySelectorAll(".p_loopitem"); t.forEach(e => e.classList.remove("active")), t[n] && t[n].classList.add("active") }) }) }) } document.addEventListener("DOMContentLoaded", () => { bindSyncEvent("tab-hover", "mouseenter"), bindSyncEvent("tab-click", "click") });
52
53
54  // 无缝滚动
55
56 (function () {
57  function splitCsv(s) {
58    var t = String(s || "").trim();
59    if (!t) return [];
60    return t.split(",").map(function (x) { return String(x || "").trim(); }).filter(Boolean);
61  }
62  function toLower(s) {
63    return String(s || "").trim().toLowerCase();
64  }
65  function parseBoolAttr(el, name, defVal) {
66    var v = el.getAttribute(name);
67    if (v == null) return !!defVal;
68    v = toLower(v);
69    return v === "true" || v === "1" || v === "yes";
70  }
71  function parseNumAttr(el, name, defVal) {
72    var v = parseFloat(el.getAttribute(name));
73    return Number.isFinite(v) ? v : defVal;
74  }
75  function parseIntAttr(el, name, defVal) {
76    var v = parseInt(el.getAttribute(name), 10);
77    return Number.isFinite(v) ? v : defVal;
78  }
79  function outerSize(el, isHorizontal) {
80    var rect = el.getBoundingClientRect();
81    var cs = getComputedStyle(el);
82    if (isHorizontal) {
83      var ml = parseFloat(cs.marginLeft) || 0;
84      var mr = parseFloat(cs.marginRight) || 0;
85      return rect.width + ml + mr;
86    } else {
87      var mt = parseFloat(cs.marginTop) || 0;
88      var mb = parseFloat(cs.marginBottom) || 0;
89      return rect.height + mt + mb;
90    }
91  }
92  function clampLoopPos(pos, totalSize, dir) {
93    if (!totalSize) return pos;
94    if (dir === "left" || dir === "up") {
95      while (-pos >= totalSize) pos += totalSize;
96      while (pos > 0) pos -= totalSize;
97      return pos;
98    } else {
99      while (pos >= 0) pos -= totalSize;
100      while (-pos >= totalSize) pos += totalSize;
101      return pos;
102    }
103  }
104
105  function initSeamlessScroll(container) {
106    var mainDir = toLower(container.getAttribute("data-direction") || "horizontal");
107    var speed = parseNumAttr(container, "data-speed", 0.5);
108    var pauseOnHover = parseBoolAttr(container, "data-pause-on-hover", false);
109    var draggable = parseBoolAttr(container, "data-draggable", false);
110    var rows = Math.max(1, parseIntAttr(container, "data-rows", 1));
111    var rowDirections = splitCsv(container.getAttribute("data-row-directions") || container.dataset.rowDirections);
112    var items = Array.from(container.querySelectorAll(".p_loopitem"));
113    if (!items.length) return;
114    container.innerHTML = "";
115    var itemsPerRow = Math.ceil(items.length / rows);
116    var rowContainers = [];
117    for (var r = 0; r < rows; r++) {
118      var rowDiv = document.createElement("div");
119      rowDiv.className = "p_row";
120      var specificDir = toLower(rowDirections[r]);
121      if (!specificDir) specificDir = (mainDir === "vertical") ? "up" : "left";
122      if (!/^(left|right|up|down)$/.test(specificDir)) {
123        specificDir = (mainDir === "vertical") ? "up" : "left";
124      }
125      rowDiv.dataset.direction = specificDir;
126      for (var i = r * itemsPerRow; i < (r + 1) * itemsPerRow && i < items.length; i++) {
127        rowDiv.appendChild(items[i]);
128      }
129      container.appendChild(rowDiv);
130      rowContainers.push(rowDiv);
131    }
132    container.style.overflow = "hidden";
133    container.style.userSelect = "none";
134    container.style.webkitUserSelect = "none";
135    container.style.touchAction = "none"; 
136    if (draggable) container.style.cursor = "grab";
137    rowContainers.forEach(function (row) {
138      var direction = toLower(row.dataset.direction);
139      var isHorizontal = (direction === "left" || direction === "right");
140      var sign = (direction === "left" || direction === "up") ? -1 : 1;
141      row.style.display = "flex";
142      row.style.flexWrap = "nowrap";
143      if (isHorizontal) {
144        row.style.flexDirection = "row";
145        row.style.willChange = "transform";
146      } else {
147        row.style.flexDirection = "column";
148        row.style.willChange = "transform";
149      }
150      var rowItems = Array.from(row.children);
151      if (!rowItems.length) return;
152      var totalSize = 0;
153      for (var k = 0; k < rowItems.length; k++) {
154        totalSize += outerSize(rowItems[k], isHorizontal);
155      }
156      if (!totalSize) return;
157      var containerSize = isHorizontal ? container.getBoundingClientRect().width : container.getBoundingClientRect().height;
158      if (!containerSize) containerSize = isHorizontal ? container.offsetWidth : container.offsetHeight;
159      var repeatCount = Math.ceil(containerSize / totalSize) + 3;
160      var originals = Array.from(row.children);
161      for (var c = 0; c < repeatCount; c++) {
162        for (var j = 0; j < originals.length; j++) {
163          row.appendChild(originals[j].cloneNode(true));
164        }
165      }
166      var pos = (direction === "right" || direction === "down") ? -totalSize : 0;
167      pos = clampLoopPos(pos, totalSize, direction);
168      var paused = false;
169      if (pauseOnHover) {
170        row.addEventListener("mouseenter", function () { paused = true; });
171        row.addEventListener("mouseleave", function () { paused = false; });
172      }
173      var isDragging = false;
174      var start = 0;
175      var startPos = 0;
176      function getPoint(e) {
177        if (e.touches && e.touches[0]) return { x: e.touches[0].clientX, y: e.touches[0].clientY };
178        return { x: e.clientX, y: e.clientY };
179      }
180      function applyTransform() {
181        row.style.transform = isHorizontal
182          ? "translateX(" + pos + "px)"
183          : "translateY(" + pos + "px)";
184      }
185
186      if (draggable) {
187        function dragStart(e) {
188          if (e.type === "mousedown" && e.button !== 0) return;
189          isDragging = true;
190          paused = true;
191          var p = getPoint(e);
192          start = isHorizontal ? p.x : p.y;
193          startPos = pos;
194          container.style.cursor = "grabbing";
195        }
196
197        function dragMove(e) {
198          if (!isDragging) return;
199          if (e.cancelable) e.preventDefault();
200          var p = getPoint(e);
201          var current = isHorizontal ? p.x : p.y;
202          pos = startPos + (current - start);
203          pos = clampLoopPos(pos, totalSize, direction);
204          applyTransform();
205        }
206
207        function dragEnd() {
208          if (!isDragging) return;
209          isDragging = false;
210          paused = false;
211          container.style.cursor = "grab";
212        }
213
214        row.addEventListener("mousedown", dragStart);
215        row.addEventListener("touchstart", dragStart, { passive: true });
216        document.addEventListener("mousemove", dragMove);
217        document.addEventListener("touchmove", dragMove, { passive: false });
218        document.addEventListener("mouseup", dragEnd);
219        document.addEventListener("touchend", dragEnd);
220        document.addEventListener("touchcancel", dragEnd);
221      }
222      function step() {
223        if (!paused && !isDragging) {
224          pos += speed * sign;
225          pos = clampLoopPos(pos, totalSize, direction);
226        }
227        applyTransform();
228        requestAnimationFrame(step);
229      }
230      applyTransform();
231      step();
232    });
233  }
234  function autoInit() {
235    var list = document.querySelectorAll(".Seamless_scrolling");
236    Array.from(list).forEach(function (el) {
237      initSeamlessScroll(el);
238    });
239  }
240  if (document.readyState === "loading") {
241    document.addEventListener("DOMContentLoaded", autoInit);
242  } else {
243    autoInit();
244  }
245})();
246
247  //智慧客服图标位置移动 
248  (function () { const $icon = $('#myIcon'); const iconId = 'smartIconPos'; const directionLock = 'both'; const snapPadding = 25; const saved = localStorage.getItem(iconId); if (saved) { const pos = JSON.parse(saved); $icon.css({ left: pos.left, top: pos.top }); } else { $icon.css({ left: '100px', top: '100px' }); } $(document).on('mousedown touchstart', '.smartIcon', function (e) { if (e.type === 'touchstart' && e.originalEvent.touches.length !== 1) return; e.preventDefault(); const $el = $(this); const evt = e.type === 'touchstart' ? e.originalEvent.touches[0] : e; let startX = evt.clientX; let startY = evt.clientY; const startLeft = parseInt($el.css('left')) || 0; const startTop = parseInt($el.css('top')) || 0; const winW = window.innerWidth; const winH = window.innerHeight; const elW = $el.outerWidth(); const elH = $el.outerHeight(); let isDragging = false; let animId; function preventScroll(ev) { if (isDragging) ev.preventDefault(); } document.addEventListener('touchmove', preventScroll, { passive: false }); const drag = e => { const ev = e.type === 'touchmove' ? e.originalEvent.touches[0] : e; const dx = ev.clientX - startX; const dy = ev.clientY - startY; if (!isDragging && Math.abs(dx) + Math.abs(dy) > 5) { isDragging = true; $el.addClass('being-dragged').css('transition', 'none'); $('body').addClass('no-scroll'); } if (!isDragging) return; if (animId) cancelAnimationFrame(animId); animId = requestAnimationFrame(() => { let newLeft = startLeft + dx; let newTop = startTop + dy; newLeft = Math.max(0, Math.min(winW - elW, newLeft)); newTop = Math.max(0, Math.min(winH - elH, newTop)); if (directionLock === 'horizontal') { $el.css({ left: newLeft }); } else if (directionLock === 'vertical') { $el.css({ top: newTop }); } else { $el.css({ left: newLeft, top: newTop }); } }); }; const stop = () => { if (animId) cancelAnimationFrame(animId); $(window).off('.smartIconDrag'); $(document).off('.smartIconDrag'); document.removeEventListener('touchmove', preventScroll); if (isDragging) { const l = parseInt($el.css('left')) || 0; const t = parseInt($el.css('top')) || 0; const snapLeft = l < (winW / 2 - elW / 2) ? snapPadding : winW - elW - snapPadding; $el.css({ left: snapLeft, transition: 'all 0.3s' }); localStorage.setItem(iconId, JSON.stringify({ left: snapLeft + 'px', top: t + 'px' })); setTimeout(() => $el.removeClass('being-dragged'), 100); $el.data('wasDragged', true); } isDragging = false; $('body').removeClass('no-scroll'); }; $(window).on('mousemove.smartIconDrag touchmove.smartIconDrag', drag); $(window).on('mouseup.smartIconDrag touchend.smartIconDrag', stop); $(document).on('keydown.smartIconDrag', e => { if (e.key === 'Escape') stop(); }); }); $(document).on('click', '.smartIcon', function (e) { if ($(this).data('wasDragged')) { e.preventDefault(); e.stopImmediatePropagation(); $(this).removeData('wasDragged'); return false; } }); })();
249
250
251  //循环体没有内容时
252  const Empty_Container = document.querySelector('#Empty_Container .Global-right');
253  if (Empty_Container) { const t = Empty_Container.textContent.trim(); if (t) document.querySelectorAll('.p_nodata, .pl_empty').forEach(e => { const d = e.querySelector('div:first-child'); d && d.remove(); const b = document.createElement('blank'); b.className = 'No-box'; const i = document.createElement('div'); i.className = 'icon-box'; i.innerHTML = `<svg t="1750770104616" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7283" width="160" height="160"><path d="M457 335.8v165.6l397.7 1.1V372.8z" fill="#CBCBCB" p-id="7284"></path><path d="M457 335.8V485l-321.5-32.7v-46.8z" fill="#B9B9B9" p-id="7285"></path><path d="M136.6 405.5v432.6l380.3 76.3V442.5z" fill="#D3D3D3" p-id="7286"></path><path d="M136.6 405.5l-74 160.4 380.3 76.3 74-199.7z" fill="#E9E9E9" p-id="7287"></path><path d="M855.8 375v432.6L516.9 914.4V442.5z" fill="#C9C9C9" p-id="7288"></path><path d="M855.8 375l103.5 168.8-338.8 106.8-103.6-208.1z" fill="#DDDDDD" p-id="7289"></path><path d="M618.8 90.7l53.1-19.5-4.7 89.8-30.6 8.9zM688.5 176.6l17.7 13.6L789 92.6l-61.5-29.2zM752.7 215.9l11.4 31.6 95.3-31.6-10.9-63.2z" fill="#E9E9E9" p-id="7290"></path></svg>`; const n = document.createElement('div'); n.className = 'No-words'; const p = document.createElement('p'); p.className = 'text-No'; p.textContent = t; n.appendChild(p); b.appendChild(i); b.appendChild(n); e.appendChild(b); }); }
254
255
256  //循环体翻页回弹顶部
257  (function () { var OFFSET = 150; function scrollListToOffset(listEl) { if (!listEl) return; var rect = listEl.getBoundingClientRect(); var targetTop = rect.top + window.pageYOffset - OFFSET; window.scrollTo({ top: targetTop, behavior: 'smooth' }); } document.addEventListener('click', function (e) { var btn = e.target.closest('.p_page .page_a'); if (!btn) return; var href = btn.getAttribute('href') || ''; if (!/^javascript:/i.test(href)) return; var pageBox = btn.closest('.p_page'); if (!pageBox) return; var wrapper = pageBox.parentElement; if (!wrapper) return; var listEl = wrapper.querySelector('.p_list'); if (!listEl) return; scrollListToOffset(listEl); }); })();
258
259  // 在线客服添加返回顶部
260  const $backToTop = $('<div id="backToTop" class="item_con clearfix"><div class="service_item"><p class="service_icon"><svg t="1750506118559" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5522" width="200" height="200"><path d="M921.395 76.762h-818.79c-20.982 0-38.381-17.4-38.381-38.381S81.624 0 102.604 0h818.791c20.982 0 38.381 17.4 38.381 38.38s-17.4 38.382-38.38 38.382zM673.2 1024H355.918c-16.376 0-31.728-6.14-43.498-17.911s-17.911-27.122-17.911-43.498V660.66H139.962c-16.376 0-31.728-6.14-43.498-17.91s-17.911-27.123-17.911-43.499c0-15.352 5.629-30.193 16.376-41.45l372.038-405.814c11.258-12.282 26.098-18.935 42.474-19.958 16.376-0.512 32.24 5.117 44.01 15.864l2.559 2.559 373.573 406.836c11.259 12.282 16.888 27.635 15.864 44.01-0.511 16.376-7.676 31.728-19.958 42.475-11.258 10.235-26.099 16.376-41.451 16.376h-149.43v301.929c0 16.376-6.14 31.728-17.91 43.498-11.77 12.282-27.123 18.423-43.499 18.423zM371.27 947.238h286.577V583.9H849.24L512 216.468 174.76 583.9h196.51v363.338z" p-id="5523"></path></svg></p></div></div>');
261  function isShowBackToTopConditionMet() { return !!document.querySelector("#Top_up .Global-right"); } function bindBackToTopClick() { $backToTop.off("click").on("click", () => { if (window._smoothScrollState && typeof window._smoothScrollState.i === "function") { const state = window._smoothScrollState; state.t = 0; if (!state.o) { state.o = true; requestAnimationFrame(state.i); } } else { window.scrollTo({ top: 0, behavior: 'smooth' }); } }); } function insertBackToTopButton() { if (!isShowBackToTopConditionMet()) return false; const $group = $(".pl_service4 .service_group").last(); if ($group.length && !$group.find("#backToTop").length) { $group.append($backToTop); bindBackToTopClick(); return true; } return false; } if (!insertBackToTopButton()) { const observer = new MutationObserver(() => { insertBackToTopButton() && observer.disconnect(); }); observer.observe(document.body, { childList: true, subtree: true }); } if (window.innerWidth < 768 && isShowBackToTopConditionMet()) { if (!$('#backToTop').length) { $('body').append($backToTop); bindBackToTopClick(); } }
262
263  //在线客服4样式切换
264  const serviceClassMap = { "1": "Service1", "2": "Service2", "3": "Service3" }; const getCurrentServiceClassKey = () => { const el = document.querySelector('#Right_Service .Global-right'); if (!el) return null; const val = el.textContent.trim(); return serviceClassMap.hasOwnProperty(val) ? val : null; }; const ServiceObserver = new MutationObserver((mutationsList) => { const currentKey = getCurrentServiceClassKey(); if (!currentKey) return; mutationsList.forEach((mutation) => { if (mutation.type === "childList") { mutation.addedNodes.forEac
264h((node) => { if (node instanceof Element) { const targetElements = node.matches(".pl_service4") ? [node] : Array.from(node.querySelectorAll(".pl_service4")); targetElements.forEach((element) => { element.classList.add(serviceClassMap[currentKey]); }); } }); } }); }); ServiceObserver.observe(document.body, { childList: true, subtree: true }); function updateServiceClassFromDom() { const key = getCurrentServiceClassKey(); } updateServiceClassFromDom();
265
266
267  // 导航栏控制下拉加类名
268  const updateFirstDiv = () => { if (!document.querySelector("#Navigation_Class .Global-right")) return; const e = document.querySelector(".main>div:first-child"); e && e.classList.toggle("active", window.scrollY > 50) }; window.addEventListener("scroll", updateFirstDiv), window.addEventListener("load", updateFirstDiv), updateFirstDiv();
269
270
271  //禁止全站的文字复制和图片下载
272  if (document.querySelector('#Prohibit_Copy .Global-right')) { document.oncontextmenu = document.oncut = document.onpaste = () => !1; document.addEventListener("selectstart", e => { const t = e.target?.closest?.("a[href],.copy-ok"); t || e.preventDefault() }); document.oncopy = e => { const s = window.getSelection(), n = s?.anchorNode; if (n) { const el = n.nodeType === 3 ? n.parentElement : n, r = el?.closest?.('a[href],.copy-ok'); if (r) return !0 } e.preventDefault(); return !1 }; $(document).on("dragstart", e => "IMG" === e.target.nodeName && e.preventDefault()); $(document).on("touchstart", e => "IMG" === e.target.tagName && e.preventDefault()) }
273
274  //图片alt标题设置
275  document.addEventListener("DOMContentLoaded", () => { const src = document.querySelector("#Image_Keywords .Global-right"); if (!src) return; const keyword = src.textContent.trim(); if (!keyword) return; document.querySelectorAll("img").forEach(img => { const alt = img.getAttribute("alt")?.trim() ?? ""; const title = img.getAttribute("title")?.trim() ?? ""; const altInvalid = !alt || alt === "图片名称"; const titleInvalid = !title || title === "图片名称"; if (altInvalid) { img.setAttribute("alt", keyword); } if (titleInvalid) { if (!altInvalid) { img.setAttribute("title", alt); } else { img.setAttribute("title", keyword); } } }); });
276
277  //屏蔽页面上图片的alt/title提示
278  document.addEventListener('DOMContentLoaded', () => { const e = document.querySelector('#Shield_alt .Global-right'); if (!e) return; const imgs = document.querySelectorAll('img'); imgs.forEach(img => { let originalTitle = img.getAttribute('title'); img.addEventListener('mouseenter', () => { if (img.hasAttribute('title')) { originalTitle = img.getAttribute('title'); img.removeAttribute('title'); } }); img.addEventListener('mouseleave', () => { if (originalTitle) { img.setAttribute('title', originalTitle); } }); }); });
279
280  //页面顺滑的滚动
281  if (document.querySelector('#Smooth_Scrolling .Global-right')) { const box = document.querySelector('#Smooth_Scrolling .Global-right'); let t = scrollY, n = scrollY, o = false, k = Math.max(.01, Math.min(parseFloat(box.dataset.smooth) || .05, 1)); const mapSel = ['#baiduMap', '.BMap_mask', '.BMap_noprint'], inMap = e => mapSel.some(s => e.target.closest && e.target.closest(s)); const scEl = () => document.scrollingElement || document.documentElement; const canScroll = (el, dy) => { if (!el || el === document.body || el === document.documentElement) return false; const st = el.scrollTop, sh = el.scrollHeight, ch = el.clientHeight; if (sh <= ch + 1) return false; return dy > 0 ? st + ch < sh - 1 : st > 0; }; const findScrollable = (e, dy) => { for (let el = e.target; el && el !== document.body && el !== document.documentElement; el = el.parentElement) { const s = getComputedStyle(el); if (!/(auto|scroll)/.test(s.overflowY)) continue; if (canScroll(el, dy)) return el; } return null; }; const step = () => { const d = t - n; n += d * k; scrollTo(0, n); Math.abs(d) > .5 ? requestAnimationFrame(step) : (n = t, o = false); }; addEventListener('wheel', e => { if (e.ctrlKey || inMap(e)) return; if (findScrollable(e, e.deltaY)) return;
281 const se = scEl(), m = se.scrollHeight - innerHeight; t = Math.max(0, Math.min(t + e.deltaY, m)); if (!o) { o = true; requestAnimationFrame(step); } e.preventDefault(); }, { passive: false }); addEventListener('scroll', () => { if (!o) t = n = scrollY; }); addEventListener('load', () => t = n = scrollY); addEventListener('resize', () => { const se = scEl(), m = se.scrollHeight - innerHeight; t = Math.min(t, m); }); }
282
283
284
285  //屏蔽手机端访问
286  if (document.querySelector('#Block_Mobile .Global-right') && /Android|iPhone|iPad|iPod|Windows Phone/i.test(navigator.userAgent)) { document.body.innerHTML = '<div style="display:flex;justify-content:center;align-items:center;height:100vh;font-size:1.5rem;padding:20px;box-sizing:border-box;text-align:center;background:#f5f5f5;color:#333;">为了效果更好,请采用电脑端进行预览</div>'; document.body.style.margin = 0; document.body.style.overflow = 'hidden' }
287
288
289
290  //移除客服热线设置
291  const observer = new MutationObserver((mutations) => { const targets = document.querySelectorAll('.pl_service4 > .item_con.clearfix'); if (targets.length) { targets.forEach(el => el.remove()); observer.disconnect(); } }); observer.observe(document.body, { childList: true, subtree: true });
292
293
294  //开启在线客服名称
295  var syncObserver = new MutationObserver(() => { const names = document.querySelectorAll('#Service_box .Service_name'); const items = document.querySelectorAll('.pl_service4 .item_con'); if (!names.length || !items.length) return; names.forEach((nameEl, i) => { const item = items[i]; if (!item) return; const target = item.querySelector('.p_doThirdFunc'); if (!target) return; if (target.dataset.synced === "1") return; const labelHtml = nameEl.innerHTML.trim(); if (!labelHtml) return; const existText = (target.firstChild?.textContent || "").replace(/\s+/g, ''); const newText = nameEl.textContent.replace(/\s+/g, ''); if (existText === newText) { target.dataset.synced = "1"; return; } target.insertAdjacentHTML('afterbegin', labelHtml); target.dataset.synced = "1"; }); syncObserver.disconnect(); }); syncObserver.observe(document.body, { childList: true, subtree: true });
296
297  const serviceObserver = new MutationObserver(() => { document.querySelectorAll('.service_group .service_item').forEach(item => { if (item.dataset.svgLinked === '1') return; const linkEl = item.querySelector('.service_value a'); const svg = item.querySelector('.service_icon svg'); if (!linkEl || !svg) return; const href = linkEl.getAttribute('href') || '#'; const target = linkEl.getAttribute('target') || '_self'; const a = document.createElement('a'); a.href = href; a.target = target; svg.replaceWith(a); a.appendChild(svg); item.dataset.svgLinked = '1'; }); }); serviceObserver.observe(document.body, { childList: true, subtree: true });
298
299
300  //手风琴效果
301  function setupAccordion(c) { const i = c.children, t = i.length, e = parseFloat(c.dataset.openWidth || "60"), n = parseInt(c.dataset.openIndex || "0"), r = t > 1 ? (100 - e) / (t - 1) : 0, s = c.dataset.swiperOpen; if (s) { const t = window.innerWidth, o = t < 768 ? "mo" : t < 1025 ? "ipad" : "pc"; if (s.split(/[\s,]+/).includes(o)) return; } function a(n) { Array.from(i).forEach((t, o) => { t.style.flex = o === n ? e : r; t.classList.toggle("active", o === n); }); } a(n); Array.from(i).forEach((t, e) => { t.addEventListener("mouseenter", () => { c.dataset.openIndex = e; a(e); }); }); } document.addEventListener("DOMContentLoaded", () => { document.querySelectorAll(".accordion").forEach(setupAccordion); });
302
303  //表格响应式
304  document.querySelectorAll('.Table_Adaptation').forEach(root => { root.querySelectorAll('table').forEach(table => { if (table.parentElement?.classList.contains('table-scroll')) return; const wrap = document.createElement('div'); wrap.className = 'table-scroll'; table.replaceWith(wrap); wrap.appendChild(table); }); });
305
306  //可视化排版的FAQ
307  document.addEventListener('click', e => { const q = e.target.closest('.v-faq-q'); if (!q) return; const item = q.parentElement; item.classList.toggle('open'); const tg = q.querySelector('.v-faq-toggle'); if (tg) tg.textContent = item.classList.contains('open') ? '−' : '+'; });
308
309  document.addEventListener('DOMContentLoaded', () => { document.querySelectorAll('.faq-item .faq-question').forEach(q => { q.addEventListener('click', (e) => { e.preventDefault(); const item = q.closest('.faq-item'); if (!item) return; item.classList.toggle('is-open'); }); }); });
310
311
312  //图片点击放大 swiper切换
313  (function () { const popupHTML = ` <div class="modelTost"> <div class="modelTostChile Printing"> <span class="modelClose">×</span> <div class="swiper-container mainSwiper"> <div class="swiper-wrapper"></div> <div class="swiper-button-next"></div> <div class="swiper-button-prev"></div> </div> <div class="swiper-container thumbSwiper"> <div class="swiper-wrapper"></div> </div> </div> </div>`; let mainSwiper = null, thumbSwiper = null; function cleanSrc(src) { if (!src) return ''; return src.replace(/(_\d+x[^.]+)?\.(png|jpe?g|webp)$/i, '.$2').replace(/\.(png|jpe?g|webp)\.\1$/i, '.$1'); } function closePopup() { if (mainSwiper) { mainSwiper.destroy(true, true); mainSwiper = null; } if (thumbSwiper) { thumbSwiper.destroy(true, true); thumbSwiper = null; } const $modal = $(".modelTost"); $modal.find(".modelTostChile").css({ animation: "modelTost_zoomOut 0.2s ease forwards" }); $modal.css({ animation: "modelTost_fadeOut 0.2s ease forwards" }); setTimeout(() => { $modal.remove(); $(document).off("keydown.modelTostKey"); }, 200); } $(document).on("click", ".modelTostParents img", function () { const $parent = $(this).closest(".modelTostParents"); if (!$parent.length) return; const images = $parent.find("img").map((_, el) => cleanSrc($(el).attr("src"))).get(); const clickedSrc = cleanSrc($(this).attr("src")); const activeIndex = images.indexOf(clickedSrc); $(".modelTost").remove(); $("body").append(popupHTML); const $mainWrapper = $(".mainSwiper .swiper-wrapper").empty(); const $thumbWrapper = $(".thumbSwiper .swiper-wrapper").empty(); images.forEach(src => { $mainWrapper.append(` <div class="swiper-slide"> <img src="${src}" style="max-width:100%;max-height:100%;object-fit:contain;" /> </div>`); $thumbWrapper.append(` <div class="swiper-slide" style="width:auto;cursor:pointer;"> <img src="${src}" style="height:100%;object-fit:cover;border:2px solid transparent;" /> </div>`); }); thumbSwiper = new Swiper(".thumbSwiper", { spaceBetween: 10, slidesPerView: "auto", freeMode: true, watchSlidesProgress: true }); mainSwiper = new Swiper(".mainSwiper", { initialSlide: activeIndex >= 0 ? activeIndex : 0, navigation: { nextEl: ".swiper-button-next", prevEl: ".swiper-button-prev" }, slidesPerView: 1, loop: true, observer: true, observeParents: true, thumbs: { swiper: thumbSwiper } }); $(document).on("keydown.modelTostKey", function (e) { if (!mainSwiper) return; if (e.key === "ArrowLeft") mainSwiper.slidePrev(); else if (e.key === "ArrowRight") mainSwiper.slideNext(); else if (e.key === "Escape") closePopup(); }); }); $(document).on("click", ".modelTost .modelClose", closePopup); $(document).on("click", ".modelTost", function (e) { if ($(e.target).hasClass("modelTost")) closePopup(); }); })();
314
315
316  //邮箱自动补充和号码区号下拉
317  document.addEventListener("DOMContentLoaded", function () { const d = ['gmail.com', 'outlook.com', 'hotmail.com', 'live.com', 'yahoo.com', 'icloud.com', 'aol.com', 'protonmail.com', 'zoho.com', 'yandex.com', 'mail.ru']; document.querySelectorAll('.clueEmail').forEach(function (i) { const l = i.parentNode.querySelector('.emailSuggestList'); init(i, l); }); function init(i, l) { let a = -1; i.addEventListener('focus', function () { if (i.value.trim() === '') { hide(); } else { onInput(); } }); i.addEventListener('input', onInput); i.addEventListener('keydown', function (e) { const items = l.querySelectorAll('li'); if (l.style.display !== 'block') return; if (e.key === 'ArrowDown') { a = (a + 1) % items.length; setActive(items); e.preventDefault(); } else if (e.key === 'ArrowUp') { a = (a - 1 + items.length) % items.length; setActive(items); e.preventDefault(); } else if (e.key === 'Enter') { if (a >= 0 && items[a]) { i.value = items[a].dataset.value; hide(); e.preventDefault(); } } }); i.addEventListener('blur', () => setTimeout(hide, 200)); function onInput() { const v = i.value.trim(); if (v === '') { hide(); return; } const at = v.indexOf('@'); let pre = v, dom = ''; if (at !== -1) { pre = v.slice(0, at); dom = v.slice(at + 1).toLowerCase(); } const m = d.filter(x => x.indexOf(dom) === 0).map(x => pre + '@' + x); if (m.length > 0 && pre.length > 0) { render(m); } else { hide(); } } function render(emails) { l.innerHTML = ''; l.style.display = 'block'; l.style.width = i.offsetWidth + 'px'; a = -1;
317 emails.forEach(function (em, j) { var li = document.createElement('li'); var p = em.split('@'); li.innerHTML = '<span class="email-name">' + p[0] + '</span><span class="email-domain">@' + p[1] + '</span>'; li.setAttribute('data-index', j); li.setAttribute('data-value', em); li.addEventListener('mousedown', function () { i.value = em; hide(); }); l.appendChild(li); }); } function setActive(items) { for (var i = 0; i < items.length; i++) items[i].classList.remove('active'); if (items[a]) { items[a].classList.add('active'); scrollIntoView(items[a]); } } function scrollIntoView(item) { var p = item.parentNode, pr = p.getBoundingClientRect(), ir = item.getBoundingClientRect(); if (ir.bottom > pr.bottom) p.scrollTop += ir.bottom - pr.bottom; else if (ir.top < pr.top) p.scrollTop -= pr.top - ir.top; } function hide() { l.style.display = 'none'; l.innerHTML = ''; a = -1; } } document.querySelectorAll('.p_phoneCode').forEach(c => { const e = c.querySelector('.dialInput'), cl = c.querySelector('.p_codeList'), hd = c.querySelector('input[name="phoneDail"]'), hi = c.querySelector('input[name="phoneIso"]'), ds = c.querySelector('.control_Naner'); if (!e || !cl || !ds) return; let uc = false; const rd = () => { const v = ds.textContent.trim(); e.value = v; hd.value = v; hi.value = ''; }; e.addEventListener('focus', () => { cl.classList.add('active'); uc = false; }); e.addEventListener('blur', () => { setTimeout(() => { cl.classList.remove('active'); const vi = [...cl.querySelectorAll('.p_codeItem')].filter(x => x.style.display !== 'none'); if (!uc) { if (vi.length === 1) vi[0].click(); else rd(); } }, 200); }); e.addEventListener('input', () => { const v = e.value.trim().replace('+', ''); cl.querySelectorAll('.p_codeItem').forEach(x => { const d = x.querySelector('.p_enDial')?.textContent?.trim().replace('+', '') || ''; x.style.display = d.startsWith(v) ? '' : 'none'; }); }); cl.addEventListener('click', ev => { const t = ev.target.closest('.p_codeItem'); if (!t) return; const d = t.getAttribute('data-dial') || t.querySelector('.p_enDial')?.textContent.trim() || '', iso = t.getAttribute('data-iso') || ''; e.value = d; hd.value = d; hi.value = iso; cl.querySelectorAll('.p_codeItem').forEach(x => x.style.display = ''); cl.classList.remove('active'); e.blur(); uc = true; }); }); });
318
319})();
320
321//数字滚动
322(function () {
323  const els = document.querySelectorAll('.Nameu'); if (!els.length) return; const DEFAULT_DURATION = 2000; const easeOutCubic = x => 1 - Math.pow(1 - x, 3); const getDecimalsFromText = s => { const m = String(s).trim().match(/\.(\d+)\b/); return m ? m[1].length : 0; }; function splitAffixes(text) { let s = String(text ?? '').trim(); if (!s) return null; const m = s.match(/^([^0-9+\-]*)([+\-]?\d[\d,\s]*(?:\.\d+)?)([^0-9]*)$/); if (!m) return null; let pre = m[1] || ''; let num = m[2] || ''; let suf = m[3] || ''; const cleanNum = num.replace(/[\s,]/g, ''); if (!/^[+\-]?\d+(?:\.\d+)?$/.test(cleanNum)) return null; return { pre, num: cleanNum, suf }; } function ensureParts(host) { if (host.__partsReady) return host.__parts; const raw = host.dataset.value ?? host.textContent.trim(); const parts = splitAffixes(raw); if (!parts) { host.dataset.value = raw; host.__partsReady = true; host.__parts = { numEl: host, preEl: null, sufEl: null, raw, pre: '', suf: '' }; return host.__parts; } host.dataset.value = parts.num; host.textContent = ''; let preEl = null, sufEl = null; const numEl = document.createElement('span'); numEl.className = 'c-num'; numEl.textContent = parts.num; if (parts.pre) { preEl = document.createElement('span'); preEl.className = 'c-pre'; preEl.textContent = parts.pre; host.appendChild(preEl); } host.appendChild(numEl); if (parts.suf) { sufEl = document.createElement('span'); sufEl.className = 'c-suf'; sufEl.textContent = parts.suf; host.appendChild(sufEl); } host.__partsReady = true; host.__parts = { numEl, preEl, sufEl, raw, pre: parts.pre, suf: parts.suf }; return host.__parts; } function animateCount(host) { const { numEl } = ensureParts(host); if (numEl.__counting || numEl.__done) return; numEl.__counting = true; const rawNum = host.dataset.value ?? numEl.textContent.trim(); const finalValue = parseFloat(rawNum); if (!Number.isFinite(finalValue)) { numEl.__counting = false; return; } const duration = parseInt(host.dataset.duration || DEFAULT_DURATION, 10); const decimals = parseInt(host.dataset.decimals ?? getDecimalsFromText(rawNum), 10); const startTime = performance.now(); function update(now) { const d = duration > 0 ? duration : 1; const t = Math.min((now - startTime) / d, 1); const p = easeOutCubic(t); numEl.textContent = (finalValue * p).toFixed(decimals); if (t < 1) requestAnimationFrame(update); else { numEl.textContent = Number(finalValue).toFixed(decimals); numEl.__done = true; numEl.__counting = false; } } requestAnimationFrame(update); } const io = new IntersectionObserver((entries) =>
323 { entries.forEach(entry => { if (!entry.isIntersecting) return; animateCount(entry.target); io.unobserve(entry.target); }); }, { threshold: 0.2 }); els.forEach(host => { const { numEl } = ensureParts(host); const rawNum = host.dataset.value ?? numEl.textContent.trim(); const decimals = parseInt(host.dataset.decimals ?? getDecimalsFromText(rawNum), 10); numEl.textContent = (0).toFixed(decimals); io.observe(host); });
324})();
325
326
327
328
329/*全局动画*/
330(function () { var a, b, c, d, e, f = function (a, b) { return function () { return a.apply(b, arguments) } }, g = [].indexOf || function (a) { for (var b = 0, c = this.length; c > b; b++)if (b in this && this[b] === a) return b; return -1 }; b = function () { function a() { } return a.prototype.extend = function (a, b) { var c, d; for (c in b) d = b[c], null == a[c] && (a[c] = d); return a }, a.prototype.isMobile = function (a) { return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(a) }, a.prototype.createEvent = function (a, b, c, d) { var e; return null == b && (b = !1), null == c && (c = !1), null == d && (d = null), null != document.createEvent ? (e = document.createEvent("CustomEvent"), e.initCustomEvent(a, b, c, d)) : null != document.createEventObject ? (e = document.createEventObject(), e.eventType = a) : e.eventName = a, e }, a.prototype.emitEvent = function (a, b) { return null != a.dispatchEvent ? a.dispatchEvent(b) : b in (null != a) ? a[b]() : "on" + b in (null != a) ? a["on" + b]() : void 0 }, a.prototype.addEvent = function (a, b, c) { return null != a.addEventListener ? a.addEventListener(b, c, !1) : null != a.attachEvent ? a.attachEvent("on" + b, c) : a[b] = c }, a.prototype.removeEvent = function (a, b, c) { return null != a.removeEventListener ? a.removeEventListener(b, c, !1) : null != a.detachEvent ? a.detachEvent("on" + b, c) : delete a[b] }
vendor: 5,911 bytes, line 330
330, a.prototype.innerHeight = function () { return "innerHeight" in window ? window.innerHeight : document.documentElement.clientHeight }, a }(), c = this.WeakMap || this.MozWeakMap || (c = function () { function a() { this.keys = [], this.values = [] } return a.prototype.get = function (a) { var b, c, d, e, f; for (f = this.keys, b = d = 0, e = f.length; e > d; b = ++d)if (c = f[b], c === a) return this.values[b] }, a.prototype.set = function (a, b) { var c, d, e, f, g; for (g = this.keys, c = e = 0, f = g.length; f > e; c = ++e)if (d = g[c], d === a) return void (this.values[c] = b); return this.keys.push(a), this.values.push(b) }, a }()), a = this.MutationObserver || this.WebkitMutationObserver || this.MozMutationObserver || (a = function () { function a() { "undefined" != typeof console && null !== console && console.warn("MutationObserver is not supported by your browser."), "undefined" != typeof console && null !== console && console.warn("WOW.js cannot detect dom mutations, please call .sync() after loading new content.") } return a.notSupported = !0, a.prototype.observe = function () { }, a }()), d = this.getComputedStyle || function (a) { return this.getPropertyValue = function (b) { var c; return "float" === b && (b = "styleFloat"), e.test(b) && b.replace(e, function (a, b) { return b.toUpperCase() }), (null != (c = a.currentStyle) ? c[b] : void 0) || null }, this }, e = /(\-([a-z]){1})/g, this.WOW = function () { function e(a) { null == a && (a = {}), this.scrollCallback = f(this.scrollCallback, this), this.scrollHandler = f(this.scrollHandler, this), this.resetAnimation = f(this.resetAnimation, this), this.start = f(this.start, this), this.scrolled = !0, this.config = this.util().extend(a, this.defaults), this.animationNameCache = new c, this.wowEvent = this.util().createEvent(this.config.boxClass) } return e.prototype.defaults = { boxClass: "wow", animateClass: "animated", offset: 0, mobile: !0, live: !0, callback: null }, e.prototype.init = function () { var a; return this.element = window.document.documentElement, "interactive" === (a = document.readyState) || "complete" === a ? this.start() : this.util().addEvent(document, "DOMContentLoaded", this.start), this.finished = [] }, e.prototype.start = function () { var b, c, d, e; if (this.stopped = !1, this.boxes = function () { var a, c, d, e; for (d = this.element.querySelectorAll("." + this.config.boxClass), e = [], a = 0, c = d.length; c > a; a++)b = d[a], e.push(b); return e }.call(this), this.all = function () { var a, c, d, e; for (d = this.boxes, e = [], a = 0, c = d.length; c > a; a++)b = d[a], e.push(b); return e }.call(this), this.boxes.length) if (this.disabled()) this.resetStyle(); else for (e = this.boxes, c = 0, d = e.length; d > c; c++)b = e[c], this.applyStyle(b, !0); return this.disabled() || (this.util().addEvent(window, "scroll", this.scrollHandler), this.util().addEvent(window, "resize", this.scrollHandler), this.interval = setInterval(this.scrollCallback, 50)), this.config.live ? new a(function (a) { return function (b) { var c, d, e, f, g; for (g = [], c = 0, d = b.length; d > c; c++)f = b[c], g.push(function () { var a, b, c, d; for (c = f.addedNodes || [], d = [], a = 0, b = c.length; b > a; a++)e = c[a], d.push(this.doSync(e)); return d }.call(a)); return g } }(this)).observe(document.body, { childList: !0, subtree: !0 }) : void 0 }, e.prototype.stop = function () { return this.stopped = !0, this.util().removeEvent(window, "scroll", this.scrollHandler), this.util().removeEvent(window, "resize", this.scrollHandler), null != this.interval ? clearInterval(this.interval) : void 0 }, e.prototype.sync = function () { return a.notSupported ? this.doSync(this.element) : void 0 }, e.prototype.doSync = function (a) { var b, c, d, e, f; if (null == a && (a = this.element), 1 === a.nodeType) { for (a = a.parentNode || a, e = a.querySelectorAll("." + this.config.boxClass), f = [], c = 0, d = e.length; d > c; c++)b = e[c], g.call(this.all, b) < 0 ? (this.boxes.push(b), this.all.push(b), this.stopped || this.disabled() ? this.resetStyle() : this.applyStyle(b, !0), f.push(this.scrolled = !0)) : f.push(void 0); return f } }, e.prototype.show = function (a) { return this.applyStyle(a), a.className = a.className + " " + this.config.animateClass, null != this.config.callback && this.config.callback(a), this.util().emitEvent(a, this.wowEvent), this.util().addEvent(a, "animationend", this.resetAnimation), this.util().addEvent(a, "oanimationend", this.resetAnimation), this.util().addEvent(a, "webkitAnimationEnd", this.resetAnimation), this.util().addEvent(a, "MSAnimationEnd", this.resetAnimation), a }, e.prototype.applyStyle = function (a, b) { var c, d, e; return d = a.getAttribute("data-wow-duration"), c = a.getAttribute("data-wow-delay"), e = a.getAttribute("data-wow-iteration"), this.animate(function (f) { return function () { return f.customStyle(a, b, d, c, e) } }(this)) }, e.prototype.animate = function () { return "requestAnimationFrame" in window ? function (a) { return window.requestAnimationFrame(a) } : function (a) { return a() } }(), e.prototype.resetStyle = function () { var a, b, c, d, e; for (d = this.boxes, e = [], b = 0, c = d.length; c > b; b++)a = d[b], e.push(a.style.visibility = "visible"); return e }, e.prototype.resetAnimation = function (a) { var b; return a.type.toLowerCase().indexOf("animationend") >= 0 ? (b = a.target || a.srcElement, b.className = b.className.replace(this.config.animateClass, "").trim()) : void 0 }, e.prototype.customStyle = function (a, b, c, d, e) { return b && this.cacheAnimationName(a), a.style.visibility = b ? "hidden" : "visible", c && this.vendorSet(a.style, { animationDuration: c }), d && this.vendorSet(a.style, { animationDelay: d }), e && this.vendorSet(a.style, { animationIterationCount: e }), this.vendorSet(a.style, { animationName: b ? "none" : this.cachedAnimationName(a) }), a }
330, e.prototype.vendors = ["moz", "webkit"], e.prototype.vendorSet = function (a, b) { var c, d, e, f; d = []; for (c in b) e = b[c], a["" + c] = e, d.push(function () { var b, d, g, h; for (g = this.vendors, h = [], b = 0, d = g.length; d > b; b++)f = g[b], h.push(a["" + f + c.charAt(0).toUpperCase() + c.substr(1)] = e); return h }.call(this)); return d }, e.prototype.vendorCSS = function (a, b) { var c, e, f, g, h, i; for (h = d(a), g = h.getPropertyCSSValue(b), f = this.vendors, c = 0, e = f.length; e > c; c++)i = f[c], g = g || h.getPropertyCSSValue("-" + i + "-" + b); return g }, e.prototype.animationName = function (a) { var b; try { b = this.vendorCSS(a, "animation-name").cssText } catch (c) { b = d(a).getPropertyValue("animation-name") } return "none" === b ? "" : b }, e.prototype.cacheAnimationName = function (a) { return this.animationNameCache.set(a, this.animationName(a)) }, e.prototype.cachedAnimationName = function (a) { return this.animationNameCache.get(a) }, e.prototype.scrollHandler = function () { return this.scrolled = !0 }, e.prototype.scrollCallback = function () { var a; return !this.scrolled || (this.scrolled = !1, this.boxes = function () { var b, c, d, e; for (d = this.boxes, e = [], b = 0, c = d.length; c > b; b++)a = d[b], a && (this.isVisible(a) ? this.show(a) : e.push(a)); return e }.call(this), this.boxes.length || this.config.live) ? void 0 : this.stop() }, e.prototype.offsetTop = function (a) { for (var b; void 0 === a.offsetTop;)a = a.parentNode; for (b = a.offsetTop; a = a.offsetParent;)b += a.offsetTop; return b }, e.prototype.isVisible = function (a) { var b, c, d, e, f; return c = a.getAttribute("data-wow-offset") || this.config.offset, f = window.pageYOffset, e = f + Math.min(this.element.clientHeight, this.util().innerHeight()) - c, d = this.offsetTop(a), b = d + a.clientHeight, e >= d && b >= f }, e.prototype.util = function () { return null != this._util ? this._util : this._util = new b }, e.prototype.disabled = function () { return !this.config.mobile && this.util().isMobile(navigator.userAgent) }, e }() }).call(this);
331var wow = new WOW({ boxClass: 'wow', animateClass: 'animated', offset: 0, mobile: true }); wow.init();
332
333
334// 获取所有的 class 名包含 e_button, e_text, e_container, p_loopitem, e_image 的元素
335!function () { var e = "#Scroll_Animation .Global-right", t = '[data-wow],[class*="e_button"],[class*="e_text"],[class*="e_container"],[class*="p_loopitem"],[class*="e_image"]'; if (!document.body.__wowEnhancerLive) { function n(e) { return !!(e && 1 === e.nodeType) && !(e.closest && e.closest(".
335no-animate,[data-no-wow=\"true\"]")) && !(e.closest && e.closest('[id^="c_popbox-"]')) } function o(e) { var o = e || document; o.matches && o.matches(t) && n(o) && !o.classList.contains("wow") && o.classList.add("wow", "fadeInUp"), o.querySelectorAll(t).forEach(function (e) { n(e) && !e.classList.contains("wow") && e.classList.add("wow", "fadeInUp") }) } function a() { var e = window.wow; e && "function" == typeof e.init && function () { try { e.init() } catch (e) { } }() } function r() { document.body.__wowEnhancerLive || (document.body.__wowEnhancerLive = !0, o(document), a(), new MutationObserver(function (e) { for (var t = 0; t < e.length; t++)for (var n = e[t].addedNodes || [], a = 0; a < n.length; a++) { var r = n[a]; r && 1 === r.nodeType && o(r) } }).observe(document.body, { childList: !0, subtree: !0 })) } function c() { if (document.querySelector(e)) r(); else { var t = new MutationObserver(function () { document.querySelector(e) && (t.disconnect(), r()) }); t.observe(document.body, { childList: !0, subtree: !0 }) } } "loading" === document.readyState ? document.addEventListener("DOMContentLoaded", c, { once: !0 }) : c() } }();
336
337
338// 基于Swiper 8.4.7和我们封装的自动初始化脚本
339
340
341(function () { function parseBreakpoints(val, type = "slidesPerView") { if (!val) return undefined; if (val.includes("{")) { try { return JSON.parse(val); } catch (e) { return undefined; } } else { const parts = val.split(",").map(p => parseFloat(p.trim()) || 0); if (parts.length < 1) return undefined; const result = {}; const defaults = { slidesPerView: [4, 2, 1], spaceBetween: [10, 10, 10], slidesPerGroup: [1, 1, 1] }; const d = defaults[type] || [1, 1, 1]; result[0] = { [type]: parts[2] ?? d[2] }; result[769] = { [type]: parts[1] ?? d[1] }; result[1025] = { [type]: parts[0] ?? d[0] }; return result; } } function parseResponsiveBool(attrValue, defaultValue = false) { if (attrValue == null) return defaultValue; const screenW = window.innerWidth; const val = attrValue.trim().toLowerCase(); if (val === "true") return true; if (val === "false") return false; const rules = val.split(",").map(r => r.trim()); return ((rules.includes("pc") && screenW >= 1025) || (rules.includes("ipad") && screenW >= 769 && screenW < 1025) || (rules.includes("mo") && screenW < 769)); } function mergeBreakpoints(a = {}, b = {}) { const result = { ...a }; for (const key in b) { result[key] = { ...(result[key] || {}), ...b[key] }; } return result; } function wireThumbAndMain(thumbSwiper, mainSwiper) { if (!thumbSwiper || !mainSwiper) return; const mainRoot = mainSwiper.el.closest('[data-swiper]'); const thumbRoot = thumbSwiper.el.closest('[data-swiper]'); const triggerMode = (thumbRoot?.getAttribute('data-thumb-trigger') || 'click').toLowerCase(); const eventName = triggerMode === 'hover' ? 'mouseenter' : 'click'; const clickSpeed = parseInt(mainRoot?.getAttribute('data-thumb-hover-speed')) || parseInt(mainRoot?.getAttribute('data-speed')) || mainSwiper.params.speed || 300; const followSpeed = parseInt(thumbRoot?.getAttribute('data-thumb-follow-speed')) || parseInt(thumbRoot?.getAttribute('data-speed')) || thumbSwiper.params.speed || 300; if (thumbSwiper.slides && thumbSwiper.slides.length) { thumbSwiper.slides.forEach((slide, index) => { slide.addEventListener(eventName, () => { mainSwiper.slideToLoop(index, clickSpeed); }); }); } function setThumbActive(i) { const total = thumbSwiper.slides.length; if (!total) return; const idx = Math.max(0, Math.min(i, total - 1)); thumbSwiper.slides.forEach(el => el.classList && el.classList.remove('is-active')); const active = thumbSwiper.slides[idx]; if (active && active.classList) active.classList.add('is-active'); } function syncNow(speed) { const i = mainSwiper.realIndex || 0; thumbSwiper.slideTo(i, typeof speed === 'number' ? speed : followSpeed); setThumbActive(i); } mainSwiper.on('slideChange', () => syncNow()); if (mainSwiper.initialized && thumbSwiper.initialized) { setTimeout(() => syncNow(0), 0); } else { mainSwiper.on('afterInit', () => setTimeout(() => syncNow(0), 0)); thumbSwiper.on('afterInit', () => setTimeout(() => syncNow(0), 0)); } } function initSwiperElement(container) { const openRule = (container.getAttribute("data-swiper-open") || "all").toLowerCase(); const screenW = window.innerWidth; const shouldInit = (() => { if (openRule === "all") return true; const rules = openRule.split(",").map(r => r.trim()); return ((rules.includes("pc") && screenW >= 1025) || (rules.includes("ipad") && screenW >= 769 && screenW < 1025) || (rules.includes("mo") && screenW < 769)); })(); if (!shouldInit || container._swiperInitialized) return; container._swiperInitialized = true; container.classList.add("swiper"); const originalChildren = Array.from(container.children); const wrapper = document.createElement("div"); wrapper.className = "swiper-wrapper";
341 originalChildren.forEach(child => { child.classList && child.classList.remove("p_loopitem"); child.classList && child.classList.add("swiper-slide"); wrapper.appendChild(child); }); const inner = document.createElement("div"); inner.className = "swiper-inner"; inner.appendChild(wrapper); container.innerHTML = ""; container.appendChild(inner); const paginationType = (container.getAttribute("data-pagination") || "").toLowerCase(); const hasPagination = paginationType && paginationType !== "false"; const hasNavigation = container.getAttribute("data-navigation") === "true"; let pagEl, prevEl, nextEl; if (hasPagination) { pagEl = document.createElement("div"); pagEl.className = "swiper-pagination"; container.appendChild(pagEl); } if (hasNavigation) { prevEl = document.createElement("div"); nextEl = document.createElement("div"); prevEl.className = "swiper-button-prev"; nextEl.className = "swiper-button-next"; container.appendChild(prevEl); container.appendChild(nextEl); } const bpSlides = parseBreakpoints(container.getAttribute("data-breakpoints"), "slidesPerView"); const bpSpace = parseBreakpoints(container.getAttribute("data-space-between"), "spaceBetween"); const bpGroup = parseBreakpoints(container.getAttribute("data-slides-per-group"), "slidesPerGroup"); const mergedBreakpoints = mergeBreakpoints(mergeBreakpoints(bpSlides, bpSpace), bpGroup); const thumbForSel = container.getAttribute("data-thumb-for"); const isThumbs = !!thumbForSel; const options = { loop: container.getAttribute("data-loop") !== "false", effect: container.getAttribute("data-effect") || "slide", direction: container.getAttribute("data-direction") || "horizontal", speed: parseInt(container.getAttribute("data-speed")) || 300, spaceBetween: container.getAttribute("data-space-between")?.includes(",") ? undefined : parseFloat(container.getAttribute("data-space-between")) || 10, centeredSlides: parseResponsiveBool(container.getAttribute("data-centered-slides"), false), freeMode: container.getAttribute("data-free-mode") === "true", loopedSlides: parseInt(container.getAttribute("data-looped-slides")) || undefined, touchRatio: parseFloat(container.getAttribute("data-touch-ratio")) || 1, slidesPerView: (() => { const val = container.getAttribute("data-slides-per-view"); return container.hasAttribute("data-breakpoints") ? undefined : (val === "auto" ? "auto" : parseFloat(val) || 4); })(), slidesPerGroup: (() => { const val = container.getAttribute("data-slides-per-group"); return (val && val.includes(",")) ? undefined : (parseInt(val) || 1); })(), autoplay: (() => { const delay = parseInt(container.getAttribute("data-autoplay")); return delay ? { delay, disableOnInteraction: false } : false; })(), grid: (() => { const rows = parseInt(container.getAttribute("data-rows")); return rows > 1 ? { rows: rows, fill: 'row' } : undefined; })(), breakpoints: mergedBreakpoints, autoHeight: container.getAttribute("data-auto-height") === "true" }; if (pagEl) options.pagination = { el: pagEl, clickable: true, type: paginationType || "bullets" }; if (prevEl && nextEl) options.navigation = { nextEl, prevEl }; if (options.grid) options.loop = false; const swiperInstance = new Swiper(container.querySelector(".swiper-inner"), options); container._swiperInstance = swiperInstance; const navId = container.getAttribute("data-nav-id"); if (navId) { const navRoot = document.querySelector(`.custom_navigation[data-nav-id="${navId}"]`); if (navRoot) { const prevBtn = navRoot.querySelector(".swiper-prev"); const nextBtn = navRoot.querySelector(".swiper-next"); if (prevBtn) prevBtn.addEventListener("click", () => swiperInstance.slidePrev()); if (nextBtn) nextBtn.addEventListener("click", () => swiperInstance.slideNext()); } } if (isThumbs && thumbForSel) { const mainEl = document.querySelector(thumbForSel); if (mainEl) { if (mainEl._swiperInstance) wireThumbAndMain(swiperInstance, mainEl._swiperInstance); else (mainEl.__pendingThumbs ||= []).push(swiperInstance); } } else { const pending = container.__pendingThumbs; if (pending && pending.length) { pending.forEach(ts => wireThumbAndMain(ts, swiperInstance)); container.__pendingThumbs = []; } } } function initAllSwipers() { document.querySelectorAll("[data-swiper]").forEach(initSwiperElement); } window.addEventListener("DOMContentLoaded", initAllSwipers); const observer = new MutationObserver(mutations => { mutations.forEach(mutation =>
341 { mutation.addedNodes.forEach(node => { if (node.nodeType !== 1) return; if (node.matches && node.matches("[data-swiper]")) initSwiperElement(node); else if (node.querySelectorAll) node.querySelectorAll("[data-swiper]").forEach(initSwiperElement); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.