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AEZ,MAED,IAAK,aAUL,IAAK,gBACJvB,EAAW,CACVmB,iBAAiB,EACjBd,YAAY,EACZgB,SAAU,EACVC,UAAU,EACVC,UAAW,QAEZ,MAED,IAAK,cAEe,KAAfxB,IAEHC,EAAW,CACVwB,SAAUzB,EACVuB,UAAU,EACVG,SAAS,IAIX,MAED,IAAK,eACJzB,EAAW,CACVY,WAAYA,EACZP,YAAY,EACZgB,UAAU,EACVC,UAAU,GAEX,MAED,IAAK,oBACJtB,EAAW,CACVmB,iBAAiB,EACjBC,UAAU,EACVf,YAAY,EACZiB,UAAU,EACVC,UAAW,QAEZ,MAED,IAAK,kBACJvB,EAAW,CACVmB,iBAAiB,EACjBC,UAAU,EACVf,YAAY,EACZgB,SAAU,EACVC,UAAU,EACVC,UAAW,QAYd,OAAOvB,CACR,EAEAU,MAAO,SAAUgB,GACDjB,IAAEiB,EAAEC,QAAQC,QAAQ5C,GACX6C,KAAK7C,GACRoB,KAAKnB,GAEpB6C,UACP,EAEAnB,MAAO,SAAUe,GACDjB,IAAEiB,EAAEC,QAAQC,QAAQ5C,GACX6C,KAAK7C,GACRoB,KAAKnB,GAEpB8C,MACP,EAEAxB,gBAAiB,SAAUd,GAC1B,IAAIuC,EAAWvC,EAASmC,QAAQ5C,GAC5BiD,EAAQD,EAASH,KAAK7C,GACtBkD,EAAQF,EAASH,KAAK7C,GAE1B,OAAO,SAAUmD,GAChB,IAGIC,EAAoB,IAAVD,EACVE,EAASF,GAJDG,KACOC,OAAO7C,OAGG,EAE7BuC,EAAMO,KAAK,WAAYJ,GACvBF,EAAMM,KAAK,WAAYH,EACxB,CACD,GAGGI,EAAU,CACbtD,KAAMD,EAAOC,K","sources":["webpack://BellGully/../http/content/scripts/src/app/ui/rotator/rotator.js"],"sourcesContent":["/* app/ui/rotator/rotator */\r\n\r\nimport $ from 'jquery';\r\nimport Flickity from 'flickity';\r\nimport 'flickity-as-nav-for';\r\n\r\nvar $rotators;\r\n\r\nvar selectors = {\r\n\twrapper: '.js-rotator__wrapper',\r\n\trotator: '.js-rotator',\r\n\r\n\tprev: '.js-rotator__prev',\r\n\tnext: '.js-rotator__next'\r\n};\r\n\r\nvar dataSelectors = {\r\n\tflickity: 'flickity-instance'\r\n};\r\n\r\nvar module = {\r\n\tinit: function ($elms) {\r\n\t\tmodule._initElements($elms);\r\n\t\tmodule._initRotators();\r\n\t\tmodule._initEvents();\r\n\t},\r\n\r\n\t_initElements: function ($elms) {\r\n\t\t$rotators = $elms;\r\n\t},\r\n\r\n\t_initRotators: function () {\r\n\t\tvar i;\r\n\t\tvar $rotator;\r\n\r\n\t\tfor (i = 0; i < $rotators.length; i++) {\r\n\t\t\t$rotator = $rotators.eq(i);\r\n\t\t\tmodule._initRotator($rotator);\r\n\t\t}\r\n\t},\r\n\r\n\t_initRotator: function ($rotator) {\r\n\t\tvar rotatorType = $rotator.attr('data-rotator-type') || 'content';\r\n\t\tvar rotatorNav = $rotator.attr('data-rotator-nav') || '';\r\n\t\tvar settings = module._getRotatorSettings($rotator, rotatorType, rotatorNav);\r\n\t\tvar thisFlick = new Flickity($rotator[0], settings);\r\n\r\n\t\t$rotator.data(dataSelectors.flickity, thisFlick);\r\n\r\n\t\tif (!settings.wrapAround) {\r\n\t\t\tthisFlick.on('change', module._setArrowStates($rotator));\r\n\t\t\tmodule._setArrowStates($rotator).call(thisFlick, 0);\r\n\t\t}\r\n\t},\r\n\r\n\t_initEvents: function () {\r\n\t\t$(selectors.prev).on('click', module._prev);\r\n\t\t$(selectors.next).on('click', module._next);\r\n\t},\r\n\r\n\t// Return the settings for the type of rotator that has been initialised\r\n\t// These can be edited, and new types can be added\r\n\t// Documentation for the options can be found here: https://flickity.metafizzy.co/\r\n\t_getRotatorSettings: function ($rotator, rotatorType, rotatorNav) {\r\n\t\tvar settings;\r\n\t\tvar arrowShape = {\r\n\t\t\tx0: 10,\r\n\t\t\tx1: 60, y1: 50,\r\n\t\t\tx2: 65, y2: 45,\r\n\t\t\tx3: 20\r\n\t\t};\r\n\r\n\t\tswitch (rotatorType) {\r\n\r\n\t\t\tcase 'image':\r\n\t\t\t\tsettings = {\r\n\t\t\t\t\tprevNextButtons: false,\r\n\t\t\t\t\tautoPlay: false,\r\n\t\t\t\t\twrapAround: false,\r\n\t\t\t\t\tlazyLoad: true\r\n\t\t\t\t};\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'gallery':\r\n\t\t\t\tsettings = {\r\n\t\t\t\t\tarrowShape: arrowShape,\r\n\t\t\t\t\twrapAround: true,\r\n\t\t\t\t\tlazyLoad: 1,\r\n\t\t\t\t\tpageDots: false\r\n\t\t\t\t};\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'carousel':\r\n\t\t\t\tsettings = {\r\n\t\t\t\t\tarrowShape: arrowShape,\r\n\t\t\t\t\twrapAround: true,\r\n\t\t\t\t\tlazyLoad: 6,\r\n\t\t\t\t\tcellAlign: 'left'\r\n\t\t\t\t};\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'experience':\r\n\t\t\t\tsettings = {\r\n\t\t\t\t\tprevNextButtons: false,\r\n\t\t\t\t\twrapAround: true,\r\n\t\t\t\t\tlazyLoad: 3,\r\n\t\t\t\t\tpageDots: false,\r\n\t\t\t\t\tcellAlign: 'left'\r\n\t\t\t\t};\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'accommodation':\r\n\t\t\t\tsettings = {\r\n\t\t\t\t\tprevNextButtons: false,\r\n\t\t\t\t\twrapAround: true,\r\n\t\t\t\t\tlazyLoad: 3,\r\n\t\t\t\t\tpageDots: false,\r\n\t\t\t\t\tcellAlign: 'left'\r\n\t\t\t\t};\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'gallery-nav':\r\n\r\n\t\t\t\tif (rotatorNav !== \"\") {\r\n\r\n\t\t\t\t\tsettings = {\r\n\t\t\t\t\t\tasNavFor: rotatorNav,\r\n\t\t\t\t\t\tpageDots: false,\r\n\t\t\t\t\t\tcontain: true\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'testimonials':\r\n\t\t\t\tsettings = {\r\n\t\t\t\t\tarrowShape: arrowShape,\r\n\t\t\t\t\twrapAround: true,\r\n\t\t\t\t\tlazyLoad: true,\r\n\t\t\t\t\tpageDots: false\r\n\t\t\t\t};\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'benefits-carousel':\r\n\t\t\t\tsettings = {\r\n\t\t\t\t\tprevNextButtons: false,\r\n\t\t\t\t\tautoPlay: false,\r\n\t\t\t\t\twrapAround: false,\r\n\t\t\t\t\tpageDots: false,\r\n\t\t\t\t\tcellAlign: 'left'\r\n\t\t\t\t};\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'latest-insights':\r\n\t\t\t\tsettings = {\r\n\t\t\t\t\tprevNextButtons: false,\r\n\t\t\t\t\tautoPlay: false,\r\n\t\t\t\t\twrapAround: false,\r\n\t\t\t\t\tlazyLoad: 4,\r\n\t\t\t\t\tpageDots: true,\r\n\t\t\t\t\tcellAlign: 'left',\r\n\t\t\t\t};\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tsettings = {\r\n\t\t\t\t\tprevNextButtons: false,\r\n\t\t\t\t\tautoPlay: false,\r\n\t\t\t\t\twrapAround: false,\r\n\t\t\t\t\tlazyLoad: true,\r\n\t\t\t\t};\r\n\t\t}\r\n\t\treturn settings;\r\n\t},\r\n\r\n\t_prev: function (e) {\r\n\t\tvar $wrapper = $(e.target).closest(selectors.wrapper);\r\n\t\tvar $rotator = $wrapper.find(selectors.rotator);\r\n\t\tvar flick = $rotator.data(dataSelectors.flickity);\r\n\r\n\t\tflick.previous();\r\n\t},\r\n\r\n\t_next: function (e) {\r\n\t\tvar $wrapper = $(e.target).closest(selectors.wrapper);\r\n\t\tvar $rotator = $wrapper.find(selectors.rotator);\r\n\t\tvar flick = $rotator.data(dataSelectors.flickity);\r\n\r\n\t\tflick.next();\r\n\t},\r\n\r\n\t_setArrowStates: function ($rotator) {\r\n\t\tvar $wrapper = $rotator.closest(selectors.wrapper);\r\n\t\tvar $prev = $wrapper.find(selectors.prev);\r\n\t\tvar $next = $wrapper.find(selectors.next);\r\n\r\n\t\treturn function (index) {\r\n\t\t\tvar flick = this;\r\n\t\t\tvar length = flick.slides.length;\r\n\r\n\t\t\tvar isFirst = index === 0;\r\n\t\t\tvar isLast = index >= length-1;\r\n\r\n\t\t\t$prev.prop('disabled', isFirst);\r\n\t\t\t$next.prop('disabled', isLast);\r\n\t\t}\r\n\t}\r\n};\r\n\r\nvar Rotator = {\r\n\tinit: module.init\r\n};\r\n\r\nexport { Rotator };\r\n"],"names":["$rotators","selectors","dataSelectors","module","init","$elms","_initElements","_initRotators","_initEvents","i","$rotator","length","eq","_initRotator","rotatorType","attr","rotatorNav","settings","_getRotatorSettings","thisFlick","Flickity","data","wrapAround","on","_setArrowStates","call","$","_prev","_next","arrowShape","x0","x1","y1","x2","y2","x3","prevNextButtons","autoPlay","lazyLoad","pageDots","cellAlign","asNavFor","contain","e","target","closest","find","previous","next","$wrapper","$prev","$next","index","isFirst","isLast","this","slides","prop","Rotator"],"sourceRoot":""}