\n \n \n `))).join(""))}async function tabChannelByGroup(e,t,a,n,o){try{if(getOk){let e=(await axios.get(`${apiStb}getChannelByGroup/${t}?ts=${Date.now()}`,{timeout:7e3})).data;e.forEach((e=>{e.icon=e.stb_icon&&e.stb_icon.startsWith("/")?urlStb+e.stb_icon:e.stb_icon})),renderChannelList(e,t,n,o)}else{let a="",i=(await axios.post(`${apiLayananUrl}api/getChannelIdAktifByNoHp`,{no_hp:a},{timeout:7e3})).data.data.map((e=>e.channel_id)),l=new Set(i),r=(await axios.get(`/api/getChannelByGroup/${e}/${t}`,{timeout:7e3})).data;r.forEach((e=>{e.aktif=l.has(e.channel_id)})),renderChannelList(r,t,n,o)}if(getOk){let e=await channelHide();for(const t of e)$(`#ch-${t.channel_id}`).hide()}var i=localStorage.getItem("channel-custom-"+n);let a=JSON.parse(i),l=[];for(const e of l)2!==a?.[e]&&$(`#ch-${e}`).hide();for(const e in a){const t=a[e],n=$(`#ch-${e}`);1===t&&n.hide()}}catch(e){Swal.fire("",e.message?e.message:e,"error")}}function tabChannelByCustomApi(){$("#tabCategory").html(""),$("#jessibucaPlay").addClass("sembunyi"),$("#myVideo").removeClass("sembunyi");let e=apiStb+"vod/getGroups";apiCustom&&(e=`${apiCustom}vod/getVodGroups`);let t={};apiCustom&&(t={custom_id:custom_id}),$.ajax({url:e,method:"POST",data:t,success:function(e){const t=e?.map((e=>{const t=e.group_name.replaceAll(" ","-");return`\n
\n `}));$("#tabCategory").html(t);let a=e.map((e=>getVods(e.group_name)));Promise.allSettled(a).then((()=>{keynapCard("vod")})),$("#tabCategory").append('')},error:function(e){}})}function getVods(e){const t=e.replaceAll(" ","-");let a=apiStb+"vod/getGroupVideos/"+e;apiCustom&&(a=`${apiCustom}vod/getVods`);let n={};return apiCustom&&(n={custom_id:custom_id,group_name:e}),$.ajax({url:a,method:"POST",data:n,success:function(e){e&&$("#group-icon-"+t).html(e?.map(((e,a)=>`\n \n
\n
\n
\n
\n `)))},error:function(e){Swal.fire("",e,"warning")}})}async function getLocationServer(e){let t=null;try{let a=new URL(e);a.pathname="/locate/"+a.pathname.split("/").pop(),a=a.toString();let n=await axios.head(a,{timeout:3e3});200==n.status?t="":204==n.status?t="Gedung Cyber":404==n.status&&(t="Local")}catch(e){404==e?.response?.status?t="Local":console.error(e)}return t}$((async function(){genOk(),mediaBaseUrl=await getMediaBaseUrl(),satellite=await getSatelliteStatus(),locationServer=await getLocationServer(playUrl),"Gedung Cyber"==locationServer?($("#wifi_icon").removeClass("sembunyi"),$("#wifi").removeClass("sembunyi")):""==locationServer?($("#satelit_icon").removeClass("sembunyi"),$("#satellite").removeClass("sembunyi")):($("#cdn_logo").removeClass("sembunyi"),$("#satellite").removeClass("sembunyi"),$("#location_cdn").text(locationServer)),innerWidth