frontend.js 71 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941
  1. /*! elementor - v2.2.4 - 20-09-2018 */
  2. /******/ (function(modules) { // webpackBootstrap
  3. /******/ // The module cache
  4. /******/ var installedModules = {};
  5. /******/
  6. /******/ // The require function
  7. /******/ function __webpack_require__(moduleId) {
  8. /******/
  9. /******/ // Check if module is in cache
  10. /******/ if(installedModules[moduleId]) {
  11. /******/ return installedModules[moduleId].exports;
  12. /******/ }
  13. /******/ // Create a new module (and put it into the cache)
  14. /******/ var module = installedModules[moduleId] = {
  15. /******/ i: moduleId,
  16. /******/ l: false,
  17. /******/ exports: {}
  18. /******/ };
  19. /******/
  20. /******/ // Execute the module function
  21. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  22. /******/
  23. /******/ // Flag the module as loaded
  24. /******/ module.l = true;
  25. /******/
  26. /******/ // Return the exports of the module
  27. /******/ return module.exports;
  28. /******/ }
  29. /******/
  30. /******/
  31. /******/ // expose the modules object (__webpack_modules__)
  32. /******/ __webpack_require__.m = modules;
  33. /******/
  34. /******/ // expose the module cache
  35. /******/ __webpack_require__.c = installedModules;
  36. /******/
  37. /******/ // define getter function for harmony exports
  38. /******/ __webpack_require__.d = function(exports, name, getter) {
  39. /******/ if(!__webpack_require__.o(exports, name)) {
  40. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  41. /******/ }
  42. /******/ };
  43. /******/
  44. /******/ // define __esModule on exports
  45. /******/ __webpack_require__.r = function(exports) {
  46. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  47. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  48. /******/ }
  49. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  50. /******/ };
  51. /******/
  52. /******/ // create a fake namespace object
  53. /******/ // mode & 1: value is a module id, require it
  54. /******/ // mode & 2: merge all properties of value into the ns
  55. /******/ // mode & 4: return value when already ns object
  56. /******/ // mode & 8|1: behave like require
  57. /******/ __webpack_require__.t = function(value, mode) {
  58. /******/ if(mode & 1) value = __webpack_require__(value);
  59. /******/ if(mode & 8) return value;
  60. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  61. /******/ var ns = Object.create(null);
  62. /******/ __webpack_require__.r(ns);
  63. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  64. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  65. /******/ return ns;
  66. /******/ };
  67. /******/
  68. /******/ // getDefaultExport function for compatibility with non-harmony modules
  69. /******/ __webpack_require__.n = function(module) {
  70. /******/ var getter = module && module.__esModule ?
  71. /******/ function getDefault() { return module['default']; } :
  72. /******/ function getModuleExports() { return module; };
  73. /******/ __webpack_require__.d(getter, 'a', getter);
  74. /******/ return getter;
  75. /******/ };
  76. /******/
  77. /******/ // Object.prototype.hasOwnProperty.call
  78. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  79. /******/
  80. /******/ // __webpack_public_path__
  81. /******/ __webpack_require__.p = "";
  82. /******/
  83. /******/
  84. /******/ // Load entry module and return exports
  85. /******/ return __webpack_require__(__webpack_require__.s = 167);
  86. /******/ })
  87. /************************************************************************/
  88. /******/ ({
  89. /***/ 1:
  90. /***/ (function(module, exports, __webpack_require__) {
  91. "use strict";
  92. var Module = __webpack_require__(2),
  93. ViewModule;
  94. ViewModule = Module.extend({
  95. elements: null,
  96. getDefaultElements: function getDefaultElements() {
  97. return {};
  98. },
  99. bindEvents: function bindEvents() {},
  100. onInit: function onInit() {
  101. this.initElements();
  102. this.bindEvents();
  103. },
  104. initElements: function initElements() {
  105. this.elements = this.getDefaultElements();
  106. }
  107. });
  108. module.exports = ViewModule;
  109. /***/ }),
  110. /***/ 16:
  111. /***/ (function(module, exports, __webpack_require__) {
  112. "use strict";
  113. var ViewModule = __webpack_require__(1);
  114. module.exports = ViewModule.extend({
  115. getDefaultSettings: function getDefaultSettings() {
  116. return {
  117. container: null,
  118. items: null,
  119. columnsCount: 3,
  120. verticalSpaceBetween: 30
  121. };
  122. },
  123. getDefaultElements: function getDefaultElements() {
  124. return {
  125. $container: jQuery(this.getSettings('container')),
  126. $items: jQuery(this.getSettings('items'))
  127. };
  128. },
  129. run: function run() {
  130. var heights = [],
  131. distanceFromTop = this.elements.$container.position().top,
  132. settings = this.getSettings(),
  133. columnsCount = settings.columnsCount;
  134. distanceFromTop += parseInt(this.elements.$container.css('margin-top'), 10);
  135. this.elements.$items.each(function (index) {
  136. var row = Math.floor(index / columnsCount),
  137. $item = jQuery(this),
  138. itemHeight = $item[0].getBoundingClientRect().height + settings.verticalSpaceBetween;
  139. if (row) {
  140. var itemPosition = $item.position(),
  141. indexAtRow = index % columnsCount,
  142. pullHeight = itemPosition.top - distanceFromTop - heights[indexAtRow];
  143. pullHeight -= parseInt($item.css('margin-top'), 10);
  144. pullHeight *= -1;
  145. $item.css('margin-top', pullHeight + 'px');
  146. heights[indexAtRow] += itemHeight;
  147. } else {
  148. heights.push(itemHeight);
  149. }
  150. });
  151. }
  152. });
  153. /***/ }),
  154. /***/ 167:
  155. /***/ (function(module, exports, __webpack_require__) {
  156. "use strict";
  157. /* global elementorFrontendConfig */
  158. (function ($) {
  159. var elements = {},
  160. EventManager = __webpack_require__(20),
  161. Module = __webpack_require__(5),
  162. ElementsHandler = __webpack_require__(168),
  163. YouTubeModule = __webpack_require__(180),
  164. AnchorsModule = __webpack_require__(181),
  165. LightboxModule = __webpack_require__(182);
  166. var ElementorFrontend = function ElementorFrontend() {
  167. var self = this,
  168. dialogsManager;
  169. this.config = elementorFrontendConfig;
  170. this.Module = Module;
  171. var setDeviceModeData = function setDeviceModeData() {
  172. elements.$body.attr('data-elementor-device-mode', self.getCurrentDeviceMode());
  173. };
  174. var initElements = function initElements() {
  175. elements.window = window;
  176. elements.$window = $(window);
  177. elements.$document = $(document);
  178. elements.$body = $('body');
  179. elements.$elementor = elements.$document.find('.elementor');
  180. elements.$wpAdminBar = elements.$document.find('#wpadminbar');
  181. };
  182. var bindEvents = function bindEvents() {
  183. elements.$window.on('resize', setDeviceModeData);
  184. };
  185. var initOnReadyComponents = function initOnReadyComponents() {
  186. self.utils = {
  187. youtube: new YouTubeModule(),
  188. anchors: new AnchorsModule(),
  189. lightbox: new LightboxModule()
  190. };
  191. self.modules = {
  192. StretchElement: __webpack_require__(183),
  193. Masonry: __webpack_require__(16)
  194. };
  195. self.elementsHandler = new ElementsHandler($);
  196. };
  197. var initHotKeys = function initHotKeys() {
  198. self.hotKeys = __webpack_require__(17);
  199. self.hotKeys.bindListener(elements.$window);
  200. };
  201. var getSiteSettings = function getSiteSettings(settingType, settingName) {
  202. var settingsObject = self.isEditMode() ? elementor.settings[settingType].model.attributes : self.config.settings[settingType];
  203. if (settingName) {
  204. return settingsObject[settingName];
  205. }
  206. return settingsObject;
  207. };
  208. var addIeCompatibility = function addIeCompatibility() {
  209. var isIE = 'Microsoft Internet Explorer' === navigator.appName || !!navigator.userAgent.match(/Trident/g) || !!navigator.userAgent.match(/MSIE/g) || !!navigator.userAgent.match(/rv:11/),
  210. el = document.createElement('div'),
  211. supportsGrid = 'string' === typeof el.style.grid;
  212. if (!isIE && supportsGrid) {
  213. return;
  214. }
  215. elements.$body.addClass('elementor-msie');
  216. var msieCss = '<link rel="stylesheet" id="elementor-frontend-css-msie" href="' + elementorFrontend.config.urls.assets + 'css/frontend-msie.min.css?' + elementorFrontend.config.version + '" type="text/css" />';
  217. elements.$body.append(msieCss);
  218. };
  219. this.init = function () {
  220. self.hooks = new EventManager();
  221. initElements();
  222. addIeCompatibility();
  223. bindEvents();
  224. setDeviceModeData();
  225. elements.$window.trigger('elementor/frontend/init');
  226. if (!self.isEditMode()) {
  227. initHotKeys();
  228. }
  229. initOnReadyComponents();
  230. };
  231. this.getElements = function (element) {
  232. if (element) {
  233. return elements[element];
  234. }
  235. return elements;
  236. };
  237. this.getDialogsManager = function () {
  238. if (!dialogsManager) {
  239. dialogsManager = new DialogsManager.Instance();
  240. }
  241. return dialogsManager;
  242. };
  243. this.getPageSettings = function (settingName) {
  244. return getSiteSettings('page', settingName);
  245. };
  246. this.getGeneralSettings = function (settingName) {
  247. return getSiteSettings('general', settingName);
  248. };
  249. this.isEditMode = function () {
  250. return self.config.isEditMode;
  251. };
  252. // Based on underscore function
  253. this.throttle = function (func, wait) {
  254. var timeout,
  255. context,
  256. args,
  257. result,
  258. previous = 0;
  259. var later = function later() {
  260. previous = Date.now();
  261. timeout = null;
  262. result = func.apply(context, args);
  263. if (!timeout) {
  264. context = args = null;
  265. }
  266. };
  267. return function () {
  268. var now = Date.now(),
  269. remaining = wait - (now - previous);
  270. context = this;
  271. args = arguments;
  272. if (remaining <= 0 || remaining > wait) {
  273. if (timeout) {
  274. clearTimeout(timeout);
  275. timeout = null;
  276. }
  277. previous = now;
  278. result = func.apply(context, args);
  279. if (!timeout) {
  280. context = args = null;
  281. }
  282. } else if (!timeout) {
  283. timeout = setTimeout(later, remaining);
  284. }
  285. return result;
  286. };
  287. };
  288. this.addListenerOnce = function (listenerID, event, callback, to) {
  289. if (!to) {
  290. to = self.getElements('$window');
  291. }
  292. if (!self.isEditMode()) {
  293. to.on(event, callback);
  294. return;
  295. }
  296. this.removeListeners(listenerID, event, to);
  297. if (to instanceof jQuery) {
  298. var eventNS = event + '.' + listenerID;
  299. to.on(eventNS, callback);
  300. } else {
  301. to.on(event, callback, listenerID);
  302. }
  303. };
  304. this.removeListeners = function (listenerID, event, callback, from) {
  305. if (!from) {
  306. from = self.getElements('$window');
  307. }
  308. if (from instanceof jQuery) {
  309. var eventNS = event + '.' + listenerID;
  310. from.off(eventNS, callback);
  311. } else {
  312. from.off(event, callback, listenerID);
  313. }
  314. };
  315. this.getCurrentDeviceMode = function () {
  316. return getComputedStyle(elements.$elementor[0], ':after').content.replace(/"/g, '');
  317. };
  318. this.waypoint = function ($element, callback, options) {
  319. var defaultOptions = {
  320. offset: '100%',
  321. triggerOnce: true
  322. };
  323. options = $.extend(defaultOptions, options);
  324. var correctCallback = function correctCallback() {
  325. var element = this.element || this,
  326. result = callback.apply(element, arguments);
  327. // If is Waypoint new API and is frontend
  328. if (options.triggerOnce && this.destroy) {
  329. this.destroy();
  330. }
  331. return result;
  332. };
  333. return $element.elementorWaypoint(correctCallback, options);
  334. };
  335. };
  336. window.elementorFrontend = new ElementorFrontend();
  337. })(jQuery);
  338. if (!elementorFrontend.isEditMode()) {
  339. jQuery(elementorFrontend.init);
  340. }
  341. /***/ }),
  342. /***/ 168:
  343. /***/ (function(module, exports, __webpack_require__) {
  344. "use strict";
  345. var ElementsHandler;
  346. ElementsHandler = function ElementsHandler($) {
  347. var self = this;
  348. // element-type.skin-type
  349. var handlers = {
  350. // Elements
  351. section: __webpack_require__(169),
  352. // Widgets
  353. 'accordion.default': __webpack_require__(170),
  354. 'alert.default': __webpack_require__(171),
  355. 'counter.default': __webpack_require__(172),
  356. 'progress.default': __webpack_require__(173),
  357. 'tabs.default': __webpack_require__(174),
  358. 'toggle.default': __webpack_require__(175),
  359. 'video.default': __webpack_require__(176),
  360. 'image-carousel.default': __webpack_require__(177),
  361. 'text-editor.default': __webpack_require__(178)
  362. };
  363. var addGlobalHandlers = function addGlobalHandlers() {
  364. elementorFrontend.hooks.addAction('frontend/element_ready/global', __webpack_require__(179));
  365. };
  366. var addElementsHandlers = function addElementsHandlers() {
  367. $.each(handlers, function (elementName, funcCallback) {
  368. elementorFrontend.hooks.addAction('frontend/element_ready/' + elementName, funcCallback);
  369. });
  370. };
  371. var runElementsHandlers = function runElementsHandlers() {
  372. var $elements;
  373. if (elementorFrontend.isEditMode()) {
  374. // Elements outside from the Preview
  375. $elements = jQuery('.elementor-element', '.elementor:not(.elementor-edit-mode)');
  376. } else {
  377. $elements = $('.elementor-element');
  378. }
  379. $elements.each(function () {
  380. self.runReadyTrigger($(this));
  381. });
  382. };
  383. var init = function init() {
  384. if (!elementorFrontend.isEditMode()) {
  385. self.initHandlers();
  386. }
  387. };
  388. this.initHandlers = function () {
  389. addGlobalHandlers();
  390. addElementsHandlers();
  391. runElementsHandlers();
  392. };
  393. this.getHandlers = function (handlerName) {
  394. if (handlerName) {
  395. return handlers[handlerName];
  396. }
  397. return handlers;
  398. };
  399. this.runReadyTrigger = function ($scope) {
  400. var elementType = $scope.attr('data-element_type');
  401. if (!elementType) {
  402. return;
  403. }
  404. // Initializing the `$scope` as frontend jQuery instance
  405. $scope = jQuery($scope);
  406. elementorFrontend.hooks.doAction('frontend/element_ready/global', $scope, $);
  407. var isWidgetType = -1 === ['section', 'column'].indexOf(elementType);
  408. if (isWidgetType) {
  409. elementorFrontend.hooks.doAction('frontend/element_ready/widget', $scope, $);
  410. }
  411. elementorFrontend.hooks.doAction('frontend/element_ready/' + elementType, $scope, $);
  412. };
  413. init();
  414. };
  415. module.exports = ElementsHandler;
  416. /***/ }),
  417. /***/ 169:
  418. /***/ (function(module, exports, __webpack_require__) {
  419. "use strict";
  420. var HandlerModule = __webpack_require__(5);
  421. var BackgroundVideo = HandlerModule.extend({
  422. player: null,
  423. isYTVideo: null,
  424. getDefaultSettings: function getDefaultSettings() {
  425. return {
  426. selectors: {
  427. backgroundVideoContainer: '.elementor-background-video-container',
  428. backgroundVideoEmbed: '.elementor-background-video-embed',
  429. backgroundVideoHosted: '.elementor-background-video-hosted'
  430. }
  431. };
  432. },
  433. getDefaultElements: function getDefaultElements() {
  434. var selectors = this.getSettings('selectors'),
  435. elements = {
  436. $backgroundVideoContainer: this.$element.find(selectors.backgroundVideoContainer)
  437. };
  438. elements.$backgroundVideoEmbed = elements.$backgroundVideoContainer.children(selectors.backgroundVideoEmbed);
  439. elements.$backgroundVideoHosted = elements.$backgroundVideoContainer.children(selectors.backgroundVideoHosted);
  440. return elements;
  441. },
  442. calcVideosSize: function calcVideosSize() {
  443. var containerWidth = this.elements.$backgroundVideoContainer.outerWidth(),
  444. containerHeight = this.elements.$backgroundVideoContainer.outerHeight(),
  445. aspectRatioSetting = '16:9',
  446. //TEMP
  447. aspectRatioArray = aspectRatioSetting.split(':'),
  448. aspectRatio = aspectRatioArray[0] / aspectRatioArray[1],
  449. ratioWidth = containerWidth / aspectRatio,
  450. ratioHeight = containerHeight * aspectRatio,
  451. isWidthFixed = containerWidth / containerHeight > aspectRatio;
  452. return {
  453. width: isWidthFixed ? containerWidth : ratioHeight,
  454. height: isWidthFixed ? ratioWidth : containerHeight
  455. };
  456. },
  457. changeVideoSize: function changeVideoSize() {
  458. var $video = this.isYTVideo ? jQuery(this.player.getIframe()) : this.elements.$backgroundVideoHosted,
  459. size = this.calcVideosSize();
  460. $video.width(size.width).height(size.height);
  461. },
  462. startVideoLoop: function startVideoLoop() {
  463. var self = this;
  464. // If the section has been removed
  465. if (!self.player.getIframe().contentWindow) {
  466. return;
  467. }
  468. var elementSettings = self.getElementSettings(),
  469. startPoint = elementSettings.background_video_start || 0,
  470. endPoint = elementSettings.background_video_end;
  471. self.player.seekTo(startPoint);
  472. if (endPoint) {
  473. var durationToEnd = endPoint - startPoint + 1;
  474. setTimeout(function () {
  475. self.startVideoLoop();
  476. }, durationToEnd * 1000);
  477. }
  478. },
  479. prepareYTVideo: function prepareYTVideo(YT, videoID) {
  480. var self = this,
  481. $backgroundVideoContainer = self.elements.$backgroundVideoContainer,
  482. elementSettings = self.getElementSettings(),
  483. startStateCode = YT.PlayerState.PLAYING;
  484. // Since version 67, Chrome doesn't fire the `PLAYING` state at start time
  485. if (window.chrome) {
  486. startStateCode = YT.PlayerState.UNSTARTED;
  487. }
  488. $backgroundVideoContainer.addClass('elementor-loading elementor-invisible');
  489. self.player = new YT.Player(self.elements.$backgroundVideoEmbed[0], {
  490. videoId: videoID,
  491. events: {
  492. onReady: function onReady() {
  493. self.player.mute();
  494. self.changeVideoSize();
  495. self.startVideoLoop();
  496. self.player.playVideo();
  497. },
  498. onStateChange: function onStateChange(event) {
  499. switch (event.data) {
  500. case startStateCode:
  501. $backgroundVideoContainer.removeClass('elementor-invisible elementor-loading');
  502. break;
  503. case YT.PlayerState.ENDED:
  504. self.player.seekTo(elementSettings.background_video_start || 0);
  505. }
  506. }
  507. },
  508. playerVars: {
  509. controls: 0,
  510. showinfo: 0,
  511. rel: 0
  512. }
  513. });
  514. elementorFrontend.getElements('$window').on('resize', self.changeVideoSize);
  515. },
  516. activate: function activate() {
  517. var self = this,
  518. videoLink = self.getElementSettings('background_video_link'),
  519. videoID = elementorFrontend.utils.youtube.getYoutubeIDFromURL(videoLink);
  520. self.isYTVideo = !!videoID;
  521. if (videoID) {
  522. elementorFrontend.utils.youtube.onYoutubeApiReady(function (YT) {
  523. setTimeout(function () {
  524. self.prepareYTVideo(YT, videoID);
  525. }, 1);
  526. });
  527. } else {
  528. self.elements.$backgroundVideoHosted.attr('src', videoLink).one('canplay', self.changeVideoSize);
  529. }
  530. },
  531. deactivate: function deactivate() {
  532. if (this.isYTVideo && this.player.getIframe()) {
  533. this.player.destroy();
  534. } else {
  535. this.elements.$backgroundVideoHosted.removeAttr('src');
  536. }
  537. },
  538. run: function run() {
  539. var elementSettings = this.getElementSettings();
  540. if ('video' === elementSettings.background_background && elementSettings.background_video_link) {
  541. this.activate();
  542. } else {
  543. this.deactivate();
  544. }
  545. },
  546. onInit: function onInit() {
  547. HandlerModule.prototype.onInit.apply(this, arguments);
  548. this.run();
  549. },
  550. onElementChange: function onElementChange(propertyName) {
  551. if ('background_background' === propertyName) {
  552. this.run();
  553. }
  554. }
  555. });
  556. var StretchedSection = HandlerModule.extend({
  557. stretchElement: null,
  558. bindEvents: function bindEvents() {
  559. var handlerID = this.getUniqueHandlerID();
  560. elementorFrontend.addListenerOnce(handlerID, 'resize', this.stretch);
  561. elementorFrontend.addListenerOnce(handlerID, 'sticky:stick', this.stretch, this.$element);
  562. elementorFrontend.addListenerOnce(handlerID, 'sticky:unstick', this.stretch, this.$element);
  563. },
  564. unbindEvents: function unbindEvents() {
  565. elementorFrontend.removeListeners(this.getUniqueHandlerID(), 'resize', this.stretch);
  566. },
  567. initStretch: function initStretch() {
  568. this.stretchElement = new elementorFrontend.modules.StretchElement({
  569. element: this.$element,
  570. selectors: {
  571. container: this.getStretchContainer()
  572. }
  573. });
  574. },
  575. getStretchContainer: function getStretchContainer() {
  576. return elementorFrontend.getGeneralSettings('elementor_stretched_section_container') || window;
  577. },
  578. stretch: function stretch() {
  579. if (!this.getElementSettings('stretch_section')) {
  580. return;
  581. }
  582. this.stretchElement.stretch();
  583. },
  584. onInit: function onInit() {
  585. HandlerModule.prototype.onInit.apply(this, arguments);
  586. this.initStretch();
  587. this.stretch();
  588. },
  589. onElementChange: function onElementChange(propertyName) {
  590. if ('stretch_section' === propertyName) {
  591. if (this.getElementSettings('stretch_section')) {
  592. this.stretch();
  593. } else {
  594. this.stretchElement.reset();
  595. }
  596. }
  597. },
  598. onGeneralSettingsChange: function onGeneralSettingsChange(changed) {
  599. if ('elementor_stretched_section_container' in changed) {
  600. this.stretchElement.setSettings('selectors.container', this.getStretchContainer());
  601. this.stretch();
  602. }
  603. }
  604. });
  605. var Shapes = HandlerModule.extend({
  606. getDefaultSettings: function getDefaultSettings() {
  607. return {
  608. selectors: {
  609. container: '> .elementor-shape-%s'
  610. },
  611. svgURL: elementorFrontend.config.urls.assets + 'shapes/'
  612. };
  613. },
  614. getDefaultElements: function getDefaultElements() {
  615. var elements = {},
  616. selectors = this.getSettings('selectors');
  617. elements.$topContainer = this.$element.find(selectors.container.replace('%s', 'top'));
  618. elements.$bottomContainer = this.$element.find(selectors.container.replace('%s', 'bottom'));
  619. return elements;
  620. },
  621. buildSVG: function buildSVG(side) {
  622. var self = this,
  623. baseSettingKey = 'shape_divider_' + side,
  624. shapeType = self.getElementSettings(baseSettingKey),
  625. $svgContainer = this.elements['$' + side + 'Container'];
  626. $svgContainer.empty().attr('data-shape', shapeType);
  627. if (!shapeType) {
  628. return;
  629. }
  630. var fileName = shapeType;
  631. if (self.getElementSettings(baseSettingKey + '_negative')) {
  632. fileName += '-negative';
  633. }
  634. var svgURL = self.getSettings('svgURL') + fileName + '.svg';
  635. jQuery.get(svgURL, function (data) {
  636. $svgContainer.append(data.childNodes[0]);
  637. });
  638. this.setNegative(side);
  639. },
  640. setNegative: function setNegative(side) {
  641. this.elements['$' + side + 'Container'].attr('data-negative', !!this.getElementSettings('shape_divider_' + side + '_negative'));
  642. },
  643. onInit: function onInit() {
  644. var self = this;
  645. HandlerModule.prototype.onInit.apply(self, arguments);
  646. ['top', 'bottom'].forEach(function (side) {
  647. if (self.getElementSettings('shape_divider_' + side)) {
  648. self.buildSVG(side);
  649. }
  650. });
  651. },
  652. onElementChange: function onElementChange(propertyName) {
  653. var shapeChange = propertyName.match(/^shape_divider_(top|bottom)$/);
  654. if (shapeChange) {
  655. this.buildSVG(shapeChange[1]);
  656. return;
  657. }
  658. var negativeChange = propertyName.match(/^shape_divider_(top|bottom)_negative$/);
  659. if (negativeChange) {
  660. this.buildSVG(negativeChange[1]);
  661. this.setNegative(negativeChange[1]);
  662. }
  663. }
  664. });
  665. var HandlesPosition = HandlerModule.extend({
  666. isFirst: function isFirst() {
  667. return this.$element.is('.elementor-edit-mode .elementor-top-section:first');
  668. },
  669. getOffset: function getOffset() {
  670. return this.$element.offset().top;
  671. },
  672. setHandlesPosition: function setHandlesPosition() {
  673. var self = this;
  674. if (self.isFirst()) {
  675. var offset = self.getOffset(),
  676. $handlesElement = self.$element.find('> .elementor-element-overlay > .elementor-editor-section-settings'),
  677. insideHandleClass = 'elementor-section--handles-inside';
  678. if (offset < 25) {
  679. self.$element.addClass(insideHandleClass);
  680. if (offset < -5) {
  681. $handlesElement.css('top', -offset);
  682. } else {
  683. $handlesElement.css('top', '');
  684. }
  685. } else {
  686. self.$element.removeClass(insideHandleClass);
  687. }
  688. }
  689. },
  690. onInit: function onInit() {
  691. this.setHandlesPosition();
  692. this.$element.on('mouseenter', this.setHandlesPosition);
  693. }
  694. });
  695. module.exports = function ($scope) {
  696. if (elementorFrontend.isEditMode() || $scope.hasClass('elementor-section-stretched')) {
  697. new StretchedSection({ $element: $scope });
  698. }
  699. if (elementorFrontend.isEditMode()) {
  700. new Shapes({ $element: $scope });
  701. new HandlesPosition({ $element: $scope });
  702. }
  703. new BackgroundVideo({ $element: $scope });
  704. };
  705. /***/ }),
  706. /***/ 17:
  707. /***/ (function(module, exports, __webpack_require__) {
  708. "use strict";
  709. var HotKeys = function HotKeys() {
  710. var hotKeysHandlers = {};
  711. var applyHotKey = function applyHotKey(event) {
  712. var handlers = hotKeysHandlers[event.which];
  713. if (!handlers) {
  714. return;
  715. }
  716. jQuery.each(handlers, function () {
  717. var handler = this;
  718. if (handler.isWorthHandling && !handler.isWorthHandling(event)) {
  719. return;
  720. }
  721. // Fix for some keyboard sources that consider alt key as ctrl key
  722. if (!handler.allowAltKey && event.altKey) {
  723. return;
  724. }
  725. event.preventDefault();
  726. handler.handle(event);
  727. });
  728. };
  729. this.isControlEvent = function (event) {
  730. return event[elementor.envData.mac ? 'metaKey' : 'ctrlKey'];
  731. };
  732. this.addHotKeyHandler = function (keyCode, handlerName, handler) {
  733. if (!hotKeysHandlers[keyCode]) {
  734. hotKeysHandlers[keyCode] = {};
  735. }
  736. hotKeysHandlers[keyCode][handlerName] = handler;
  737. };
  738. this.bindListener = function ($listener) {
  739. $listener.on('keydown', applyHotKey);
  740. };
  741. };
  742. module.exports = new HotKeys();
  743. /***/ }),
  744. /***/ 170:
  745. /***/ (function(module, exports, __webpack_require__) {
  746. "use strict";
  747. var TabsModule = __webpack_require__(22);
  748. module.exports = function ($scope) {
  749. new TabsModule({
  750. $element: $scope,
  751. showTabFn: 'slideDown',
  752. hideTabFn: 'slideUp'
  753. });
  754. };
  755. /***/ }),
  756. /***/ 171:
  757. /***/ (function(module, exports, __webpack_require__) {
  758. "use strict";
  759. module.exports = function ($scope, $) {
  760. $scope.find('.elementor-alert-dismiss').on('click', function () {
  761. $(this).parent().fadeOut();
  762. });
  763. };
  764. /***/ }),
  765. /***/ 172:
  766. /***/ (function(module, exports, __webpack_require__) {
  767. "use strict";
  768. module.exports = function ($scope, $) {
  769. elementorFrontend.waypoint($scope.find('.elementor-counter-number'), function () {
  770. var $number = $(this),
  771. data = $number.data();
  772. var decimalDigits = data.toValue.toString().match(/\.(.*)/);
  773. if (decimalDigits) {
  774. data.rounding = decimalDigits[1].length;
  775. }
  776. $number.numerator(data);
  777. });
  778. };
  779. /***/ }),
  780. /***/ 173:
  781. /***/ (function(module, exports, __webpack_require__) {
  782. "use strict";
  783. module.exports = function ($scope, $) {
  784. elementorFrontend.waypoint($scope.find('.elementor-progress-bar'), function () {
  785. var $progressbar = $(this);
  786. $progressbar.css('width', $progressbar.data('max') + '%');
  787. });
  788. };
  789. /***/ }),
  790. /***/ 174:
  791. /***/ (function(module, exports, __webpack_require__) {
  792. "use strict";
  793. var TabsModule = __webpack_require__(22);
  794. module.exports = function ($scope) {
  795. new TabsModule({
  796. $element: $scope,
  797. toggleSelf: false
  798. });
  799. };
  800. /***/ }),
  801. /***/ 175:
  802. /***/ (function(module, exports, __webpack_require__) {
  803. "use strict";
  804. var TabsModule = __webpack_require__(22);
  805. module.exports = function ($scope) {
  806. new TabsModule({
  807. $element: $scope,
  808. showTabFn: 'slideDown',
  809. hideTabFn: 'slideUp',
  810. hidePrevious: false,
  811. autoExpand: 'editor'
  812. });
  813. };
  814. /***/ }),
  815. /***/ 176:
  816. /***/ (function(module, exports, __webpack_require__) {
  817. "use strict";
  818. var HandlerModule = __webpack_require__(5),
  819. VideoModule;
  820. VideoModule = HandlerModule.extend({
  821. getDefaultSettings: function getDefaultSettings() {
  822. return {
  823. selectors: {
  824. imageOverlay: '.elementor-custom-embed-image-overlay',
  825. video: '.elementor-video',
  826. videoIframe: '.elementor-video-iframe'
  827. }
  828. };
  829. },
  830. getDefaultElements: function getDefaultElements() {
  831. var selectors = this.getSettings('selectors');
  832. return {
  833. $imageOverlay: this.$element.find(selectors.imageOverlay),
  834. $video: this.$element.find(selectors.video),
  835. $videoIframe: this.$element.find(selectors.videoIframe)
  836. };
  837. },
  838. getLightBox: function getLightBox() {
  839. return elementorFrontend.utils.lightbox;
  840. },
  841. handleVideo: function handleVideo() {
  842. if (!this.getElementSettings('lightbox')) {
  843. this.elements.$imageOverlay.remove();
  844. this.playVideo();
  845. }
  846. },
  847. playVideo: function playVideo() {
  848. if (this.elements.$video.length) {
  849. this.elements.$video[0].play();
  850. return;
  851. }
  852. var $videoIframe = this.elements.$videoIframe,
  853. lazyLoad = $videoIframe.data('lazy-load');
  854. if (lazyLoad) {
  855. $videoIframe.attr('src', lazyLoad);
  856. }
  857. var newSourceUrl = $videoIframe[0].src.replace('&autoplay=0', '');
  858. $videoIframe[0].src = newSourceUrl + '&autoplay=1';
  859. },
  860. animateVideo: function animateVideo() {
  861. this.getLightBox().setEntranceAnimation(this.getElementSettings('lightbox_content_animation'));
  862. },
  863. handleAspectRatio: function handleAspectRatio() {
  864. this.getLightBox().setVideoAspectRatio(this.getElementSettings('aspect_ratio'));
  865. },
  866. bindEvents: function bindEvents() {
  867. this.elements.$imageOverlay.on('click', this.handleVideo);
  868. },
  869. onElementChange: function onElementChange(propertyName) {
  870. if ('lightbox_content_animation' === propertyName) {
  871. this.animateVideo();
  872. return;
  873. }
  874. var isLightBoxEnabled = this.getElementSettings('lightbox');
  875. if ('lightbox' === propertyName && !isLightBoxEnabled) {
  876. this.getLightBox().getModal().hide();
  877. return;
  878. }
  879. if ('aspect_ratio' === propertyName && isLightBoxEnabled) {
  880. this.handleAspectRatio();
  881. }
  882. }
  883. });
  884. module.exports = function ($scope) {
  885. new VideoModule({ $element: $scope });
  886. };
  887. /***/ }),
  888. /***/ 177:
  889. /***/ (function(module, exports, __webpack_require__) {
  890. "use strict";
  891. var HandlerModule = __webpack_require__(5),
  892. ImageCarouselHandler;
  893. ImageCarouselHandler = HandlerModule.extend({
  894. getDefaultSettings: function getDefaultSettings() {
  895. return {
  896. selectors: {
  897. carousel: '.elementor-image-carousel'
  898. }
  899. };
  900. },
  901. getDefaultElements: function getDefaultElements() {
  902. var selectors = this.getSettings('selectors');
  903. return {
  904. $carousel: this.$element.find(selectors.carousel)
  905. };
  906. },
  907. onInit: function onInit() {
  908. HandlerModule.prototype.onInit.apply(this, arguments);
  909. var elementSettings = this.getElementSettings(),
  910. slidesToShow = +elementSettings.slides_to_show || 3,
  911. isSingleSlide = 1 === slidesToShow,
  912. breakpoints = elementorFrontend.config.breakpoints;
  913. var slickOptions = {
  914. slidesToShow: slidesToShow,
  915. autoplay: 'yes' === elementSettings.autoplay,
  916. autoplaySpeed: elementSettings.autoplay_speed,
  917. infinite: 'yes' === elementSettings.infinite,
  918. pauseOnHover: 'yes' === elementSettings.pause_on_hover,
  919. speed: elementSettings.speed,
  920. arrows: -1 !== ['arrows', 'both'].indexOf(elementSettings.navigation),
  921. dots: -1 !== ['dots', 'both'].indexOf(elementSettings.navigation),
  922. rtl: 'rtl' === elementSettings.direction,
  923. responsive: [{
  924. breakpoint: breakpoints.lg,
  925. settings: {
  926. slidesToShow: +elementSettings.slides_to_show_tablet || (isSingleSlide ? 1 : 2),
  927. slidesToScroll: 1
  928. }
  929. }, {
  930. breakpoint: breakpoints.md,
  931. settings: {
  932. slidesToShow: +elementSettings.slides_to_show_mobile || 1,
  933. slidesToScroll: 1
  934. }
  935. }]
  936. };
  937. if (isSingleSlide) {
  938. slickOptions.fade = 'fade' === elementSettings.effect;
  939. } else {
  940. slickOptions.slidesToScroll = +elementSettings.slides_to_scroll;
  941. }
  942. this.elements.$carousel.slick(slickOptions);
  943. }
  944. });
  945. module.exports = function ($scope) {
  946. new ImageCarouselHandler({ $element: $scope });
  947. };
  948. /***/ }),
  949. /***/ 178:
  950. /***/ (function(module, exports, __webpack_require__) {
  951. "use strict";
  952. var HandlerModule = __webpack_require__(5),
  953. TextEditor;
  954. TextEditor = HandlerModule.extend({
  955. dropCapLetter: '',
  956. getDefaultSettings: function getDefaultSettings() {
  957. return {
  958. selectors: {
  959. paragraph: 'p:first'
  960. },
  961. classes: {
  962. dropCap: 'elementor-drop-cap',
  963. dropCapLetter: 'elementor-drop-cap-letter'
  964. }
  965. };
  966. },
  967. getDefaultElements: function getDefaultElements() {
  968. var selectors = this.getSettings('selectors'),
  969. classes = this.getSettings('classes'),
  970. $dropCap = jQuery('<span>', { class: classes.dropCap }),
  971. $dropCapLetter = jQuery('<span>', { class: classes.dropCapLetter });
  972. $dropCap.append($dropCapLetter);
  973. return {
  974. $paragraph: this.$element.find(selectors.paragraph),
  975. $dropCap: $dropCap,
  976. $dropCapLetter: $dropCapLetter
  977. };
  978. },
  979. getElementName: function getElementName() {
  980. return 'text-editor';
  981. },
  982. wrapDropCap: function wrapDropCap() {
  983. var isDropCapEnabled = this.getElementSettings('drop_cap');
  984. if (!isDropCapEnabled) {
  985. // If there is an old drop cap inside the paragraph
  986. if (this.dropCapLetter) {
  987. this.elements.$dropCap.remove();
  988. this.elements.$paragraph.prepend(this.dropCapLetter);
  989. this.dropCapLetter = '';
  990. }
  991. return;
  992. }
  993. var $paragraph = this.elements.$paragraph;
  994. if (!$paragraph.length) {
  995. return;
  996. }
  997. var paragraphContent = $paragraph.html().replace(/&nbsp;/g, ' '),
  998. firstLetterMatch = paragraphContent.match(/^ *([^ ] ?)/);
  999. if (!firstLetterMatch) {
  1000. return;
  1001. }
  1002. var firstLetter = firstLetterMatch[1],
  1003. trimmedFirstLetter = firstLetter.trim();
  1004. // Don't apply drop cap when the content starting with an HTML tag
  1005. if ('<' === trimmedFirstLetter) {
  1006. return;
  1007. }
  1008. this.dropCapLetter = firstLetter;
  1009. this.elements.$dropCapLetter.text(trimmedFirstLetter);
  1010. var restoredParagraphContent = paragraphContent.slice(firstLetter.length).replace(/^ */, function (match) {
  1011. return new Array(match.length + 1).join('&nbsp;');
  1012. });
  1013. $paragraph.html(restoredParagraphContent).prepend(this.elements.$dropCap);
  1014. },
  1015. onInit: function onInit() {
  1016. HandlerModule.prototype.onInit.apply(this, arguments);
  1017. this.wrapDropCap();
  1018. },
  1019. onElementChange: function onElementChange(propertyName) {
  1020. if ('drop_cap' === propertyName) {
  1021. this.wrapDropCap();
  1022. }
  1023. }
  1024. });
  1025. module.exports = function ($scope) {
  1026. new TextEditor({ $element: $scope });
  1027. };
  1028. /***/ }),
  1029. /***/ 179:
  1030. /***/ (function(module, exports, __webpack_require__) {
  1031. "use strict";
  1032. var HandlerModule = __webpack_require__(5),
  1033. GlobalHandler;
  1034. GlobalHandler = HandlerModule.extend({
  1035. getElementName: function getElementName() {
  1036. return 'global';
  1037. },
  1038. animate: function animate() {
  1039. var $element = this.$element,
  1040. animation = this.getAnimation(),
  1041. elementSettings = this.getElementSettings(),
  1042. animationDelay = elementSettings._animation_delay || elementSettings.animation_delay || 0;
  1043. $element.removeClass(animation);
  1044. setTimeout(function () {
  1045. $element.removeClass('elementor-invisible').addClass(animation);
  1046. }, animationDelay);
  1047. },
  1048. getAnimation: function getAnimation() {
  1049. var elementSettings = this.getElementSettings();
  1050. return elementSettings.animation || elementSettings._animation;
  1051. },
  1052. onInit: function onInit() {
  1053. HandlerModule.prototype.onInit.apply(this, arguments);
  1054. var animation = this.getAnimation();
  1055. if (!animation) {
  1056. return;
  1057. }
  1058. this.$element.removeClass(animation);
  1059. elementorFrontend.waypoint(this.$element, this.animate.bind(this));
  1060. },
  1061. onElementChange: function onElementChange(propertyName) {
  1062. if (/^_?animation/.test(propertyName)) {
  1063. this.animate();
  1064. }
  1065. }
  1066. });
  1067. module.exports = function ($scope) {
  1068. new GlobalHandler({ $element: $scope });
  1069. };
  1070. /***/ }),
  1071. /***/ 180:
  1072. /***/ (function(module, exports, __webpack_require__) {
  1073. "use strict";
  1074. var ViewModule = __webpack_require__(1);
  1075. module.exports = ViewModule.extend({
  1076. getDefaultSettings: function getDefaultSettings() {
  1077. return {
  1078. isInserted: false,
  1079. APISrc: 'https://www.youtube.com/iframe_api',
  1080. selectors: {
  1081. firstScript: 'script:first'
  1082. }
  1083. };
  1084. },
  1085. getDefaultElements: function getDefaultElements() {
  1086. return {
  1087. $firstScript: jQuery(this.getSettings('selectors.firstScript'))
  1088. };
  1089. },
  1090. insertYTAPI: function insertYTAPI() {
  1091. this.setSettings('isInserted', true);
  1092. this.elements.$firstScript.before(jQuery('<script>', { src: this.getSettings('APISrc') }));
  1093. },
  1094. onYoutubeApiReady: function onYoutubeApiReady(callback) {
  1095. var self = this;
  1096. if (!self.getSettings('IsInserted')) {
  1097. self.insertYTAPI();
  1098. }
  1099. if (window.YT && YT.loaded) {
  1100. callback(YT);
  1101. } else {
  1102. // If not ready check again by timeout..
  1103. setTimeout(function () {
  1104. self.onYoutubeApiReady(callback);
  1105. }, 350);
  1106. }
  1107. },
  1108. getYoutubeIDFromURL: function getYoutubeIDFromURL(url) {
  1109. var videoIDParts = url.match(/^(?:https?:\/\/)?(?:www\.)?(?:m\.)?(?:youtu\.be\/|youtube\.com\/(?:(?:watch)?\?(?:.*&)?vi?=|(?:embed|v|vi|user)\/))([^?&"'>]+)/);
  1110. return videoIDParts && videoIDParts[1];
  1111. }
  1112. });
  1113. /***/ }),
  1114. /***/ 181:
  1115. /***/ (function(module, exports, __webpack_require__) {
  1116. "use strict";
  1117. var ViewModule = __webpack_require__(1);
  1118. module.exports = ViewModule.extend({
  1119. getDefaultSettings: function getDefaultSettings() {
  1120. return {
  1121. scrollDuration: 500,
  1122. selectors: {
  1123. links: 'a[href*="#"]',
  1124. targets: '.elementor-element, .elementor-menu-anchor',
  1125. scrollable: 'html, body'
  1126. }
  1127. };
  1128. },
  1129. getDefaultElements: function getDefaultElements() {
  1130. var $ = jQuery,
  1131. selectors = this.getSettings('selectors');
  1132. return {
  1133. $scrollable: $(selectors.scrollable)
  1134. };
  1135. },
  1136. bindEvents: function bindEvents() {
  1137. elementorFrontend.getElements('$document').on('click', this.getSettings('selectors.links'), this.handleAnchorLinks);
  1138. },
  1139. handleAnchorLinks: function handleAnchorLinks(event) {
  1140. var clickedLink = event.currentTarget,
  1141. isSamePathname = location.pathname === clickedLink.pathname,
  1142. isSameHostname = location.hostname === clickedLink.hostname;
  1143. if (!isSameHostname || !isSamePathname || clickedLink.hash.length < 2) {
  1144. return;
  1145. }
  1146. var $anchor = jQuery(clickedLink.hash).filter(this.getSettings('selectors.targets'));
  1147. if (!$anchor.length) {
  1148. return;
  1149. }
  1150. var scrollTop = $anchor.offset().top,
  1151. $wpAdminBar = elementorFrontend.getElements('$wpAdminBar'),
  1152. $activeStickies = jQuery('.elementor-sticky--active'),
  1153. maxStickyHeight = 0;
  1154. if ($wpAdminBar.length > 0) {
  1155. scrollTop -= $wpAdminBar.height();
  1156. }
  1157. // Offset height of tallest sticky
  1158. if ($activeStickies.length > 0) {
  1159. maxStickyHeight = Math.max.apply(null, $activeStickies.map(function () {
  1160. return jQuery(this).outerHeight();
  1161. }).get());
  1162. scrollTop -= maxStickyHeight;
  1163. }
  1164. event.preventDefault();
  1165. scrollTop = elementorFrontend.hooks.applyFilters('frontend/handlers/menu_anchor/scroll_top_distance', scrollTop);
  1166. this.elements.$scrollable.animate({
  1167. scrollTop: scrollTop
  1168. }, this.getSettings('scrollDuration'), 'linear');
  1169. },
  1170. onInit: function onInit() {
  1171. ViewModule.prototype.onInit.apply(this, arguments);
  1172. this.bindEvents();
  1173. }
  1174. });
  1175. /***/ }),
  1176. /***/ 182:
  1177. /***/ (function(module, exports, __webpack_require__) {
  1178. "use strict";
  1179. var ViewModule = __webpack_require__(1),
  1180. LightboxModule;
  1181. LightboxModule = ViewModule.extend({
  1182. oldAspectRatio: null,
  1183. oldAnimation: null,
  1184. swiper: null,
  1185. getDefaultSettings: function getDefaultSettings() {
  1186. return {
  1187. classes: {
  1188. aspectRatio: 'elementor-aspect-ratio-%s',
  1189. item: 'elementor-lightbox-item',
  1190. image: 'elementor-lightbox-image',
  1191. videoContainer: 'elementor-video-container',
  1192. videoWrapper: 'elementor-fit-aspect-ratio',
  1193. playButton: 'elementor-custom-embed-play',
  1194. playButtonIcon: 'fa',
  1195. playing: 'elementor-playing',
  1196. hidden: 'elementor-hidden',
  1197. invisible: 'elementor-invisible',
  1198. preventClose: 'elementor-lightbox-prevent-close',
  1199. slideshow: {
  1200. container: 'swiper-container',
  1201. slidesWrapper: 'swiper-wrapper',
  1202. prevButton: 'elementor-swiper-button elementor-swiper-button-prev',
  1203. nextButton: 'elementor-swiper-button elementor-swiper-button-next',
  1204. prevButtonIcon: 'eicon-chevron-left',
  1205. nextButtonIcon: 'eicon-chevron-right',
  1206. slide: 'swiper-slide'
  1207. }
  1208. },
  1209. selectors: {
  1210. links: 'a, [data-elementor-lightbox]',
  1211. slideshow: {
  1212. activeSlide: '.swiper-slide-active',
  1213. prevSlide: '.swiper-slide-prev',
  1214. nextSlide: '.swiper-slide-next'
  1215. }
  1216. },
  1217. modalOptions: {
  1218. id: 'elementor-lightbox',
  1219. entranceAnimation: 'zoomIn',
  1220. videoAspectRatio: 169,
  1221. position: {
  1222. enable: false
  1223. }
  1224. }
  1225. };
  1226. },
  1227. getModal: function getModal() {
  1228. if (!LightboxModule.modal) {
  1229. this.initModal();
  1230. }
  1231. return LightboxModule.modal;
  1232. },
  1233. initModal: function initModal() {
  1234. var modal = LightboxModule.modal = elementorFrontend.getDialogsManager().createWidget('lightbox', {
  1235. className: 'elementor-lightbox',
  1236. closeButton: true,
  1237. closeButtonClass: 'eicon-close',
  1238. selectors: {
  1239. preventClose: '.' + this.getSettings('classes.preventClose')
  1240. },
  1241. hide: {
  1242. onClick: true
  1243. }
  1244. });
  1245. modal.on('hide', function () {
  1246. modal.setMessage('');
  1247. });
  1248. },
  1249. showModal: function showModal(options) {
  1250. var self = this,
  1251. defaultOptions = self.getDefaultSettings().modalOptions;
  1252. self.setSettings('modalOptions', jQuery.extend(defaultOptions, options.modalOptions));
  1253. var modal = self.getModal();
  1254. modal.setID(self.getSettings('modalOptions.id'));
  1255. modal.onShow = function () {
  1256. DialogsManager.getWidgetType('lightbox').prototype.onShow.apply(modal, arguments);
  1257. setTimeout(function () {
  1258. self.setEntranceAnimation();
  1259. }, 10);
  1260. };
  1261. modal.onHide = function () {
  1262. DialogsManager.getWidgetType('lightbox').prototype.onHide.apply(modal, arguments);
  1263. modal.getElements('widgetContent').removeClass('animated');
  1264. };
  1265. switch (options.type) {
  1266. case 'image':
  1267. self.setImageContent(options.url);
  1268. break;
  1269. case 'video':
  1270. self.setVideoContent(options);
  1271. break;
  1272. case 'slideshow':
  1273. self.setSlideshowContent(options.slideshow);
  1274. break;
  1275. default:
  1276. self.setHTMLContent(options.html);
  1277. }
  1278. modal.show();
  1279. },
  1280. setHTMLContent: function setHTMLContent(html) {
  1281. this.getModal().setMessage(html);
  1282. },
  1283. setImageContent: function setImageContent(imageURL) {
  1284. var self = this,
  1285. classes = self.getSettings('classes'),
  1286. $item = jQuery('<div>', { class: classes.item }),
  1287. $image = jQuery('<img>', { src: imageURL, class: classes.image + ' ' + classes.preventClose });
  1288. $item.append($image);
  1289. self.getModal().setMessage($item);
  1290. },
  1291. setVideoContent: function setVideoContent(options) {
  1292. var classes = this.getSettings('classes'),
  1293. $videoContainer = jQuery('<div>', { class: classes.videoContainer }),
  1294. $videoWrapper = jQuery('<div>', { class: classes.videoWrapper }),
  1295. $videoElement,
  1296. modal = this.getModal();
  1297. if ('hosted' === options.videoType) {
  1298. var videoParams = { src: options.url, autoplay: '' };
  1299. options.videoParams.forEach(function (param) {
  1300. videoParams[param] = '';
  1301. });
  1302. $videoElement = jQuery('<video>', videoParams);
  1303. } else {
  1304. var videoURL = options.url.replace('&autoplay=0', '') + '&autoplay=1';
  1305. $videoElement = jQuery('<iframe>', { src: videoURL, allowfullscreen: 1 });
  1306. }
  1307. $videoContainer.append($videoWrapper);
  1308. $videoWrapper.append($videoElement);
  1309. modal.setMessage($videoContainer);
  1310. this.setVideoAspectRatio();
  1311. var onHideMethod = modal.onHide;
  1312. modal.onHide = function () {
  1313. onHideMethod();
  1314. modal.getElements('message').removeClass('elementor-fit-aspect-ratio');
  1315. };
  1316. },
  1317. setSlideshowContent: function setSlideshowContent(options) {
  1318. var $ = jQuery,
  1319. self = this,
  1320. classes = self.getSettings('classes'),
  1321. slideshowClasses = classes.slideshow,
  1322. $container = $('<div>', { class: slideshowClasses.container }),
  1323. $slidesWrapper = $('<div>', { class: slideshowClasses.slidesWrapper }),
  1324. $prevButton = $('<div>', { class: slideshowClasses.prevButton + ' ' + classes.preventClose }).html($('<i>', { class: slideshowClasses.prevButtonIcon })),
  1325. $nextButton = $('<div>', { class: slideshowClasses.nextButton + ' ' + classes.preventClose }).html($('<i>', { class: slideshowClasses.nextButtonIcon }));
  1326. options.slides.forEach(function (slide) {
  1327. var slideClass = slideshowClasses.slide + ' ' + classes.item;
  1328. if (slide.video) {
  1329. slideClass += ' ' + classes.video;
  1330. }
  1331. var $slide = $('<div>', { class: slideClass });
  1332. if (slide.video) {
  1333. $slide.attr('data-elementor-slideshow-video', slide.video);
  1334. var $playIcon = $('<div>', { class: classes.playButton }).html($('<i>', { class: classes.playButtonIcon }));
  1335. $slide.append($playIcon);
  1336. } else {
  1337. var $zoomContainer = $('<div>', { class: 'swiper-zoom-container' }),
  1338. $slideImage = $('<img>', { class: classes.image + ' ' + classes.preventClose, src: slide.image });
  1339. $zoomContainer.append($slideImage);
  1340. $slide.append($zoomContainer);
  1341. }
  1342. $slidesWrapper.append($slide);
  1343. });
  1344. $container.append($slidesWrapper, $prevButton, $nextButton);
  1345. var modal = self.getModal();
  1346. modal.setMessage($container);
  1347. var onShowMethod = modal.onShow;
  1348. modal.onShow = function () {
  1349. onShowMethod();
  1350. var swiperOptions = {
  1351. navigation: {
  1352. prevEl: $prevButton,
  1353. nextEl: $nextButton
  1354. },
  1355. pagination: {
  1356. clickable: true
  1357. },
  1358. on: {
  1359. slideChangeTransitionEnd: self.onSlideChange
  1360. },
  1361. grabCursor: true,
  1362. runCallbacksOnInit: false,
  1363. loop: true,
  1364. keyboard: true
  1365. };
  1366. if (options.swiper) {
  1367. $.extend(swiperOptions, options.swiper);
  1368. }
  1369. self.swiper = new Swiper($container, swiperOptions);
  1370. self.setVideoAspectRatio();
  1371. self.playSlideVideo();
  1372. };
  1373. },
  1374. setVideoAspectRatio: function setVideoAspectRatio(aspectRatio) {
  1375. aspectRatio = aspectRatio || this.getSettings('modalOptions.videoAspectRatio');
  1376. var $widgetContent = this.getModal().getElements('widgetContent'),
  1377. oldAspectRatio = this.oldAspectRatio,
  1378. aspectRatioClass = this.getSettings('classes.aspectRatio');
  1379. this.oldAspectRatio = aspectRatio;
  1380. if (oldAspectRatio) {
  1381. $widgetContent.removeClass(aspectRatioClass.replace('%s', oldAspectRatio));
  1382. }
  1383. if (aspectRatio) {
  1384. $widgetContent.addClass(aspectRatioClass.replace('%s', aspectRatio));
  1385. }
  1386. },
  1387. getSlide: function getSlide(slideState) {
  1388. return jQuery(this.swiper.slides).filter(this.getSettings('selectors.slideshow.' + slideState + 'Slide'));
  1389. },
  1390. playSlideVideo: function playSlideVideo() {
  1391. var $activeSlide = this.getSlide('active'),
  1392. videoURL = $activeSlide.data('elementor-slideshow-video');
  1393. if (!videoURL) {
  1394. return;
  1395. }
  1396. var classes = this.getSettings('classes'),
  1397. $videoContainer = jQuery('<div>', { class: classes.videoContainer + ' ' + classes.invisible }),
  1398. $videoWrapper = jQuery('<div>', { class: classes.videoWrapper }),
  1399. $videoFrame = jQuery('<iframe>', { src: videoURL }),
  1400. $playIcon = $activeSlide.children('.' + classes.playButton);
  1401. $videoContainer.append($videoWrapper);
  1402. $videoWrapper.append($videoFrame);
  1403. $activeSlide.append($videoContainer);
  1404. $playIcon.addClass(classes.playing).removeClass(classes.hidden);
  1405. $videoFrame.on('load', function () {
  1406. $playIcon.addClass(classes.hidden);
  1407. $videoContainer.removeClass(classes.invisible);
  1408. });
  1409. },
  1410. setEntranceAnimation: function setEntranceAnimation(animation) {
  1411. animation = animation || this.getSettings('modalOptions.entranceAnimation');
  1412. var $widgetMessage = this.getModal().getElements('message');
  1413. if (this.oldAnimation) {
  1414. $widgetMessage.removeClass(this.oldAnimation);
  1415. }
  1416. this.oldAnimation = animation;
  1417. if (animation) {
  1418. $widgetMessage.addClass('animated ' + animation);
  1419. }
  1420. },
  1421. isLightboxLink: function isLightboxLink(element) {
  1422. if ('A' === element.tagName && !/\.(png|jpe?g|gif|svg)$/i.test(element.href)) {
  1423. return false;
  1424. }
  1425. var generalOpenInLightbox = elementorFrontend.getGeneralSettings('elementor_global_image_lightbox'),
  1426. currentLinkOpenInLightbox = element.dataset.elementorOpenLightbox;
  1427. return 'yes' === currentLinkOpenInLightbox || generalOpenInLightbox && 'no' !== currentLinkOpenInLightbox;
  1428. },
  1429. openLink: function openLink(event) {
  1430. var element = event.currentTarget,
  1431. $target = jQuery(event.target),
  1432. editMode = elementorFrontend.isEditMode(),
  1433. isClickInsideElementor = !!$target.closest('#elementor').length;
  1434. if (!this.isLightboxLink(element)) {
  1435. if (editMode && isClickInsideElementor) {
  1436. event.preventDefault();
  1437. }
  1438. return;
  1439. }
  1440. event.preventDefault();
  1441. if (editMode && !elementorFrontend.getGeneralSettings('elementor_enable_lightbox_in_editor')) {
  1442. return;
  1443. }
  1444. var lightboxData = {};
  1445. if (element.dataset.elementorLightbox) {
  1446. lightboxData = JSON.parse(element.dataset.elementorLightbox);
  1447. }
  1448. if (lightboxData.type && 'slideshow' !== lightboxData.type) {
  1449. this.showModal(lightboxData);
  1450. return;
  1451. }
  1452. if (!element.dataset.elementorLightboxSlideshow) {
  1453. this.showModal({
  1454. type: 'image',
  1455. url: element.href
  1456. });
  1457. return;
  1458. }
  1459. var slideshowID = element.dataset.elementorLightboxSlideshow;
  1460. var $allSlideshowLinks = jQuery(this.getSettings('selectors.links')).filter(function () {
  1461. return slideshowID === this.dataset.elementorLightboxSlideshow;
  1462. });
  1463. var slides = [],
  1464. uniqueLinks = {};
  1465. $allSlideshowLinks.each(function () {
  1466. var slideVideo = this.dataset.elementorLightboxVideo,
  1467. uniqueID = slideVideo || this.href;
  1468. if (uniqueLinks[uniqueID]) {
  1469. return;
  1470. }
  1471. uniqueLinks[uniqueID] = true;
  1472. var slideIndex = this.dataset.elementorLightboxIndex;
  1473. if (undefined === slideIndex) {
  1474. slideIndex = $allSlideshowLinks.index(this);
  1475. }
  1476. var slideData = {
  1477. image: this.href,
  1478. index: slideIndex
  1479. };
  1480. if (slideVideo) {
  1481. slideData.video = slideVideo;
  1482. }
  1483. slides.push(slideData);
  1484. });
  1485. slides.sort(function (a, b) {
  1486. return a.index - b.index;
  1487. });
  1488. var initialSlide = element.dataset.elementorLightboxIndex;
  1489. if (undefined === initialSlide) {
  1490. initialSlide = $allSlideshowLinks.index(element);
  1491. }
  1492. this.showModal({
  1493. type: 'slideshow',
  1494. modalOptions: {
  1495. id: 'elementor-lightbox-slideshow-' + slideshowID
  1496. },
  1497. slideshow: {
  1498. slides: slides,
  1499. swiper: {
  1500. initialSlide: +initialSlide
  1501. }
  1502. }
  1503. });
  1504. },
  1505. bindEvents: function bindEvents() {
  1506. elementorFrontend.getElements('$document').on('click', this.getSettings('selectors.links'), this.openLink);
  1507. },
  1508. onInit: function onInit() {
  1509. ViewModule.prototype.onInit.apply(this, arguments);
  1510. if (elementorFrontend.isEditMode()) {
  1511. elementor.settings.general.model.on('change', this.onGeneralSettingsChange);
  1512. }
  1513. },
  1514. onGeneralSettingsChange: function onGeneralSettingsChange(model) {
  1515. if ('elementor_lightbox_content_animation' in model.changed) {
  1516. this.setSettings('modalOptions.entranceAnimation', model.changed.elementor_lightbox_content_animation);
  1517. this.setEntranceAnimation();
  1518. }
  1519. },
  1520. onSlideChange: function onSlideChange() {
  1521. this.getSlide('prev').add(this.getSlide('next')).add(this.getSlide('active')).find('.' + this.getSettings('classes.videoWrapper')).remove();
  1522. this.playSlideVideo();
  1523. }
  1524. });
  1525. module.exports = LightboxModule;
  1526. /***/ }),
  1527. /***/ 183:
  1528. /***/ (function(module, exports, __webpack_require__) {
  1529. "use strict";
  1530. var ViewModule = __webpack_require__(1);
  1531. module.exports = ViewModule.extend({
  1532. getDefaultSettings: function getDefaultSettings() {
  1533. return {
  1534. element: null,
  1535. direction: elementorFrontend.config.is_rtl ? 'right' : 'left',
  1536. selectors: {
  1537. container: window
  1538. }
  1539. };
  1540. },
  1541. getDefaultElements: function getDefaultElements() {
  1542. return {
  1543. $element: jQuery(this.getSettings('element'))
  1544. };
  1545. },
  1546. stretch: function stretch() {
  1547. var containerSelector = this.getSettings('selectors.container'),
  1548. $container;
  1549. try {
  1550. $container = jQuery(containerSelector);
  1551. } catch (e) {}
  1552. if (!$container || !$container.length) {
  1553. $container = jQuery(this.getDefaultSettings().selectors.container);
  1554. }
  1555. this.reset();
  1556. var $element = this.elements.$element,
  1557. containerWidth = $container.outerWidth(),
  1558. elementOffset = $element.offset().left,
  1559. isFixed = 'fixed' === $element.css('position'),
  1560. correctOffset = isFixed ? 0 : elementOffset;
  1561. if (window !== $container[0]) {
  1562. var containerOffset = $container.offset().left;
  1563. if (isFixed) {
  1564. correctOffset = containerOffset;
  1565. }
  1566. if (elementOffset > containerOffset) {
  1567. correctOffset = elementOffset - containerOffset;
  1568. }
  1569. }
  1570. if (!isFixed) {
  1571. if (elementorFrontend.config.is_rtl) {
  1572. correctOffset = containerWidth - ($element.outerWidth() + correctOffset);
  1573. }
  1574. correctOffset = -correctOffset;
  1575. }
  1576. var css = {};
  1577. css.width = containerWidth + 'px';
  1578. css[this.getSettings('direction')] = correctOffset + 'px';
  1579. $element.css(css);
  1580. },
  1581. reset: function reset() {
  1582. var css = {};
  1583. css.width = '';
  1584. css[this.getSettings('direction')] = '';
  1585. this.elements.$element.css(css);
  1586. }
  1587. });
  1588. /***/ }),
  1589. /***/ 2:
  1590. /***/ (function(module, exports, __webpack_require__) {
  1591. "use strict";
  1592. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  1593. var Module = function Module() {
  1594. var $ = jQuery,
  1595. instanceParams = arguments,
  1596. self = this,
  1597. settings,
  1598. events = {};
  1599. var ensureClosureMethods = function ensureClosureMethods() {
  1600. $.each(self, function (methodName) {
  1601. var oldMethod = self[methodName];
  1602. if ('function' !== typeof oldMethod) {
  1603. return;
  1604. }
  1605. self[methodName] = function () {
  1606. return oldMethod.apply(self, arguments);
  1607. };
  1608. });
  1609. };
  1610. var initSettings = function initSettings() {
  1611. settings = self.getDefaultSettings();
  1612. var instanceSettings = instanceParams[0];
  1613. if (instanceSettings) {
  1614. $.extend(settings, instanceSettings);
  1615. }
  1616. };
  1617. var init = function init() {
  1618. self.__construct.apply(self, instanceParams);
  1619. ensureClosureMethods();
  1620. initSettings();
  1621. self.trigger('init');
  1622. };
  1623. this.getItems = function (items, itemKey) {
  1624. if (itemKey) {
  1625. var keyStack = itemKey.split('.'),
  1626. currentKey = keyStack.splice(0, 1);
  1627. if (!keyStack.length) {
  1628. return items[currentKey];
  1629. }
  1630. if (!items[currentKey]) {
  1631. return;
  1632. }
  1633. return this.getItems(items[currentKey], keyStack.join('.'));
  1634. }
  1635. return items;
  1636. };
  1637. this.getSettings = function (setting) {
  1638. return this.getItems(settings, setting);
  1639. };
  1640. this.setSettings = function (settingKey, value, settingsContainer) {
  1641. if (!settingsContainer) {
  1642. settingsContainer = settings;
  1643. }
  1644. if ('object' === (typeof settingKey === 'undefined' ? 'undefined' : _typeof(settingKey))) {
  1645. $.extend(settingsContainer, settingKey);
  1646. return self;
  1647. }
  1648. var keyStack = settingKey.split('.'),
  1649. currentKey = keyStack.splice(0, 1);
  1650. if (!keyStack.length) {
  1651. settingsContainer[currentKey] = value;
  1652. return self;
  1653. }
  1654. if (!settingsContainer[currentKey]) {
  1655. settingsContainer[currentKey] = {};
  1656. }
  1657. return self.setSettings(keyStack.join('.'), value, settingsContainer[currentKey]);
  1658. };
  1659. this.forceMethodImplementation = function (methodArguments) {
  1660. var functionName = methodArguments.callee.name;
  1661. throw new ReferenceError('The method ' + functionName + ' must to be implemented in the inheritor child.');
  1662. };
  1663. this.on = function (eventName, callback) {
  1664. if ('object' === (typeof eventName === 'undefined' ? 'undefined' : _typeof(eventName))) {
  1665. $.each(eventName, function (singleEventName) {
  1666. self.on(singleEventName, this);
  1667. });
  1668. return self;
  1669. }
  1670. var eventNames = eventName.split(' ');
  1671. eventNames.forEach(function (singleEventName) {
  1672. if (!events[singleEventName]) {
  1673. events[singleEventName] = [];
  1674. }
  1675. events[singleEventName].push(callback);
  1676. });
  1677. return self;
  1678. };
  1679. this.off = function (eventName, callback) {
  1680. if (!events[eventName]) {
  1681. return self;
  1682. }
  1683. if (!callback) {
  1684. delete events[eventName];
  1685. return self;
  1686. }
  1687. var callbackIndex = events[eventName].indexOf(callback);
  1688. if (-1 !== callbackIndex) {
  1689. delete events[eventName][callbackIndex];
  1690. }
  1691. return self;
  1692. };
  1693. this.trigger = function (eventName) {
  1694. var methodName = 'on' + eventName[0].toUpperCase() + eventName.slice(1),
  1695. params = Array.prototype.slice.call(arguments, 1);
  1696. if (self[methodName]) {
  1697. self[methodName].apply(self, params);
  1698. }
  1699. var callbacks = events[eventName];
  1700. if (!callbacks) {
  1701. return self;
  1702. }
  1703. $.each(callbacks, function (index, callback) {
  1704. callback.apply(self, params);
  1705. });
  1706. return self;
  1707. };
  1708. init();
  1709. };
  1710. Module.prototype.__construct = function () {};
  1711. Module.prototype.getDefaultSettings = function () {
  1712. return {};
  1713. };
  1714. Module.extendsCount = 0;
  1715. Module.extend = function (properties) {
  1716. var $ = jQuery,
  1717. parent = this;
  1718. var child = function child() {
  1719. return parent.apply(this, arguments);
  1720. };
  1721. $.extend(child, parent);
  1722. child.prototype = Object.create($.extend({}, parent.prototype, properties));
  1723. child.prototype.constructor = child;
  1724. /*
  1725. * Constructor ID is used to set an unique ID
  1726. * to every extend of the Module.
  1727. *
  1728. * It's useful in some cases such as unique
  1729. * listener for frontend handlers.
  1730. */
  1731. var constructorID = ++Module.extendsCount;
  1732. child.prototype.getConstructorID = function () {
  1733. return constructorID;
  1734. };
  1735. child.__super__ = parent.prototype;
  1736. return child;
  1737. };
  1738. module.exports = Module;
  1739. /***/ }),
  1740. /***/ 20:
  1741. /***/ (function(module, exports, __webpack_require__) {
  1742. "use strict";
  1743. /**
  1744. * Handles managing all events for whatever you plug it into. Priorities for hooks are based on lowest to highest in
  1745. * that, lowest priority hooks are fired first.
  1746. */
  1747. var EventManager = function EventManager() {
  1748. var slice = Array.prototype.slice,
  1749. MethodsAvailable;
  1750. /**
  1751. * Contains the hooks that get registered with this EventManager. The array for storage utilizes a "flat"
  1752. * object literal such that looking up the hook utilizes the native object literal hash.
  1753. */
  1754. var STORAGE = {
  1755. actions: {},
  1756. filters: {}
  1757. };
  1758. /**
  1759. * Removes the specified hook by resetting the value of it.
  1760. *
  1761. * @param type Type of hook, either 'actions' or 'filters'
  1762. * @param hook The hook (namespace.identifier) to remove
  1763. *
  1764. * @private
  1765. */
  1766. function _removeHook(type, hook, callback, context) {
  1767. var handlers, handler, i;
  1768. if (!STORAGE[type][hook]) {
  1769. return;
  1770. }
  1771. if (!callback) {
  1772. STORAGE[type][hook] = [];
  1773. } else {
  1774. handlers = STORAGE[type][hook];
  1775. if (!context) {
  1776. for (i = handlers.length; i--;) {
  1777. if (handlers[i].callback === callback) {
  1778. handlers.splice(i, 1);
  1779. }
  1780. }
  1781. } else {
  1782. for (i = handlers.length; i--;) {
  1783. handler = handlers[i];
  1784. if (handler.callback === callback && handler.context === context) {
  1785. handlers.splice(i, 1);
  1786. }
  1787. }
  1788. }
  1789. }
  1790. }
  1791. /**
  1792. * Use an insert sort for keeping our hooks organized based on priority. This function is ridiculously faster
  1793. * than bubble sort, etc: http://jsperf.com/javascript-sort
  1794. *
  1795. * @param hooks The custom array containing all of the appropriate hooks to perform an insert sort on.
  1796. * @private
  1797. */
  1798. function _hookInsertSort(hooks) {
  1799. var tmpHook, j, prevHook;
  1800. for (var i = 1, len = hooks.length; i < len; i++) {
  1801. tmpHook = hooks[i];
  1802. j = i;
  1803. while ((prevHook = hooks[j - 1]) && prevHook.priority > tmpHook.priority) {
  1804. hooks[j] = hooks[j - 1];
  1805. --j;
  1806. }
  1807. hooks[j] = tmpHook;
  1808. }
  1809. return hooks;
  1810. }
  1811. /**
  1812. * Adds the hook to the appropriate storage container
  1813. *
  1814. * @param type 'actions' or 'filters'
  1815. * @param hook The hook (namespace.identifier) to add to our event manager
  1816. * @param callback The function that will be called when the hook is executed.
  1817. * @param priority The priority of this hook. Must be an integer.
  1818. * @param [context] A value to be used for this
  1819. * @private
  1820. */
  1821. function _addHook(type, hook, callback, priority, context) {
  1822. var hookObject = {
  1823. callback: callback,
  1824. priority: priority,
  1825. context: context
  1826. };
  1827. // Utilize 'prop itself' : http://jsperf.com/hasownproperty-vs-in-vs-undefined/19
  1828. var hooks = STORAGE[type][hook];
  1829. if (hooks) {
  1830. // TEMP FIX BUG
  1831. var hasSameCallback = false;
  1832. jQuery.each(hooks, function () {
  1833. if (this.callback === callback) {
  1834. hasSameCallback = true;
  1835. return false;
  1836. }
  1837. });
  1838. if (hasSameCallback) {
  1839. return;
  1840. }
  1841. // END TEMP FIX BUG
  1842. hooks.push(hookObject);
  1843. hooks = _hookInsertSort(hooks);
  1844. } else {
  1845. hooks = [hookObject];
  1846. }
  1847. STORAGE[type][hook] = hooks;
  1848. }
  1849. /**
  1850. * Runs the specified hook. If it is an action, the value is not modified but if it is a filter, it is.
  1851. *
  1852. * @param type 'actions' or 'filters'
  1853. * @param hook The hook ( namespace.identifier ) to be ran.
  1854. * @param args Arguments to pass to the action/filter. If it's a filter, args is actually a single parameter.
  1855. * @private
  1856. */
  1857. function _runHook(type, hook, args) {
  1858. var handlers = STORAGE[type][hook],
  1859. i,
  1860. len;
  1861. if (!handlers) {
  1862. return 'filters' === type ? args[0] : false;
  1863. }
  1864. len = handlers.length;
  1865. if ('filters' === type) {
  1866. for (i = 0; i < len; i++) {
  1867. args[0] = handlers[i].callback.apply(handlers[i].context, args);
  1868. }
  1869. } else {
  1870. for (i = 0; i < len; i++) {
  1871. handlers[i].callback.apply(handlers[i].context, args);
  1872. }
  1873. }
  1874. return 'filters' === type ? args[0] : true;
  1875. }
  1876. /**
  1877. * Adds an action to the event manager.
  1878. *
  1879. * @param action Must contain namespace.identifier
  1880. * @param callback Must be a valid callback function before this action is added
  1881. * @param [priority=10] Used to control when the function is executed in relation to other callbacks bound to the same hook
  1882. * @param [context] Supply a value to be used for this
  1883. */
  1884. function addAction(action, callback, priority, context) {
  1885. if ('string' === typeof action && 'function' === typeof callback) {
  1886. priority = parseInt(priority || 10, 10);
  1887. _addHook('actions', action, callback, priority, context);
  1888. }
  1889. return MethodsAvailable;
  1890. }
  1891. /**
  1892. * Performs an action if it exists. You can pass as many arguments as you want to this function; the only rule is
  1893. * that the first argument must always be the action.
  1894. */
  1895. function doAction() /* action, arg1, arg2, ... */{
  1896. var args = slice.call(arguments);
  1897. var action = args.shift();
  1898. if ('string' === typeof action) {
  1899. _runHook('actions', action, args);
  1900. }
  1901. return MethodsAvailable;
  1902. }
  1903. /**
  1904. * Removes the specified action if it contains a namespace.identifier & exists.
  1905. *
  1906. * @param action The action to remove
  1907. * @param [callback] Callback function to remove
  1908. */
  1909. function removeAction(action, callback) {
  1910. if ('string' === typeof action) {
  1911. _removeHook('actions', action, callback);
  1912. }
  1913. return MethodsAvailable;
  1914. }
  1915. /**
  1916. * Adds a filter to the event manager.
  1917. *
  1918. * @param filter Must contain namespace.identifier
  1919. * @param callback Must be a valid callback function before this action is added
  1920. * @param [priority=10] Used to control when the function is executed in relation to other callbacks bound to the same hook
  1921. * @param [context] Supply a value to be used for this
  1922. */
  1923. function addFilter(filter, callback, priority, context) {
  1924. if ('string' === typeof filter && 'function' === typeof callback) {
  1925. priority = parseInt(priority || 10, 10);
  1926. _addHook('filters', filter, callback, priority, context);
  1927. }
  1928. return MethodsAvailable;
  1929. }
  1930. /**
  1931. * Performs a filter if it exists. You should only ever pass 1 argument to be filtered. The only rule is that
  1932. * the first argument must always be the filter.
  1933. */
  1934. function applyFilters() /* filter, filtered arg, arg2, ... */{
  1935. var args = slice.call(arguments);
  1936. var filter = args.shift();
  1937. if ('string' === typeof filter) {
  1938. return _runHook('filters', filter, args);
  1939. }
  1940. return MethodsAvailable;
  1941. }
  1942. /**
  1943. * Removes the specified filter if it contains a namespace.identifier & exists.
  1944. *
  1945. * @param filter The action to remove
  1946. * @param [callback] Callback function to remove
  1947. */
  1948. function removeFilter(filter, callback) {
  1949. if ('string' === typeof filter) {
  1950. _removeHook('filters', filter, callback);
  1951. }
  1952. return MethodsAvailable;
  1953. }
  1954. /**
  1955. * Maintain a reference to the object scope so our public methods never get confusing.
  1956. */
  1957. MethodsAvailable = {
  1958. removeFilter: removeFilter,
  1959. applyFilters: applyFilters,
  1960. addFilter: addFilter,
  1961. removeAction: removeAction,
  1962. doAction: doAction,
  1963. addAction: addAction
  1964. };
  1965. // return all of the publicly available methods
  1966. return MethodsAvailable;
  1967. };
  1968. module.exports = EventManager;
  1969. /***/ }),
  1970. /***/ 22:
  1971. /***/ (function(module, exports, __webpack_require__) {
  1972. "use strict";
  1973. var HandlerModule = __webpack_require__(5);
  1974. module.exports = HandlerModule.extend({
  1975. $activeContent: null,
  1976. getDefaultSettings: function getDefaultSettings() {
  1977. return {
  1978. selectors: {
  1979. tabTitle: '.elementor-tab-title',
  1980. tabContent: '.elementor-tab-content'
  1981. },
  1982. classes: {
  1983. active: 'elementor-active'
  1984. },
  1985. showTabFn: 'show',
  1986. hideTabFn: 'hide',
  1987. toggleSelf: true,
  1988. hidePrevious: true,
  1989. autoExpand: true
  1990. };
  1991. },
  1992. getDefaultElements: function getDefaultElements() {
  1993. var selectors = this.getSettings('selectors');
  1994. return {
  1995. $tabTitles: this.findElement(selectors.tabTitle),
  1996. $tabContents: this.findElement(selectors.tabContent)
  1997. };
  1998. },
  1999. activateDefaultTab: function activateDefaultTab() {
  2000. var settings = this.getSettings();
  2001. if (!settings.autoExpand || 'editor' === settings.autoExpand && !this.isEdit) {
  2002. return;
  2003. }
  2004. var defaultActiveTab = this.getEditSettings('activeItemIndex') || 1,
  2005. originalToggleMethods = {
  2006. showTabFn: settings.showTabFn,
  2007. hideTabFn: settings.hideTabFn
  2008. };
  2009. // Toggle tabs without animation to avoid jumping
  2010. this.setSettings({
  2011. showTabFn: 'show',
  2012. hideTabFn: 'hide'
  2013. });
  2014. this.changeActiveTab(defaultActiveTab);
  2015. // Return back original toggle effects
  2016. this.setSettings(originalToggleMethods);
  2017. },
  2018. deactivateActiveTab: function deactivateActiveTab(tabIndex) {
  2019. var settings = this.getSettings(),
  2020. activeClass = settings.classes.active,
  2021. activeFilter = tabIndex ? '[data-tab="' + tabIndex + '"]' : '.' + activeClass,
  2022. $activeTitle = this.elements.$tabTitles.filter(activeFilter),
  2023. $activeContent = this.elements.$tabContents.filter(activeFilter);
  2024. $activeTitle.add($activeContent).removeClass(activeClass);
  2025. $activeContent[settings.hideTabFn]();
  2026. },
  2027. activateTab: function activateTab(tabIndex) {
  2028. var settings = this.getSettings(),
  2029. activeClass = settings.classes.active,
  2030. $requestedTitle = this.elements.$tabTitles.filter('[data-tab="' + tabIndex + '"]'),
  2031. $requestedContent = this.elements.$tabContents.filter('[data-tab="' + tabIndex + '"]');
  2032. $requestedTitle.add($requestedContent).addClass(activeClass);
  2033. $requestedContent[settings.showTabFn]();
  2034. },
  2035. isActiveTab: function isActiveTab(tabIndex) {
  2036. return this.elements.$tabTitles.filter('[data-tab="' + tabIndex + '"]').hasClass(this.getSettings('classes.active'));
  2037. },
  2038. bindEvents: function bindEvents() {
  2039. var self = this;
  2040. self.elements.$tabTitles.on('focus', function (event) {
  2041. self.changeActiveTab(event.currentTarget.dataset.tab);
  2042. });
  2043. if (self.getSettings('toggleSelf')) {
  2044. self.elements.$tabTitles.on('mousedown', function (event) {
  2045. if (jQuery(event.currentTarget).is(':focus')) {
  2046. self.changeActiveTab(event.currentTarget.dataset.tab);
  2047. }
  2048. });
  2049. }
  2050. },
  2051. onInit: function onInit() {
  2052. HandlerModule.prototype.onInit.apply(this, arguments);
  2053. this.activateDefaultTab();
  2054. },
  2055. onEditSettingsChange: function onEditSettingsChange(propertyName) {
  2056. if ('activeItemIndex' === propertyName) {
  2057. this.activateDefaultTab();
  2058. }
  2059. },
  2060. changeActiveTab: function changeActiveTab(tabIndex) {
  2061. var isActiveTab = this.isActiveTab(tabIndex),
  2062. settings = this.getSettings();
  2063. if ((settings.toggleSelf || !isActiveTab) && settings.hidePrevious) {
  2064. this.deactivateActiveTab();
  2065. }
  2066. if (!settings.hidePrevious && isActiveTab) {
  2067. this.deactivateActiveTab(tabIndex);
  2068. }
  2069. if (!isActiveTab) {
  2070. this.activateTab(tabIndex);
  2071. }
  2072. }
  2073. });
  2074. /***/ }),
  2075. /***/ 5:
  2076. /***/ (function(module, exports, __webpack_require__) {
  2077. "use strict";
  2078. var ViewModule = __webpack_require__(1),
  2079. HandlerModule;
  2080. HandlerModule = ViewModule.extend({
  2081. $element: null,
  2082. editorListeners: null,
  2083. onElementChange: null,
  2084. onEditSettingsChange: null,
  2085. onGeneralSettingsChange: null,
  2086. onPageSettingsChange: null,
  2087. isEdit: null,
  2088. __construct: function __construct(settings) {
  2089. this.$element = settings.$element;
  2090. this.isEdit = this.$element.hasClass('elementor-element-edit-mode');
  2091. if (this.isEdit) {
  2092. this.addEditorListeners();
  2093. }
  2094. },
  2095. findElement: function findElement(selector) {
  2096. var $mainElement = this.$element;
  2097. return $mainElement.find(selector).filter(function () {
  2098. return jQuery(this).closest('.elementor-element').is($mainElement);
  2099. });
  2100. },
  2101. getUniqueHandlerID: function getUniqueHandlerID(cid, $element) {
  2102. if (!cid) {
  2103. cid = this.getModelCID();
  2104. }
  2105. if (!$element) {
  2106. $element = this.$element;
  2107. }
  2108. return cid + $element.attr('data-element_type') + this.getConstructorID();
  2109. },
  2110. initEditorListeners: function initEditorListeners() {
  2111. var self = this;
  2112. self.editorListeners = [{
  2113. event: 'element:destroy',
  2114. to: elementor.channels.data,
  2115. callback: function callback(removedModel) {
  2116. if (removedModel.cid !== self.getModelCID()) {
  2117. return;
  2118. }
  2119. self.onDestroy();
  2120. }
  2121. }];
  2122. if (self.onElementChange) {
  2123. var elementName = self.getElementName(),
  2124. eventName = 'change';
  2125. if ('global' !== elementName) {
  2126. eventName += ':' + elementName;
  2127. }
  2128. self.editorListeners.push({
  2129. event: eventName,
  2130. to: elementor.channels.editor,
  2131. callback: function callback(controlView, elementView) {
  2132. var elementViewHandlerID = self.getUniqueHandlerID(elementView.model.cid, elementView.$el);
  2133. if (elementViewHandlerID !== self.getUniqueHandlerID()) {
  2134. return;
  2135. }
  2136. self.onElementChange(controlView.model.get('name'), controlView, elementView);
  2137. }
  2138. });
  2139. }
  2140. if (self.onEditSettingsChange) {
  2141. self.editorListeners.push({
  2142. event: 'change:editSettings',
  2143. to: elementor.channels.editor,
  2144. callback: function callback(changedModel, view) {
  2145. if (view.model.cid !== self.getModelCID()) {
  2146. return;
  2147. }
  2148. self.onEditSettingsChange(Object.keys(changedModel.changed)[0]);
  2149. }
  2150. });
  2151. }
  2152. ['page', 'general'].forEach(function (settingsType) {
  2153. var listenerMethodName = 'on' + elementor.helpers.firstLetterUppercase(settingsType) + 'SettingsChange';
  2154. if (self[listenerMethodName]) {
  2155. self.editorListeners.push({
  2156. event: 'change',
  2157. to: elementor.settings[settingsType].model,
  2158. callback: function callback(model) {
  2159. self[listenerMethodName](model.changed);
  2160. }
  2161. });
  2162. }
  2163. });
  2164. },
  2165. getEditorListeners: function getEditorListeners() {
  2166. if (!this.editorListeners) {
  2167. this.initEditorListeners();
  2168. }
  2169. return this.editorListeners;
  2170. },
  2171. addEditorListeners: function addEditorListeners() {
  2172. var uniqueHandlerID = this.getUniqueHandlerID();
  2173. this.getEditorListeners().forEach(function (listener) {
  2174. elementorFrontend.addListenerOnce(uniqueHandlerID, listener.event, listener.callback, listener.to);
  2175. });
  2176. },
  2177. removeEditorListeners: function removeEditorListeners() {
  2178. var uniqueHandlerID = this.getUniqueHandlerID();
  2179. this.getEditorListeners().forEach(function (listener) {
  2180. elementorFrontend.removeListeners(uniqueHandlerID, listener.event, null, listener.to);
  2181. });
  2182. },
  2183. getElementName: function getElementName() {
  2184. return this.$element.data('element_type').split('.')[0];
  2185. },
  2186. getID: function getID() {
  2187. return this.$element.data('id');
  2188. },
  2189. getModelCID: function getModelCID() {
  2190. return this.$element.data('model-cid');
  2191. },
  2192. getElementSettings: function getElementSettings(setting) {
  2193. var elementSettings = {},
  2194. modelCID = this.getModelCID();
  2195. if (this.isEdit && modelCID) {
  2196. var settings = elementorFrontend.config.elements.data[modelCID],
  2197. settingsKeys = elementorFrontend.config.elements.keys[settings.attributes.widgetType || settings.attributes.elType];
  2198. jQuery.each(settings.getActiveControls(), function (controlKey) {
  2199. if (-1 !== settingsKeys.indexOf(controlKey)) {
  2200. elementSettings[controlKey] = settings.attributes[controlKey];
  2201. }
  2202. });
  2203. } else {
  2204. elementSettings = this.$element.data('settings') || {};
  2205. }
  2206. return this.getItems(elementSettings, setting);
  2207. },
  2208. getEditSettings: function getEditSettings(setting) {
  2209. var attributes = {};
  2210. if (this.isEdit) {
  2211. attributes = elementorFrontend.config.elements.editSettings[this.getModelCID()].attributes;
  2212. }
  2213. return this.getItems(attributes, setting);
  2214. },
  2215. onDestroy: function onDestroy() {
  2216. this.removeEditorListeners();
  2217. if (this.unbindEvents) {
  2218. this.unbindEvents();
  2219. }
  2220. }
  2221. });
  2222. module.exports = HandlerModule;
  2223. /***/ })
  2224. /******/ });
  2225. //# sourceMappingURL=frontend.js.map