(function () { 'use strict'; if (window.__DBC_COLLABORATION_LOOP_V7301__) return; window.__DBC_COLLABORATION_LOOP_V7301__ = true; const root = document.documentElement; const body = document.body; const form = document.querySelector('form[data-v7301-collaboration-form]'); const query = new URLSearchParams(window.location.search); const sampleTopics = Object.freeze({ 'pha-barrier-emulsion': { kind: 'material-sample', selectionZh: '博碳阻隔乳液', selectionEn: 'BIOTEN barrier emulsion', provider: 'dbc', domain: '', }, 'waterborne-coated-paper': { kind: 'coated-paper-sample', selectionZh: '博碳水涂纸', selectionEn: 'BIOTEN waterborne-coated paper', provider: 'partner-coater', domain: '', }, 'bioten-foodserviceware': { kind: 'finished-article-sample', selectionZh: '博碳餐饮具', selectionEn: 'BIOTEN foodserviceware', provider: 'partner-converter', domain: 'food-beverage', }, 'paper-cup-sample': { kind: 'finished-article-sample', selectionZh: '纸杯', selectionEn: 'Paper cups', provider: 'partner-converter', domain: 'food-beverage', }, 'paper-box-sample': { kind: 'finished-article-sample', selectionZh: '纸盒', selectionEn: 'Paper cartons', provider: 'partner-converter', domain: '', }, 'paper-bag-sample': { kind: 'finished-article-sample', selectionZh: '纸袋等制品', selectionEn: 'Paper bags and related articles', provider: 'partner-converter', domain: '', }, 'other-sample': { kind: 'other-sample', selectionZh: '其他纸基包装样品', selectionEn: 'Other fiber-based packaging sample', provider: 'to-be-confirmed', domain: '', }, }); const allowedDomains = new Set([ 'packaging', 'food-beverage', 'beauty-care', 'medical-outer', 'special-performance', ]); const allowedPartnerRoles = new Set([ 'paper-mill', 'coater', 'printer-converter', 'foodserviceware-producer', 'brand-owner', 'test-evidence', ]); const allowedRoutes = new Set([ '', 'plus', 'pro', 'ultra', 'co-development', 'paper-mill', 'coater', 'printer-converter', 'foodserviceware-producer', 'brand-owner', 'test-evidence', ]); const allowedTopics = new Set([ ...Object.keys(sampleTopics), 'coating-converting-partnership', 'developer-intake', 'project-intake', 'bioten-plus-balanced-matte', 'hotel-amenity-paper-pouch', 'film-free-carton', 'film-continuity', 'methods-evidence', 'method-evidence', ]); const knownSources = new Set([ '', 'dbc-home-packaging-entry', 'packaging-home-sample', 'packaging-product-release', 'packaging-home-final', 'packaging-footer', 'DEV-PKG', ]); function language() { return root.dataset.lang === 'en' || root.lang === 'en' ? 'en' : 'zh'; } function sourceIsAllowed(value) { return knownSources.has(value) || /^[A-Z]{2,8}-\d{3}$/.test(value); } function safeValue(name, allowed) { const value = String(query.get(name) || '').trim(); return allowed(value) ? value : ''; } const context = { domain: safeValue('domain', (value) => allowedDomains.has(value)), topic: safeValue('topic', (value) => allowedTopics.has(value)), route: safeValue('route', (value) => allowedRoutes.has(value)), source: safeValue('source', sourceIsAllowed), releaseId: safeValue('release_id', (value) => value === '' || /^[A-Z]{2,8}-\d{3}$/.test(value)), }; const isPartnership = context.topic === 'coating-converting-partnership' || context.source === 'packaging-product-release'; const initialSample = sampleTopics[context.topic] || null; const intentKind = isPartnership ? 'partnership-request' : (initialSample ? 'sample-request' : 'project-intake'); function ensureHidden(name, value) { if (!form) return null; let input = form.querySelector(`input[name="${name}"]`); if (!input) { input = document.createElement('input'); input.type = 'hidden'; input.name = name; form.prepend(input); } input.value = value || ''; return input; } function configureContract() { if (!form) return; form.dataset.requestRecipient = language() === 'en' ? 'the BIOTEN Packaging team' : '博碳包装项目团队'; form.dataset.resetStatus = language() === 'en' ? 'After submission, the information enters manual completeness and fit review.' : '提交后,信息进入人工完整性与项目适配评审。'; ensureHidden('intent_kind', intentKind); ensureHidden('domain', context.domain); ensureHidden('topic', context.topic); ensureHidden('route', context.route); ensureHidden('source', context.source || 'packaging-direct'); ensureHidden('release_id', context.releaseId || (/^[A-Z]{2,8}-\d{3}$/.test(context.source) ? context.source : '')); ensureHidden('sample_kind', initialSample ? initialSample.kind : ''); ensureHidden('provider_role', initialSample ? initialSample.provider : ''); const formId = form.querySelector('input[name="form_id"]'); if (formId) { formId.value = isPartnership ? 'bioten-partnership-request' : (initialSample ? 'bioten-packaging-sample-request' : 'bioten-general-request'); } } function ensurePackagingSystemOption(select) { if (!select || Array.from(select.options).some((option) => option.value === 'packaging-system')) return; const option = document.createElement('option'); option.value = 'packaging-system'; option.dataset.zh = '跨领域纸基包装 / 产业协作'; option.dataset.en = 'Cross-field fiber packaging / industrial collaboration'; option.textContent = language() === 'en' ? option.dataset.en : option.dataset.zh; select.appendChild(option); } function setCheck(name, value, checked) { if (!form) return; const input = form.querySelector(`input[name="${name}"][value="${value}"]`); if (input) input.checked = checked; } function configureVisibleForm() { if (!form) return; const sampleSelection = form.querySelector('input[name="sample_selection"]'); const domainSelect = form.querySelector('select[name="packaging_domain"]'); const application = form.querySelector('input[name="application"]'); const message = form.querySelector('textarea[name="message"]'); const partnershipFields = form.querySelector('[data-v7301-partnership-fields]'); const partnerInputs = partnershipFields ? Array.from(partnershipFields.querySelectorAll('input, select, textarea')) : []; const sampleResponsibility = document.querySelector('[data-v7301-sample-responsibility]'); ensurePackagingSystemOption(domainSelect); if (initialSample) { setCheck('request_need', '样品/纸样测试', true); if (sampleSelection && !sampleSelection.value) { sampleSelection.value = `${initialSample.selectionZh} / ${initialSample.selectionEn}`; } const intendedDomain = context.domain === 'packaging' ? '' : (context.domain || initialSample.domain); if (domainSelect && intendedDomain) domainSelect.value = intendedDomain; } if (isPartnership) { setCheck('request_need', '商务合作/报价咨询', true); if (domainSelect) domainSelect.value = context.domain && context.domain !== 'packaging' ? context.domain : 'packaging-system'; if (application && !application.value) { application.value = '产业伙伴能力与协作 / Industrial partner capability and collaboration'; } if (message && !message.value) { message.value = language() === 'en' ? 'We would like to assess a BIOTEN Packaging prototyping, converting, validation, or market collaboration route.' : '希望评估博碳包装的打样、加工、联合验证或市场协作路径。'; } } if (partnershipFields) partnershipFields.hidden = !isPartnership; if (sampleResponsibility) { sampleResponsibility.hidden = isPartnership; sampleResponsibility.setAttribute('aria-hidden', String(isPartnership)); } partnerInputs.forEach((input) => { input.disabled = !isPartnership; if (input.matches('[data-v7301-partner-required]')) input.required = isPartnership; }); if (isPartnership && allowedPartnerRoles.has(context.route)) { const partnerRole = form.querySelector('select[name="partner_role"]'); if (partnerRole) partnerRole.value = context.route; } } function friendlyContext() { if (!form) return; const box = document.querySelector('[data-bp7140-intake-context]'); const output = box && box.querySelector('[data-bp7140-context-value]'); if (!box || !output) return; const sourceMap = { 'dbc-home-packaging-entry': ['首页 · 包装协作入口', 'Homepage · Packaging collaboration'], 'packaging-home-sample': ['博碳包装 · 样品入口', 'BIOTEN Packaging · Sample entry'], 'packaging-product-release': ['新应用发布 · 合作入口', 'Application releases · Partnership entry'], 'packaging-home-final': ['博碳包装 · 项目入口', 'BIOTEN Packaging · Project entry'], 'packaging-footer': ['博碳包装 · 页脚入口', 'BIOTEN Packaging · Footer entry'], 'DEV-PKG': ['包装开发者 · 工程入口', 'Packaging Developer · Engineering entry'], }; const topicMap = { 'pha-barrier-emulsion': ['博碳阻隔乳液', 'BIOTEN barrier emulsion'], 'waterborne-coated-paper': ['博碳水涂纸', 'BIOTEN waterborne-coated paper'], 'bioten-foodserviceware': ['博碳餐饮具', 'BIOTEN foodserviceware'], 'other-sample': ['其他纸基包装样品', 'Other fiber-based packaging sample'], 'coating-converting-partnership': ['产业伙伴合作申请', 'Industrial partnership application'], 'developer-intake': ['包装工程问题', 'Packaging engineering problem'], 'project-intake': ['包装项目预审', 'Packaging project intake'], 'bioten-plus-balanced-matte': ['Bioten Plus 博碳平衡型应用', 'Bioten Plus balanced application'], 'hotel-amenity-paper-pouch': ['酒店用品纸基包装研究命题', 'Hotel amenity paper-packaging brief'], 'film-free-carton': ['美妆纸盒工程命题', 'Beauty-carton engineering brief'], 'film-continuity': ['涂层连续成膜工程命题', 'Coating film-continuity brief'], }; const zh = []; const en = []; if (topicMap[context.topic]) { zh.push(topicMap[context.topic][0]); en.push(topicMap[context.topic][1]); } if (/^[A-Z]{2,8}-\d{3}$/.test(context.source)) { zh.push(`发布编号 ${context.source}`); en.push(`Release ${context.source}`); } else if (sourceMap[context.source]) { zh.push(sourceMap[context.source][0]); en.push(sourceMap[context.source][1]); } if (!zh.length) { box.hidden = true; output.textContent = ''; delete output.dataset.zh; delete output.dataset.en; return; } box.hidden = false; output.dataset.zh = zh.join(' · '); output.dataset.en = en.join(' · '); output.textContent = language() === 'en' ? output.dataset.en : output.dataset.zh; } function applyDynamicLanguage() { document.querySelectorAll('[data-placeholder-zh]').forEach((element) => { element.placeholder = language() === 'en' ? (element.dataset.placeholderEn || '') : (element.dataset.placeholderZh || ''); }); const introTitle = document.getElementById('paper-sample-title'); const introCopy = document.querySelector('[data-v7301-intake-intro]'); if (introTitle) { introTitle.textContent = isPartnership ? (language() === 'en' ? 'Define partner capabilities before joint assessment' : '先说明合作能力,再进入共同评估') : (initialSample ? (language() === 'en' ? 'Confirm the sample object, then add real project conditions' : '先确认样品对象,再补充真实项目条件') : (language() === 'en' ? 'Organize real project conditions through seven engineering steps' : '按七步工程链整理真实项目条件')); } if (introCopy) { introCopy.textContent = isPartnership ? (language() === 'en' ? 'Capability information supports manual fit review and defines the collaboration role, sample or line task, validation scope and next interface.' : '能力信息将用于人工适配评审,便于明确协作角色、样品或产线任务、验证范围与下一步接口。') : (language() === 'en' ? 'The selected object, provider role, paper, coating, converting, use conditions, and evidence requirements are reviewed together.' : '所选对象、提供方角色、纸张、涂层、加工、使用工况与证据要求将被一起评审。'); } configurePartnershipSurface(); friendlyContext(); } function setRuntimeText(element, zh, en) { if (!element) return; element.dataset.zh = zh; element.dataset.en = en; element.textContent = language() === 'en' ? en : zh; } function configurePartnershipSurface() { if (!isPartnership) return; const hero = document.querySelector('.request-hero'); const kicker = hero?.querySelector('.request-kicker'); const heading = hero?.querySelector('h1'); const descriptor = hero?.querySelector('.about-hero-title > span'); const lead = hero?.querySelector('.about-hero-title > p'); const action = hero?.querySelector('.request-hero-actions a'); setRuntimeText(kicker, 'BIOTEN PACKAGING · 产业合作申请', 'BIOTEN PACKAGING · PARTNERSHIP INTAKE'); setRuntimeText(heading, '博碳包装产业合作申请', 'BIOTEN Packaging Partnership Application'); setRuntimeText(descriptor, 'PAPER · COATING · CONVERTING · FORMING · EVIDENCE', 'PAPER · COATING · CONVERTING · FORMING · EVIDENCE'); setRuntimeText( lead, '面向纸厂、涂布、印刷、模切、制盒、制袋、成型、品牌与检测伙伴,提交真实设备、工艺窗口、服务区域与协作方向,进入能力匹配与联合验证评审。', 'For paper, coating, printing, die cutting, carton or bag making, forming, brand and testing partners: submit real equipment, process windows, service regions and collaboration directions for capability matching and joint-validation review.' ); setRuntimeText(action, '填写合作能力 ↓', 'Describe capabilities ↓'); const currentContext = document.querySelector('.bp7140-context [aria-current="page"]'); setRuntimeText(currentContext, '合作申请', 'Partnership application'); const pathIntro = document.querySelector('.v281-path__intro'); setRuntimeText(pathIntro?.querySelector('span'), 'PARTNERSHIP INTAKE', 'PARTNERSHIP INTAKE'); setRuntimeText(pathIntro?.querySelector('strong'), '把产线能力整理成可评审的协作输入', 'Structure production capabilities for collaboration review'); const pathSteps = Array.from(document.querySelectorAll('.v281-path__copy')); const stepCopy = [ ['能力范围', '角色、设备、工艺与区域', 'Capability scope', 'Role, equipment, process and region'], ['当前申请', '提交能力与协作方向', 'Current application', 'Submit capabilities and direction'], ['联合评估', '匹配任务、版本与方法', 'Joint assessment', 'Match tasks, versions and methods'], ['合作回执', '确认接口与下一步任务', 'Partnership response', 'Confirm interface and next task'], ]; pathSteps.forEach((step, index) => { const copy = stepCopy[index]; if (!copy) return; setRuntimeText(step.querySelector('strong'), copy[0], copy[2]); setRuntimeText(step.querySelector('small'), copy[1], copy[3]); }); document.title = language() === 'en' ? 'BIOTEN Packaging Partnership Application | Industrial Collaboration' : '博碳包装产业合作申请|纸基包装产业协同'; } function configureSampleChoices() { if (!form) return; document.querySelectorAll('[data-v7301-sample-choice]').forEach((link) => { link.addEventListener('click', (event) => { const topic = link.dataset.v7301SampleChoice; const sample = sampleTopics[topic]; if (!sample) return; event.preventDefault(); const sampleSelection = form.querySelector('input[name="sample_selection"]'); const domainSelect = form.querySelector('select[name="packaging_domain"]'); ensureHidden('intent_kind', 'sample-request'); ensureHidden('topic', topic); ensureHidden('sample_kind', sample.kind); ensureHidden('provider_role', sample.provider); const formId = form.querySelector('input[name="form_id"]'); if (formId) formId.value = 'bioten-packaging-sample-request'; if (sampleSelection) sampleSelection.value = `${sample.selectionZh} / ${sample.selectionEn}`; // A new sample object owns its domain state. Clear the previous domain // when the selected object has no prescribed domain so stale routing is // never carried into the authoritative form contract. if (domainSelect) domainSelect.value = sample.domain || ''; setCheck('request_need', '样品/纸样测试', true); document.querySelectorAll('[data-v7301-sample-choice]').forEach((item) => item.removeAttribute('aria-current')); link.setAttribute('aria-current', 'true'); const next = new URL(window.location.href); next.searchParams.set('topic', topic); if (!next.searchParams.get('source')) next.searchParams.set('source', 'packaging-direct'); window.history.replaceState({}, '', next); document.getElementById('paper-sample-title')?.scrollIntoView({ behavior: root.matches('[data-reduced-motion]') ? 'auto' : 'smooth', block: 'start' }); }); if (link.dataset.v7301SampleChoice === context.topic) link.setAttribute('aria-current', 'true'); }); } if (body) body.dataset.v7301CollaborationMode = intentKind; configureContract(); configureVisibleForm(); configureSampleChoices(); applyDynamicLanguage(); document.addEventListener('dbc:languagechange', applyDynamicLanguage); const observer = new MutationObserver(() => applyDynamicLanguage()); observer.observe(root, { attributes: true, attributeFilter: ['data-lang', 'lang'] }); }());