{"version":3,"sources":["webpack://@verndale/toolkit/./src/js/modules/community-landing-about.js","webpack://@verndale/toolkit/./node_modules/js-cookie/src/js.cookie.js"],"names":["Module","Component","Cookies","hostname","pathname","recentCommunitiesValue","communityId","object","elementIndex","elementObj","recentCommunitiesValueString","recentCommunitiesString","currentCommunityString","ssl_communityname","ssl_thumbnailimage","ssl_pricingandavailabilityphone","ssl_residentsandfamilyphone","ssl_distance","ssl_communitylink","communityHeader","communityImage","availabilityPhone","residentsPhone","communityLink","communityDistance","recentCommunitiesWrapper","el","communityInfo","communityTitle","unitLabel","communitiesColumn","factory","registeredInModuleLoader","module","OldCookies","api","extend","i","result","attributes","key","decode","s","init","converter","set","value","stringifiedAttributes","attributeName","get","json","jar","cookies","parts","cookie","name"],"mappings":"+KAGA,MAAMA,UAAeC,WAAU,CAC7B,eAAgB,CACd,KAAK,IAAM,CACT,UAAW,SAAS,cAAc,+BAA+B,CACnE,EACA,KAAK,aAAe,KAAK,IAAI,UAAU,QAAQ,YAC/C,KAAK,cAAgB,KAAK,IAAI,UAAU,QAAQ,aAChD,KAAK,kBAAoB,KAAK,IAAI,UAAU,QAAQ,iBACpD,KAAK,mBAAqB,KAAK,IAAI,UAAU,QAAQ,kBACrD,KAAK,qBAAuB,KAAK,IAAI,UAAU,QAAQ,oBACvD,KAAK,gCAAkC,KAAK,IAAI,UAAU,QAAQ,+BAClE,KAAK,4BAA8B,KAAK,IAAI,UAAU,QAAQ,2BAC9D,KAAK,oBAAsB,KAAK,IAAI,UAAU,QAAQ,mBACtD,KAAK,gBAAkB,KAAK,IAAI,UAAU,QAAQ,eAElD,KAAK,aAAe,KAAK,iBAAiB,EAEtC,KAAK,kBACP,KAAK,iBAAmB,CAAC,EAEzB,KAAK,iBAAmB,CACtB,aAAc,KAAK,aACnB,cAAe,KAAK,cACpB,kBAAmB,KAAK,kBACxB,mBAAoB,KAAK,mBAAqB,KAAK,mBAAqB,KAAK,qBAC7E,gCAAiC,KAAK,gCACtC,4BAA6B,K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G,EAC5BiB,EAASD,EAAM,MAAM,CAAC,EAAE,KAAK,GAAG,EAEhC,CAACH,GAAQI,EAAO,OAAO,CAAC,IAAM,MACjCA,EAASA,EAAO,MAAM,EAAG,EAAE,GAG5B,GAAI,CACH,IAAIC,EAAOd,EAAOY,EAAM,EAAE,EAI1B,GAHAC,GAAUV,EAAU,MAAQA,GAAWU,EAAQC,CAAI,GAClDd,EAAOa,CAAM,EAEVJ,EACH,GAAI,CACHI,EAAS,KAAK,MAAMA,CAAM,CAC3B,MAAE,CAAW,CAKd,GAFAH,EAAII,GAAQD,EAERd,IAAQe,EACX,KAEF,MAAE,CAAW,CACd,CAEA,OAAOf,EAAMW,EAAIX,GAAOW,EACzB,CAEA,OAAAhB,EAAI,IAAMU,EACVV,EAAI,IAAM,SAAUK,EAAK,CACxB,OAAOS,EAAIT,EAAK,EAAuB,CACxC,EACAL,EAAI,QAAU,SAAUK,EAAK,CAC5B,OAAOS,EAAIT,EAAK,EAAuB,CACxC,EACAL,EAAI,OAAS,SAAUK,EAAKD,EAAY,CACvCM,EAAIL,EAAK,GAAIJ,EAAOG,EAAY,CAC/B,QAAS,EACV,CAAC,CAAC,CACH,EAEAJ,EAAI,SAAW,CAAC,EAEhBA,EAAI,cAAgBQ,EAEbR,CACR,CAEA,OAAOQ,EAAK,UAAY,CAAC,CAAC,CAC3B,CAAC,C","file":"Areas/SunriseSeniorLiving/Scripts/7742.a0e7198178c1eb67905b.bundle.js","sourcesContent":["import { Component } from '@verndale/core';\nimport Cookies from 'js-cookie';\n\nclass Module extends Component {\n setupDefaults() {\n this.dom = {\n $mainPage: document.querySelector('.community-landing-page-coveo')\n };\n this.ssl_latitude = this.dom.$mainPage.dataset.sslLatitude;\n this.ssl_longitude = this.dom.$mainPage.dataset.sslLongitude;\n this.ssl_communityname = this.dom.$mainPage.dataset.sslCommunityname;\n this.ssl_thumbnailimage = this.dom.$mainPage.dataset.sslThumbnailimage;\n this.ssl_mainimagedesktop = this.dom.$mainPage.dataset.sslMainimagedesktop;\n this.ssl_pricingandavailabilityphone = this.dom.$mainPage.dataset.sslPricingandavailabilityphone;\n this.ssl_residentsandfamilyphone = this.dom.$mainPage.dataset.sslResidentsandfamilyphone;\n this.ssl_contextlanguage = this.dom.$mainPage.dataset.sslContextlanguage;\n this.ssl_communityid = this.dom.$mainPage.dataset.sslCommunityid;\n\n this.communityUrl = this.getCommunityLink();\n\n if (this.ssl_communityid){\n this.recentCommunites = []\n\n this.currentCommunity = {\n ssl_latitude: this.ssl_latitude,\n ssl_longitude: this.ssl_longitude,\n ssl_communityname: this.ssl_communityname,\n ssl_thumbnailimage: this.ssl_thumbnailimage ? this.ssl_thumbnailimage : this.ssl_mainimagedesktop,\n ssl_pricingandavailabilityphone: this.ssl_pricingandavailabilityphone,\n ssl_residentsandfamilyphone: this.ssl_residentsandfamilyphone,\n ssl_contextlanguage: this.ssl_contextlanguage,\n ssl_communityid: this.ssl_communityid,\n ssl_communitylink: this.communityUrl\n }\n\n this.handleCommunityData();\n\n if (Cookies.get('recent_communities')){\n this.recentlyViewedCommunities = JSON.parse(Cookies.get('recent_communities'));\n }\n }\n\n this.location = Cookies.get('ssl-location');\n\n if (this.location){\n this.userLocation = JSON.parse(this.location);\n }\n }\n\n getCommunityLink() {\n const { hostname, pathname } = window.location;\n if (window.location.pathname.includes('/thank-you')) {\n return `https://${hostname}${pathname.replace('/thank-you', '')}`;\n }\n\n return `https://${hostname}${pathname}`;\n }\n\n handleCommunityData() {\n this.storeCommunity();\n this.storeRecentCommunites();\n }\n\n storeRecentCommunites(){\n if (!Cookies.get('recent_communities')){\n this.recentCommunites.push(this.currentCommunity);\n const recentCommunitiesString = JSON.stringify(this.recentCommunites);\n Cookies.set('recent_communities', recentCommunitiesString);\n } else {\n const recentCommunitiesValue = JSON.parse(Cookies.get('recent_communities'));\n const communityId = recentCommunitiesValue.findIndex(object => object.ssl_communityid === this.currentCommunity.ssl_communityid);\n if (communityId === -1 && recentCommunitiesValue.length < 5){\n recentCommunitiesValue.push(this.currentCommunity);\n } else if (communityId === -1){\n recentCommunitiesValue.splice(0, 1);\n recentCommunitiesValue.push(this.currentCommunity);\n } else {\n const elementIndex = communityId;\n const elementObj = recentCommunitiesValue.splice(elementIndex, 1)[0]\n recentCommunitiesValue.splice(recentCommunitiesValue.length, 0, elementObj);\n }\n const recentCommunitiesValueString = JSON.stringify(recentCommunitiesValue);\n Cookies.set('recent_communities', recentCommunitiesValueString);\n }\n }\n\n storeCommunity(){\n const currentCommunityString = JSON.stringify(this.currentCommunity);\n Cookies.set('current_community', currentCommunityString);\n this.renderCommunity();\n this.recentCommunitiesHandler();\n }\n\n renderCommunity(){\n if (this.currentCommunity.ssl_communityid){\n const { ssl_communityname, ssl_thumbnailimage, ssl_pricingandavailabilityphone, ssl_residentsandfamilyphone, ssl_distance, ssl_communitylink } = this.currentCommunity;\n if (ssl_communityname && ssl_communitylink){\n const communityHeader = document.querySelector('.schedule-a-tour-current-community__card-name');\n const communityImage = document.querySelector('.schedule-a-tour-current-community__image');\n const availabilityPhone = document.querySelector('.schedule-a-tour__availability-contact a');\n const residentsPhone = document.querySelector('.schedule-a-tour__residents-contact a');\n const communityLink = document.querySelector('.schedule-a-tour-current-community__card');\n\n if (communityLink){\n communityLink.href = ssl_communitylink;\n communityLink.alt = ssl_communityname;\n }\n\n if (communityHeader) communityHeader.textContent = ssl_communityname;\n if (communityImage) communityImage.src = ssl_thumbnailimage;\n if (availabilityPhone) {\n availabilityPhone.querySelector('.btn__label').textContent = ssl_pricingandavailabilityphone;\n availabilityPhone.href = `tel:${ssl_pricingandavailabilityphone}`;\n }\n if (residentsPhone) {\n residentsPhone.querySelector('.btn__label').textContent = ssl_residentsandfamilyphone;\n residentsPhone.href = `tel:${ssl_residentsandfamilyphone}`;\n }\n }\n\n if (ssl_distance){\n const communityDistance = document.querySelector('.schedule-a-tour-current-community__card-distance');\n if (communityDistance) {\n communityDistance.textContent = `${ssl_distance} ${this.el.dataset.unitLabel}`;\n }\n }\n }\n }\n\n recentCommunitiesHandler(){\n if (this.recentlyViewedCommunities && this.recentlyViewedCommunities.length > 2){\n const recentCommunitiesWrapper = document.querySelector('.primary-nav__recently-viewed-communities');\n this.recentlyViewedCommunities.reverse();\n this.recentlyViewedCommunities.map(el => {\n if (el.ssl_communityid !== this.currentCommunity.ssl_communityid){\n const communityLink = document.createElement('a');\n communityLink.href = el.ssl_communitylink;\n communityLink.classList.add('primary-nav__recently-viewed-communities-link');\n const communityImage = document.createElement('img');\n communityImage.src = `${el.ssl_thumbnailimage}`;\n communityImage.classList.add('primary-nav__recently-viewed-communities-image');\n const communityInfo = document.createElement('div');\n communityInfo.classList.add('primary-nav__recently-viewed-communities-info');\n const communityTitle = document.createElement('span');\n communityTitle.classList.add('primary-nav__recently-viewed-communities-title');\n communityTitle.textContent = el.ssl_communityname;\n const communityDistance = document.createElement('span');\n communityDistance.classList.add('primary-nav__recently-viewed-communities-distance');\n const unitLabel = this.dom.$panel?.dataset.unitLabel ? this.dom.$panel.dataset.unitLabel : 'miles away';\n communityDistance.textContent = el.ssl_distance ? `${el.ssl_distance} ${unitLabel}` : '';\n\n communityInfo.append(communityTitle);\n communityInfo.append(communityDistance);\n communityLink.append(communityImage);\n communityLink.append(communityInfo);\n if (recentCommunitiesWrapper){\n recentCommunitiesWrapper.append(communityLink);\n }\n }\n });\n } else {\n const communitiesColumn = document.querySelector('.schedule-a-tour__content');\n if (communitiesColumn){\n const communitiesSibling = communitiesColumn?.nextElementSibling\n communitiesSibling.remove();\n }\n }\n }\n}\n\nexport default Module;\n","/*!\n * JavaScript Cookie v2.2.1\n * https://github.com/js-cookie/js-cookie\n *\n * Copyright 2006, 2015 Klaus Hartl & Fagner Brack\n * Released under the MIT license\n */\n;(function (factory) {\n\tvar registeredInModuleLoader;\n\tif (typeof define === 'function' && define.amd) {\n\t\tdefine(factory);\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (typeof exports === 'object') {\n\t\tmodule.exports = factory();\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (!registeredInModuleLoader) {\n\t\tvar OldCookies = window.Cookies;\n\t\tvar api = window.Cookies = factory();\n\t\tapi.noConflict = function () {\n\t\t\twindow.Cookies = OldCookies;\n\t\t\treturn api;\n\t\t};\n\t}\n}(function () {\n\tfunction extend () {\n\t\tvar i = 0;\n\t\tvar result = {};\n\t\tfor (; i < arguments.length; i++) {\n\t\t\tvar attributes = arguments[ i ];\n\t\t\tfor (var key in attributes) {\n\t\t\t\tresult[key] = attributes[key];\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tfunction decode (s) {\n\t\treturn s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);\n\t}\n\n\tfunction init (converter) {\n\t\tfunction api() {}\n\n\t\tfunction set (key, value, attributes) {\n\t\t\tif (typeof document === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tattributes = extend({\n\t\t\t\tpath: '/'\n\t\t\t}, api.defaults, attributes);\n\n\t\t\tif (typeof attributes.expires === 'number') {\n\t\t\t\tattributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5);\n\t\t\t}\n\n\t\t\t// We're using \"expires\" because \"max-age\" is not supported by IE\n\t\t\tattributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';\n\n\t\t\ttry {\n\t\t\t\tvar result = JSON.stringify(value);\n\t\t\t\tif (/^[\\{\\[]/.test(result)) {\n\t\t\t\t\tvalue = result;\n\t\t\t\t}\n\t\t\t} catch (e) {}\n\n\t\t\tvalue = converter.write ?\n\t\t\t\tconverter.write(value, key) :\n\t\t\t\tencodeURIComponent(String(value))\n\t\t\t\t\t.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);\n\n\t\t\tkey = encodeURIComponent(String(key))\n\t\t\t\t.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)\n\t\t\t\t.replace(/[\\(\\)]/g, escape);\n\n\t\t\tvar stringifiedAttributes = '';\n\t\t\tfor (var attributeName in attributes) {\n\t\t\t\tif (!attributes[attributeName]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tstringifiedAttributes += '; ' + attributeName;\n\t\t\t\tif (attributes[attributeName] === true) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Considers RFC 6265 section 5.2:\n\t\t\t\t// ...\n\t\t\t\t// 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n\t\t\t\t// character:\n\t\t\t\t// Consume the characters of the unparsed-attributes up to,\n\t\t\t\t// not including, the first %x3B (\";\") character.\n\t\t\t\t// ...\n\t\t\t\tstringifiedAttributes += '=' + attributes[attributeName].split(';')[0];\n\t\t\t}\n\n\t\t\treturn (document.cookie = key + '=' + value + stringifiedAttributes);\n\t\t}\n\n\t\tfunction get (key, json) {\n\t\t\tif (typeof document === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar jar = {};\n\t\t\t// To prevent the for loop in the first place assign an empty array\n\t\t\t// in case there are no cookies at all.\n\t\t\tvar cookies = document.cookie ? document.cookie.split('; ') : [];\n\t\t\tvar i = 0;\n\n\t\t\tfor (; i < cookies.length; i++) {\n\t\t\t\tvar parts = cookies[i].split('=');\n\t\t\t\tvar cookie = parts.slice(1).join('=');\n\n\t\t\t\tif (!json && cookie.charAt(0) === '\"') {\n\t\t\t\t\tcookie = cookie.slice(1, -1);\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tvar name = decode(parts[0]);\n\t\t\t\t\tcookie = (converter.read || converter)(cookie, name) ||\n\t\t\t\t\t\tdecode(cookie);\n\n\t\t\t\t\tif (json) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcookie = JSON.parse(cookie);\n\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t}\n\n\t\t\t\t\tjar[name] = cookie;\n\n\t\t\t\t\tif (key === name) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {}\n\t\t\t}\n\n\t\t\treturn key ? jar[key] : jar;\n\t\t}\n\n\t\tapi.set = set;\n\t\tapi.get = function (key) {\n\t\t\treturn get(key, false /* read as raw */);\n\t\t};\n\t\tapi.getJSON = function (key) {\n\t\t\treturn get(key, true /* read as json */);\n\t\t};\n\t\tapi.remove = function (key, attributes) {\n\t\t\tset(key, '', extend(attributes, {\n\t\t\t\texpires: -1\n\t\t\t}));\n\t\t};\n\n\t\tapi.defaults = {};\n\n\t\tapi.withConverter = init;\n\n\t\treturn api;\n\t}\n\n\treturn init(function () {});\n}));\n"],"sourceRoot":""}