{"version":3,"file":"resources.min.js","sources":["resources.min.js"],"sourcesContent":["\"use strict\";\n\n(function ($, Drupal) {\n function showReadMore(context) {\n // Resources/Blog/Newsroom Search Show read more text in the link\n $('.js-anchor-text-update-to-readmore a').text('Read More');\n\n // RESOURCES\n // When the query string has ?download = 1, then show\n // a different layout with the resource and hide the gated form section\n var urlParameter = Drupal.getUrlParameter('download');\n var download = parseInt(urlParameter, 10);\n var sales = $('#sales-user').attr('data-value');\n /* Show and hide sections */\n if (download === 1 || sales === 'true') {\n $('.js-resources-gated-true').show();\n $('.js-resources-gated-false').hide();\n $('.resource-image').toggleClass('gated-video');\n $('.resource-detail-content').removeClass('resource-gated');\n } else {\n $('.js-resources-gated-true').hide();\n }\n }\n\n /**\n * Function to add the \"download-page\" class to the \"content-wrapper\" div.\n */\n function addDownloadPageClass() {\n var path = window.location.pathname;\n var queryParams = window.location.search;\n\n // Check if the path matches \"/resources\"\n if (path.includes('/resources/') && queryParams.includes('download=1')) {\n var contentWrapper = $('.resource-detail-wrapper .resource-detail-content .content-wrapper');\n contentWrapper.addClass('download-page');\n }\n }\n Drupal.behaviors.Resources = {\n attach: function attach() {\n // Resources/Blog/Newsroom Search Show read more text in the link\n showReadMore();\n // Add the \"download-page\" class to the \"content-wrapper\" div.\n addDownloadPageClass();\n }\n };\n Drupal.behaviors.resourcesHeader = {\n attach: function attach(context) {\n var resourceHeader = context.classList && context.classList.contains('js-hide-resource-details-page') ? context : context.querySelector('.js-hide-resource-details-page');\n if (!resourceHeader) {\n return;\n }\n resourceHeader.getElementsByClassName('views-row')[0].classList.add('first-feature');\n }\n };\n})(jQuery, Drupal);"],"names":["$","Drupal","behaviors","Resources","attach","path","queryParams","text","urlParameter","getUrlParameter","download","parseInt","sales","attr","show","hide","toggleClass","removeClass","window","location","pathname","search","includes","addClass","resourcesHeader","context","resourceHeader","classList","contains","querySelector","getElementsByClassName","add","jQuery"],"mappings":"CAEA,CAAWA,EAAGC,KAmCZA,EAAOC,UAAUC,UAAY,CAC3BC,OAAQ,WAnCV,IAyBMC,EACAC,EAxBJN,EAAE,sCAAsC,EAAEO,KAAK,WAAW,EAKtDC,EAAeP,EAAOQ,gBAAgB,UAAU,EAChDC,EAAWC,SAASH,EAAc,EAAE,EACpCI,EAAQZ,EAAE,aAAa,EAAEa,KAAK,YAAY,EAE7B,IAAbH,GAA4B,SAAVE,GACpBZ,EAAE,0BAA0B,EAAEc,KAAK,EACnCd,EAAE,2BAA2B,EAAEe,KAAK,EACpCf,EAAE,iBAAiB,EAAEgB,YAAY,aAAa,EAC9ChB,EAAE,0BAA0B,EAAEiB,YAAY,gBAAgB,GAE1DjB,EAAE,0BAA0B,EAAEe,KAAK,EAQjCV,EAAOa,OAAOC,SAASC,SACvBd,EAAcY,OAAOC,SAASE,OAG9BhB,EAAKiB,SAAS,aAAa,GAAKhB,EAAYgB,SAAS,YAAY,GAC9CtB,EAAE,oEAAoE,EAC5EuB,SAAS,eAAe,CASzC,CACF,EACAtB,EAAOC,UAAUsB,gBAAkB,CACjCpB,OAAQ,SAAgBqB,GAClBC,EAAiBD,EAAQE,WAAaF,EAAQE,UAAUC,SAAS,+BAA+B,EAAIH,EAAUA,EAAQI,cAAc,gCAAgC,EACnKH,GAGLA,EAAeI,uBAAuB,WAAW,EAAE,GAAGH,UAAUI,IAAI,eAAe,CACrF,CACF,CACD,GAAEC,OAAQ/B,MAAM"}