'}
}
const SUPPLY=[];
const BUYERS=[];
const REPORTS=[];
const T={
zh:{soldOut:'售罄',resultOf:'{a} / {b} 条货源',pageOf:'第 {a} / {b} 页',noResult:'未找到匹配货源或报告编号',supply:'全球货源大厅',buyers:'全球订单大厅',supplyLabel:'GLOBAL SUPPLY HALL',buyersLabel:'GLOBAL ORDER HALL',searchPh:'搜索报告编号 / 型号 / 地区',searchBtn:'搜索',all:'全部',total:'总数量',moq:'最低起售',price:'单价',threshold:'最低验资',seek:'求购',target:'目标数量',funds:'已验资金额',report:'验资报告',inspect:'验货报告',contact:'直接联系',from:'起',verified:'已验货',fundVerified:'已验资',units:{unit:'台',rack:'架'},city:{singapore:'新加坡',dallas:'达拉斯',johor:'新山',hanoi:'河内',abudhabi:'阿布扎比',shanghai:'上海',tokyo:'东京',frankfurt:'法兰克福',sanjose:'圣何塞',hongkong:'香港',seoul:'首尔'}},
en:{soldOut:'SOLD OUT',resultOf:'{a} / {b} listings',pageOf:'Page {a} / {b}',noResult:'No matching listings or report numbers',supply:'Global Supply Hall',buyers:'Global Order Hall',supplyLabel:'GLOBAL SUPPLY HALL',buyersLabel:'GLOBAL ORDER HALL',searchPh:'Search report no. / model / region',searchBtn:'Search',all:'All',total:'Total',moq:'Min. Order',price:'Unit Price',threshold:'Min. Verification',seek:'Seeking',target:'Target',funds:'Verified Funds',report:'Fund Report',inspect:'Inspection Report',contact:'Direct Contact',from:'from',verified:'VERIFIED',fundVerified:'FUNDS VERIFIED',units:{unit:'units',rack:'racks'},city:{singapore:'Singapore',dallas:'Dallas',johor:'Johor',hanoi:'Hanoi',abudhabi:'Abu Dhabi',shanghai:'Shanghai',tokyo:'Tokyo',frankfurt:'Frankfurt',sanjose:'San Jose',hongkong:'Hong Kong',seoul:'Seoul'}},
ja:{resultOf:'{a} / {b} 件の出品',pageOf:'{a} / {b} ページ',supply:'グローバル供給ホール',buyers:'グローバル注文ホール',supplyLabel:'GLOBAL SUPPLY HALL',buyersLabel:'GLOBAL ORDER HALL',searchPh:'報告番号 / 型番 / 地域を検索',searchBtn:'検索',all:'すべて',total:'総数',moq:'最低注文',price:'単価',threshold:'最低認証額',seek:'希望',target:'目標数',funds:'認証資金',report:'資金報告',inspect:'検収報告',contact:'直接連絡',from:'から',verified:'検収済',fundVerified:'資金認証済',units:{unit:'台',rack:'ラック'},city:{singapore:'シンガポール',dallas:'ダラス',johor:'ジョホール',hanoi:'ハノイ',abudhabi:'アブダビ',shanghai:'上海',tokyo:'東京',frankfurt:'フランクフルト',sanjose:'サンノゼ',hongkong:'香港',seoul:'ソウル'}},
ko:{resultOf:'{a} / {b}개 출품',pageOf:'{a} / {b} 페이지',supply:'글로벌 공급 홀',buyers:'글로벌 주문 홀',supplyLabel:'GLOBAL SUPPLY HALL',buyersLabel:'GLOBAL ORDER HALL',searchPh:'보고서 번호 / 모델 / 지역 검색',searchBtn:'검색',all:'전체',total:'총수',moq:'최소주문',price:'단가',threshold:'최소 인증',seek:'구매 희망',target:'목표 수량',funds:'인증 자금',report:'자금 보고서',inspect:'검수 보고서',contact:'직접 연락',from:'부터',verified:'검수 완료',fundVerified:'자금 인증',units:{unit:'대',rack:'랙'},city:{singapore:'싱가포르',dallas:'달라스',johor:'조호르',hanoi:'하노이',abudhabi:'아부다비',shanghai:'상하이',tokyo:'도쿄',frankfurt:'프랑크푸르트',sanjose:'산호세',hongkong:'홍콩',seoul:'서울'}},
de:{resultOf:'{a} / {b} Angebote',pageOf:'Seite {a} / {b}',supply:'Globales Angebot',buyers:'Globaler Auftragsmarkt',supplyLabel:'GLOBAL SUPPLY HALL',buyersLabel:'GLOBAL ORDER HALL',searchPh:'Berichtsnr. / Modell / Region suchen',searchBtn:'Suchen',all:'Alle',total:'Gesamt',moq:'Mindestmenge',price:'Stückpreis',threshold:'Mindestprüfung',seek:'Sucht',target:'Zielmenge',funds:'Geprüftes Kapital',report:'Kapitalbericht',inspect:'Prüfbericht',contact:'Direktkontakt',from:'ab',verified:'GEPRÜFT',fundVerified:'KAPITAL GEPRÜFT',units:{unit:'Stück',rack:'Racks'},city:{singapore:'Singapur',dallas:'Dallas',johor:'Johor',hanoi:'Hanoi',abudhabi:'Abu Dhabi',shanghai:'Shanghai',tokyo:'Tokio',frankfurt:'Frankfurt',sanjose:'San Jose',hongkong:'Hongkong',seoul:'Seoul'}},
fr:{resultOf:'{a} / {b} offres',pageOf:'Page {a} / {b}',supply:'Offre Mondiale',buyers:'Marché Global des Ordres',supplyLabel:'GLOBAL SUPPLY HALL',buyersLabel:'GLOBAL ORDER HALL',searchPh:'Rechercher n° / modèle / région',searchBtn:'Rechercher',all:'Tous',total:'Total',moq:'Minimum',price:'Prix unitaire',threshold:'Vérification min.',seek:'Recherche',target:'Objectif',funds:'Fonds vérifiés',report:'Rapport de fonds',inspect:'Rapport d’inspection',contact:'Contact direct',from:'à partir de',verified:'VÉRIFIÉ',fundVerified:'FONDS VÉRIFIÉS',units:{unit:'unités',rack:'racks'},city:{singapore:'Singapour',dallas:'Dallas',johor:'Johor',hanoi:'Hanoï',abudhabi:'Abu Dhabi',shanghai:'Shanghai',tokyo:'Tokyo',frankfurt:'Francfort',sanjose:'San José',hongkong:'Hong Kong',seoul:'Séoul'}},
es:{resultOf:'{a} / {b} ofertas',pageOf:'Página {a} / {b}',supply:'Oferta Global',buyers:'Mercado Global de Órdenes',supplyLabel:'GLOBAL SUPPLY HALL',buyersLabel:'GLOBAL ORDER HALL',searchPh:'Buscar informe / modelo / región',searchBtn:'Buscar',all:'Todos',total:'Total',moq:'Mínimo',price:'Precio unit.',threshold:'Verif. mínima',seek:'Busca',target:'Objetivo',funds:'Fondos verificados',report:'Informe de fondos',inspect:'Informe de inspección',contact:'Contacto directo',from:'desde',verified:'VERIFICADO',fundVerified:'FONDOS VERIFICADOS',units:{unit:'unid.',rack:'racks'},city:{singapore:'Singapur',dallas:'Dallas',johor:'Johor',hanoi:'Hanói',abudhabi:'Abu Dabi',shanghai:'Shanghái',tokyo:'Tokio',frankfurt:'Fráncfort',sanjose:'San José',hongkong:'Hong Kong',seoul:'Seúl'}},
pt:{resultOf:'{a} / {b} ofertas',pageOf:'Página {a} / {b}',supply:'Oferta Global',buyers:'Mercado Global de Ordens',supplyLabel:'GLOBAL SUPPLY HALL',buyersLabel:'GLOBAL ORDER HALL',searchPh:'Pesquisar relatório / modelo / região',searchBtn:'Pesquisar',all:'Todos',total:'Total',moq:'Mínimo',price:'Preço un.',threshold:'Verif. mínima',seek:'Procura',target:'Meta',funds:'Fundos verificados',report:'Relatório de fundos',inspect:'Relatório de inspeção',contact:'Contato direto',from:'a partir de',verified:'VERIFICADO',fundVerified:'FUNDOS VERIFICADOS',units:{unit:'unid.',rack:'racks'},city:{singapore:'Singapura',dallas:'Dallas',johor:'Johor',hanoi:'Hanói',abudhabi:'Abu Dabi',shanghai:'Xangai',tokyo:'Tóquio',frankfurt:'Frankfurt',sanjose:'San Jose',hongkong:'Hong Kong',seoul:'Seul'}},
ru:{resultOf:'{a} / {b} предложений',pageOf:'Стр. {a} / {b}',supply:'Глобальные предложения',buyers:'Глобальный зал ордеров',supplyLabel:'GLOBAL SUPPLY HALL',buyersLabel:'GLOBAL ORDER HALL',searchPh:'Поиск: отчет / модель / регион',searchBtn:'Найти',all:'Все',total:'Всего',moq:'Мин. заказ',price:'Цена за ед.',threshold:'Мин. проверка',seek:'Ищет',target:'Цель',funds:'Проверенные средства',report:'Отчет о средствах',inspect:'Отчет об осмотре',contact:'Прямой контакт',from:'от',verified:'ПРОВЕРЕНО',fundVerified:'СРЕДСТВА ПРОВЕРЕНЫ',units:{unit:'шт.',rack:'стойки'},city:{singapore:'Сингапур',dallas:'Даллас',johor:'Джохор',hanoi:'Ханой',abudhabi:'Абу-Даби',shanghai:'Шанхай',tokyo:'Токио',frankfurt:'Франкфурт',sanjose:'Сан-Хосе',hongkong:'Гонконг',seoul:'Сеул'}},
ar:{resultOf:'{a} / {b} من العروض',pageOf:'صفحة {a} / {b}',supply:'قاعة العرض العالمية',buyers:'قاعة الطلبات العالمية',supplyLabel:'GLOBAL SUPPLY HALL',buyersLabel:'GLOBAL ORDER HALL',searchPh:'البحث: رقم التقرير / الطراز / المنطقة',searchBtn:'بحث',all:'الكل',total:'الإجمالي',moq:'الحد الأدنى',price:'سعر الوحدة',threshold:'الحد الأدنى للتحقق',seek:'يبحث عن',target:'الكمية',funds:'أموال موثقة',report:'تقرير الأموال',inspect:'تقرير الفحص',contact:'اتصال مباشر',from:'من',verified:'موثق',fundVerified:'أموال موثقة',units:{unit:'وحدة',rack:'حاويات'},city:{singapore:'سنغافورة',dallas:'دالاس',johor:'جوهر',hanoi:'هانوي',abudhabi:'أبوظبي',shanghai:'شنغهاي',tokyo:'طوكيو',frankfurt:'فرانكفورت',sanjose:'سان خوسيه',hongkong:'هونغ كونغ',seoul:'سيول'}}
};
let type=new URLSearchParams(location.search).get('type')||'supply';
const urlLang=new URLSearchParams(location.search).get('lang');if(['zh','en','ja','ko','de','fr','es','pt','ru','ar'].includes(urlLang))lang=urlLang;
const el=id=>document.getElementById(id);
const MODEL_I18N={
en:{'液冷CDU':'Liquid Cooling CDU','42U AI机柜':'42U AI Rack'},
ja:{'液冷CDU':'液冷CDU','42U AI机柜':'42U AIラック'},
ko:{'液冷CDU':'액냉 CDU','42U AI机柜':'42U AI 랙'},
de:{'液冷CDU':'Flüssigkeits-CDU','42U AI机柜':'42U KI-Rack'},
fr:{'液冷CDU':'CDU de refroidissement liquide','42U AI机柜':'Rack IA 42U'},
es:{'液冷CDU':'CDU de líquido','42U AI机柜':'Rack de IA 42U'},
pt:{'液冷CDU':'CDU a líquido','42U AI机柜':'Rack de IA 42U'},
ru:{'液冷CDU':'Жидкостная CDU','42U AI机柜':'Стойка ИИ 42U'},
ar:{'液冷CDU':'وحدة توزيع سائل التبريد','42U AI机柜':'رف AI 42U'}};
function modelName(m){return (MODEL_I18N[lang]&&MODEL_I18N[lang][m])||m}
const COUNTRY_I18N={ja:{EU:'欧州連合'},ko:{EU:'유럽연합'},fr:{EU:'Union européenne'},es:{EU:'Unión Europea'},pt:{EU:'União Europeia'},ru:{EU:'ЕС'},ar:{EU:'الاتحاد الأوروبي'}};
function region(code){if(code.toUpperCase()==='CN')return lang==='zh'?'中国大陆':'Mainland China';if(COUNTRY_I18N[lang]&&COUNTRY_I18N[lang][code.toUpperCase()])return COUNTRY_I18N[lang][code.toUpperCase()];try{return new Intl.DisplayNames([lang],{type:'region'}).of(code.toUpperCase())}catch(e){return code.toUpperCase()}}
function setLang(l){lang=l;document.documentElement.lang=l;document.body.classList.toggle('rtl-content',l==='ar');const t=T[l]||T.en;document.getElementById('q').placeholder=t.searchPh;document.getElementById('searchBtn').textContent=t.searchBtn;document.getElementById('langName').textContent=LANGS.find(x=>x[0]===l)[1];document.querySelectorAll('#langMenu button').forEach(b=>b.classList.toggle('active',b.dataset.code===l));document.getElementById('brandCn').style.display=l==='zh'?'inline':'none';document.getElementById('brandEn').textContent='AIXX GLOBAL';el('pageTitle').textContent=t[type]||T.en[type];el('label').textContent=t[type+'Label']||T.en[type+'Label'];render();window.__renderMember&&window.__renderMember()}
function setMode(m){type=m;modelParam='all';countryParam='all';page=1;history.replaceState(null,'',`hall.html?type=${m}`);loadV2Market()}
function metric(k,v){return `
${k}${v}
`}
const PRICE_LIVE={zh:'价格实时波动,实际以联系货主为准。',en:'Prices fluctuate in real time; final terms subject to owner contact.',ja:'価格はリアルタイムで変動します。最終条件は出品者へ確認してください。',ko:'가격은 실시간 변동되며 최종 조건은 판매자와 확인하세요.',de:'Preise ändern sich in Echtzeit; endgültige Konditionen beim Anbieter klären.',fr:'Prix en temps réel; conditions finales à confirmer avec le propriétaire.',es:'Precios en tiempo real; condiciones finales sujetas al propietario.',pt:'Preços em tempo real; condições finais sujeitas ao proprietário.',ru:'Цены меняются в реальном времени; условия уточните у владельца.',ar:'الأسعار تتغير في الوقت الفعلي؛ الشروط النهائية عبر الاتصال بالمالك.'};
let modelParam='all',countryParam='all';
let query='';
let FACETS={supply:null,buyers:null};
function interp(key,a,b){const tpl=(T[lang]||T.en)[key]||(T.en&&T.en[key])||key;return tpl.replace('{a}',a).replace('{b}',b)}
function pageButton(label,target,active=false,disabled=false){return ``}
function renderPagination(){
const box=el('pagination');if(!box)return;
let nums=[];const start=Math.max(1,page-2),end=Math.min(totalPages,start+4);
for(let i=start;i<=end;i++)nums.push(i);
box.innerHTML=pageButton('‹',page-1,false,page<=1)+nums.map(i=>pageButton(i,i,i===page)).join('')+pageButton('›',page+1,false,page>=totalPages);
box.querySelectorAll('button[data-page]').forEach(b=>b.onclick=()=>{const target=parseInt(b.dataset.page,10);if(target>=1&&target<=totalPages&&target!==page){page=target;loadV2Market()}});
}
function renderFilters(){
const t=T[lang]||T.en;
const src=type==='supply'?FACETS.supply:FACETS.buyers;
const fallback=[...new Set((type==='supply'?SUPPLY:BUYERS).map(x=>x.model))];
const models=(src&&src.models&&src.models.length)?src.models:fallback;
el('filters').innerHTML=``+models.map(m=>``).join('');
const cf=el('countryFilters');
const countries=type==='supply'&&FACETS.supply&&FACETS.supply.countries&&FACETS.supply.countries.length?FACETS.supply.countries:[];
if(countries.length){
cf.style.display='flex';
cf.innerHTML=``+countries.map(c=>``).join('');
}else{cf.style.display='none';cf.innerHTML=''}
document.querySelectorAll('#filters .chip').forEach(b=>b.onclick=()=>{modelParam=b.dataset.model;page=1;loadV2Market()});
document.querySelectorAll('#countryFilters .chip').forEach(b=>b.onclick=()=>{countryParam=b.dataset.country;page=1;loadV2Market()});
}
function render(){
const t=T[lang]||T.en;
renderFilters();
const rows=type==='supply'?SUPPLY:BUYERS;
el('resultCount').textContent=type==='supply'?interp('resultOf',rows.length,totalCount):`${rows.length}`;
el('pageInfo').textContent=type==='supply'?interp('pageOf',page,totalPages):'';
el('cards').innerHTML=type==='supply'?(rows.length?rows.map(x=>{
const sold=x.lifecycle==='sold_out';
return `
${isIns?`Exception policy: mismatch and non-new units are marked separately. Accepted currencies: ${(x.config||[]).filter(c=>c[0]==='Accepted currencies').map(c=>c[1])[0]||'USD / CNY'}. Full raw diagnostics remain available to qualified members after NDA.
交易、结算、物流、税务与发票安排由买卖双方自行协商,平台不参与交易资金与票据。`:`Fund evidence is matched to the verified real-name entity. Accepted settlement currencies: ${x.currency}. Counterparty details remain protected until direct contact is unlocked.`}
`;
docOverlay.classList.add('open');
}
function openDocByModel(){/* v2-only:报告一律按编号 openDoc(reportNo) 打开 */}
document.getElementById('docClose').onclick=()=>docOverlay.classList.remove('open');
document.getElementById('gateClose').onclick=()=>gateOverlay.classList.remove('open');
document.getElementById('gateCancel').onclick=()=>gateOverlay.classList.remove('open');
document.addEventListener('click',e=>{
const ins=e.target.closest('[data-inspect]');if(ins)return ins.dataset.reportNo?openDoc(ins.dataset.reportNo):openDocByModel(ins.dataset.inspect,'inspect');
const rep=e.target.closest('[data-report-no]');if(rep&&rep.dataset.reportNo)return openDoc(rep.dataset.reportNo);
});
try{if(!Array.isArray(SUPPLY)||!Array.isArray(BUYERS)||!Array.isArray(REPORTS))throw new Error('market data missing');setLang(lang);loadV2Market()}catch(e){document.getElementById('cards').innerHTML='