1import{U as e,f as t,ht as n}from"./DKhRV_XD.js";import{t as r}from"./CgxnmZgM.js";import{n as i}from"./C-6T4v8M.js";var a=[{code:`en`,language:`en-US`,name:`English`,nativeName:`English`,switchLabel:`EN`,switchLabels:{en:`EN`,zh:`EN`,ja:`EN`},file:`en.json`,defaultDomain:`localhost:3000`,domainEnv:`NUXT_PUBLIC_SITE_DOMAIN_EN`,domainsEnv:[`NUXT_PUBLIC_SITE_DOMAINS_EN`,`SITE_DOMAINS_EN`],siteTitle:`Bioer Technology`,ogLocale:`en_US`,logo:`/bioer-en.png`,logoWidth:1233,logoHeight:258},{code:`zh`,language:`zh-CN`,name:`Chinese`,nativeName:`ç®ä½ä¸æ`,switchLabel:`CN`,switchLabels:{en:`CN`,zh:`CN`,ja:`CN`},file:`zh.json`,defaultDomain:`localhost:3001`,domainEnv:`NUXT_PUBLIC_SITE_DOMAIN_ZH`,domainsEnv:[`NUXT_PUBLIC_SITE_DOMAINS_ZH`,`SITE_DOMAINS_ZH`],siteTitle:`åæ¥ç§æ`,ogLocale:`zh_CN`,logo:`/bioer-zh.png`,logoWidth:501,logoHeight:133},{code:`ja`,language:`ja-JP`,name:`Japanese`,nativeName:`æ¥æ¬èª`,switchLabel:`JP`,switchLabels:{en:`JP`,zh:`JP`,ja:`JP`},file:`ja.json`,defaultDomain:`localhost:3002`,domainEnv:`NUXT_PUBLIC_SITE_DOMAIN_JA`,domainsEnv:[`NUXT_PUBLIC_SITE_DOMAINS_JA`,`SITE_DOMAINS_JA`],siteTitle:`Bioer Technology`,ogLocale:`ja_JP`,logo:`/bioer-en.png`,logoWidth:1233,logoHeight:258}];function o(e){return Array.from(new Set(e.map(e=>e.trim()).filter(Boolean)))}function s(e){return a.map(t=>{let n=e[t.domainEnv]?.trim()||t.defaultDomain,r=t.domainsEnv.flatMap(t=>(e[t]||``).split(`,`));return{code:t.code,language:t.language,name:t.name,nativeName:t.nativeName,switchLabel:t.switchLabel,switchLabels:t.switchLabels,file:t.file,domain:n,domains:o([n,...r]),siteTitle:t.siteTitle,ogLocale:t.ogLocale,logo:t.logo,logoWidth:t.logoWidth,logoHeight:t.logoHeight}})}function c(e){if(!Array.isArray(e))return s({});let t=e.flatMap(e=>{if(!e||typeof e!=`object`||Array.isArray(e))return[];let t=e,n=typeof t.code==`string`?t.code.trim().toLowerCase():``;if(!n)return[];let r=Array.isArray(t.domains)?t.domains.filter(e=>typeof e==`string`):[];return[{code:n,language:typeof t.language==`string`?t.language:n,name:typeof t.name==`string`?t.name:n.toUpperCase(),nativeName:typeof t.nativeName==`string`?t.nativeName:typeof t.name==`string`?t.name:n.toUpperCase(),switchLabel:typeof t.switchLabel==`string`?t.switchLabel:n.toUpperCase(),switchLabels:t.switchLabels&&typeof t.switchLabels==`object`&&!Array.isArray(t.switchLabels)?Object.fromEntries(Object.entries(t.switchLabels).filter(e=>typeof e[1]==`string`)):{},file:typeof t.file==`string`?t.file:`${n}.json`,domain:typeof t.domain==`string`?t.domain:``,domains:o(r),siteTitle:typeof t.siteTitle==`string`?t.siteTitle:`Bioer Technology`,ogLocale:typeof t.ogLocale==`string`?t.ogLocale:n.replace(`-`,`_`),logo:typeof t.logo==`string`?t.logo:`/bioer-en.png`,logoWidth:Number(t.logoWidth)||1233,logoHeight:Number(t.logoHeight)||258}]});return t.length?t:s({})}function l(e,t,n=`en`){let r=String(t||``).trim().toLowerCase();return e.find(e=>e.code.toLowerCase()===r)||e.find(e=>e.code===n)||e[0]||s({})[0]}function u(e,t){let n=e.trim().toLowerCase(),r=t.trim().toLowerCase().split(`-`)[0]||`en`,i=a.find(e=>e.code===n);return i&&(i.switchLabels[r]||i.switchLabel)||n.toUpperCase()}function d(e){let t=typeof e==`string`?e.trim().replace(/\/+$/,``):``;return t?/^https?:\/\//i.test(t)?t:`${t.startsWith(`localhost`)||t.startsWith(`127.0.0.1`)?`http`:`https`}://${t}`:``}function f(e){let t=e.split(`#`)[0]?.split(`?`)[0]||`/`;return t.startsWith(`/`)?t:`/${t}`}function p(e,t){let n=f(e),r=n.split(`/`)[1]?.toLowerCase()||``;return t.some(e=>e.code.toLowerCase()===r)?n.slice(r.length+1)||`/`:n}function m(e){let t=p(e.path,e.locales);return e.differentDomains||e.locale===(e.defaultLocale||`en`)?t:t===`/`?`/${e.locale}`:`/${e.locale}${t}`}function h(e,t,n,r){if(t===n)return e;let i=e.match(/^\/(?:(?:en|zh|ja)\/)?(products|news)\/[^/]+\/[^/]+\/?$/);if(!i)return e;let a=r?.[n]?.trim();return a?.startsWith(`/`)&&!a.startsWith(`//`)?a:`/${i[1]}`}function g(e){let t=new URLSearchParams;Object.keys(e).sort().forEach(n=>{let r=e[n];(Array.isArray(r)?r:[r]).forEach(e=>{e!=null&&t.append(n,String(e))})});let n=t.toString();return n?`?${n}`:``}function _(){let a=e(),o=t(),{locale:s}=i(),u=n(()=>c(a.public?.siteLocales)),f=n(()=>String(a.public?.defaultSiteLocale||`en`)),p=n(()=>a.public?.i18nDifferentDomains!==!1),_=n(()=>l(u.value,s.value,f.value)),v=r(`site-locale-switch-paths`,()=>({path:``,paths:{}})),y=e=>l(u.value,e,f.value),b=e=>d(y(e).domain),x=(e,t=o.path||`/`)=>m({path:t,locale:y(e).code,locales:u.value,defaultLocale:f.value,differentDomains:p.value}),S=(e,t=o.path||`/`,n=o.query)=>{let r=`${x(e,t)}${g(n)}`;if(!p.value)return r;let i=b(e);return i?`${i}${r}`:r},C=(e,t=!1)=>{let n=o.path||`/`,r=t&&v.value.path===n?v.value.paths:void 0,i=h(n,_.value.code,
1y(e).code,r);return S(e,i,i===n?o.query:{})},w=n(()=>(p.value?b(_.value.code):b(f.value))||u.value.map(e=>d(e.domain)).find(Boolean)||``),T=n(()=>x(_.value.code)),E=n(()=>w.value?`${w.value}${T.value}`:T.value),D=n(()=>u.value.map(e=>({locale:e,href:S(e.code,o.path||`/`,{})})));return{locale:s,locales:u,defaultLocale:f,differentDomains:p,current:_,currentOrigin:w,canonicalPath:T,canonicalUrl:E,alternates:D,defaultAlternate:n(()=>D.value.find(e=>e.locale.code===f.value)||D.value[0]),siteHomeUrl:n(()=>{let e=x(_.value.code,`/`);return`${w.value||``}${e}`.replace(/\/+$/,``)||`/`}),localeFor:y,originFor:b,pathFor:x,hrefFor:S,switchHrefFor:C,switchPaths:v}}export{u as n,d as r,_ as t};
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.