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EAAYN,MAAO,SACpCY,EAAiBJ,EAAWR,MAAO,QACnCY,EAAiBL,EAAWP,MAAO,QAGnCK,EAAWL,MAAQM,EAAYN,MAAQQ,EAAWR,MAAQO,EAAWP,MAAQ,KAG7ES,EAAgBT,OAAS,CAC7B,GAAG,IACP,EAEA,MAAO,CAAC8B,EAAUC,MACRC,EAAAA,EAAAA,cAAcC,EAAAA,EAAAA,oBAAoB,MAAO,KAAM,EACrDlD,EAAAA,EAAAA,oBAAoB,MAAOL,EAAY,EACrCK,EAAAA,EAAAA,oBAAoB,MAAOF,EAAY,EACrCqD,EAAAA,EAAAA,YAAYJ,EAAKK,OAAQ,cAE3BpD,EAAAA,EAAAA,oBAAoB,IAAK,CACvBH,MAAO,wBACPwD,KAAM,IACNC,KAAM,SACNC,QAASP,EAAO,KAAOA,EAAO,IAAKQ,EAAAA,EAAAA,gBAAgBC,GAAiB7B,GAAW,IAAK,CAAC,cACpF1B,IACHF,EAAAA,EAAAA,oBAAoB,IAAK,CACvBH,MAAO,yBACPwD,KAAM,IACNC,KAAM,SACNC,QAASP,EAAO,KAAOA,EAAO,IAAKQ,EAAAA,EAAAA,gBAAgBC,GAAiB7B,EAAU,IAAK,CAAC,cACnFvB,IACHL,EAAAA,EAAAA,oBAAoB,KAAMM,EAAY,GACnC2C,EAAAA,EAAAA,YAAW,IAAOC,EAAAA,EAAAA,oBAAoBQ,EAAAA,SAAW,MAAMC,EAAAA,EAAAA,aAAYC,EAAAA,EAAAA,OAAO5C,IAAqBwB,KACtFS,EAAAA,EAAAA,cAAcC,EAAAA,EAAAA,oBAAoB,KAAM,CAC9CW,IAAKrB,EACLe,QAAUE,GAAiBb,EAAiBJ,EAAM,IACjD,KAAM,EAAGjC,MACV,YAKZ,IC9MA,MAAMuD,EAAc,EAEpB,O","sources":["webpack://beliefnet-frontend/./src/components/carousel/simple.vue?fb91","webpack://beliefnet-frontend/./src/components/carousel/simple.vue"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, createElementVNode as _createElementVNode, withModifiers as _withModifiers, unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n  id: \"myCarousel\",\n  class: \"container text-center simple-carousel testimonial\"\n}\nconst _hoisted_2 = {\n  class: \"carousel-inner\",\n  id: \"carousel-inner\"\n}\nconst _hoisted_3 = /*#__PURE__*/_createElementVNode(\"div\", { class: \"arrow\" }, null, -1)\nconst _hoisted_4 = /*#__PURE__*/_createElementVNode(\"span\", { class: \"sr-only\" }, \"Previous\", -1)\nconst _hoisted_5 = [\n  _hoisted_3,\n  _hoisted_4\n]\nconst _hoisted_6 = /*#__PURE__*/_createElementVNode(\"div\", { class: \"arrow-right\" }, null, -1)\nconst _hoisted_7 = /*#__PURE__*/_createElementVNode(\"span\", { class: \"sr-only\" }, \"Next\", -1)\nconst _hoisted_8 = [\n  _hoisted_6,\n  _hoisted_7\n]\nconst _hoisted_9 = { class: \"carousel-indicators\" }\nconst _hoisted_10 = [\"onClick\"]\n\nimport { ref, toRefs } from 'vue';\nimport { useLogger } from 'vue-logger-plugin';\n\n// Define Component Input Properties\n\nexport default /*#__PURE__*/_defineComponent({\n  __name: 'simple',\n  props: {\n    numberOfSlides: Number\n},\n  setup(__props) {\n\nconst props = __props;\n\n\n\n// get back slide card info\nconst { numberOfSlides } = toRefs(props);\nconst maxNumberOfSlides = numberOfSlides?.value;\n\n// logger for information\nconst logger = useLogger();\n// this is what slide we're on\nconst currentActive = ref(0);\nconst leftActive = ref(null);\nconst rightActive = ref(null);\nconst nextActive = ref(null);\nconst prevActive = ref(null);\nconst activelySliding = ref(-1);\n\n// every 8 seconds go to the next slide\nsetInterval(function () {\n    nextSlide(1);\n}, 8000);\n\n// resets a single slide\nconst removeSlideClass = function (slide, className) {\n    if (slide !== null && slide >= 0 && slide < maxNumberOfSlides) {\n        logger.debug(`resetting class for slide ${slide}`);\n        const topElement = document.getElementById('carousel-inner');\n        topElement.children[slide].classList.remove(className);\n    }\n};\n\n// reset all slide back to 0\nconst resetAllSlides = function () {\n    logger.debug('calling reset all slides classes');\n    const topElement = document.getElementById('carousel-inner');\n    for (var idx = 0; idx < maxNumberOfSlides; idx++) {\n        topElement.children[idx].classList.remove('active', 'next', 'prev', 'left', 'right');\n    }\n};\n\n// add class to the inner slide\nconst addSlideClass = function (slide, className, updateActiveSlide = false) {\n    if (slide !== null && slide >= 0 && slide < maxNumberOfSlides) {\n        if (updateActiveSlide) {\n            logger.debug(`updating currentActive slide to ${slide}`);\n            // update the currently active slide to this slide\n            currentActive.value = slide;\n        }\n\n        logger.debug(`adding class ${className} to slide ${slide} `);\n        // add class to the current slide\n        const topElement = document.getElementById('carousel-inner');\n        topElement.children[slide].classList.add(className);\n    }\n};\n\n// for when the indicator bubbles are clicked go directly to the page in question\nconst onIndicatorClick = function (slide) {\n    logger.debug(`indicator clicked for slide ${slide}`);\n    resetAllSlides();\n    addSlideClass(slide, 'active', true);\n};\n\n// when next or prev buttons are clicked\nconst nextSlide = function (direction) {\n    // do not slide until we're able to\n    if (activelySliding.value >= 0) {\n        return;\n    }\n\n    let slide = currentActive.value;\n\n    // set that we're actively sliding to the next card\n    activelySliding.value = slide;\n\n    // positive means going next slide\n    if (direction > 0) {\n        leftActive.value = slide;\n        slide++;\n\n        // keep it in bound\n        if (slide >= maxNumberOfSlides) {\n            slide = 0;\n        }\n\n        setTimeout(function () {\n            // next active is the one we want\n            nextActive.value = slide;\n            addSlideClass(nextActive.value, 'next');\n        }, 500);\n\n        // make slide active and left slide left\n        addSlideClass(leftActive.value, 'left');\n    } else {\n        rightActive.value = slide;\n        slide--;\n\n        // keep the slide in bound\n        if (slide < 0) {\n            slide = maxNumberOfSlides - 1;\n        }\n\n        setTimeout(function () {\n            // previous active is up next\n            prevActive.value = slide;\n            addSlideClass(prevActive.value, 'prev');\n        }, 500);\n\n        // make slide active and right slide right\n        addSlideClass(rightActive.value, 'right');\n    }\n\n    // this time out sets the current active value so the carousel looks like it is \"sliding\"\n    setTimeout(function () {\n        // reset the currently active slide before we move\n        removeSlideClass(currentActive.value, 'active');\n\n        // reset the next and prev values\n        if (nextActive.value != null) {\n            currentActive.value = nextActive.value;\n        } else {\n            currentActive.value = prevActive.value;\n        }\n\n        // this should already be done but re-do it just in case it got reset in a timer\n        addSlideClass(currentActive.value, 'active');\n\n        // reset the other slides\n        removeSlideClass(leftActive.value, 'left');\n        removeSlideClass(rightActive.value, 'right');\n        removeSlideClass(prevActive.value, 'prev');\n        removeSlideClass(nextActive.value, 'next');\n\n        // reset all values\n        leftActive.value = rightActive.value = prevActive.value = nextActive.value = null;\n\n        // we're no longer sliding so indicate that\n        activelySliding.value = -1;\n    }, 1000);\n};\n\nreturn (_ctx: any,_cache: any) => {\n  return (_openBlock(), _createElementBlock(\"div\", null, [\n    _createElementVNode(\"div\", _hoisted_1, [\n      _createElementVNode(\"div\", _hoisted_2, [\n        _renderSlot(_ctx.$slots, \"default\")\n      ]),\n      _createElementVNode(\"a\", {\n        class: \"left carousel-control\",\n        href: \"#\",\n        role: \"button\",\n        onClick: _cache[0] || (_cache[0] = _withModifiers(($event: any) => (nextSlide(-1)), [\"prevent\"]))\n      }, _hoisted_5),\n      _createElementVNode(\"a\", {\n        class: \"right carousel-control\",\n        href: \"#\",\n        role: \"button\",\n        onClick: _cache[1] || (_cache[1] = _withModifiers(($event: any) => (nextSlide(1)), [\"prevent\"]))\n      }, _hoisted_8),\n      _createElementVNode(\"ol\", _hoisted_9, [\n        (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(maxNumberOfSlides), (idx) => {\n          return (_openBlock(), _createElementBlock(\"li\", {\n            key: idx,\n            onClick: ($event: any) => (onIndicatorClick(idx - 1))\n          }, null, 8, _hoisted_10))\n        }), 128))\n      ])\n    ])\n  ]))\n}\n}\n\n})","import script from \"./simple.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./simple.vue?vue&type=script&setup=true&lang=ts\"\n\nconst __exports__ = script;\n\nexport default __exports__"],"names":["_hoisted_1","id","class","_hoisted_2","_hoisted_3","_createElementVNode","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_defineComponent","__name","props","numberOfSlides","Number","setup","__props","toRefs","maxNumberOfSlides","value","logger","useLogger","currentActive","ref","leftActive","rightActive","nextActive","prevActive","activelySliding","setInterval","nextSlide","removeSlideClass","slide","className","debug","topElement","document","getElementById","children","classList","remove","resetAllSlides","idx","addSlideClass","updateActiveSlide","add","onIndicatorClick","direction","setTimeout","_ctx","_cache","_openBlock","_createElementBlock","_renderSlot","$slots","href","role","onClick","_withModifiers","$event","_Fragment","_renderList","_unref","key","__exports__"],"sourceRoot":""}