{"version":3,"file":"shared-lib.DqlVbdtq.mjs","names":["React"],"sources":["https:/framerusercontent.com/modules/GgdRoxi9FcVjElMwrcLk/56G9glsTVW1cDWJiSmmJ/TVKSeo.js","https:/framerusercontent.com/modules/Rh12G1bT5rArpt2bqVFW/0F1RJEZVLo0xOURWmA4z/ykV1SqofR.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";const{useEffect}=React;// Site-wide SEO helper for tvkhd.tv: JSON-LD (Organization, WebSite, live TVK/TVK2 channels on the home pages),\n// hreflang alternates between the EN / KM / FR / TH versions, and the page language on <html>.\nconst ORIGIN=\"https://tvkhd.tv\";const LANGS=[\"en\",\"km\",\"fr\",\"th\"];const TRANSLATED=[\"/\",\"/delete-data\",\"/privacy\",\"/community\",\"/terms\",\"/rooms\"]// pages that exist in all four languages\n;const LOGO=\"https://framerusercontent.com/images/Ps5tH5d8gLDwgbV7RWKfbVHCHRw.png\";const SHARE=\"https://framerusercontent.com/images/4xHLk14P2voeTW54juX0DjawCTY.jpg\";const POSTERS={tvk:\"https://framerusercontent.com/images/iG7jCyUuBIgo9WNpWXToSc3zRqo.jpg\",tvk2:\"https://framerusercontent.com/images/EV6cVJxdd87GpsmrPd4eerRg9EE.jpg\"};const STREAMS={tvk:\"https://live.kh.malimarcdn.com/live/tvk.stream/playlist.m3u8\",tvk2:\"https://live.kh.malimarcdn.com/live/tvk2.stream/playlist.m3u8\"};const LIVE_NAME={en:c=>`${c} live stream`,km:c=>`${c} ផ្សាយផ្ទាល់`,fr:c=>`${c} en direct`,th:c=>`${c} ถ่ายทอดสด`};const LIVE_DESC={en:c=>`Watch ${c}, the National Television of Cambodia, live in HD on tvkhd.tv.`,km:c=>`ទស្សនា ${c} ទូរទស្សន៍ជាតិកម្ពុជា ផ្សាយផ្ទាល់ HD នៅ tvkhd.tv។`,fr:c=>`Regardez ${c}, la T\\xe9l\\xe9vision nationale du Cambodge, en direct et en HD sur tvkhd.tv.`,th:c=>`ดู ${c} สถานีโทรทัศน์แห่งชาติกัมพูชา ถ่ายทอดสดแบบ HD บน tvkhd.tv`};export function splitPath(path){const p=(path||\"/\").replace(/\\/+$/,\"\")||\"/\";const m=p.match(/^\\/(km|fr|th)(\\/.*)?$/);return m?{lang:m[1],base:m[2]||\"/\"}:{lang:\"en\",base:p};}export function urlFor(lang,base){return ORIGIN+(lang===\"en\"?base:\"/\"+lang+(base===\"/\"?\"\":base));}// one 24-hour broadcast window for \"today\" in Cambodia (UTC+7); the channels broadcast around the clock\nfunction dayWindow(now=Date.now()){const d=new Date(now+7*3600*1e3).toISOString().slice(0,10);return{start:`${d}T00:00:00+07:00`,end:`${d}T23:59:59+07:00`,day:d};}export function buildLd(path,now=Date.now()){const{lang,base}=splitPath(path);const pageUrl=urlFor(lang,base);const org={\"@type\":\"Organization\",\"@id\":ORIGIN+\"/#organization\",name:\"tvkhd.tv\",url:ORIGIN+\"/\",logo:{\"@type\":\"ImageObject\",url:LOGO,width:180,height:180},image:SHARE};const site={\"@type\":\"WebSite\",\"@id\":ORIGIN+\"/#website\",name:\"tvkhd.tv\",url:ORIGIN+\"/\",inLanguage:[...LANGS],publisher:{\"@id\":ORIGIN+\"/#organization\"}};const graph=[org,site];if(base===\"/\"){const w=dayWindow(now);for(const id of[\"tvk\",\"tvk2\"]){const name=id===\"tvk2\"?\"TVK2\":\"TVK\";graph.push({\"@type\":\"VideoObject\",\"@id\":pageUrl+\"#live-\"+id,name:LIVE_NAME[lang](name),description:LIVE_DESC[lang](name),thumbnailUrl:[POSTERS[id]],uploadDate:w.start,inLanguage:\"km\",contentUrl:STREAMS[id],isFamilyFriendly:true,publisher:{\"@id\":ORIGIN+\"/#organization\"},publication:{\"@type\":\"BroadcastEvent\",isLiveBroadcast:true,startDate:w.start,endDate:w.end}});}}return{\"@context\":\"https://schema.org\",\"@graph\":graph};}/**\n * Invisible SEO helper. Put one on each page (primary breakpoint) and set \"Page path\" to the page's path.\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n * @framerIntrinsicWidth 1\n * @framerIntrinsicHeight 1\n */export default function TVKSeo(props){const{path=\"/\",hreflang=true}=props;const ld=JSON.stringify(buildLd(path)).replace(/</g,\"\\\\u003c\");useEffect(()=>{if(typeof document===\"undefined\")return;const{lang,base}=splitPath(path);// the page's language on <html>\ntry{document.documentElement.lang=lang;}catch(e){}// refresh the broadcast window to today's date (the static HTML carries the publish date)\ntry{const s=document.getElementById(\"tvk-ld\");if(s)s.textContent=JSON.stringify(buildLd(path)).replace(/</g,\"\\\\u003c\");}catch(e){}if(!hreflang||!TRANSLATED.includes(base))return;const head=document.head;head.querySelectorAll('link[rel=\"alternate\"][hreflang]').forEach(l=>l.remove());const add=(hl,href)=>{const l=document.createElement(\"link\");l.rel=\"alternate\";l.hreflang=hl;l.href=href;l.setAttribute(\"data-tvk\",\"1\");head.appendChild(l);};LANGS.forEach(l=>add(l,urlFor(l,base)));add(\"x-default\",urlFor(\"en\",base));},[path,hreflang]);return /*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":\"true\",style:{...props.style,width:1,height:1,overflow:\"hidden\",pointerEvents:\"none\",opacity:0},children:/*#__PURE__*/_jsx(\"script\",{id:\"tvk-ld\",type:\"application/ld+json\",dangerouslySetInnerHTML:{__html:ld}})});}addPropertyControls(TVKSeo,{path:{type:ControlType.String,title:\"Page path\",defaultValue:\"/\"},hreflang:{type:ControlType.Boolean,title:\"hreflang\",defaultValue:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"urlFor\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"buildLd\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"splitPath\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"TVKSeo\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicWidth\":\"1\",\"framerIntrinsicHeight\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TVKSeo.map","// Generated by Framer (2b87f15)\nimport{fontStore}from\"framer\";fontStore.loadFonts([]);export const fonts=[{explicitInter:true,fonts:[]}];export const css=[\".framer-gljG2 .framer-styles-preset-14urptl:not(.rich-text-wrapper), .framer-gljG2 .framer-styles-preset-14urptl.rich-text-wrapper a { --framer-link-current-text-color: #ffffff; --framer-link-hover-text-color: #ffffff; --framer-link-text-color: rgba(255, 255, 255, 0.62); --framer-link-text-decoration: none; }\"];export const className=\"framer-gljG2\";\nexport const __FramerMetadata__ = {\"exports\":{\"className\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"css\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"fonts\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"iLAG26B,SAAgB,EAAU,EAAK,CAAC,IAAM,GAAG,GAAM,IAAA,CAAK,QAAQ,OAAO,EAAE,GAAG,IAAU,EAAE,EAAE,MAAM,uBAAuB,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,EAAE,IAAI,GAAG,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,CAAE,CAAC,SAAgB,EAAO,EAAK,EAAK,CAAC,OAAO,GAAQ,IAAO,KAAK,EAAK,IAAI,GAAM,IAAO,IAAI,GAAG,GAAO,CACzrC,SAAS,EAAU,EAAI,KAAK,IAAI,EAAE,CAAC,IAAM,EAAE,IAAI,KAAK,EAAI,EAAE,KAAK,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,MAAM,GAAG,EAAE,iBAAiB,IAAI,GAAG,EAAE,iBAAiB,IAAI,CAAC,CAAE,C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