function updateQueryStringParameter(n,t,i){var r=new RegExp("([?&])"+t+"=.*?(&|$)","i"),u=n.indexOf("?")!==-1?"&":"?";return n.match(r)?n.replace(r,"$1"+t+"="+i+"$2"):n+u+t+"="+i}function getParameterByName(n,t){t||(t=window.location.href);n=n.replace(/[\[\]]/g,"\\$&");var r=new RegExp("[?&]"+n+"(=([^&#]*)|&|#|$)"),i=r.exec(t);return i?i[2]?decodeURIComponent(i[2].replace(/\+/g," ")):"":""}function getUrlParameter(n){n=n.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i=new RegExp("[\\?&]"+n+"=([^&#]*)"),t=i.exec(location.search);return t===null?undefined:decodeURIComponent(t[1].replace(/\+/g," "))}function removeUrlParameter(n,t){var u=n.split("?"),r;if(u.length>=2){var f=u.shift(),e=u.join("?"),o=encodeURIComponent(t)+"=",i=e.split(/[&;]/g);for(r=i.length;r-->0;)i[r].lastIndexOf(o,0)!==-1&&i.splice(r,1);n=f+"?"+i.join("&")}return n}var mediusCommon=function(){function o(n,t){window.setTimeout(function(){$(n).hide()},t)}var i={alertMessageTemplate:{saveSuccess:' <div class="alert alert-success alert-dismissable fade in" id="divalert"><a href="#" class="close" data-dismiss="alert" aria-label="close">&times;<\/a> <strong>Success!<\/strong> <p id="alertmsg">{{msg}}<\/p><\/div>',warning:' <div class="alert alert-warning  alert-dismissable fade in" id="divalert"><a href="#" class="close" data-dismiss="alert" aria-label="close">&times;<\/a> <strong>Warning!<\/strong> <p id="alertmsg">{{msg}}<\/p><\/div>',error:' <div class="alert alert-danger  alert-dismissable fade in" id="divalert"><a href="#" class="close" data-dismiss="alert" aria-label="close">&times;<\/a> <strong>Error!<\/strong> <p id="alertmsg">{{msg}}<\/p><\/div>',info:' <div class="alert alert-info  alert-dismissable fade in" id="divalert"><a href="#" class="close" data-dismiss="alert" aria-label="close">&times;<\/a> <strong>Info!<\/strong> <p id="alertmsg">{{msg}}<\/p><\/div>'},getListofchannelsToAdd:"/Video/AddToChannelList?vid={{vid}}",getListofPlaylistToAdd:"/Video/AddToPlayList?vid={{vid}}",copytoClipBoard:'<textarea id="clipboard" title="Clipboard text" style="display:none"><textarea>',selectedOwner:'<a  data-newselected="true" data-title="{{name}}" class="list-group-item"><div class="roomInChannelCreateForm" title="{{name}}">{{name}}<span style="left:5px" class="glyphicon glyphicon-remove selectedRoomLi" title="Remove Owner"  aria-hidden="true" onclick="$(this).parent().parent().remove();" tabindex="0" onkeydown="if (event.which === 13) {$(this).parent().parent().remove();}" title="Delete"><\/span><\/div><\/a>'},r={success:"successalert",error:"erroralert",warning:"warningtalert",info:"infoalert"},n={saveVideoToChannels:"/Video/AddVideoChannels",saveVideoToPlaylist:"/Video/AddVideoToPlaylist",getAllVideosBasedOnSearchString:"/Home/GetAllVideosBasedOnSearchString",deleteVideo:"/Video/Delete",getAllRooms:"/Channel/GetRooms",deleteChannel:"/channel/Delete",deletePlaylist:"/playlist/Delete",deleteSearchgrid:"/Searchgrid/Delete",deleteCta:"/Mediusutility/DeleteCTAEntity",deleteVideoAdditionalAssets:"/Mediusutility/DeleteVideoAdditionalAssetsEntity",deleteVideoMetadata:"/Mediusutility/DeleteVideoMetadataEntity",deleteVideosAsset:"/Mediusutility/DeleteVideosAssetsEntity",deleteVideoSearchFilterMapping:"/Mediusutility/DeleteVideoSearchFilterMappingEntity",deleteVideoSubclipper:"/Mediusutility/DeleteVideoSubclipperEntity",deleteVideoVerification:"/Mediusutility/DeleteVideoVerificationEntity",deleteYoutubeSyndicationStatus:"/Mediusutility/DeleteYoutubeSyndicationStatusEntity",deleteVideoTagsMapping:"/Mediusutility/DeleteVideoTagsMappingEntity",deleteVideoLike:"/Mediusutility/DeleteVideoLikeEntity",deleteRelatedVideo:"/Mediusutility/DeleteRelatedVideoEntity",deletePlaylistVideo:"/Mediusutility/DeletePlaylistVideoEntity",deleteEncodingTasks:"/Mediusutility/DeleteEncodingTasksEntity",deleteJob:"/Mediusutility/DeleteJobEntity",deleteBulkUpload:"/Mediusutility/DeleteBulkUploadEntity",deleteVideoInputAssets:"/Mediusutility/DeleteVideoInputAssetsEntity",getHomePageVideoTile:"/Home/RenderVideoTile",getHomePageChannelsTile:"/Home/RenderChannelTile",loadMoreChannelInAddToChannel:"/Video/AddToChannelList",loadMorePlaylistInAddToPlaylist:"/Video/AddToPlayList",deletePubbleApp:"/Mediusutility/DeletePubbleApplication",deletePubbleAppPosts:"/Mediusutility/DeletePubbleAppPosts",getPubblePageDetails:"/Video/GetPubbleDetails"},c={ImgVideoDND:"/Content/images/DefaultImg/Video_Dnp_.jpg",ImgLiveStreamStart:"/Content/images/DefaultImg/Live_Stream_Starting_Soon.jpg",ImgVideoComingSoon:"/Content/images/DefaultImg/Video_Will_Be_Available_Soon.jpg",ImgVideoNotAvailable:"/Content/images/DefaultImg/Video_Not_Available.jpg"},u=!1,l=!1,a=!1,v=!1,w=1,b=1,st=function(){vt();at();ii();ht()},ht=function(){for(var t,n=0;n<sessionStorage.length;++n)sessionStorage.key(n).indexOf("medius")!==-1&&(t={},t.properties=JSON.parse(sessionStorage.getItem(sessionStorage.key(n))),mediusAnalytics.sendTrackingdata(t),sessionStorage.removeItem(sessionStorage.key(n)))},ct=function(){if($("#msccBanner").length>0){var t=$("<i />").addClass("fa fa-times"),n=$("<a/>").addClass("pull-right").css({color:"#494647","padding-top":"14px","padding-right":"10px",cursor:"pointer"});n.append(t);n.prependTo($("#msccBanner"))}},lt=function(){$.ajax({url:"https://uhf.microsoft.com/en-gb/shell/api/mscc?sitename=medius&domain=medius.studios.ms&country=euregion",method:"GET",success:function(n){if(n.IsConsentRequired){$("<link>").attr("href",n.Css[0]).attr("rel","stylesheet").appendTo("head");var t=$("<div><div>").hide();t.append(n.Markup);t.find("#msccBanner").append('<span class="glyphicon glyphicon-remove" style="cursor:pointer;display:inline;vertical-align:sub;margin-left:10px;" onclick="$(\'#msccBanner\').hide();"><\/span>');$(".navbar-inverse").prepend(t);$.getScript(n.Js[0],function(){if(!mscc||mscc.hasConsent())$(".container").first().css("padding-top","0px");else{t.show();$(".container").first().css("padding-top","50px");mscc.on("consent",function(){$(".container").first().css("padding-top","0px")})}})}},complete:function(){ct()}})},at=function(){$("#myChannels").html("");$("#myVideos").html("")},vt=function(){$("#txtSearchOnNav").on("keyup",function(n){if(n.keyCode===13){var t="/Home/SearchResults?searchvalue="+$("#txtSearchOnNav").val();window.location.href=t}});$("body").append(i.copytoClipBoard);$(document).on("click",".embedVideolink",function(){var i=$(this).attr("data-vid"),u=$(this).attr("data-page"),r=$(this).attr("data-issecure"),o="video-nc",t,e,n;r!==null&&r!=""&&r!=="undefined"&&(r=="True"||r==!0)&&(o="video-aes");t="";u==="video"?(n=window.location.host,t='<iframe width="560" height="315" src="https://'+n+"/Embed/Video/"+i+'" frameborder="0" allowfullscreen><\/iframe>',e=$(this).attr("data-isYt"),e==="True"&&(t=t+'<!-------to play video from youtube----------><iframe width="560" height="315" src="https://'+n+"/Embed/Video/"+i+'?SFYT=true" frameborder="0" allowfullscreen><\/iframe>'),f(t)):u==="channel"?(n=window.location.host,t='<iframe width="560" height="315" src="https://'+n+"/Embed/channel/"+i+'" frameborder="0" allowfullscreen><\/iframe>',f(t)):u==="playlist"?(n=window.location.host,t='<!-------to render playlist Aside to player-------><iframe width="560" height="315" src="https://'+n+"/Embed/playlist/"+i+'" frameborder="0" allowfullscreen><\/iframe><!-------------to render playlist on player---------------------><iframe width="560" height="315" src="https://'+n+"/Embed/playlist?id="+i+'&showonplayer=true" frameborder="0" allowfullscreen><\/iframe>',f(t)):u==="search"&&(n=window.location.host,t='<iframe width="560" height="315" src="https://'+n+"/Embed/VideoSearch/"+i+'" frameborder="0" allowfullscreen><\/iframe>',f(t))});$(document).on("click",".embedCopyVideoUrl",function(){var u=$(this).attr("data-vid"),e=$(this).attr("data-page"),n=$(this).attr("data-issecure"),i="video-nc",t,r;n!==null&&n!=""&&n!=="undefined"&&(n=="True"||n==!0)&&(i="video-aes");t="";e==="video"&&(r=window.location.host,t="https://"+r+"/Embed/"+i+"/"+u+"?r="+Math.floor(Math.random()*0xfa0000002d),f(t))});$(".renderedCatagories").on("click",function(){var n=$(this).text().replace(/;/,"").trim().split(":"),t="/Home/Landing?"+n[0]+"="+n[1];window.open(t)});$(".renderedTags").on("click",function(){var n=$(this).text().trim(),t="/Home/Landing?Tags="+n;window.open(t)});$(function(){var n=decodeURIComponent(window.location.href),u=n.indexOf("?")>-1,f=window.location.pathname.toLowerCase().indexOf("landing")>-1,t="";if(window.location.port!=null&&(t=":"+window.location.port),u&&f){var i=n.split("?")[1].split("="),r=i[0].trim().replace(" ","_"),e=i[1];$("[filterType = "+r+"]").each(function(){$(this).attr("filterValue").indexOf(e)>-1&&($(this).trigger("click"),$("#heading_"+r).children().children().click(),window.history.pushState(null,null,window.location.protocol+"//"+window.location.hostname+t))})}});$(".captureTimeInstance").on("click",function(){k(this)});$(".captureTimeInstance").on("keydown",function(){event.which===13&&k(this)});$(document).on("click",".shareVideoLink",function(){var i=$(this).attr("data-vid"),r=$(this).attr("data-page"),t="",n;r==="video"?(n=window.location.host,t="https://"+n+"/Video/Details/"+i,p(t)):r==="channel"?(n=window.location.host,t="https://"+n+"/Channel/Details/"+i,p(t)):r==="search"&&(n=window.location.host,t="https://"+n+"/Embed/VideoSearch/"+i,p(t))});$(document).on("click",".linkaddToChannel",function(n){n.preventDefault();var t=$(this).attr("data-videoid");t!=""&&it(t)});$(document).on("click",".linkaddToPlayList",function(n){n.preventDefault();var t=$(this).attr("data-videoid");t!=""&&rt(t)});$(document).on("click","span.glyphicon.glyphicon-ok.addToChannelList",function(n){n.preventDefault();var r=$(this).attr("id"),t=r.split("_")[1],i=[];$("#ulchannellisfor_"+t).find("li").find(".chkAddToCheckList").each(function(){if($(this).is(":checked")){var n=$(this).attr("data-channelid");t>0&&i.push({VideoId:t,ChannelId:n})}});i.length>0&&ut(i)});$(document).on("keydown","span.glyphicon.glyphicon-ok.addToChannelList",function(n){if(n.which===13){n.preventDefault();var r=$(this).attr("id"),t=r.split("_")[1],i=[];$("#ulchannellisfor_"+t).find("li").find(".chkAddToCheckList").each(function(){if($(this).is(":checked")){var n=$(this).attr("data-channelid");t>0&&i.push({VideoId:t,ChannelId:n})}});i.length>0&&ut(i)}});$(document).on("click","span.addToplayList",function(n){n.stopPropagation();n.preventDefault();var r=$(this).attr("id"),t=r.split("_")[1],i=[];$("#ulPlaylistfor_"+t).find("li").find(".chkAddToplaylist").each(function(){if($(this).is(":checked")){var n=$(this).attr("data-playlistid");t>0&&i.push({VideoId:t,PlaylistId:n})}});i.length>0&&ft(i)});$(document).on("keydown","span.addToplayList",function(n){if(n.which===13){n.stopPropagation();n.preventDefault();var r=$(this).attr("id"),t=r.split("_")[1],i=[];$("#ulPlaylistfor_"+t).find("li").find(".chkAddToplaylist").each(function(){if($(this).is(":checked")){var n=$(this).attr("data-playlistid");t>0&&i.push({VideoId:t,PlaylistId:n})}});i.length>0&&ft(i)}});$(document).on("click","#btnBulkDeletePubblePost",function(){jQuery.noConflict();$("#PubbleDletionOptions").modal({show:"true"})});$(document).on("click","#btnPubblePostDeletaion",function(){var n={};n={postTypes:$("#MultiSelectOptionforPubble").val(),unapprovedOnly:$("#unapprovedOnlyId").prop("checked")?!0:!1,approvedOnly:$("#approvedOnlyId").prop("checked")?!0:!1,BothApproveAndUnapprove:$("#BothApproveAndUnapproveId").prop("checked")?!0:!1};gt(n)});$(document).on("click",".deleteAsset",function(){var n=$(this).attr("data-asetid"),t=$(this).attr("data-page"),i=$(this).parents(".custModel").attr("id");dt(n,t,i)});$(document).on("click",".Custclose",function(){$("#deleteconfirmDiv").length>0&&$("#deleteconfirmDiv").dialog("close")});$(document).on("click","#deleteasset",function(){var n=$(this).attr("data-assetid"),t=$(this).attr("data-urltodelete"),i=$(this).attr("data-eleid"),r={url:t,dataId:n,eletohide:i};ni(r);$("#detelconfirm").hide()});$(document).on("click",".videoTileHeaderEditOptions, .channelTileEditOptionsLink",function(){d(this)});$(document).on("keydown",".videoTileHeaderEditOptions,.channelTileEditOptionsLink",function(){event.which===13&&d(this)});$("body").on("click",function(n){$(n.target).parents(".tile").length<=0&&$(".custModel").hasClass("in")&&($(".custModel").modal("hide"),$("body").removeClass("modal-open"),$(".modal-backdrop").remove())})},k=function(n){var i=window.frames.videoToPlayNow,t;typeof i!="undefined"&&(t=i.AMPlayer.getCurrentTime(),typeof t!="undefined"&&t!="0.0666666"&&$(n).parent().parent().find("input").val(yt(t)))},yt=function(n){var t=Math.floor(n/3600),r=Math.floor((n-t*3600)/60),i=n-t*3600-r*60,u;return i=Math.round(i*1e7)/1e7,u=t<10?"0"+t:t,u+=":"+(r<10?"0"+r:r),u+(":"+(i<10?"0"+i:i))},d=function(n){var r,t,i;if($(n.children[0]).length>0){r=$(n.children[0]).data("target");$(r).on("shown.bs.modal",function(){$(".Custclose").focus()});if(t=$(r).find(".dialog-start")[0],i=$(r).find(".dialog-end")[0],t!==null&&i!==null){function u(n){var i=n||window.event,r=i.which||i.keyCode;r===9&&(i.preventDefault?i.preventDefault():i.returnValue=!1,t.focus())}function f(n){var t=n||window.event,r=t.which||t.keyCode;r===9&&t.shiftKey&&(t.preventDefault?t.preventDefault():t.returnValue=!1,i.focus())}i.addEventListener?i.addEventListener("keydown",u,!1):i.attachEvent&&i.attachEvent("onkeydown",u);t.addEventListener?t.addEventListener("keydown",f,!1):t.attachEvent&&t.attachEvent("onkeydown",f)}}},pt=function(n){if($(n).scrollTop()+$(n).innerHeight()>=$(n)[0].scrollHeight)if(u===!1&&l===!1)bt();else return!1;else return!1},wt=function(){if(u===!1&&v===!1)kt();else return!1},bt=function(){u===!1&&t>0&&$.ajax({type:"GET",url:n.loadMoreChannelInAddToChannel,datatype:"json",data:{pageindex:w,vid:t},success:function(n){if(n!==null&&n!==""){var i=0;$(n).filter(".addTochannelTile").each(function(){var n=$(this).html();i++});i>=4?($("#ulchannellisfor_"+t).append($(n)),$("#AddToChannel_"+t).find(".inlineLoader").hide(),u=!1):(l=!0,mediusCommon.createAlert("No more channels found.",mediusCommon.alertTypes.info,".container"),mediusCommon.createAutoClosingAlert(".alert-info",500));w++}else mediusCommon.createAlert("No more channels found.",mediusCommon.alertTypes.info,".container"),mediusCommon.createAutoClosingAlert(".alert-info",5e3),$("#AddToChannel_"+t).find(".inlineLoader").hide(),l=!0},cache:!1,beforeSend:function(){$("#AddToChannel_"+t).find(".inlineLoader").show();u=!0},complete:function(){u=!1;$("#AddToChannel_"+t).find(".inlineLoader").hide()},error:function(){mediusCommon.createAlert("Error in retriving playlist Video,Please try again later.",mediusCommon.alertTypes.error,"#myplaylistContainer");mediusCommon.createAutoClosingAlert(".alert-danger",2e3);$("#AddToPlaylist_"+t).find(".inlineLoader").hide()}})},kt=function(){a===!1&&t>0&&$.ajax({type:"GET",url:n.loadMorePlaylistInAddToPlaylist,datatype:"json",data:{pageindex:b,vid:t},success:function(n){if(n!==null&&n!==""){var i=0;$(n).filter(".addToPlaylistTile").each(function(){var n=$(this).html();i++});i>=4?($("#ulPlaylistfor_"+t).append($(n)),$("#AddToPlaylist_"+t).find(".inlineLoader").hide(),a=!1):(v=!0,mediusCommon.createAlert("No more playlist found.",mediusCommon.alertTypes.info,"#createVideoFrorms"),mediusCommon.createAutoClosingAlert(".alert-info",500));b++}else mediusCommon.createAlert("No more playlist found.",mediusCommon.alertTypes.info,"#myplaylistContainer"),mediusCommon.createAutoClosingAlert(".alert-info",5e3),$("#AddToPlaylist_"+t).find(".inlineLoader").hide(),v=!0},cache:!1,beforeSend:function(){$("#AddToPlaylist_"+t).find(".inlineLoader").show();a=!0},complete:function(){a=!1;$("#AddToPlaylist_"+t).find(".inlineLoader").hide()},error:function(){mediusCommon.createAlert("Error in retriving playlist Video,Please try again later.",mediusCommon.alertTypes.error,"#myplaylistContainer");mediusCommon.createAutoClosingAlert(".alert-danger",2e3);$("#AddToPlaylist_"+t).find(".inlineLoader").hide()}})},dt=function(t,i,r){var u="",f="",e="";switch(i){case"video":u=n.deleteVideo;f="Do you really want to delete selected video from medius?";e="video";break;case"channel":u=n.deleteChannel;f="Do you really want to delete selected channel from medius?";e="channel";break;case"playlist":u=n.deletePlaylist;f="Do you really want to delete selected playlist from medius?";e="playlist";break;case"search":u=n.deleteSearchgrid;f="Do you really want to delete selected searchgrid from medius?";e="searchgrid";break;case"deleteCta":u=n.deleteCta;f="Do you really want to delete selected record from medius?";break;case"deleteVideoAdditionalAssets":u=n.deleteVideoAdditionalAssets;f="Do you really want to delete selected record from medius?";break;case"deleteVideoMetadata":u=n.deleteVideoMetadata;f="Do you really want to delete selected record from medius?";break;case"deleteVideosAsset":u=n.deleteVideosAsset;f="Do you really want to delete selected record from medius?";break;case"deleteVideoSearchFilterMapping":u=n.deleteVideoSearchFilterMapping;f="Do you really want to delete selected record from medius?";break;case"deleteVideoSubclipper":u=n.deleteVideoSubclipper;f="Do you really want to delete selected record from medius?";break;case"deleteVideoVerification":u=n.deleteVideoVerification;f="Do you really want to delete selected record from medius?";break;case"deleteYoutubeSyndicationStatus":u=n.deleteYoutubeSyndicationStatus;f="Do you really want to delete selected record from medius?";break;case"deleteVideoTagsMapping":u=n.deleteVideoTagsMapping;f="Do you really want to delete selected record from medius?";break;case"deleteVideoLike":u=n.deleteVideoLike;f="Do you really want to delete selected record from medius?";break;case"deleteRelatedVideo":u=n.deleteRelatedVideo;f="Do you really want to delete selected record from medius?";break;case"deletePlaylistVideo":u=n.deletePlaylistVideo;f="Do you really want to delete selected record from medius?";break;case"deleteEncodingTasks":u=n.deleteEncodingTasks;f="Do you really want to delete selected record from medius?";break;case"deleteJob":u=n.deleteJob;f="Do you really want to delete selected record from medius?";break;case"deleteBulkUpload":u=n.deleteBulkUpload;f="Do you really want to delete selected record from medius?";break;case"deleteVideoInputAssets":u=n.deleteVideoInputAssets;f="Do you really want to delete selected record from medius?";break;case"deletePubbleApp":u=n.deletePubbleApp;f="Do you really want to delete selected pubble from medius?"}$("#deleteasset").attr("data-assetid",t);$("#deleteasset").attr("data-urltodelete",u);$("#deleteasset").attr("data-eleid",r);$("#deletemsg").text("").text(f);$("#detelconfirm").show()},gt=function(t){var i=$("#videoid").val(),r=$('input[name="__RequestVerificationToken"]').val();mediusCommon.executeXHR({url:n.deletePubbleAppPosts,contentType:"application/x-www-form-urlencoded",asyncCall:!1,method:"POST",data:{__RequestVerificationToken:r,deletePostTypes:t.postTypes,deleteUnapprovedOnly:t.unapprovedOnly,deleteApprovedOnly:t.approvedOnly,deleteBoth:t.BothApproveAndUnapprove,videoid:i}}).promise().then(function(n){var i=[],t,r;if(n.modelerrorlist!==undefined){for(t in n.modelerrorlist)i.push([t,n.modelerrorlist[t]]);if(i.length!==0)for(t=0;t<i.length;t++)document.getElementById(i[t][0])!==null&&(r=document.getElementById(i[t][0]),r.innerHTML="<span style='color: red;'>"+i[t][1][0]+"<\/span > ")}n.success>0?($("#PubbleDletionOptions").modal("hide"),mediusCommon.createAlert("Pubble Post Deleted successfully",mediusCommon.alertTypes.success,"#PubbleDletionOptions"),mediusCommon.createAutoClosingAlert(".alert-success",2e3)):(mediusCommon.createAlert(n.err,mediusCommon.alertTypes.error,"#PubbleDletionOptions"),mediusCommon.createAutoClosingAlert(".alert-danger",2e3))},function(n){alert(n)})},ni=function(t){var i,r,u;t.dataId!==null&&typeof t.dataId!="undefined"?(i="",r="",t.url==n.deleteChannel||t.url==n.deleteVideo||t.url==n.deletePlaylist||t.url==n.deleteSearchgrid?(u=$('input[name="__RequestVerificationToken"]').val(),i={__RequestVerificationToken:u,Id:t.dataId},r="application/x-www-form-urlencoded"):(i=JSON.stringify({Id:t.dataId}),r="application/json; charset=utf-8"),$("#pageLoader").show(),y({url:t.url,contentType:r,method:"POST",data:i}).promise().then(function(n){n.success>0?($("#"+t.eletohide).parents("#myChannels").length===1?g("channel"):$("#"+t.eletohide).parents("#myVideos").length===1&&g("video"),t.url==="/Mediusutility/DeletePubbleApplication"&&wi(),$("#searchShortCode").trigger("click"),$("#"+t.eletohide).parents(".tile").remove(),$(".modal-backdrop").remove(),$("body").removeClass("modal-open"),$("#detelconfirm").hide(),mediusCommon.createAlert("Deleted successfully",mediusCommon.alertTypes.success,"#container"),mediusCommon.createAutoClosingAlert(".alert-success",2e3)):($("#detelconfirm").hide(),mediusCommon.createAlert("Error while deleting ",mediusCommon.alertTypes.error,"#container"),mediusCommon.createAutoClosingAlert(".alert-danger",2e3));$("#pageLoader").hide()},function(n){console.log(n);$("#pageLoader").hide();$("#detelconfirm").hide();mediusCommon.createAlert("Error while deleting ",mediusCommon.alertTypes.error,"#container");mediusCommon.createAutoClosingAlert(".alert-danger",2e3)})):($("#pageLoader").hide(),$("#detelconfirm").hide(),mediusCommon.createAlert("Error while deleteing record",mediusCommon.alertTypes.error,"#container"),mediusCommon.createAutoClosingAlert(".alert-danger",2e3))},g=function(n){switch(n){case"channel":nt();break;case"video":tt()}},nt=function(){$.ajax({url:n.getHomePageChannelsTile,method:"GET",cache:!1,beforeSend:function(){},success:function(n){$("#myChannels").html("");$("#myChannels").append(n)},error:function(){s()},complete:function(){s()}})},s=function(){$("#pageLoader").hide()},ti=function(){$("#pageLoader").show()},tt=function(){$.ajax({url:n.getHomePageVideoTile,method:"GET",cache:!1,beforeSend:function(){},success:function(n){$("#myVideos").html("");$("#myVideos").append(n)},error:function(){s()},complete:function(){s()}})},ii=function(){var n=$("#txtSearchOnNav");n.length===1&&($("#txtSearchOnNav").autocomplete({source:function(n,t){mediusCommon.fillVideoSearchBox(n,t)},appendTo:"#globSearch",select:function(n,t){return event.preventDefault(),$("#displaySearchedResult_"+t.item.value).css("background-color","#428bca"),window.location.href="/video/Details/"+t.item.value,!1},focus:function(n,t){return event.preventDefault(),$('[id^="displaySearchedResult_"]').css("background-color","transparent"),$("#displaySearchedResult_"+t.item.value).css("background-color","#428bca"),!1},minLength:1}).data("ui-autocomplete")._renderItem=function(n,t){var r,e,o,i;if(typeof t.label!="undefined"){r=t.asset;r===null&&(r="/Content/images/defaultVideos.png");var c=t.label,l=t.value,s=t.isAdmin,i="",u='<div class="row playlistItem "><div class="col-lg-5 col-md-5 col-sm-5 col-xs-5 leftthumbnail "><img src="{{imgurl}}" class="related-video-img media-object playlistThumbnail" alt=""><\/div><div class="col-lg-7 col-md-7 col-sm-7 col-xs-7 rightinfo"> <div class="divforPlaylisttitle"><span class="playlist_heading ">{{title}}<\/span><\/div><p class="playlist-paragraph block-with-text">{{description}}<\/p><\/div>',f='<hr style= "width:94%;border-top-color:rgba(51, 51, 51, 1);" ><\/div>';i=s===!0?u+'<div class="embedLink pull-right padding-right125em"><span class="glyphicon glyphicon-edit"><\/span> <u><span><a href="/Video/create/{{guid}}" title="Edit video"><text class="themeColor embedLink">Edit<\/text><\/a><\/span><\/u> &nbsp;|&nbsp; <span class="glyphicon glyphicon-time"><\/span> <u><span><a href="/Video/Status?videoGuid={{guid}}" title="WorkFlow Status"><text class="themeColor">W-Status<\/text><\/a><\/span><\/u><\/div>'+f:u+f;e={imgurl:r,title:t.label,description:t.description,guid:t.value};o=h(i,e);$(".embedLink").off("click").on("click",function(n){n.stopPropagation()});return $("<li><\/li>").data("ui-autocomplete-item",t).append(o).appendTo(n)}return i='<div class="row playlistItem " style="height: 40px; font-size: 15px; margin-top: 4px;"><span> No Video Found<\/span><\/div>',$("customVideoSearchAutoComplete").attr("style","overflow:hidden"),$("customVideoSearchAutoComplete").attr("style","overflow:hidden"),$("<li><\/li>").data("ui-autocomplete-item",t).append(i).appendTo(n)})},ri=function(t,i){$.ajax({url:n.getAllVideosBasedOnSearchString,data:{searchPrefix:t.term},type:"POST",success:function(n){i($.map(n,function(n){return n}));$("#globSearch").find(".ui-autocomplete").addClass("customVideoSearchAutoComplete");$("#globSearch").find(".vjs-menu-content").addClass("customVideoSearchAutoComplete")}})},t=0,it=function(n){var r,u;$("#ulchannellisfor_"+n+" li").length==0&&(r={vid:n},l=!1,w=1,t=n,u=h(i.getListofchannelsToAdd,r),$("#AddToChannel_"+n).find(".inlineLoader").show(),$("#ulchannellisfor_"+n).load(u,function(){$("#ulchannellisfor_"+n).find(".addTochannelTile").length>0&&$("#yesNobtnForAddToChannelList_"+n).show();$("#AddToChannel_"+n).find(".inlineLoader").hide()}))},rt=function(n){var r,u;$("#ulPlaylistfor_"+n+" li").length==0&&(r={vid:n},v=!1,b=1,t=n,u=h(i.getListofPlaylistToAdd,r),$("#AddToPlaylist_"+n).find(".inlineLoader").show(),$("#ulPlaylistfor_"+n).load(u,function(){$("#yesNobtnForAddToPlaylist_"+n).show();$("#AddToPlaylist_"+n).find(".inlineLoader").hide()}))},ut=function(t){var i=JSON.stringify({videoChannelsList:t});y({url:n.saveVideoToChannels,method:"POST",data:i}).promise().then(function(n){n.Success>0?($("#ulchannellisfor_"+t[0].VideoId).html(""),it(t[0].VideoId),mediusCommon.createAlert("Video Channels saved successfully",mediusCommon.alertTypes.success,"#container"),mediusCommon.createAutoClosingAlert(".alert-success",2e3)):(mediusCommon.createAlert("Error while saveing video Channels",mediusCommon.alertTypes.error,"#container"),mediusCommon.createAutoClosingAlert(".alert-danger",2e3))},function(n){console.log(n)})},ft=function(t){var i=JSON.stringify({playlistvideosList:t});y({url:n.saveVideoToPlaylist,method:"POST",data:i}).promise().then(function(n){n.Success>0?($("#ulPlaylistfor_"+t[0].VideoId).html(""),rt(t[0].VideoId),mediusCommon.createAlert("Video playlist saved successfully",mediusCommon.alertTypes.success,"#container"),mediusCommon.createAutoClosingAlert(".alert-success",2e3)):(mediusCommon.createAlert("Error while saveing video playlist",mediusCommon.alertTypes.error,"#container"),mediusCommon.createAutoClosingAlert(".alert-danger",2e3))},function(n){console.log(n)})},y=function(n){n.url=n.url.toLowerCase();(n.useCredentials===undefined||n.useCredentials===null)&&(n.useCredentials=!1);n.useCredentials&&(jQuery.support.cors=!0);n.method||(n.method="GET");n.headers||(n.headers={Accept:"application/json; odata=verbose"});(n.datatype===undefined||n.datatype===null)&&(n.datatype="json");(n.contentType===undefined||n.contentType===null)&&(n.contentType="application/json; charset=utf-8");(n.asyncCall===undefined||n.asyncCall===null)&&(n.asyncCall=!0);n.data=n.data?n.stringifyData?JSON.stringify(n.data):n.data:"";var t=$.Deferred();return $.ajax({url:n.url,contentType:n.contentType,dataType:n.datatype,method:n.method,headers:n.headers,async:n.asyncCall,cache:!1,data:n.data,xhrFields:{withCredentials:n.useCredentials},beforeSend:function(){},success:function(n){t.resolve(n)},error:function(n){t.reject(n)},complete:function(){}}),t},ui=function(){return $("#IsSealed").prop("disabled")?!0:$("#IsSealed").prop("checked")?!0:!1},fi=function(n,t,i){typeof i==undefined&&(i="owners");$.ajax({url:"/Users/AutoComplete/",data:{prefix:n.term.trim().toLowerCase(),isFormAuthenticated:!1},dataType:"json",type:"GET",contentType:"application/json; charset=utf-8",success:function(n){t($.map(n,function(n){return n}))},beforeSend:function(){i=="AdditionalOwners"?$("#inLoderAdditionalOwners").css("visibility","visible"):$("#inLoderOwner").css("visibility","visible")},error:function(n){console.log(n.responseText)},failure:function(n){alert(n.responseText)},complete:function(){i=="AdditionalOwners"?$("#inLoderAdditionalOwners").css("visibility","hidden"):$("#inLoderOwner").css("visibility","hidden")}})},ei=function(t,i){var r=$("#ShortCode").val();$.ajax({url:n.getAllRooms,data:{prefix:t.term,shortCode:r},dataType:"json",type:"GET",contentType:"application/json; charset=utf-8",success:function(n){i($.map(n,function(n){return n}))},beforeSend:function(){$("#inLoderRooms").css("visibility","visible")},error:function(n){console.log(n.responseText)},failure:function(n){alert(n.responseText)},complete:function(){$("#inLoderRooms").css("visibility","hidden")}})},oi=function(n,t){var s,u;$("#RoomIdSessionImport").val(t.item.label);var h={name:t.item.label},c=t.item.label,f=!1;$("#ulselectedRooms>a").each(function(){$(this).attr("data-title").trim().toLowerCase()===c.trim().toLowerCase()&&(f=!0)});f===!1?(s=mediusCommon.replaceAll(i.selectedOwner,h),$(s).appendTo("#ulselectedRooms"),$(".selectedRoomsContent").show(),$("#ulselectedRooms").scrollTop(0),$("#ulselectedRooms").scrollTop($("#ulselectedRooms")[0].scrollHeight),u="",$("#ulselectedRooms a").each(function(){u=u+" "+$(this).text()+";"}),$("#RoomIdSessionImport").val("")):(e("Already selected",r.warning,"#createVideoFrorms "),o(".alert-warning",2e3),$("#RoomIdSessionImport").val(""))},h=function(n,t){var i,r;for(i in t)t.hasOwnProperty(i)&&(t["{{"+i+"}}"]=t[i],delete t[i]);return r=new RegExp(Object.keys(t).join("|"),"gi"),n.replace(r,function(n){return t[n]})},si=function(n){var t=$(n).val(),i,r;$("#previewTitle").text("").text(t);$(n).attr("data-isChannel")==="true"&&(i=$("#ChannelKey").val(),r="",i.indexOf(":")>-1?(r=i.split(":")[0],$("#ChannelKey").val(r+":"+t.replace(/\W+/g,""))):$("#ChannelKey").val(t.replace(/\W+/g,"")))},hi=function(n){var t=$(n).val();$("#previewDescrip").text("").text(t)},ci=function(n){var t=$(n).val();$("#speakerheader").removeClass("displayNone");$("#previewspeaker").text("").text(t)},li=function(n){var t=$(n).val();$("#previewOwner").text("").text(t)},ai=function(n){var t=$(n).val();t!==""?($("#PublishDate").datepicker({dateFormat:"dd-mm-yy"}),$("#previewVideoPubDate").text("").text($("#PublishDate").val())):$("#previewVideoPubDate").text("").text(t.replace("00:00:00",""))},vi=function(n){var t=$(n).val();t!==""?($("#SessionEndTime").datepicker({dateFormat:"dd-mm-yy"}),$("#previewVideoEndDate").text("").text($("#SessionEndTime").val())):$("#previewVideoEndDate").text("").text(t.replace("00:00:00",""))},yi=function(n){$(n).parent().remove()},pi=function(n){var i=$(n).val(),u=new RegExp("^<iframe(.*)><\/iframe>$"),f=u.test(i),t;f?(t=$(n).val(),t!==""?($("#playerPreviewDiv").html(t),$("#playerPreviewDiv").css("display","block"),$("#previewVideoThumbnail").hide()):($("#previewVideoThumbnail").show(),$("#playerPreviewDiv").html('<img src="/Content/images/defaultChannels.png" id="previewVideoThumbnail" alt="">'))):(e("Please enter valid iframe code.you might entered wrong iframe code",r.error,""),o(".alert-danger",1e3))},f=function(n){et.tryCopyTextToClipboard(n.toString())},p=function(n){et.tryCopyTextToClipboard(n.toString())},et=function(){function n(){}return n.tryCopyTextToClipboard=function(n){var t=$("#clipboard")[0];$(t).show();t.value=n;t.select();try{document.execCommand("copy")?(e("Copied to Clipboard!",r.success,"body"),o(".alert-success",2e3)):(e("Failed to Copy :-(",r.error,"body"),o(".alert-danger",2e3))}catch(i){e("Failed to Copy :-(",r.error,"body");o(".alert-danger",2e3)}$(t).hide()},n}(),wi=function(){var t=$("#videoid").val();$.ajax({url:n.getPubblePageDetails,method:"GET",cache:!1,data:{videoid:t},success:function(n){$("#collapsePubbleInfo").html("");$("#collapsePubbleInfo").append(n);videoManager.init()},error:function(){},complete:function(){}})},e=function(n,t,r){var e={msg:n},u="",f;switch(t){case"successalert":u=i.alertMessageTemplate.saveSuccess;break;case"erroralert":u=i.alertMessageTemplate.error;break;case"warningtalert":u=i.alertMessageTemplate.warning;break;case"infoalert":u=i.alertMessageTemplate.info}f=h(u,e);$(r).append($(f))},bi=function(n){var t=n.split("@");return t.length===2&&(t[1].toLowerCase()==="outlook.com"||t[1].toLowerCase()==="live.com"||t[1].toLowerCase()==="microsoft.com")?!0:!1},ki=function(n){var t=!1;return n!==""&&n.indexOf("-")===-1&&(t=ot(n)?!0:!1),t},ot=function(n){var t=n.split("@");return t.length===2&&t[1].toLowerCase()==="microsoft.com"&&!t[0].toLowerCase().match("^v-")?!0:!1},di=function(){$(".loadmoreActiondiv").removeClass("loadingmsgDiv")},gi=function(){$(".loadmoreActiondiv").addClass("loadingmsgDiv")},nr=function(n,t){if(t.length>0)return t;var i="";switch(n){case"ImgVideoDND":i=c.ImgVideoDND;break;case"ImgLiveStreamStart":i=c.ImgLiveStreamStart;break;case"ImgVideoComingSoon":i=c.ImgVideoComingSoon;break;case"ImgVideoNotAvailable":i=c.ImgVideoNotAvailable}return i};return{alertTypes:r,init:st,executeXHR:y,replaceAll:h,ChangePreviewTitle:si,ChangePreviewDescription:hi,ChangePreviewSpeaker:ci,ChangePreviewOwner:li,ChangePreviewPubDate:ai,ChangePreviewSessionEndDate:vi,removeParent:yi,changePreviewEmbed:pi,promptEmbedMessage:f,promptShareLinkMessage:p,fillOwnerSearchBox:fi,createAlert:e,validateContributorName:bi,validationFTEUser:ki,validateOnlyMSDomain:ot,createAutoClosingAlert:o,fillVideoSearchBox:ri,hideLoadingMSg:di,showLoadingMsg:gi,hidePageLoader:s,showPageLoader:ti,loadmoreChannelScroll:pt,loadmorePlaylistScroll:wt,loadHomepageChannels:nt,loadHomePageVideos:tt,checkForUserConsetnt:lt,GetImageForVideo:nr,handleRoomsSelection:oi,fillRoomsSearchBox:ei,checkSealedValue:ui}}(),mediusAnalytics;Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(n){var i,u,f,t,r;if(this==null)throw TypeError('"this" is null or not defined');if(i=Object(this),u=i.length>>>0,typeof n!="function")throw TypeError("predicate must be a function");for(f=arguments[1],t=0;t<u;){if(r=i[t],n.call(f,r,t,i))return r;t++}return undefined},configurable:!0,writable:!0});mediusAnalytics=function(){"use strict";var r={linkClicked:"lc"},t=[{name:"vjs-play-control",eleReg:"Player",AIT:"",CG:"play/pause"},{name:"vjs-big-play-button",eleReg:"Player",AIT:"Big Play button",CG:"BigPlayButton"},{name:"amp-feedback-control",eleReg:"Player",AIT:"feedback link",CG:"feedback"},{name:"amp-playbackrate-control",eleReg:"Player",AIT:"Playback Speed link",CG:"PlaybackSpeed"},{name:"amp-audiotracks-control",eleReg:"Player",AIT:"Audito Track link",CG:"AuditoTrack"},{name:"vjs-subtitles-button",eleReg:"Player",AIT:"Subtitle link",CG:"Subtitle"},{name:"amp-quality-control",eleReg:"Player",AIT:"quality control link",CG:"qualitycontrol"},{name:"amp-moreoptions-control",eleReg:"Player",AIT:"moreoptions link",CG:"moreoptions"},{name:"amp-share-control",eleReg:"Player",AIT:"share link",CG:"share"},{name:"vjs-captionsearch-button",eleReg:"Player",AIT:"Caption Search link",CG:"CaptionSearch"},{name:"amp-donwload-control",eleReg:"Player",AIT:"donwload link",CG:"donwload"},{name:"vjs-volume-bar",eleReg:"Player",AIT:"volume control",CG:"volumecontrol"},{name:"vjs-volume-menu-button",eleReg:"Player",AIT:"volume menu",CG:"volume"},{name:"vjs-fullscreen-control",eleReg:"Player",AIT:"fullscreen link",CG:"FullScreen"},{name:"vjs-seek-handle",eleReg:"Player",AIT:"No Title",CG:"Progressbar"},{name:"vjs-volume-handle",eleReg:"Player",AIT:"No Title",CG:"VolumeSlider"},{name:"shareicononsharepanel",eleReg:"Player",AIT:"No Title",CG:"share icon"}],n={},u=function(){f()},f=function(){$(document).on("click",function(r){var v,s,u,h,o,w,b,f;if($(r.target).attr("data-ai")){var e=$(r.target)[0],d=e.nodeName,l=e.getAttribute("Title"),a=e.getAttribute("data-catagory"),y="",p="";typeof l!="undefined"&&l!==null&&l!=""&&(y=l);typeof a!="undefined"&&a!==null&&a!==""&&(p=a);v=e.getAttribute("data-eleregion");s="";switch(d){case"A":s=e.getAttribute("href");break;case"IMG":s=e.getAttribute("data-url");break;case"DIV":s=e.getAttribute("data-tu")}u={rg:v,aitl:y,tu:s,cg:p};$(r.target).hasClass("shareicononsharepanel")&&(c=!0,h=$(r.target).parent("a").attr("href"),o="",h.indexOf("facebook")>-1?o=" facebook":h.indexOf("twitter")>-1?o=" twitter":h.indexOf("linkedin")>-1?o=" linkedin":h.indexOf("mailto")>-1&&(o=" mail"),v=$(r.target).attr("data-eleregion"),u.rg=v,u.aitl=$(r.target).attr("title")+o,u.tu="",u.cg=$(r.target).attr("data-catagory"));($(r.target).hasClass("divforrecDesconplayer")||$(r.target).hasClass("recommLinkOnCTAoverlay"))&&(c=!0,u.rg=$(r.target).attr("data-eleregion"),u.aitl=$(r.target).attr("title"),u.tu=$(r.target).attr("data-tu"),u.cg=$(r.target).attr("data-catagory"));$(r.target).attr("data-sessionStorage")?(w=JSON.stringify(u),b=sessionStorage.length+1,sessionStorage.setItem("medius_"+b,w)):(n={},n.properties=u,i(n))}else{var u={},k=!1,c=!1;for(f=0;f<t.length;f++)$(r.target).hasClass(t[f].name)&&(k=!0,t[f].name==="vjs-play-control"&&($(r.target).hasClass("vjs-playing")?(c=!0,u.rg=t[f].eleReg,u.aitl=t[f].AIT+" pause Click",u.tu="",u.cg=t[f].CG):$(r.target).hasClass("vjs-paused")&&(c=!0,u.rg=t[f].eleReg,u.aitl=t[f].AIT+" play Click",u.tu="",u.cg=t[f].CG)),c===!1&&(u.rg=t[f].eleReg,u.aitl=t[f].AIT,u.tu="",u.cg=t[f].CG));k&&(n={},n.properties=u,i(n))}});setTimeout(function(){var u=document.querySelectorAll(".amp-closedcaption-control li.vjs-menu-item"),f=document.querySelectorAll(".amp-subtitles-control li.vjs-menu-item"),t,r;if(u.length>0||f.length>0){for(t=0;t<u.length;t++)r=u[t].innerText,r.toLowerCase()!="off"&&r.toLowerCase()!="settings"&&r.toLowerCase()!="captions off"&&u[t].addEventListener("mousedown",function(){var t={};t.rg="player";t.aitl=r;t.tu="";t.cg="Closed Caption Language";n={};n.properties=t;i(n)});for(t=0;t<f.length;t++)r=f[t].innerText,r.toLowerCase()!="off"&&r.toLowerCase()!="settings"&&r.toLowerCase()!="captions off"&&f[t].addEventListener("mousedown",function(){var t={};t.rg="player";t.aitl=r;t.tu="";t.cg="subtitles Language";n={};n.properties=t;i(n)})}},3e3);setTimeout(function(){function u(r){for(var u,f=0;f<t.length-1;f++)if(u={},$(r).hasClass(t[f].name)){u.rg=t[f].eleReg;u.aitl=$(r).attr("title")!==""&&typeof $(r).attr("title")!="undedefined"?$(r).attr("title"):t[f].AIT;u.tu="";u.cg=t[f].CG;n={};n.properties=u;i(n);break}else if($(r).parents(".amp-playbackrate-control").length>0){u.rg="player";u.aitl=$(r).text();u.tu="";u.cg="PlaybackRate";n={};n.properties=u;i(n);break}else if($(r).parents(".amp-quality-control").length>0){u.rg="player";u.aitl=$(r).text();u.tu="";u.cg="quality value";n={};n.properties=u;i(n);break}else if($(r).hasClass("amp-feedback-control")){u.rg="player";u.aitl="Feedback";u.tu="";u.cg="Feedback";n={};n.properties=u;i(n);break}}var h=document.querySelectorAll(".Custome-MoreMenu .vjs-menu-item"),f,e,o,l,a,c,s,r;if(h.length>0)for(r=0;r<h.length-1;r++)h[r].addEventListener("mousedown",function(){console.log($(this));u($(this))});if(f=document.querySelectorAll(".amp-captionsearch-control .custom-caption-Search"),f.length>0)for(r=0;r<f.length-1;r++)f[r].addEventListener("mousedown",function(){u($(this))});if(e=document.querySelectorAll(".vjs-control-bar .vjs-progress-holder"),e.length>0)for(r=0;r<e.length-1;r++)e[r].addEventListener("mousedown",function(){u($(this))});if(o=document.querySelectorAll(".amp-controlbaricons-right .amp-playbackrate-control ul.vjs-menu-content li.amp-menu-item"),o.length>0)for(r=0;r<o.length-1;r++)o[r].addEventListener("mousedown",function(){u($(this))});if(l=document.querySelectorAll(".amp-controlbaricons-right .amp-subtitles-control"),$(l[1]).text("").text("Captions"),a=document.querySelectorAll(".amp-controlbaricons-right .amp-subtitles-control ul.vjs-menu-content li.amp-menu-header"),$(a).text("").text("Captions"),c=document.querySelectorAll(".amp-controlbaricons-right .amp-moreoptions-control .vjs-control-content .vjs-menu ul.vjs-menu-content li.amp-feedback-control "),c.length>0&&c[0].addEventListener("mousedown",function(){u($(this))}),s=document.querySelectorAll(".amp-controlbaricons-right .amp-quality-control ul.vjs-menu-content li.vjs-menu-item"),s.length>0)for(r=0;r<s.length-1;r++)s[r].addEventListener("mousedown",function(){u($(this))})},2e3)},i=function(n){if(window.appInsights){var t={ru:document.referrer||""};t=$.extend(t,t,n.properties);appInsights.trackEvent(r.linkClicked,t)}else console.log("App Insights not detected")};return{init:u,sendTrackingdata:i}}();$(document).ready(function(){mediusAnalytics.init()})