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AAe,KAC1BxM,KAAK8H,MAAM2E,eAAiB,KAE5BzM,KAAKgM,WAAWW,OACpB,EAEAC,YAAAA,GACI5M,KAAKkL,WAAY,EACjBlL,KAAKmL,kBAAmB,EACxBnL,KAAK6M,WACT,EAEAA,SAAAA,GACI7M,KAAKsL,oBAAqB,EAC1BtL,KAAKuL,kBAAmB,CAC5B,G,kDCjHR,SACEpK,SAAU,CACR/B,IAAGA,IACM0N,EAAAA,I","sources":["webpack:///./Onlia/Scripts/onlia/blog/components/article-list.js","webpack:///./Onlia/Scripts/onlia/blog/components/article-template-dropdown.js","webpack:///./Onlia/Scripts/onlia/blog/components/latest-category-articles.js","webpack:///./Onlia/Scripts/onlia/blog/components/magazine-article-list.js","webpack:///./Onlia/Scripts/onlia/blog/components/subscription-card.js","webpack:///./Onlia/Scripts/onlia/blog/mixins/api.js"],"sourcesContent":["import axios from 'axios';\r\nimport api from '../mixins/api';\r\nimport { IS_DEV, HEADER_NAV } from '@Shared/settings';\r\n// import { gsap } from 'gsap';\r\nimport { loadGSAP } from '@Shared/utils/gsap-utils';\r\n\r\nconst TOTAL_PAGINATION_ITEMS = 5;\r\n\r\nconst ELLIPSIS_PAGINATION = {\r\n label: '...',\r\n attributes: {\r\n class: '-disabled',\r\n is: 'div'\r\n }\r\n};\r\n\r\nexport default {\r\n name: 'article-list',\r\n mixins: [ api ],\r\n\r\n props: {\r\n topArticles: {\r\n type: Object,\r\n required: true\r\n },\r\n previousButtonLabel: {\r\n type: String,\r\n required: true\r\n },\r\n nextButtonLabel: {\r\n type: String,\r\n required: true\r\n }\r\n },\r\n\r\n data() {\r\n const { Articles, PageIndex } = this.topArticles;\r\n return {\r\n articles: Articles,\r\n currentPageIndex: PageIndex\r\n };\r\n },\r\n\r\n beforeCreate() {\r\n import(/* webpackChunkName: 'styles.blog' */ \"@Styles/blog\");\r\n },\r\n\r\n mounted() {\r\n window.onpopstate = async (event) => {\r\n if (event && event.state) {\r\n await this.loadPage(event.state.page, true);\r\n } else {\r\n const params = new URLSearchParams(location.search);\r\n if (params.has('page')) {\r\n await this.loadPage(parseInt(params.get('page')), true);\r\n } else {\r\n await this.loadPage(1, true);\r\n }\r\n }\r\n }\r\n },\r\n\r\n computed: {\r\n baseURL() {\r\n const { location: { origin, pathname } } = window;\r\n return `${origin}${pathname}?page=`;\r\n },\r\n itemsPerPage() {\r\n return this.topArticles.ItemsPerPage;\r\n },\r\n totalArticles() {\r\n return this.topArticles.TotalCount;\r\n },\r\n lastPageIndex() {\r\n return Math.ceil(this.totalArticles / this.itemsPerPage);\r\n },\r\n articleContext() {\r\n return this.topArticles.Context;\r\n },\r\n firstCategory() {\r\n return this.articles[0].Category;\r\n },\r\n isMobile() {\r\n return this.$store.getters.breakpointMobile;\r\n },\r\n currentPreviousButtonLabel() {\r\n return this.isMobile ? '' : this.previousButtonLabel;\r\n },\r\n currentNextButtonLabel() {\r\n return this.isMobile ? '' : this.nextButtonLabel;\r\n },\r\n previousPageURL() {\r\n return `${this.baseURL}${this.currentPageIndex - 1}`;\r\n },\r\n nextPageURL() {\r\n return `${this.baseURL}${this.currentPageIndex + 1}`;\r\n },\r\n showPreviousButton() {\r\n return this.currentPageIndex > 1;\r\n },\r\n showNextButton() {\r\n return this.currentPageIndex < this.lastPageIndex;\r\n },\r\n paginationItems() {\r\n const range = this.lastPageIndex - this.currentPageIndex;\r\n const isBeginning = (range >= TOTAL_PAGINATION_ITEMS);\r\n\r\n const startIndex = isBeginning ?\r\n this.currentPageIndex :\r\n Math.max(1, this.lastPageIndex - TOTAL_PAGINATION_ITEMS + 1);\r\n\r\n const endIndex = (isBeginning && this.lastPageIndex >= TOTAL_PAGINATION_ITEMS) ?\r\n this.currentPageIndex + TOTAL_PAGINATION_ITEMS :\r\n this.lastPageIndex + 1;\r\n\r\n const items = [];\r\n\r\n for (let pageIndex = startIndex; pageIndex < endIndex; pageIndex++) {\r\n items.push({\r\n pageIndex: pageIndex,\r\n label: pageIndex,\r\n attributes: {\r\n href: `${this.baseURL}${pageIndex}`,\r\n is: 'a',\r\n class: {\r\n '-active': this.currentPageIndex === pageIndex\r\n }\r\n }\r\n });\r\n }\r\n\r\n if (isBeginning) {\r\n items[TOTAL_PAGINATION_ITEMS - 1] = {\r\n pageIndex: this.lastPageIndex,\r\n label: this.lastPageIndex,\r\n attributes: {\r\n href: `${this.baseURL}${this.lastPageIndex}`,\r\n is: 'a',\r\n class: {\r\n '-active': this.currentPageIndex === this.lastPageIndex\r\n }\r\n }\r\n };\r\n\r\n // Non functional, ellipsis pagination item\r\n items[TOTAL_PAGINATION_ITEMS - 2] = ELLIPSIS_PAGINATION;\r\n }\r\n\r\n return items;\r\n },\r\n navHeaderHeight() {\r\n const headerHeight = this.$store.getters['currentHeaderHeight'];\r\n\r\n if (!this.isMobile && this.$store.state.globalNav.isHidden) {\r\n return headerHeight + HEADER_NAV.topNavHeight;\r\n }\r\n\r\n return headerHeight;\r\n }\r\n },\r\n methods: {\r\n async loadPage(pageIndex, backButton) {\r\n try {\r\n if (typeof pageIndex !== 'number' || pageIndex === this.currentPageIndex) return;\r\n\r\n this.currentPageIndex = pageIndex;\r\n\r\n const { data, status } = await axios.post(this.api.loadMoreArticles, {\r\n Context: this.articleContext,\r\n PageIndex: this.currentPageIndex,\r\n ItemsPerPage: this.itemsPerPage,\r\n //CurrentArticlesCount: this.Model.Articles.length,\r\n FirstCategory: this.firstCategory,\r\n CategoryId: this.topArticles.CategoryId\r\n });\r\n\r\n if (status !== 200 || !data.Articles.length) return;\r\n\r\n this.articles = data.Articles;\r\n\r\n (!window.gsap && await loadGSAP());\r\n\r\n if (!backButton) { \r\n history.pushState({page: pageIndex}, `title ${pageIndex}`, `${this.baseURL}${pageIndex}`);\r\n }\r\n\r\n this.scrollToElementTop();\r\n }\r\n catch (error) {\r\n (IS_DEV && console.error('loadPage error:', error));\r\n }\r\n },\r\n async loadPrevious() {\r\n await this.loadPage(this.currentPageIndex - 1);\r\n },\r\n async loadNext() {\r\n await this.loadPage(this.currentPageIndex + 1);\r\n },\r\n async scrollToElementTop() {\r\n const { top: elementTop } = this.$el.getBoundingClientRect();\r\n const docEl = document.documentElement;\r\n const scrollTop = window.pageYOffset;\r\n const clientTop = docEl.clientTop;\r\n const top = Math.round(elementTop + scrollTop - clientTop - this.navHeaderHeight) - 20;\r\n\r\n (!window.gsap && await loadGSAP());\r\n\r\n gsap.to(document.scrollingElement, {\r\n scrollTop: top,\r\n duration: 0.6,\r\n ease: 'power3.out'\r\n });\r\n },\r\n async navigateToLink(url) {\r\n window.location.href = url;\r\n }\r\n }\r\n};\r\n","export default {\r\n name: 'article-template',\r\n data() {\r\n return {\r\n isDropdownOpen: false,\r\n headings: [],\r\n selectedHeading: null,\r\n };\r\n },\r\n mounted() {\r\n this.getHeadings();\r\n if (this.headings.length > 0) {\r\n this.selectedHeading = this.headings[0];\r\n }\r\n this.closeDropdown();\r\n\r\n\r\n\r\n },\r\n methods: {\r\n toggleDropdown() {\r\n this.isDropdownOpen = !this.isDropdownOpen;\r\n },\r\n\r\n selectHeading(heading) {\r\n this.selectedHeading = heading;\r\n this.scrollToSection(this.headings.indexOf(heading));\r\n },\r\n \r\n scrollToSection(index) {\r\n const target = document.querySelectorAll('.article-body h3, .article-body h4')[index];\r\n const offset = 100;\r\n\r\n const top = target.getBoundingClientRect().top + window.pageYOffset - offset;\r\n window.scrollTo({\r\n top,\r\n behavior: 'smooth',\r\n });\r\n },\r\n\r\n getHeadings() {\r\n const headings = document.querySelectorAll('.article-body h3 , .article-body h4');\r\n this.headings = Array.from(headings).map((_, index) => ({\r\n text: headings[index].textContent,\r\n }));\r\n },\r\n truncateText(text, maxLength) {\r\n if (text.length > maxLength) {\r\n return `${text.substring(0, maxLength)}...`;\r\n }\r\n return text;\r\n },\r\n closeDropdown(){\r\n //close dropdown if user clicks outside of it\r\n const vm = this;\r\n if (window.location.href.includes(\"magazine/blogs\") ) {\r\n document.addEventListener(\"click\", function(){\r\n if (!event.target.closest('.m-dropdown__box')) {\r\n vm.isDropdownOpen = false; \r\n }\r\n });\r\n }\r\n }\r\n }\r\n}","import axios from \"axios\";\r\nimport api from \"../mixins/api\";\r\n\r\nexport default {\r\n name: 'latest-category-articles',\r\n props: {\r\n categoryArticles: Object\r\n },\r\n\r\n created() {\r\n const vm = this;\r\n\r\n vm.Model = this.categoryArticles;\r\n\r\n if (vm.Model.Categories.length > 0) {\r\n vm.selectedCategory = vm.Model.Categories[0].Id;\r\n }\r\n },\r\n\r\n mixins: [api],\r\n\r\n data() {\r\n return {\r\n Model: {},\r\n selectedCategory: {}\r\n };\r\n },\r\n\r\n beforeCreate() {\r\n import(/* webpackChunkName: 'styles.blog' */ \"@Styles/blog\");\r\n },\r\n\r\n methods: {\r\n loadCategory(categoryId) {\r\n axios.post(this.api.loadCategory, \"\\\"\" + categoryId + \"\\\"\", { headers: { \"Content-Type\": \"application/json\" } })\r\n .then(result => {\r\n if (result.status != 200)\r\n return;\r\n\r\n if (result.data) {\r\n this.Model.Articles = result.data;\r\n }\r\n });\r\n },\r\n },\r\n};","import axios from 'axios';\r\nimport api from '../mixins/api';\r\n\r\nexport default {\r\n name: 'magazine-article-list',\r\n mixins: [api],\r\n\r\n props: {\r\n topArticles: {\r\n type: Object,\r\n required: true\r\n },\r\n },\r\n\r\n components: {\r\n SubscriptionCard: () => import('./subscription-card')\r\n },\r\n\r\n data() {\r\n const { Articles, PageIndex, CategoriesList } = this.topArticles;\r\n \r\n const categoryTabs = CategoriesList.map(category => ({\r\n name: category.Title,\r\n id: category.Id,\r\n totalCategoryArticles: category.ArticlesCount,\r\n \r\n }));\r\n const currentTab = -1;\r\n if (sessionStorage.activeTab) {\r\n activeTab = parseInt(sessionStorage.activeTab);\r\n }\r\n return {\r\n activeTab: currentTab,\r\n tabs: categoryTabs,\r\n articles: Articles,\r\n currentPageIndex: PageIndex,\r\n currentArticleCount: 0, \r\n itemsPerPage: 9,\r\n isLoading: false,\r\n selectedCategoryId: null,\r\n showMoreArticles: false,\r\n showSubscriptionCard: false\r\n };\r\n },\r\n\r\n created() {\r\n const vm = this;\r\n\r\n vm.Model = this.topArticles;\r\n\r\n if (vm.Model.CategoriesList.length > 0) {\r\n vm.selectedCategory = vm.Model.CategoriesList[0].Id;\r\n }\r\n\r\n // Check if the page is reloaded\r\n const isReloaded = performance.navigation.type === 1;\r\n if (isReloaded) {\r\n this.currentPageIndex = 1; \r\n this.articles = [];\r\n }\r\n },\r\n \r\n computed: {\r\n\r\n hasMorePages() {\r\n const currentArticles = this.articles.length;\r\n const totalArticles = this.selectedCategoryId ? this.tabs.find(tab => tab.id === this.selectedCategoryId).totalCategoryArticles : this.totalArticles;\r\n return currentArticles < totalArticles - 1;\r\n },\r\n baseURL() {\r\n const { location: { origin, pathname } } = window;\r\n const params = new URLSearchParams(window.location.search);\r\n params.set('page', this.currentPageIndex.toString());\r\n return `${origin}${pathname}?${params.toString()}`;\r\n },\r\n totalArticles() {\r\n return this.topArticles.TotalCount;\r\n },\r\n articleContext() {\r\n return this.topArticles.Context;\r\n },\r\n isMobile() {\r\n return this.$store.getters.breakpointMobile;\r\n },\r\n loadMoreItems() {\r\n const Label = this.isLoading ? '. . .' : 'Load More Articles';\r\n \r\n return [\r\n {\r\n label: Label,\r\n component: \"onlia-button\",\r\n attributes: {\r\n tag: \"button\",\r\n class: {\r\n \"m-article__loadMoreButton\": true,\r\n \"-loading\": this.isLoading,\r\n }, \r\n },\r\n }\r\n ];\r\n },\r\n },\r\n methods: {\r\n\r\n //API call to load more articles\r\n async loadArticles(pageIndex) {\r\n this.showMoreArticles = true;\r\n try {\r\n const { data, status } = await axios.post(this.api.loadMoreArticles, {\r\n Context: this.articleContext,\r\n PageIndex: pageIndex,\r\n ItemsPerPage: pageIndex === 2 ? 8 : 9,\r\n CurrentArticlesCount: this.currentArticleCount,\r\n CategoryId: this.selectedCategoryId,\r\n IsMagazinePage: true\r\n });\r\n\r\n if (status !== 200 || !data.Articles.length) {\r\n this.hasMorePages = false;\r\n } else {\r\n\r\n if (pageIndex === 1) {\r\n // Initial loaded articles\r\n const displayedArticles = data.Articles.slice(0, 8);\r\n this.articles = displayedArticles;\r\n this.currentArticleCount = data.Articles.length;\r\n this.showSubscriptionCard = true;\r\n } else {\r\n if (pageIndex === 2 && this.activeTab === -1) {\r\n this.articles = data.Articles.slice(-9);\r\n }\r\n else {\r\n this.articles.push(...data.Articles);\r\n }\r\n }\r\n this.currentArticleCount += data.Articles.length;\r\n this.currentPageIndex = pageIndex;\r\n \r\n \r\n }\r\n } catch (error) {\r\n console.error('loadArticles error:', error);\r\n }\r\n },\r\n\r\n //CateogryTabs change method\r\n changeTab(index) {\r\n this.activeTab = index;\r\n const selectedCategory = index === -1 ? null : this.tabs[index];\r\n this.selectedCategoryId = selectedCategory ? selectedCategory.id : null;\r\n this.currentArticleCount = 0;\r\n this.currentPageIndex = 1;\r\n\r\n if (this.activeTab !== -1) {\r\n this.loadArticles(this.currentPageIndex);\r\n } else {\r\n this.articles = [];\r\n }\r\n if (this.currentPageIndex !== 1) {\r\n this.showSubscriptionCard = false;\r\n }\r\n },\r\n\r\n //loadMore button method\r\n loadMore() {\r\n this.isLoading = true;\r\n if (this.currentPageIndex === 1 && this.activeTab === -1) {\r\n this.articles = this.articles.slice(0, 9);\r\n }\r\n this.loadArticles(this.currentPageIndex + 1).finally(() => {\r\n this.isLoading = false;\r\n });\r\n },\r\n \r\n navigateToLink(event, url) {\r\n event.preventDefault();\r\n if (event.metaKey || event.ctrlKey) {\r\n window.open(url, \"_blank\");\r\n } else {\r\n window.location.href = url;\r\n }\r\n },\r\n isSubscriptionCard(index) {\r\n if (this.activeTab !== -1) {\r\n return index === 4;\r\n }\r\n return false;\r\n },\r\n getArticleClass(index) {\r\n return this.isSubscriptionCard(index) ?\r\n 'o-articlesList__article col-lg-8' : 'o-articlesList__article col-lg-4';\r\n },\r\n }\r\n};\r\n","import Vue from 'vue';\r\nimport axios from \"axios\";\r\nimport api from \"../mixins/api\";\r\n\r\nexport default {\r\n name: 'subscription-card',\r\n mixins: [api],\r\n inject: [\"$validator\"],\r\n\r\n props: {\r\n model: Object\r\n },\r\n\r\n data() {\r\n return {\r\n showPopup: false,\r\n showSuccessPopup: false,\r\n loading: false,\r\n Model: {},\r\n emailStatusLoading: false,\r\n emailStatusSuccess: false,\r\n emailStatusError: false,\r\n };\r\n },\r\n created() {\r\n this.Model = this.model;\r\n },\r\n\r\n mounted() {\r\n this.setCallbacks();\r\n },\r\n methods: {\r\n showSignupPopup() {\r\n if (this.emailStatusSuccess === false) {\r\n this.showPopup = true;\r\n setTimeout(function() {\r\n document.querySelector(\".m-signupPopup__email-me-form iframe \").style.transform = \"scale(0.80)\";\r\n document.querySelector(\".m-signupPopup__email-me-form iframe \").style.display = \"block\";\r\n }, 1000);\r\n } \r\n },\r\n \r\n subscribeEmail() {\r\n \r\n const vm = this;\r\n \r\n vm.$validator.validate().then(function (isFormValid) {\r\n vm.emailStatusSuccess = false;\r\n vm.emailStatusError = false;\r\n \r\n if (isFormValid) {\r\n vm.emailStatusLoading = true;\r\n\r\n axios.post(vm.api.emailSubscribe, vm.Model)\r\n .then(result => {\r\n if (result.data) {\r\n vm.emailStatusSuccess = result.data;\r\n vm.emailStatusError = !result.data;\r\n vm.emailStatusLoading = false;\r\n vm.showSuccessPopup = true;\r\n vm.showPopup = false;\r\n \r\n } else {\r\n vm.emailStatusSuccess = !result.data;\r\n vm.emailStatusError = result.data;\r\n vm.emailStatusLoading = false;\r\n vm.showSuccessPopup = false;\r\n }\r\n \r\n vm.resetCaptcha();\r\n \r\n })\r\n .catch(result => {\r\n vm.emailStatusSuccess = false;\r\n vm.emailStatusError = true;\r\n vm.emailStatusLoading = false;\r\n\r\n vm.resetCaptcha();\r\n });\r\n \r\n } else {\r\n vm.emailStatusLoading = false;\r\n return;\r\n }\r\n \r\n });\r\n \r\n },\r\n\r\n setCallbacks() {\r\n const vm = this;\r\n window.recaptchaCallback = function (captchaValue) {\r\n vm.Model.CaptchaValue = captchaValue;\r\n vm.Model.IsCaptchaValid = true;\r\n };\r\n },\r\n\r\n resetCaptcha() {\r\n window.grecaptcha && window.grecaptcha.reset();\r\n\r\n this.Model.CaptchaValue = null;\r\n this.Model.IsCaptchaValid = null;\r\n\r\n this.$validator.reset();\r\n },\r\n\r\n dismissPopup() {\r\n this.showPopup = false;\r\n this.showSuccessPopup = false;\r\n this.resetForm();\r\n },\r\n\r\n resetForm() {\r\n this.emailStatusSuccess = false;\r\n this.emailStatusError = false;\r\n },\r\n\r\n }\r\n};\r\n","import { blog } from '@Apis';\r\n\r\nexport default {\r\n computed: {\r\n api() {\r\n return blog;\r\n }\r\n }\r\n};\r\n"],"names":["ELLIPSIS_PAGINATION","label","attributes","class","is","name","mixins","api","props","topArticles","type","Object","required","previousButtonLabel","String","nextButtonLabel","data","Articles","PageIndex","this","articles","currentPageIndex","beforeCreate","mounted","window","onpopstate","async","event","state","loadPage","page","params","URLSearchParams","location","search","has","parseInt","get","computed","baseURL","origin","pathname","concat","itemsPerPage","ItemsPerPage","totalArticles","TotalCount","lastPageIndex","Math","ceil","articleContext","Context","firstCategory","Category","isMobile","$store","getters","breakpointMobile","currentPreviousButtonLabel","currentNextButtonLabel","previousPageURL","nextPageURL","showPreviousButton","showNextButton","paginationItems","isBeginning","startIndex","max","endIndex","items","pageIndex","push","href","TOTAL_PAGINATION_ITEMS","navHeaderHeight","headerHeight","globalNav","isHidden","HEADER_NAV","topNavHeight","methods","backButton","status","axios","post","loadMoreArticles","FirstCategory","CategoryId","length","gsap","loadGSAP","history","pushState","scrollToElementTop","error","IS_DEV","loadPrevious","loadNext","top","elementTop","$el","getBoundingClientRect","docEl","document","documentElement","scrollTop","pageYOffset","clientTop","round","to","scrollingElement","duration","ease","navigateToLink","url","isDropdownOpen","headings","selectedHeading","getHeadings","closeDropdown","toggleDropdown","selectHeading","heading","scrollToSection","indexOf","index","querySelectorAll","scrollTo","behavior","Array","from","map","_","text","textContent","truncateText","maxLength","substring","vm","includes","addEventListener","target","closest","categoryArticles","created","Model","Categories","selectedCategory","Id","loadCategory","categoryId","headers","then","result","components","SubscriptionCard","CategoriesList","categoryTabs","category","Title","id","totalCategoryArticles","ArticlesCount","sessionStorage","activeTab","tabs","currentArticleCount","isLoading","selectedCategoryId","showMoreArticles","showSubscriptionCard","performance","navigation","hasMorePages","find","tab","set","toString","loadMoreItems","component","tag","loadArticles","CurrentArticlesCount","IsMagazinePage","displayedArticles","slice","changeTab","loadMore","finally","preventDefault","metaKey","ctrlKey","open","isSubscriptionCard","getArticleClass","inject","model","showPopup","showSuccessPopup","loading","emailStatusLoading","emailStatusSuccess","emailStatusError","setCallbacks","showSignupPopup","setTimeout","querySelector","style","transform","display","subscribeEmail","$validator","validate","isFormValid","emailSubscribe","resetCaptcha","catch","recaptchaCallback","captchaValue","CaptchaValue","IsCaptchaValid","grecaptcha","reset","dismissPopup","resetForm","blog"],"sourceRoot":""}