define(["require","apphost","layoutManager","focusManager","globalize","loading","connectionManager","homeSections","dom","events","listViewStyle","emby-select","emby-checkbox"],function(require,appHost,layoutManager,focusManager,globalize,loading,connectionManager,homeSections,dom,events){"use strict";function renderViews(page,user,result){var folderHtml="";folderHtml+='
',folderHtml+=result.map(function(i){var currentHtml="",id="chkGroupFolder"+i.Id,isChecked=-1!==user.Configuration.GroupedFolders.indexOf(i.Id),checkedHtml=isChecked?' checked="checked"':"";return currentHtml+=""}).join(""),folderHtml+="
",page.querySelector(".folderGroupList").innerHTML=folderHtml}function getLandingScreenOptions(type){var list=[];return"movies"===type?(list.push({name:globalize.translate("sharedcomponents#Movies"),value:"movies",isDefault:!0}),list.push({name:globalize.translate("sharedcomponents#Suggestions"),value:"suggestions"}),list.push({name:globalize.translate("sharedcomponents#Favorites"),value:"favorites"}),list.push({name:globalize.translate("sharedcomponents#Collections"),value:"collections"})):"tvshows"===type?(list.push({name:globalize.translate("sharedcomponents#Shows"),value:"shows",isDefault:!0}),list.push({name:globalize.translate("sharedcomponents#Suggestions"),value:"suggestions"}),list.push({name:globalize.translate("sharedcomponents#Latest"),value:"latest"}),list.push({name:globalize.translate("sharedcomponents#Favorites"),value:"favorites"})):"music"===type?(list.push({name:globalize.translate("sharedcomponents#Suggestions"),value:"suggestions",isDefault:!0}),list.push({name:globalize.translate("sharedcomponents#Albums"),value:"albums"}),list.push({name:globalize.translate("sharedcomponents#HeaderAlbumArtists"),value:"albumartists"}),list.push({name:globalize.translate("sharedcomponents#Artists"),value:"artists"}),list.push({name:globalize.translate("sharedcomponents#Playlists"),value:"playlists"}),list.push({name:globalize.translate("sharedcomponents#Genres"),value:"genres"})):"livetv"===type&&(list.push({name:globalize.translate("sharedcomponents#Suggestions"),value:"suggestions",isDefault:!0}),list.push({name:globalize.translate("sharedcomponents#Guide"),value:"guide"})),list}function getLandingScreenOptionsHtml(type,userValue){return getLandingScreenOptions(type).map(function(o){var selected=userValue===o.value||o.isDefault&&!userValue,selectedHtml=selected?" selected":"";return'"}).join("")}function renderViewOrder(context,user,result){var html="",index=0;html+=result.Items.map(function(view){var currentHtml="";return currentHtml+='',currentHtml+='
',currentHtml+='
',currentHtml+="
",currentHtml+=view.Name,currentHtml+="
",currentHtml+="
",currentHtml+='
',currentHtml+='
',currentHtml+="
",index++,currentHtml}).join(""),context.querySelector(".viewOrderList").innerHTML=html}function updateHomeSectionValues(context,userSettings){for(var i=1;i<=7;i++){var select=context.querySelector("#selectHomeSection"+i),defaultValue=homeSections.getDefaultSection(i-1),option=select.querySelector("option[value="+defaultValue+"]")||select.querySelector('option[value=""]'),userValue=userSettings.get("homesection"+(i-1));option.value="",select.value=userValue!==defaultValue&&userValue?userValue:""}context.querySelector(".selectTVHomeScreen").value=userSettings.get("tvhome")||""}function getPerLibrarySettingsHtml(item,user,userSettings,apiClient){var isChecked,html="";if("Channel"!==item.Type&&"boxsets"!==item.CollectionType&&"playlists"!==item.CollectionType||(isChecked=-1===(user.Configuration.MyMediaExcludes||[]).indexOf(item.Id),html+="",html+="",html+="
"),-1===["playlists","livetv","boxsets","channels"].indexOf(item.CollectionType||"")&&(isChecked=-1===user.Configuration.LatestItemsExcludes.indexOf(item.Id),html+='"),html&&(html=''+html+"
"),"movies"===item.CollectionType||"tvshows"===item.CollectionType||"music"===item.CollectionType||"livetv"===item.CollectionType){var idForLanding="livetv"===item.CollectionType?item.CollectionType:item.Id;html+='',html+='",html+="
"}if(html){var prefix="";prefix+='',prefix+='
',prefix+=item.Name,prefix+="
",html=prefix+html,html+=""}return html}function renderPerLibrarySettings(context,user,userViews,userSettings,apiClient){for(var elem=context.querySelector(".perLibrarySettings"),html="",i=0,length=userViews.length;i