{"version":3,"file":"script.js","mappings":"yBAIAA,SAASC,iBAAiB,oBAAoB,WACzBD,SAASE,iBAAiB,mCAClCC,SAAQ,SAAAC,GACnB,IAAMC,EAAaC,KAAKC,MAAMH,EAAWI,QAAQH,YAEjD,IAAKA,EAAY,OAAO,EAExBI,SAAST,SAASE,iBAAiB,IAADQ,OAAKN,EAAWO,GAAE,eCXxB,SAACN,GAC3B,IAAQO,EAAsFP,EAAtFO,KAAMC,EAAgFR,EAAhFQ,cAAeC,EAAiET,EAAjES,WAAYC,EAAqDV,EAArDU,SAAUC,EAA2CX,EAA3CW,aAEnD,MAAO,CACHC,KAAML,GAAQ,WACdM,sBAAuBL,EACvBM,wBAAyBN,EACzBO,kBAAmB,IACnBC,gBAP0FhB,EAA7BgB,gBAQ7DC,UAAWP,EACXD,WAAYA,EAAa,EACzBS,aAAcP,EACdQ,QAX0FnB,EAAZmB,QAatF,CDHqEC,CAAepB,IAGlF,IAAMqB,EAAkB1B,SAASE,iBAAiB,IAADQ,OAAKN,EAAWO,GAAE,sCACnEgB,YAAW,WACVD,EAAgBvB,SAAQ,SAAAyB,GACvBA,EAAKC,UAAUC,OAAO,kBACvB,GACD,GAAG,KAEH1B,SAAAA,EAAY2B,gBAAgB,kBAC7B,GACD,G","sources":["webpack://b-timeline-block/./src/script.js","webpack://b-timeline-block/./src/utils/config.js"],"sourcesContent":["import './style.scss';\r\nimport { timelineConfig } from './utils/config';\r\n\r\n// Timeline\r\ndocument.addEventListener('DOMContentLoaded', () => {\r\n\tconst timelineEls = document.querySelectorAll('.wp-block-tlgb-b-timeline-block');\r\n\ttimelineEls.forEach(timelineEl => {\r\n\t\tconst attributes = JSON.parse(timelineEl.dataset.attributes);\r\n\r\n\t\tif (!attributes) return false;\r\n\r\n\t\ttimeline(document.querySelectorAll(`#${timelineEl.id} .timeline`), timelineConfig(attributes));\r\n\r\n\t\t// Remove hidden-animated class for https://wordpress.org/support/topic/timeline-not-loading-on-mobile/\r\n\t\tconst allTimelineItem = document.querySelectorAll(`#${timelineEl.id} .timeline__items .timeline__item`);\r\n\t\tsetTimeout(() => {\r\n\t\t\tallTimelineItem.forEach(item => {\r\n\t\t\t\titem.classList.remove('hidden-animated');\r\n\t\t\t});\r\n\t\t}, 500);\r\n\r\n\t\ttimelineEl?.removeAttribute('data-attributes');\r\n\t});\r\n});","export const timelineConfig = (attributes) => {\r\n const { type, labelLocation, startIndex, moveItem, vigibleItems, verticalTrigger, rtlMode } = attributes;\r\n\r\n return {\r\n mode: type || 'vertical',\r\n verticalStartPosition: labelLocation,\r\n horizontalStartPosition: labelLocation,\r\n forceVerticalMode: 700,\r\n verticalTrigger,\r\n moveItems: moveItem,\r\n startIndex: startIndex - 1,\r\n visibleItems: vigibleItems,\r\n rtlMode\r\n }\r\n}"],"names":["document","addEventListener","querySelectorAll","forEach","timelineEl","attributes","JSON","parse","dataset","timeline","concat","id","type","labelLocation","startIndex","moveItem","vigibleItems","mode","verticalStartPosition","horizontalStartPosition","forceVerticalMode","verticalTrigger","moveItems","visibleItems","rtlMode","timelineConfig","allTimelineItem","setTimeout","item","classList","remove","removeAttribute"],"sourceRoot":""}