{"html":"<div class=\"uc_toggle_tabs {{remote_parent.class}} {{uc_filtering_addclass}}\" id=\"{{uc_id}}\" {{remote_parent.attributes|raw}} {{uc_filtering_attributes|raw}}>\n\n  <div class=\"uc_tab-slider--nav\">\n    <ul class=\"uc_tab-slider--tabs uc-items-wrapper\">\n      {{put_items()}}\n    <\/ul>\n  <\/div>\n  \n  <div class=\"uc_tab-slider--container uc-items-wrapper2\" data-debug=\"{{debug_elements}}\" data-editor=\"{{uc_inside_editor}}\" data-cookie=\"{{remember_selection}}\" data-cookie-name=\"{{cookie_name|raw}}\" data-cookie-days=\"{{cookie_exp_day}}\" data-cookie-hours=\"{{cookie_exp_hour}}\" data-cookie-min=\"{{cookie_exp_minutes}}\" data-cookie-sec=\"{{cookie_exp_sec}}\">\n    {{put_items2()}}\n    \n  <\/div>\n<\/div>","html_item":"<li class=\"uc_tab-slider--trigger\" data-tab-index=\"{{item.item_index}}\" >\n  <a class=\"uc-tab-slider__link\" href=\"javascript:void(0);\" data-id=\"{% if item.hash_id is not empty %}{{item.hash_id|raw}}{% else %}{{item.item_id}}{% endif %}\">\n    {% if item.show_tab_title == \"true\" %}{{item.title}}{% endif %}\n    {% if item.show_tab_icon == \"true\" %}<span class=\"ue-tab-icon\">{{item.icon_html|raw}}<\/span>{% endif %}\n  <\/a>\n<\/li>","html_item2":"<div id=\"{% if item.hash_id is not empty %}{{item.hash_id|raw}}{% else %}{{item.item_id}}{% endif %}\" class=\"uc_tab-slider--body\">\n  {% if item.source == \"content\" %}<div class=\"ue-content\">{{item.content_area|raw}}<\/div>{% endif %}\n  {% if item.source == \"template\" %}<div class=\"ue-template\">{{putElementorTemplate(item.template_templateid)}}<\/div>{% endif %}\n  {% if item.source == \"image\" %}<div class=\"ue-content\"><img class=\"ue-img\" src=\"{{item.image}}\"><\/div>{% endif %}\n  {% if item.source == \"element\" %}<div class=\"ue-element\" data-id=\"{{item.element_id|raw}}\"><\/div>{% endif %}\n<\/div>","css":"#{{uc_id}}\n{\n}\n#{{uc_id}} * { \n\tbox-sizing: border-box; \n}\n#{{uc_id}} a\n{\n  text-decoration:none;\n}\n#{{uc_id}} .uc_tab-slider--tabs {\n  \tdisplay: inline-block;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n\tposition: relative;\n\toverflow: hidden;\n\tuser-select: none;\n    border-radius:{{radius}}px;\n}\n\n#{{uc_id}} .uc_tab-slider--nav .uc_flex-tab {\n  \tposition: absolute;\n    top: 0;\n    left: 0;\n    width: 100px;\n    z-index: 1;\n    background-color:{{tab_active_background}};\n    border-radius:{{radius}}px;\n    margin: 0;\n    padding: 0;\n}\n#{{uc_id}} .uc_tab-slider--trigger a {\n\tline-height: 1;\n\ttext-align: center;\n\tposition: relative;\n\tz-index: 2;\n\tcursor: pointer;\n\tdisplay: inline-block;\n\ttransition: color 250ms ease-in-out;\n\tuser-select: none;\n    padding-left:{{tab_horizontal_padding}}px;\n    padding-right:{{tab_horizontal_padding}}px;\n    padding-top:{{tab_vertical_padding}}px;\n    padding-bottom:{{tab_vertical_padding}}px;\n}\n\n#{{uc_id}} .uc_content{\n\tdisplay: flex;\n\tflex-wrap: wrap;\n}\n\n#{{uc_id}} .uc_tab-slider--nav{\n\twidth: 100%;\n}\n#{{uc_id}} .uc_tab-slider--trigger {\n\tdisplay: inline-block;\n    margin: 0;\n  \tpadding: 0;\n}\n\n\n#{{uc_id}} .uc_tab-slider--trigger a span.ue-tab-icon\n{\n  display:inline-block;\n  line-height:1em;\n}\n\n#{{uc_id}} .uc_tab-slider--trigger a span.ue-tab-icon svg\n{\n  height:1em;\n  width:1em;\n}","css_item":"{% if item.source == \"element\" and item.item_index > 0 %} \n\n{{ ucfunc(\"put_hide_ids_css\", item.element_id) }}\n\n{% endif %}","js":"{{ ucfunc(\"put_docready_start\") }}\n\n    \/\/ids\n    var widgetId = \"{{uc_id}}\";\n\n    \/\/classes\n    var contentSwitcherBodyClass = \"uc_tab-slider--body\";\n    var ueElementClass = \"ue-element\";\n    var tabTriggerClass = \"uc_tab-slider--trigger\";\n    var bodyContainerClass = \"uc_tab-slider--container\";\n    var navLinkClass = \"uc-tab-slider__link\";\n    var tabsContainerClass = \"uc_tab-slider--tabs\";\n    var magicLineClass = \"uc_flex-tab\";\n    var activeClass = \"active\";\n    var ucActiveClass = \"uc_active\";  \n\n    \/\/selectors\n    var widgetSelector = \"#\"+widgetId;\n    var contentSwitcherBodySelector = \".\"+contentSwitcherBodyClass;\n    var ueElementSelector = \".\"+ueElementClass;\n    var tabTriggerSelector = \".\"+tabTriggerClass;\n    var bodyContainerSelector = \".\"+bodyContainerClass;\n    var navLinkSelector = \".\"+navLinkClass;\n    var tabsContainerSelector = \".\"+tabsContainerClass;\n    var magicLineSelector = \".\"+magicLineClass;\n\n    \/\/objects\n    var objTabsWrapper = jQuery(widgetSelector);\n    var objContentSwitcherBodies = objTabsWrapper.find(contentSwitcherBodySelector);\n    var objUeElements = objTabsWrapper.find(ueElementSelector);\n    var objTabTriggers = objTabsWrapper.find(tabTriggerSelector);\n    var objBodyContainer = objTabsWrapper.find(bodyContainerSelector);\n    var objNavLinks = objTabsWrapper.find(navLinkSelector);\n    var objTabsContainer = objTabsWrapper.find(tabsContainerSelector);\n    var objMagicLine;\n\n    \/\/attr\n    var dataDebug = objBodyContainer.data(\"debug\");\n    var dataEditor = objBodyContainer.data(\"editor\");\n    var dataCookie = objBodyContainer.data(\"cookie\");\n    var dataCookieName = widgetId+\"_\"+objBodyContainer.data(\"cookie-name\");  \n\n    \/\/helpers\n    var elementParentIndex;\n    var elementParentIndexArray = [];\n    var elementsId;\n    var leftPos;\n    var newWidth;\n    var currentTabIndex = 0;\n    var customCookieName = \"ue_content_switcher_\" + dataCookieName;\n\n    \/**\n    * enables elementor swiper widget`s proper work inside content switcher widget\n    *\/\n    function initSwiperWidgetProtection(){    \n      var objSwippers = objTabsWrapper.find(\".swiper\");\n\n      if(!objSwippers)\n      return(false);    \n\n      objSwippers.each(function(){    \n        var objSwiper = jQuery(this);\n        var objParentTabContainer = objSwiper.parents(contentSwitcherBodySelector);\n        var isVisible = objParentTabContainer.css(\"display\") != \"none\";\n\n        if(isVisible == true)\n        return(true);\n\n        var objSliders = objSwiper.find(\".swiper-slide\");\n\n        if(!objSliders)\n        return(true);\n\n        objSliders.each(function(){        \n          var objSlide = jQuery(this);\n\n          if(objSlide.attr('inert') !== undefined)\n          objSlide.removeAttr('inert');   \n        });     \n      });        \n    }\n\n    \/*\n    * hide container when tab with elements to show is clicked        \n    *\/ \n    function hideBodyContainers(){\n\n      objUeElements.each(function(){\n        var objElement = jQuery(this);\n        var objParentElement = objElement.parents(contentSwitcherBodySelector);\n\n        objParentElement.hide();\n      });        \n    }\n\n    \/*\n    * hide all elements\n    *\/     \n    function hideElements(){\n\n      objUeElements.each(function(){            \n        elementsId = jQuery(this).data('id');\n\n        var elementsIdArray = elementsId.split(',');\n\n        elementsIdArray.forEach(function(value){                \n          var objElement = jQuery(\"#\"+value);\n\n          objElement.hide();\n\n          objElement.removeClass(activeClass);\n\n          \/\/ show elements if in editor and debug mode is true   \n          if(dataDebug == true && dataEditor == 'yes'){\n            objElement.fadeIn();\n            objElement.css({'border': '3px solid red'});\n\n          }else{\n            objElement.css({'border': 'unset'});\n\n          }\n        });\n      });\n    }\n\n    \/**\n    * get current index\n    *\/\n    function getCurrentTabIndex(){\n\n      currentTabIndex = objTabsWrapper.find(tabTriggerSelector+'.'+ucActiveClass).index(); \n\n      return(currentTabIndex);\n\n    }\n\n    \/*\n    * find active elements\n    *\/\n    function showActive(){\n\n      objContentSwitcherBodies.find(ueElementSelector).removeClass(activeClass);\n      objContentSwitcherBodies.eq(currentTabIndex).find(ueElementSelector).addClass(activeClass);\n\n      var objActiveElements = objTabsWrapper.find(ueElementSelector+'.'+activeClass);\n\n      \/\/each child element with source: element id\n      objActiveElements.each(function(){\n        \/\/array of ids\n        elementsId = jQuery(this).data('id');\n\n        var elementsIdArray = elementsId.split(',');\n\n        \/\/each id in array\n        elementsIdArray.forEach(function(value){\n\n          var element = jQuery(\"#\" + value);\n\n          \/\/each element by id\n          elementParentIndexArray.forEach(function(index, value){\n\n            \/\/show current and hide others\n            if(currentTabIndex == index){\n              element.show();\n              element.addClass(activeClass);\n\n              hideBodyContainers();\n\n            }\/\/end if  \n\n          });\/\/end each element by id                \n        });\/\/end each id in array\n      });\/\/end each child element with source: element id\n      \n    {% if fire_resize_event_on_tab_click == \"true\" %}\n      window.dispatchEvent(new Event('resize'));\n    {% endif %}\n    \n    } \n\n    \/**\n    * set magic line size and position\n    *\/\n    function setMagicLine(objLink){\n\n      if(!objLink)\n      objLink = objTabsWrapper.find(\".\"+ucActiveClass+\" \"+navLinkSelector);\n\n      var objParentTab = objLink.parents(tabTriggerSelector);\n      var magicLineWidth = objParentTab.width();\n      var magicLineLeftPos = objLink.position().left;\n\n      objMagicLine.width(magicLineWidth);\t    \n      objMagicLine.height(objTabsContainer.height())\n      objMagicLine.css(\"left\", magicLineLeftPos);  \n    }\n\n    \/**\n    * init magic line\n    *\/\n    function initMagicLine(){\n      objTabsContainer.append(\"<li class='\"+magicLineClass+\"'><\/li>\");\n\n      objMagicLine = objTabsWrapper.find(magicLineSelector);\n\n      \/\/set position and size\n      setMagicLine();\n\n    }\n\n    \/**\n    * update magic line position after nav link click\n    *\/\n    function updateMagicLinePosition(objLink){\n      var objActiveParent = objLink.parent(tabTriggerSelector);\n\n      \/\/don't do anything if clicked link is active already\n      if(objActiveParent.hasClass(ucActiveClass))\n      return(true);\n\n      \/\/remove active class from all parent containers\n      objTabTriggers.removeClass(ucActiveClass);\n\n      \/\/assign active class to the clicked container\n      objActiveParent.addClass(ucActiveClass);\n\n      leftPos = objLink.position().left;\n      newWidth = objLink.parent().width();\n\n      objMagicLine.stop().animate({\n        left: leftPos,\n        width: newWidth\n      });\n\n      \/\/update current index\n      currentTabIndex = getCurrentTabIndex();\n\n    }  \n\n    \/**\n    * set cookie name\n    *\/\n    function setCookie(value){    \n\n      if(dataCookie == false)\n      return(false);\n\n      \/\/get data time values in miliseconds\n      var dataCookieDays = objBodyContainer.data(\"cookie-days\") * 24 * 60 * 60 * 1000;\n      var dataCookieHours = objBodyContainer.data(\"cookie-hours\") * 60 * 60 * 1000;\n      var dataCookieMinutes = objBodyContainer.data(\"cookie-min\") * 60 * 1000;\n      var dataCookieSeconds = objBodyContainer.data(\"cookie-sec\") * 1000;\n\n      var ue_expires = new Date();    \n\n      ue_expires.setTime(ue_expires.getTime() + dataCookieDays + dataCookieHours + dataCookieMinutes + dataCookieSeconds);\n\n      document.cookie = customCookieName + \"=\" + value + \"; expires=\" + ue_expires.toUTCString() + \";\";\n\n    }\n\n    \/*\n    * check cookie and open tab from it\n    *\/  \n    function checkCookieAndOpenLastTab(){\n\n      if(dataCookie == false)\n      return(false);\n\n      var lastTab = Cookies.get(customCookieName);\n\n      if(!lastTab)\n      return(false);\n\n      var objLastTabLink = objTabsWrapper.find('[data-id=\"'+ lastTab +'\"]');\n\n      objLastTabLink.trigger(\"click\");      \n    }\n     \n    \/**\n    * open tab using the hash link\n    *\/\n    function openTabFromUrlHash() {\n    \/\/ Get the hash from the URL, removing the '#' character\n      var hash = window.location.hash.substring(1);\n\n      if (hash) {\n         var tabLink = objTabsWrapper.find('[data-id=\"' + hash + '\"]');\n        \n         if (tabLink.length > 0) {\n            tabLink.trigger(\"click\");\n        }\n      }\n    }\n     \n    \/**\n    * click on nav link\n    *\/\n    function onNavLinkClick(objLink){\n\n      \/\/init swiper protection \n      initSwiperWidgetProtection(objLink);\n\n      \/\/some unknown protection\n      if(objLink.hasClass(navLinkClass) == false)\n      return(true);    \n\n      \/\/update magic line position and size\n      updateMagicLinePosition(objLink);\n\n      \/\/hide all connected elements\n      hideElements();\n\n      \/\/show active elements\n      showActive(currentTabIndex);\n\n      \/\/hide all content bodies\n      objContentSwitcherBodies.hide();\n\n      var activeTabId = objLink.attr(\"data-id\");\n\n      \/\/shows active body content element\n      jQuery(\"#\"+activeTabId).fadeIn();\n\n      \/\/set cookie\n      setCookie(activeTabId)\n\n    }\n\n    \/**\n    * init content switcher\n    *\/\n    function startToggle(){\t  \n\n      \/\/hide all content bodies\n      objContentSwitcherBodies.hide();\n\n      \/\/show first content body\n      var objFirstContentBody = objContentSwitcherBodies.eq(0);\n      var objFirstContentBodyChild = objFirstContentBody.find(\"> div\");\n\n      \/\/show first content body only if it's not an Element source (with source type elements will be shown later)\n      if(objFirstContentBodyChild.hasClass(ueElementClass) == false)\n      objFirstContentBody.show();   \n\n      var objFirstNavItem = objTabTriggers.eq(0);\n\n      \/\/activate firs nav item\n      objFirstNavItem.addClass(ucActiveClass);\n\n      \/\/code for content type set to 'element id'        \n      var objElementParentBodies = objUeElements.parents(contentSwitcherBodySelector);\n\n      \/\/detect which container bodies have element as source\n      objElementParentBodies.each(function(){        \n        elementParentIndex = jQuery(this).index();\n        elementParentIndexArray.push(elementParentIndex);\n\n      });\n\n      \/\/init swiper protection    \n      initSwiperWidgetProtection();      \n\n      \/\/hide connected elements\n      hideElements();\n\n      \/\/show active elements\n      showActive();      \n\n      \/\/init magic line\n      initMagicLine();\n      \n      \/\/check cookie\n      setTimeout(checkCookieAndOpenLastTab, 500);\n      \n      \/\/ open tab using the hash link\n      setTimeout(openTabFromUrlHash, 550);\n    }\n\n    \/\/init content switcher\n    startToggle();\n\n    \/\/init events\n    objNavLinks.on('click', function(){\n      var objLink = jQuery(this);\n    \tonNavLinkClick(objLink);\n      \n    });\n\n    objTabsWrapper.on(\"uc_ajax_refreshed\",function(){\n\n      var objChildFilter = objTabsWrapper.find(\".uc-grid-filter\");\n\n      \/\/protection that allows using filters inside content switcher items\n      if(!objChildFilter || objChildFilter.length == 0)\n      startToggle();\n\n    });\n\n    var objRemoteOptions = {\n      class_items:\"uc_tab-slider--trigger\",\n      class_active:\"uc_active\",\n      selector_item_trigger:\"a\"\n    };  \n\n    {{ucfunc(\"put_remote_parent_js\",\"objTabsWrapper\",\"objRemoteOptions\")}}  \n\n{{ ucfunc(\"put_docready_end\") }}"}