{"version":3,"file":"ExpandableNavigationGallery.Main.min.js","mappings":"yBAIMA,OAAQC,sCCFP,WACN,IAAMC,EAAsBC,EAAE,0CACxBC,EAAiBD,EAAE,oDAIzB,SAASE,IACR,IAAMC,EAAkBH,EAAE,0BAA0BI,QAC9CC,EAASC,KAAKC,IAAID,KAAKE,MAAML,EAJC,KADL,GAO/BF,EAAOQ,MAAM,EAAGJ,GAAQK,OACxBT,EAAOQ,MAAMJ,GAAQM,OAEjBV,EAAOW,OAASP,EACnBN,EAAYW,OAEZX,EAAYY,MAEd,CAEAZ,EAAYc,GAAG,kBAAkB,SAAUC,GAC1C,GAAe,aAAXA,EAAEC,MAAmC,KAAZD,EAAEE,MAA/B,CAIA,IAAMC,EAAmBhB,EAAOiB,OAAO,WAAWC,QAElDlB,EAAOS,OACPV,EAAEoB,MAAMT,OAERM,EAAiBI,KAAK,KAAKC,OAP3B,CAQD,IAEApB,IACAF,EAAEH,QAAQ0B,OAAOrB,EAClB,C","sources":["/./ExpandableNavigationGallery/ExpandableNavigationGallery.Main.ts","/./ExpandableNavigationGallery/ExpandableNavigationGallery.ts"],"sourcesContent":["// Copyright (C) Microsoft Corporation. All rights reserved.\r\n\r\nimport { InitializeExpandableNavigationGallery } from './ExpandableNavigationGallery';\r\n\r\n(window).InitializeExpandableNavigationGallery = InitializeExpandableNavigationGallery;\r\n","// Copyright (C) Microsoft Corporation. All rights reserved.\r\n\r\nexport function InitializeExpandableNavigationGallery() {\r\n\tconst $seeAllLink: JQuery = $('.expandableNavigationGallerySeeAllLink');\r\n\tconst $items: JQuery = $('.nav-gallery-expandable__cta-grid__column--image');\r\n\tconst $maxItemsPerRow: number = 9;\r\n\tconst $itemWidthWithMargin: number = 120;\r\n\r\n\tfunction updateItemVisibility() {\r\n\t\tconst $containerWidth = $('.nav-gallery__cta-grid').width();\r\n\t\tconst $count = Math.min(Math.floor($containerWidth / $itemWidthWithMargin), $maxItemsPerRow);\r\n\r\n\t\t$items.slice(0, $count).show();\r\n\t\t$items.slice($count).hide();\r\n\r\n\t\tif ($items.length > $count) {\r\n\t\t\t$seeAllLink.show();\r\n\t\t} else {\r\n\t\t\t$seeAllLink.hide();\r\n\t\t}\r\n\t}\r\n\r\n\t$seeAllLink.on('click keypress', function (e: JQuery.Event) {\r\n\t\tif (e.type === 'keypress' && e.which !== 13) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst $firstHiddenItem = $items.filter(':hidden').first();\r\n\r\n\t\t$items.show();\r\n\t\t$(this).hide();\r\n\r\n\t\t$firstHiddenItem.find('a').focus();\r\n\t});\r\n\r\n\tupdateItemVisibility();\r\n\t$(window).resize(updateItemVisibility);\r\n}\r\n\r\n\r\n"],"names":["window","InitializeExpandableNavigationGallery","$seeAllLink","$","$items","updateItemVisibility","$containerWidth","width","$count","Math","min","floor","slice","show","hide","length","on","e","type","which","$firstHiddenItem","filter","first","this","find","focus","resize"],"sourceRoot":""}