1/******/ (() => { // webpackBootstrap 2/******/ var __webpack_modules__ = ({ 3
vendor: 4,291 bytes, lines 4-38
4/***/ "./assets/src/theme/js/kube/slideshow/customizable-slideshow.js": 5/*!**********************************************************************!*\ 6 !*** ./assets/src/theme/js/kube/slideshow/customizable-slideshow.js ***! 7 \**********************************************************************/ 8/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 9 10"use strict"; 11/* harmony export */ __webpack_require__.d(__webpack_exports__, { 12/* harmony export */ "default": () => (/* binding */ CustomizableSlideshow) 13/* harmony export */ }); 14/* harmony import */ var _kubio_scripts_src_background_slideshow_slideshow__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @kubio/scripts/src/background/slideshow/slideshow */ "./kubio-plugin/src/packages/scripts/src/background/slideshow/slideshow.js"); 15function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 16 17function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 18 19function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 20 21function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 22 23function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } 24 25function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 26 27function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 28 29function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 30 31function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 32 33function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } 34 35function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 36 37function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } 38
39function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 40 41 42 43var CustomizableSlideshow = /*#__PURE__*/function (_Slideshow) { 44 _inherits(CustomizableSlideshow, _Slideshow); 45 46 var _super = _createSuper(CustomizableSlideshow); 47 48 function CustomizableSlideshow() { 49 _classCallCheck(this, CustomizableSlideshow); 50 51 return _super.apply(this, arguments); 52 } 53 54 _createClass(CustomizableSlideshow, [{ 55 key: "start", 56 value: function start() { 57 if (!this.customizerBinded && typeof wp !== 'undefined') { 58 this.opts = jQuery.extend(true, {}, this.opts, Colibri.getData(this.opts.kubioId) || {}); 59 this.wpCustomize(wp.customize); 60 this.customizerBinded = true; 61 } 62 63 _get(_getPrototypeOf(CustomizableSlideshow.prototype), "start", this).call(this); 64 } 65 }, { 66 key: "wpCustomize", 67 value: function wpCustomize(api) { 68 var _this = this; 69 70 var _loop = function _loop(opt) { 71 if (_this.opts.wpSettings.hasOwnProperty(opt)) { 72 var setting = _this.opts.wpSettings[opt]; 73 74 _this.wpSettingBind(setting, function (newValue) { 75 _this.opts[opt] = parseInt(newValue).toString(); 76 77 _this.stop(); 78 79 setTimeout(function () { 80 _this.start(); 81 }, 100); 82 }); 83 } 84 }; 85 86 for (var opt in this.opts.wpSettings) { 87 _loop(opt); 88 } 89 } 90 }, { 91 key: "wpSettingBind", 92 value: function wpSettingBind(setting_id, callback) { 93 window.wp.customize(setting_id, function (setting) { 94 setting.bind(callback); 95 }); 96 } 97 }]); 98 99 return CustomizableSlideshow; 100}(_kubio_scripts_src_background_slideshow_slideshow__WEBPACK_IMPORTED_MODULE_0__["default"]); 101 102 103 104/***/ }), 105
vendor: 4,338 bytes, lines 106-140
106/***/ "./assets/src/theme/js/kube/video-background/customizable-video-background.js": 107/*!************************************************************************************!*\ 108 !*** ./assets/src/theme/js/kube/video-background/customizable-video-background.js ***! 109 \************************************************************************************/ 110/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 111 112"use strict"; 113/* harmony export */ __webpack_require__.d(__webpack_exports__, { 114/* harmony export */ "default": () => (/* binding */ CustomizableVideoBackground) 115/* harmony export */ }); 116/* harmony import */ var _kubio_scripts_src_background_video_video_bg__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @kubio/scripts/src/background/video/video-bg */ "./kubio-plugin/src/packages/scripts/src/background/video/video-bg.js"); 117function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 118 119function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 120 121function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 122 123function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 124 125function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } 126 127function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 128 129function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 130 131function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 132 133function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 134 135function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } 136 137function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 138 139function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } 140
141function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 142 143 144 145var CustomizableVideoBackground = /*#__PURE__*/function (_VideoBackground) { 146 _inherits(CustomizableVideoBackground, _VideoBackground); 147 148 var _super = _createSuper(CustomizableVideoBackground); 149 150 function CustomizableVideoBackground(element, options) { 151 var _this; 152 153 _classCallCheck(this, CustomizableVideoBackground); 154 155 _this = _super.call(this, element, options); 156 _this.opts.wpSettings = Colibri.getData(_this.opts.kubioId) || {}; 157 return _possibleConstructorReturn(_this, _assertThisInitialized(_this)); 158 } 159 160 _createClass(CustomizableVideoBackground, [{ 161 key: "wpCustomize", 162 value: function wpCustomize(api) { 163 var _this2 = this; 164 165 this.API_URL = colibri_ADDITIONAL_JS_DATA.api_url; 166 167 var _loop = function _loop(opt) { 168 if (_this2.opts.wpSettings.hasOwnProperty(opt)) { 169 var setting = _this2.opts.wpSettings[opt]; 170 171 _this2.wpSettingBind(setting, function (newValue) { 172 if (opt === "externalUrl") { 173 _this2.restartYouTubeVideo(newValue); 174 } 175 176 if (opt === "internalUrl") { 177 _this2.restartSelfHostedVideo(newValue); 178 } 179 180 if (opt === "videoType") { 181 var videoType = "native"; 182 if (newValue === "external") videoType = "youtube"; 183 184 _this2.changeProvider(videoType); 185 } 186 187 if (opt === "posterUrl") { 188 _this2.$element.css({ 189 backgroundImage: "url(".concat(newValue, ")") 190 }); 191 192 _this2.videoData.poster = newValue; 193 } 194 }); 195 } 196 }; 197 198 for (var opt in this.opts.wpSettings) { 199 _loop(opt); 200 } 201 } 202 }, { 203 key: "changeProvider", 204 value: function changeProvider(newValue) { 205 if (newValue === "youtube") { 206 this.restartYouTubeVideo(wp.customize(this.opts.wpSettings['externalUrl']).get()); 207 } else { 208 this.restartSelfHostedVideo(wp.customize(this.opts.wpSettings['internalUrl']).get()); 209 } 210 } 211 }, { 212 key: "restartYouTubeVideo", 213 value: function restartYouTubeVideo(value) { 214 this.videoData.videoUrl = value; 215 this.videoData.mimeType = "video/x-youtube"; 216 217 _get(_getPrototypeOf(CustomizableVideoBackground.prototype), "generateVideo", this).call(this); 218 } 219 }, { 220 key: "restartSelfHostedVideo", 221 value: function restartSelfHostedVideo(value) { 222 var _this3 = this; 223 224 if (!value) { 225 this.videoData.videoUrl = ""; 226 this.videoData.mimeType = "video/mp4"; 227 228 _get(_getPrototypeOf(CustomizableVideoBackground.prototype), "generateVideo", this).call(this); 229 } else { 230 this.$.getJSON("".concat(this.API_URL, "/attachment-data/").concat(value), function (data) { 231 _this3.videoData.videoUrl = data.url; 232 _this3.videoData.mimeType = data.mime_type; 233 234 _get(_getPrototypeOf(CustomizableVideoBackground.prototype), "generateVideo", _this3).call(_this3); 235 }); 236 } 237 } 238 }]); 239 240 return CustomizableVideoBackground; 241}(_kubio_scripts_src_background_video_video_bg__WEBPACK_IMPORTED_MODULE_0__["default"]); 242 243 244 245/***/ }), 246
247/***/ "./assets/src/theme/js/menu/accordion-menu.js": 248/*!****************************************************!*\ 249 !*** ./assets/src/theme/js/menu/accordion-menu.js ***! 250 \****************************************************/ 251/***/ (() => { 252 253(function ($, Colibri) { 254 var className = "accordion-menu"; 255 256 var Component = function Component(element, options) { 257 this.namespace = className; 258 this.defaults = { 259 menuSelector: ".kubio-menu", 260 offCanvasWrapper: ".kubio-menu-container", 261 linkSelector: ".menu-item-has-children > a, .page_item_has_children > a", 262 linkLeafsSelector: "li:not(.menu-item-has-children):not(.page_item_has_children) > a", 263 arrowSelector: "svg", 264 $menu: null 265 }; // Parent Constructor 266 267 Colibri.apply(this, arguments); // Initialization 268 269 this.initBindedFunctions(); 270 this.initEventListenersData(); 271 this.start(); 272 }; 273 274 Component.prototype = { 275 start: function start() { 276 var $menu = this.$element.find(this.opts.menuSelector).first(); 277 this.opts.$menu = $menu; 278 var firstPageLoadItem = $menu.find("> ul > li.current-menu-item").get(0); 279 this.opts.$menu.find("a").data("allow-propagation", true); 280 this.opts.$menu.find(this.opts.arrowSelector).attr("tabIndex", 0); 281 this.removeEventListeners(); 282 this.addEventListeners(); 283 this.addMenuScrollSpy($menu, firstPageLoadItem); 284 var openedParent = this.opts.$menu.find(".current-menu-parent").first(); 285 286 if (openedParent.length) { 287 this.openDropDown(openedParent); 288 } 289 290 this.addFocusListener(); 291 }, 292 initBindedFunctions: function initBindedFunctions() { 293 this.debounceApplyDropdownLogic = $.debounce(this.applyDropdownLogic.bind(this), 10); 294 this.bindedLinkEventHandler = this.linkEventHandler.bind(this); 295 this.bindedLinkArrowEventHandler = this.linkArrowEventHandler.bind(this); 296 }, 297 initEventListenersData: function initEventListenersData() { 298 var menuNamespace = ".accordion-menu"; 299 var events = ["click", "tap"]; 300 var eventBase = events.map(function (event) { 301 return "".concat(event).concat(menuNamespace); 302 }); 303 var linkSelectorEvent = eventBase.map(function (item) { 304 return item + ".link-selector"; 305 }).join(" "); 306 var arrowSelectorEvent = eventBase.concat(["keyup".concat(menuNamespace)]).map(function (item) { 307 return item + " svg"; 308 }).join(" "); 309 var offCanvasEvent = eventBase.map(function (item) { 310 return item + ".off-canvas"; 311 }).join(" "); 312 this._eventOptions = { 313 menuNamespace: menuNamespace, 314 linkSelectorEvent: linkSelectorEvent, 315 arrowSelectorEvent: arrowSelectorEvent, 316 offCanvasEvent: offCanvasEvent 317 }; 318 }, 319 toggleFocus: function toggleFocus(item) { 320 var enable = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; 321 322 while (this.opts.$menu[0] !== item) { 323 if ("li" === item.tagName.toLowerCase()) { 324 if (!enable) { 325 $(item).closest("li.menu-item-has-children").children("a").removeClass("hover"); 326 item.classList.remove("hover"); 327 $(item).children("a").removeClass("hover"); 328 } else { 329 $(item).closest("li.menu-item-has-children").children("a").addClass("hover"); 330 item.classList.add("hover"); 331 $(item).children("a").addClass("hover"); 332 } 333 } 334 335 item = item.parentElement; 336 } 337 }, 338 addFocusListener: function addFocusListener() { 339 var _this = this; 340 341 var links = this.opts.$menu.find("a"); 342 links.on("focus", function (event) { 343 _this.toggleFocus(event.currentTarget); 344 }); 345 links.on("blur", function (event) { 346 _this.toggleFocus(event.currentTarget, false); 347 }); 348 }, 349 addEventListeners: function addEventListeners() { 350 var $menu = this.opts.$menu; 351 var eventOptions = this._eventOptions; 352 $menu.on(eventOptions.arrowSelectorEvent, this.opts.arrowSelector, this.bindedLinkArrowEventHandler); 353 354 if (window.wp && window.wp.customize) { 355 $menu.off(eventOptions.linkSelectorEvent, this.opts.linkSelector); 356 } 357 358 $menu.on(eventOptions.linkSelectorEvent, this.opts.linkSelector, this.bindedLinkEventHandler); 359 $menu.on(eventOptions.offCanvasEvent, this.opts.linkLeafsSelector, this.closeOffcanvasPanel); 360 $(document).on("keyup." + this.namespace, $.proxy(this.handleKeyboard, this)); 361 }, 362 removeEventListeners: function removeEventListeners() { 363 var $menu = this.opts.$menu; 364 var eventOptions = this._eventOptions; 365 $menu.off(eventOptions.menuNamespace); 366 $(document).on("keyup." + this.namespace); 367 }, 368 stop: function stop() { 369 this.removeEventListeners(); 370 this.removeAllSvgArrows(); 371 }, 372 handleKeyboard: function handleKeyboard(e) { 373 var item = e.target; 374 375 if (item.tagName.toLowerCase() === "svg") { 376 item = item.parentNode; 377 } 378 379 if ($.contains(this.opts.$menu[0], item)) { 380 if ($(item).siblings("ul").length) { 381 if (e.which === 37) { 382 this.closeDropDown($(item).closest("li")); 383 } 384 385 if (e.which === 39) { 386 this.openDropDown($(item).closest("li")); 387 } 388 } 389 } 390 }, 391 openDropDown: function openDropDown(item) { 392 if (!item) { 393 return; 394 } 395 396 if ($(item).is("a")) { 397 item = $(item).closest("li"); 398 } else { 399 item = $(item); 400 } 401 402 item.addClass("open"); 403 item.children("ul").slideDown(100); 404 }, 405 closeDropDown: function closeDropDown(item) { 406 if (!item) { 407 return; 408 } 409 410 if ($(item).is("a")) { 411 item = $(item).closest("li"); 412 } else { 413 item = $(item); 414 } 415 416 item.removeClass("open"); 417 item.children("ul").slideUp(100); 418 }, 419 isDropDownOpen: function isDropDownOpen($parent) { 420 return $parent.is(".open"); 421 }, 422 closeOffcanvasPanel: function closeOffcanvasPanel() { 423 if (window.wp && window.wp.customize) {} 424 /* 425 //some mobile menus do not work without this timeout, because the panel gets hidden before the link logic happens 426 //and some browser stop the link for security reasons because it got fired from hidden elements. 427 setTimeout(() => { 428 $('.offscreen-overlay').trigger('click'); 429 }, 500); 430 */ 431 432 }, 433 linkEventHandler: function linkEventHandler(event, isForArrow) { 434 var inCustomizer = window.wp && window.wp.customize; 435 436 if (inCustomizer) { 437 event.preventDefault(); 438 } 439 440 var $this = $(event.target); 441 var $li = $this.closest("li"); 442 var hasChildren = $li.find("ul").length !== 0; 443 444 if (!hasChildren) { 445 this.closeOffcanvasPanel(); 446 return; 447 } 448 449 if (!isForArrow && $li.hasClass("open") && !inCustomizer) { 450 this.closeOffcanvasPanel(); 451 return; 452 } //when the arrows are clicked the link should not redirect you, or when the item li is not opened. also stop 453 //propagation to the link event handler 454 455 456 if (isForArrow || !isForArrow && !$li.hasClass("open")) { 457 event.preventDefault(); // do not trigger bubbling events e.g for offcanvas 458 459 event.stopPropagation(); 460 } // event.stopPropagation(); 461 462 /** 463 * For mobile devices the event handler function is called two times one for the click event and the other time for 464 * tap event. Because of this we had to split the logic in things that needs to be called for every call and things 465 * that needs to be called once when the tap/click events are called at the same time. We use the debounce function 466 * to apply the dropdown logic only once 467 */ 468 469 470 this.debounceApplyDropdownLogic(event, isForArrow); 471 }, 472 linkArrowEventHandler: function linkArrowEventHandler(event) { 473 if (event.type === "keyup") { 474 // is pressed enter 475 if (event.which === 13) { 476 this.linkEventHandler(event, true); 477 } 478 } else { 479 this.linkEventHandler(event, true); 480 } 481 }, 482 applyDropdownLogic: function applyDropdownLogic(event, isForArrow) { 483 var $this = $(event.target); 484 var $li = $this.closest("li"); 485 var hasChildren = $li.find("ul").length !== 0; 486 487 if (!hasChildren) { 488 this.closeOffcanvasPanel(); 489 return; 490 } 491 492 if (isForArrow && this.isDropDownOpen($li)) { 493 this.closeDropDown($li); 494 } else { 495 this.openDropDown($li); 496 } 497 }, 498 removeAllSvgArrows: function removeAllSvgArrows() { 499 if (this.opts.$menu) { 500 this.opts.$menu.find(this.opts.arrowSelector).remove(); 501 } 502 }, 503 addMenuScrollSpy: function addMenuScrollSpy(startFrom, firstPageLoadItem) { 504 var $menu = startFrom; 505 var _offset = 20; 506 var component = this; 507 508 if ($.fn.kubioScrollSpy) { 509 var linkSelector = component.opts.linkSelector; 510 var arrowSelector = component.opts.arrowSelector; 511 $menu.find("a").not(linkSelector).not(arrowSelector).kubioScrollSpy({ 512 onChange: function onChange() { 513 $menu.find(".current-menu-item,.current_page_item").removeClass("current-menu-item current_page_item"); 514 $(this).closest("li").addClass("current-menu-item current_page_item"); 515 }, 516 onLeave: function onLeave() { 517 $(this).closest("li").removeClass("current-menu-item current_page_item"); 518 519 if (!$menu.find(".current-menu-item, .current_page_item").length && firstPageLoadItem) { 520 $(firstPageLoadItem).addClass("current-menu-item current_page_item"); 521 } 522 }, 523 clickCallback: function clickCallback() { 524 component.closeOffcanvasPanel(); 525 }, 526 smoothScrollAnchor: true, 527 offset: function offset() { 528 var $fixed = $menu.closest('[data-kubio-component="navigation"]'); 529 530 if ($fixed.length) { 531 return $fixed[0].getBoundingClientRect().height + _offset; 532 } 533 534 return _offset; 535 } 536 }); 537 } 538 539 $(window).trigger("smoothscroll.update"); 540 } 541 }; 542 Component.inherits(Colibri); 543 Colibri[className] = Component; 544 Colibri.Plugin.create(className); 545 Colibri.Plugin.autoload(className); // eslint-disable-next-line no-undef 546})(jQuery, Colibri); 547 548/***/ }), 549
550/***/ "./assets/src/theme/js/menu/dropdown-menu.js": 551/*!***************************************************!*\ 552 !*** ./assets/src/theme/js/menu/dropdown-menu.js ***! 553 \***************************************************/ 554/***/ (() => { 555 556(function ($, Colibri) { 557 var className = "dropdown-menu"; 558 559 var Component = function Component() { 560 this.namespace = className; 561 this.defaults = { 562 menuSelector: ".kubio-menu", 563 $menu: null 564 }; // Parent Constructor 565 566 Colibri.apply(this, arguments); // Initialization 567 568 this.start(); 569 }; 570 571 Component.prototype = { 572 start: function start() { 573 var $menu = this.$element.find(this.opts.menuSelector).first(); 574 this.opts.$menu = $menu; 575 var firstPageLoadItem = $menu.find("> ul > li.current-menu-item").get(0); 576 this.stop(); 577 this.addListener(); 578 this.addFocusListener(); 579 this.addReverseMenuLogic(); 580 /** TODO @catalin table menu logic needs work because it does not work*/ 581 582 this.addTabletMenuLogic(); 583 this.addMenuScrollSpy($menu, firstPageLoadItem); 584 }, 585 toggleFocus: function toggleFocus(item) { 586 var enable = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; 587 588 while (this.opts.$menu[0] !== item) { 589 if ("li" === item.tagName.toLowerCase()) { 590 if (!enable) { 591 $(item).closest("li.menu-item-has-children").children("a").removeClass("hover"); 592 item.classList.remove("hover"); 593 $(item).children("a").removeClass("hover"); 594 } else { 595 $(item).closest("li.menu-item-has-children").children("a").addClass("hover"); 596 item.classList.add("hover"); 597 $(item).children("a").addClass("hover"); 598 } 599 } 600 601 item = item.parentElement; 602 } 603 }, 604 addFocusListener: function addFocusListener() { 605 var _this = this; 606 607 var lis = this.opts.$menu.find("li"); 608 lis.on("mouseover", function (event) { 609 _this.toggleFocus(event.currentTarget); 610 }); 611 lis.on("mouseout", function (event) { 612 _this.toggleFocus(event.currentTarget, false); 613 }); 614 var links = this.opts.$menu.find("li > a"); /// keyboard focus / blur 615 616 links.on("focus", function (event) { 617 _this.toggleFocus(event.currentTarget); 618 }); 619 links.on("blur", function (event) { 620 _this.toggleFocus(event.currentTarget, false); 621 }); 622 }, 623 stop: function stop() { 624 this.removeListeners(); 625 }, 626 copyLiEventTaA: function copyLiEventTaA(e) { 627 var tagName = ""; 628 629 if (e.target && e.target.tagName) { 630 tagName = e.target.tagName; 631 } 632 633 if (tagName.toLowerCase() === "a") { 634 return; 635 } 636 637 var a = $(e.currentTarget).find("> a"); 638 a[0].click(); 639 }, 640 addListener: function addListener() { 641 this.opts.$menu.find("li").on("click", this.copyLiEventTaA); 642 }, 643 removeListeners: function removeListeners() { 644 var $menu = this.opts.$menu; 645 $menu.off("mouseover.navigation"); 646 $menu.find("li").off("click", this.copyLiEventTaA); 647 this.removeTabletLogic(); 648 }, 649 removeTabletLogic: function removeTabletLogic() { 650 var $menu = this.opts.$menu; 651 $menu.off("tap.navigation"); 652 }, 653 addReverseMenuLogic: function addReverseMenuLogic() { 654 var $menu = this.opts.$menu; 655 var self = this; 656 $menu.on("mouseover.navigation", "li", function () { 657 $menu.find("li.hover").removeClass("hover"); 658 self.setOpenReverseClass($menu, $(this)); 659 }); 660 }, 661 setOpenReverseClass: function setOpenReverseClass($menu, $item) { 662 // level 0 - not in dropdown 663 if (this.getItemLevel($menu, $item) > 0) { 664 var $submenu = $item.children("ul"); 665 var subItemDoesNotFit = $submenu.length && $item.offset().left + $item.width() + 300 > window.innerWidth; 666 var parentsAreReversed = $submenu.length && $item.closest(".open-reverse").length; 667 668 if (subItemDoesNotFit || parentsAreReversed) { 669 $submenu.addClass("open-reverse"); 670 } else if ($submenu.length) { 671 $submenu.removeClass("open-reverse"); 672 } 673 } 674 }, 675 getItemLevel: function getItemLevel($menu, $item) { 676 var menuSelector = this.opts.menuSelector; 677 var temp2 = $item.parentsUntil(menuSelector); 678 var temp = temp2.filter("li"); 679 return temp.length; 680 },
681 addTabletMenuLogic: function addTabletMenuLogic() { 682 var self = this; 683 var $menu = this.opts.$menu; 684 685 if (!this.opts.clickOnLink) { 686 this.opts.clickOnLink = this.clickOnLink.bind(this); 687 } 688 689 if (!this.opts.clickOnArrow) { 690 this.opts.clickOnArrow = this.clickOnArrow.bind(this); 691 } 692 693 $menu.off("tap.navigation", this.opts.clickOnArrow); 694 $menu.on("tap.navigation", "li.menu-item > a svg", this.opts.clickOnArrow); 695 $menu.off("tap.navigation", this.opts.clickOnLink); 696 $menu.on("tap.navigation", "li.menu-item > a", this.opts.clickOnLink); 697 }, 698 clickOnLink: function clickOnLink(event) { 699 var arrowWasClicked = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 700 var self = this; 701 var $this = $(event.target); 702 var $item = $this.closest("li"); 703 var $link = $this.closest("a"); 704 var $menu = this.opts.$menu; 705 var $submenu = $item.children("ul"); 706 707 if ($submenu.length) { 708 if (self.isSelectedItem($item)) { 709 var href = $link.attr("href"); // do nothing if nothing 710 711 if (href.indexOf("#") === 0) { 712 var anchor = href.replace("#", "").trim(); 713 714 if (!anchor || !$("#" + anchor).length) { 715 return; 716 } 717 } 718 719 event.stopPropagation(); 720 721 if (arrowWasClicked) { 722 event.preventDefault(); 723 } 724 725 self.deselectItems($menu, $item); 726 } else { 727 event.stopPropagation(); 728 event.preventDefault(); 729 self.selectItem($menu, $item); 730 } 731 } else { 732 event.stopPropagation(); 733 734 if (arrowWasClicked || !arrowWasClicked && self.isSelectedItem($item)) { 735 event.preventDefault(); 736 } 737 738 self.deselectItems($menu, $item); 739 } 740 }, 741 clickOnArrow: function clickOnArrow(event) { 742 this.clickOnLink(event, true); 743 }, 744 selectItem: function selectItem($menu, $item) { 745 this.deselectItems($menu, $item); 746 $item.attr("data-selected-item", true); 747 this.clearMenuHovers($menu, $item); 748 $item.addClass("hover"); 749 this.setOpenReverseClass($menu, $item); 750 var self = this; 751 $("body").on("tap.navigation-clear-selection", "*", function () { 752 var $this = jQuery(this); 753 self.clearSelectionWhenTapOutside($this, $menu); 754 }); 755 $(window).on("scroll.navigation-clear-selection", function () { 756 var $this = jQuery(this); 757 self.clearSelectionWhenTapOutside($this, $menu); 758 }); 759 }, 760 deselectItems: function deselectItems($menu, $item) { 761 $item.removeClass("hover"); 762 $menu.find("[data-selected-item]").each(function () { 763 var $itemTmp = $(this); 764 $itemTmp.removeAttr("data-selected-item"); 765 var $submenu = $menu.children("ul"); //TODO @catalin, check if this mobile menu code is needed 766 767 if ($menu.is(".mobile-menu")) { 768 $submenu.slideDown(); 769 } 770 }); 771 }, 772 isSelectedItem: function isSelectedItem($item) { 773 return $item.is("[data-selected-item]"); 774 }, 775 clearMenuHovers: function clearMenuHovers($menu, except) { 776 var self = this; 777 $menu.find("li.hover").each(function () { 778 if (except && self.containsSelectedItem($(this))) { 779 return; 780 } 781 782 $(this).removeClass("hover"); 783 }); 784 }, 785 containsSelectedItem: function containsSelectedItem($item) { 786 return $item.find("[data-selected-item]").length > 0 || $item.is("[data-selected-item]"); 787 }, 788 clearSelectionWhenTapOutside: function clearSelectionWhenTapOutside($this, $menu) { 789 $("body").off("tap.navigation-clear-selection"); 790 $(window).off("scroll.navigation-clear-selection"); 791 792 if ($this.is($menu) || $.contains($menu[0], this)) { 793 return; 794 } 795 796 this.clearMenuHovers($menu); 797 }, 798 addMenuScrollSpy: function addMenuScrollSpy(startFrom, firstPageLoadItem) { 799 var $menu = startFrom; 800 801 if ($.fn.kubioScrollSpy) { 802 $menu.find("a").kubioScrollSpy({ 803 onChange: function onChange() { 804 $menu.find(".current-menu-item, .current_page_item").removeClass("current-menu-item current_page_item"); 805 $(this).closest("li").addClass("current-menu-item current_page_item"); 806 }, 807 onLeave: function onLeave() { 808 var $fixed = $menu.closest(".h-navigation_sticky"); 809 $(this).closest("li").removeClass("current-menu-item current_page_item hover"); 810 811 if (!$menu.find(".current-menu-item, .current_page_item").length && firstPageLoadItem) { 812 if (!$fixed) { 813 $menu.find(".current-menu-item, .current_page_item").removeClass("current-menu-item current_page_item"); 814 } 815 816 $(firstPageLoadItem).addClass("current-menu-item current_page_item"); 817 } 818 }, 819 smoothScrollAnchor: true, 820 offset: function offset() { 821 //offset is needed only for sticky menu 822 var $fixed = $menu.closest(".h-navigation_sticky"); 823 824 if ($fixed.length) { 825 return $fixed[0].getBoundingClientRect().height; 826 } 827 828 return 0; 829 } 830 }); 831 } 832 833 $(window).trigger("smoothscroll.update"); 834 } 835 }; 836 Component.inherits(Colibri); 837 Colibri[className] = Component; 838 Colibri.Plugin.create(className); 839 Colibri.Plugin.autoload(className); // eslint-disable-next-line no-undef 840})(jQuery, Colibri); 841 842/***/ }), 843
844/***/ "./assets/src/theme/js/menu/index.js": 845/*!*******************************************!*\ 846 !*** ./assets/src/theme/js/menu/index.js ***! 847 \*******************************************/ 848/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => { 849 850"use strict"; 851/* harmony import */ var _dropdown_menu__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dropdown-menu */ "./assets/src/theme/js/menu/dropdown-menu.js"); 852/* harmony import */ var _dropdown_menu__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dropdown_menu__WEBPACK_IMPORTED_MODULE_0__); 853/* harmony import */ var _accordion_menu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./accordion-menu */ "./assets/src/theme/js/menu/accordion-menu.js"); 854/* harmony import */ var _accordion_menu__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_accordion_menu__WEBPACK_IMPORTED_MODULE_1__); 855/* harmony import */ var _offcanvas__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./offcanvas */ "./assets/src/theme/js/menu/offcanvas.js"); 856/* harmony import */ var _offcanvas__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_offcanvas__WEBPACK_IMPORTED_MODULE_2__); 857 858 859 860 861/***/ }), 862
863/***/ "./assets/src/theme/js/menu/offcanvas.js": 864/*!***********************************************!*\ 865 !*** ./assets/src/theme/js/menu/offcanvas.js ***! 866 \***********************************************/ 867/***/ (() => { 868 869(function ($, Colibri) { 870 var className = "offcanvas"; 871 872 var Component = function Component(element, options) { 873 this.namespace = "offcanvas"; 874 this.defaults = { 875 target: null, 876 // selector 877 push: true, 878 // boolean 879 width: "250px", 880 // string 881 direction: "left", 882 // string: left or right 883 toggleEvent: "click", 884 clickOutside: true, 885 // boolean 886 animationOpen: "slideInLeft", 887 animationClose: "slideOutLeft", 888 callbacks: ["open", "opened", "close", "closed"], 889 offcanvasOverlayId: null, 890 $overlayElement: null, 891 targetId: null 892 }; // Parent Constructor 893 894 Colibri.apply(this, arguments); // Services 895 896 this.utils = new Colibri.Utils(); 897 this.detect = new Colibri.Detect(); // Initialization 898 899 this.start(); 900 }; // Functionality 901 902 903 Component.prototype = { 904 start: function start() { 905 if (!this.hasTarget()) { 906 return; 907 } 908 909 var overlayId = this.opts.offcanvasOverlayId; 910 this.opts.$overlayElement = $("#" + overlayId); // this.stop(); 911 912 this.buildTargetWidth(); 913 this.buildAnimationDirection(); 914 this.$close = this.getCloseLink(); 915 this.$element.on(this.opts.toggleEvent + "." + this.namespace, $.proxy(this.toggle, this)); 916 this.$target.addClass("offcanvas"); 917 this.$target.trigger("kubio.offcanvas.ready"); 918 this.moveOffcanvas(); 919 this.addOffcanvasOverlayLogic(); 920 }, 921 stop: function stop() { 922 this.closeAll(); 923 this.removeOffcanvasElements(); 924 this.$element.off("." + this.namespace); 925 926 if (this.$close) { 927 this.$close.off("." + this.namespace); 928 } 929 930 $(document).off("." + this.namespace); 931 }, 932 removeOffcanvasElements: function removeOffcanvasElements() { 933 // var targetId = this.opts.targetId; 934 // var $targetElement = $('#' + targetId + '.h-offcanvas-panel'); 935 this.$target.remove(); 936 this.opts.$overlayElement.remove(); // if ($targetElement && $targetElement.length > 0) { 937 // for (var i = 0; i < $targetElement.length; i++) { 938 // var offcanvasPanel = $targetElement[i]; 939 // var offcanvasPanelParent = offcanvasPanel.parentNode; 940 // if (offcanvasPanelParent && offcanvasPanelParent.tagName === 'BODY') { 941 // offcanvasPanelParent.removeChild(offcanvasPanel); 942 // } 943 // } 944 // } 945 // 946 // var overlayElements = this.opts.$overlayElement; 947 // if (overlayElements && overlayElements.length > 0) { 948 // for (var j = 0; j < overlayElements.length; j++) { 949 // var overlayElement = overlayElements[j]; 950 // var overlayElementParent = overlayElement.parentNode; 951 // if (overlayElementParent && overlayElementParent.tagName === 'BODY') { 952 // overlayElementParent.removeChild(overlayElement); 953 // } 954 // } 955 // } 956 }, 957 moveOffcanvas: function moveOffcanvas() { 958 var offcanvasPanel = this.$target[0]; 959 document.querySelector("html > body").appendChild(offcanvasPanel); 960 var overlayElement = this.opts.$overlayElement[0]; 961 document.querySelector("html > body").appendChild(overlayElement); 962 }, 963 addOffcanvasOverlayLogic: function addOffcanvasOverlayLogic() { 964 var $overlayElement = this.opts.$overlayElement; 965 var $offCanvasWrapper = this.$target; 966 967 if ($offCanvasWrapper.length) { 968 $overlayElement.on("scroll touchmove mousewheel", function (e) { 969 e.preventDefault(); 970 e.stopPropagation(); 971 return false; 972 }); 973 $offCanvasWrapper.on("kubio.offcanvas.open", function () { 974 $overlayElement.addClass("h-offcanvas-opened"); 975 }); 976 $offCanvasWrapper.on("kubio.offcanvas.close", function () { 977 $overlayElement.removeClass("h-offcanvas-opened"); 978 }); 979 } 980 }, 981 toggle: function toggle(e) { 982 if (this.isOpened()) { 983 this.close(e); 984 } else { 985 this.open(e); 986 } 987 }, 988 buildTargetWidth: function buildTargetWidth() { 989 this.opts.width = $(window).width() < parseInt(this.opts.width) ? "100%" : this.opts.width; 990 }, 991 buildAnimationDirection: function buildAnimationDirection() { 992 if (this.opts.direction === "right") { 993 this.opts.animationOpen = "slideInRight"; 994 this.opts.animationClose = "slideOutRight"; 995 } 996 }, 997 getCloseLink: function getCloseLink() { 998 return this.$target.find(".close"); 999 }, 1000 open: function open(e) { 1001 if (e) { 1002 e.preventDefault(); 1003 } 1004 1005 if (!this.isOpened()) { 1006 this.closeAll(); 1007 this.callback("open"); 1008 this.$target.addClass("offcanvas-" + this.opts.direction); 1009 this.$target.css("width", Math.min(parseInt(this.opts.width), window.innerWidth - 100)); 1010 this.$target.css("right", "-" + Math.min(parseInt(this.opts.width), window.innerWidth - 100)); //this.pushBody(); 1011 1012 this.$target.trigger("kubio.offcanvas.open"); // this.$target.animation(this.opts.animationOpen, $.proxy(this.onOpened, this)); 1013 1014 Colibri.animate(this.$target, this.opts.animationOpen, $.proxy(this.onOpened, this)); 1015 this.$element.trigger("kubio.offcanvas.open"); 1016 } 1017 }, 1018 closeAll: function closeAll() { 1019 var $elms = $(document).find(".offcanvas"); 1020 1021 if ($elms.length !== 0) { 1022 $elms.each(function () { 1023 var $el = $(this); 1024 1025 if ($el.hasClass("open")) { 1026 $el.css("width", ""); 1027 Colibri.animate($el, "hide"); 1028 $el.removeClass("open offcanvas-left offcanvas-right"); 1029 } 1030 }); 1031 $(document).off("." + this.namespace); 1032 $("body").css("left", ""); 1033 } 1034 }, 1035 close: function close(e) { 1036 if (e) { 1037 var $el = $(e.target); 1038 var isTag = $el[0].tagName === "A" || $el[0].tagName === "INPUT" || $el[0].tagName === "BUTTON" || $el.parents("button, a").length; 1039 1040 if (isTag && $el.closest(".offcanvas").length !== 0 && !$el.hasClass("close") && window.location.href !== e.target.href) { 1041 return; 1042 } 1043 1044 e.preventDefault(); 1045 } 1046 1047 if (this.isOpened()) { 1048 // this.utils.enableBodyScroll(); 1049 this.callback("close"); //this.pullBody(); 1050 1051 this.$target.trigger("kubio.offcanvas.close"); // this.$target.animation(this.opts.animationClose, $.proxy(this.onClosed, this)); 1052 1053 Colibri.animate(this.$target, this.opts.animationClose, $.proxy(this.onClosed, this)); 1054 } 1055 }, 1056 isOpened: function isOpened() { 1057 return this.$target.hasClass("open"); 1058 }, 1059 onOpened: function onOpened() { 1060 this.$target.find("a").eq(0).focus(); 1061 this.$target.removeClass("hide"); 1062 1063 if (this.opts.clickOutside) { 1064 $(document).on("click." + this.namespace + " tap." + this.namespace, $.proxy(this.close, this)); 1065 } 1066 1067 if (!this.detect.isDesktopScreen()) { 1068 $("html").addClass("no-scroll"); 1069 } 1070 1071 $(document).on("keyup." + this.namespace, $.proxy(this.handleKeyboard, this)); 1072 $(document).on("keydown." + this.namespace, $.proxy(this.handleKeyDown, this)); 1073 this.$close.on("click." + this.namespace, $.proxy(this.close, this)); // this.utils.disableBodyScroll(); 1074 1075 this.$target.addClass("open"); 1076 this.callback("opened"); 1077 }, 1078 onClosed: function onClosed() { 1079 $("html").removeClass("no-scroll"); 1080 this.$target.css("width", "").removeClass("offcanvas-" + this.opts.direction); 1081 this.$close.off("." + this.namespace); 1082 $(document).off("." + this.namespace); 1083 this.$target.removeClass("open"); 1084 this.callback("closed"); 1085 this.$target.trigger("kubio.offcanvas.closed"); 1086 }, 1087 handleKeyboard: function handleKeyboard(e) { 1088 if (e.which === 27) { 1089 // eslint-disable-next-line @wordpress/no-global-active-element 1090 if (document.activeElement) { 1091 if ( // eslint-disable-next-line @wordpress/no-global-active-element 1092 $(document.activeElement).closest(".offcanvas").length) { 1093 this.$element.focus(); 1094 } 1095 } 1096 1097 this.close(); 1098 } 1099 }, 1100 handleKeyDown: function handleKeyDown(e) { 1101 if (e.which === 9) { 1102 var $links = this.$target.find("a:visible"); 1103 var isShift = e.shiftKey; 1104 1105 if ($links.last().is(e.target) && !isShift) { 1106 $links.first().focus(); 1107 e.preventDefault(); 1108 e.stopPropagation(); 1109 return; 1110 } 1111 1112 if ($links.first().is(e.target) && isShift) { 1113 $links.last().focus(); 1114 e.preventDefault(); 1115 e.stopPropagation(); 1116 } 1117 } 1118 } 1119 /* pullBody() { 1120 if (this.opts.push) { 1121 $('body').animate({ left: 0 }, 350, function () { 1122 $(this).removeClass('offcanvas-push-body'); 1123 }); 1124 } 1125 },*/ 1126 1127 /* pushBody() { 1128 if (this.opts.push) { 1129 const properties = 1130 this.opts.direction === 'left'
1131 ? { left: this.opts.width } 1132 : { left: '-' + this.opts.width }; 1133 $('body') 1134 .addClass('offcanvas-push-body') 1135 .animate(properties, 200); 1136 } 1137 },*/ 1138 1139 }; 1140 Component.inherits(Colibri); 1141 Colibri[className] = Component; 1142 Colibri.Plugin.create(className); 1143 Colibri.Plugin.autoload(className); // eslint-disable-next-line no-undef 1144})(jQuery, Colibri); 1145 1146/***/ }), 1147
1148/***/ "./assets/src/theme/js/theme.js": 1149/*!**************************************!*\ 1150 !*** ./assets/src/theme/js/theme.js ***! 1151 \**************************************/ 1152/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => { 1153 1154"use strict"; 1155/* harmony import */ var _kubio_scripts_src_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @kubio/scripts/src/base */ "./kubio-plugin/src/packages/scripts/src/base/index.js"); 1156/* harmony import */ var _kubio_scripts_src_detect_element_resize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @kubio/scripts/src/detect-element-resize */ "./kubio-plugin/src/packages/scripts/src/detect-element-resize.js"); 1157/* harmony import */ var _kubio_scripts_src_detect_element_resize__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_kubio_scripts_src_detect_element_resize__WEBPACK_IMPORTED_MODULE_1__); 1158/* harmony import */ var _kubio_scripts_src_jquery_extensions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @kubio/scripts/src/jquery-extensions */ "./kubio-plugin/src/packages/scripts/src/jquery-extensions.js"); 1159/* harmony import */ var domready__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! domready */ "./node_modules/domready/ready.js"); 1160/* harmony import */ var domready__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(domready__WEBPACK_IMPORTED_MODULE_3__); 1161/* harmony import */ var _kube_slideshow_customizable_slideshow__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./kube/slideshow/customizable-slideshow */ "./assets/src/theme/js/kube/slideshow/customizable-slideshow.js"); 1162/* harmony import */ var _kube_video_background_customizable_video_background__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./kube/video-background/customizable-video-background */ "./assets/src/theme/js/kube/video-background/customizable-video-background.js"); 1163/* harmony import */ var _kubio_block_library_src_navigation_frontend_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @kubio/block-library/src/navigation/frontend/index.js */ "./kubio-plugin/src/packages/block-library/src/navigation/frontend/index.js"); 1164/* harmony import */ var _kubio_block_library_src_hero_blocks_down_arrow_frontend_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @kubio/block-library/src/hero/blocks/down-arrow/frontend.js */ "./kubio-plugin/src/packages/block-library/src/hero/blocks/down-arrow/frontend.js"); 1165/* harmony import */ var _kubio_block_library_src_hero_blocks_down_arrow_frontend_js__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_kubio_block_library_src_hero_blocks_down_arrow_frontend_js__WEBPACK_IMPORTED_MODULE_7__); 1166/* harmony import */ var _menu_index_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./menu/index.js */ "./assets/src/theme/js/menu/index.js"); 1167/* harmony import */ var _kubio_scripts_src_masonry_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @kubio/scripts/src/masonry.js */ "./kubio-plugin/src/packages/scripts/src/masonry.js"); 1168/* harmony import */ var _kubio_scripts_src_masonry_js__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_kubio_scripts_src_masonry_js__WEBPACK_IMPORTED_MODULE_9__); 1169/* harmony import */ var _kubio_scripts_src_kubio_smoothscroll_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @kubio/scripts/src/kubio-smoothscroll.js */ "./kubio-plugin/src/packages/scripts/src/kubio-smoothscroll.js"); 1170/* harmony import */ var _kubio_scripts_src_kubio_smoothscroll_js__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_kubio_scripts_src_kubio_smoothscroll_js__WEBPACK_IMPORTED_MODULE_10__); 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184_kubio_scripts_src_base__WEBPACK_IMPORTED_MODULE_0__.ColibriFrontend.registerPlugin(_kube_slideshow_customizable_slideshow__WEBPACK_IMPORTED_MODULE_4__["default"]); 1185_kubio_scripts_src_base__WEBPACK_IMPORTED_MODULE_0__.ColibriFrontend.registerPlugin(_kube_video_background_customizable_video_background__WEBPACK_IMPORTED_MODULE_5__["default"]); 1186 1187_kubio_scripts_src_base__WEBPACK_IMPORTED_MODULE_0__.ColibriFrontend.getData = function (id) { 1188 if (window.kubioFrontendData && window.kubioFrontendData[id]) { 1189 return window.kubioFrontendData[id]; 1190 } 1191 1192 return {}; 1193}; 1194 1195_kubio_scripts_src_base__WEBPACK_IMPORTED_MODULE_0__.ColibriFrontend.domReady = (domready__WEBPACK_IMPORTED_MODULE_3___default()); 1196window.Colibri = _kubio_scripts_src_base__WEBPACK_IMPORTED_MODULE_0__.ColibriFrontend; // require("@/page-components/navigation/scripts/fixto"); 1197// require("@/page-components/navigation/scripts/overlap"); 1198// require("@/common/libraries/mesmerize-smoothscroll"); 1199// require("@/page-components/menu/scripts/dropdown-menu"); 1200// require("@/page-components/menu/scripts/accordion-menu"); 1201// require("@/page-components/menu/scripts/offcanvas"); 1202// 1203// // 1204// // // sticky 1205// // 1206//("@kubio/scripts/navigation/scripts/navigation"); 1207// require("@/page-components/navigation/scripts/fixto"); 1208// require("@/page-components/navigation/scripts/overlap"); 1209// require("@/page-components/common/scripts/masonry.js"); 1210// require("@/page-components/footer/scripts/footer-paralax.js"); 1211// require("@/page-components/menu/scripts/offcanvas.js"); 1212 1213/***/ }), 1214
1215/***/ "./kubio-plugin/src/packages/block-library/src/hero/blocks/down-arrow/frontend.js": 1216/*!****************************************************************************************!*\ 1217 !*** ./kubio-plugin/src/packages/block-library/src/hero/blocks/down-arrow/frontend.js ***! 1218 \****************************************************************************************/ 1219/***/ (() => { 1220 1221/* global jQuery, Colibri */ 1222(function ($, Colibri) { 1223 var className = 'downarrow'; 1224 1225 var Component = function Component() { 1226 this.namespace = className; 1227 this.defaults = { 1228 arrowSelector: '', 1229 scrollTargetSelector: '' 1230 }; // Parent Constructor 1231 1232 Colibri.apply(this, arguments); // Initialization 1233 1234 this.start(); 1235 }; 1236 1237 Component.prototype = { 1238 start: function start() { 1239 if (!(this.opts && this.opts.arrowSelector && this.opts.scrollTargetSelector)) { 1240 return; 1241 } 1242 1243 this.$arrow = this.$element.find(this.opts.arrowSelector); 1244 var $scrollTarget = $(this.opts.scrollTargetSelector); 1245 this.$arrow.smoothScrollAnchor({ 1246 target: $scrollTarget 1247 }); 1248 }, 1249 stop: function stop() { 1250 if (this.$arrow) { 1251 this.$arrow.off('click.smooth-scroll tap.smooth-scroll'); 1252 } 1253 }, 1254 reset: function reset(self) {}, 1255 restart: function restart() { 1256 this.stop(); 1257 this.start(); 1258 }, 1259 ready: function ready() { 1260 //const { type } = this.opts; 1261 if (this.opts.firstTime) { 1262 return; 1263 } 1264 1265 this.opts.firstTime = true; 1266 } 1267 }; 1268 Component.inherits(Colibri); 1269 Colibri[className] = Component; 1270 Colibri.Plugin.create(className); 1271 Colibri.Plugin.autoload(className); 1272})(jQuery, Colibri); 1273 1274/***/ }), 1275
1276/***/ "./kubio-plugin/src/packages/block-library/src/navigation/frontend/fixto.js": 1277/*!**********************************************************************************!*\ 1278 !*** ./kubio-plugin/src/packages/block-library/src/navigation/frontend/fixto.js ***! 1279 \**********************************************************************************/ 1280/***/ (() => { 1281 1282(function ($, window, document) { 1283 // Start Computed Style. Please do not modify this module here. Modify it from its own repo. See address below. 1284 1285 /*! Computed Style - v0.1.0 - 2012-07-19 1286 * https://github.com/bbarakaci/computed-style 1287 * Copyright (c) 2012 Burak Barakaci; Licensed MIT */ 1288 var computedStyle = function () { 1289 var computedStyle = { 1290 getAll: function getAll(element) { 1291 return document.defaultView.getComputedStyle(element); 1292 }, 1293 get: function get(element, name) { 1294 return this.getAll(element)[name]; 1295 }, 1296 toFloat: function toFloat(value) { 1297 return parseFloat(value, 10) || 0; 1298 }, 1299 getFloat: function getFloat(element, name) { 1300 return this.toFloat(this.get(element, name)); 1301 }, 1302 _getAllCurrentStyle: function _getAllCurrentStyle(element) { 1303 return element.currentStyle; 1304 } 1305 }; 1306 1307 if (document.documentElement.currentStyle) { 1308 computedStyle.getAll = computedStyle._getAllCurrentStyle; 1309 } 1310 1311 return computedStyle; 1312 }(); // End Computed Style. Modify whatever you want to. 1313 1314 1315 var mimicNode = function () { 1316 /* 1317 Class Mimic Node 1318 Dependency : Computed Style 1319 Tries to mimick a dom node taking his styles, dimensions. May go to his repo if gets mature. 1320 */ 1321 function MimicNode(element) { 1322 this.element = element; 1323 this.replacer = document.createElement('div'); 1324 this.replacer.style.visibility = 'hidden'; 1325 this.hide(); 1326 element.parentNode.insertBefore(this.replacer, element); 1327 } 1328 1329 MimicNode.prototype = { 1330 replace: function replace() { 1331 var rst = this.replacer.style; 1332 var styles = computedStyle.getAll(this.element); // rst.width = computedStyle.width(this.element) + 'px'; 1333 // rst.height = this.element.offsetHeight + 'px'; 1334 // Setting offsetWidth 1335 1336 rst.width = this._width(); 1337 rst.height = this._height(); // Adopt margins 1338 1339 rst.marginTop = styles.marginTop; 1340 rst.marginBottom = styles.marginBottom; 1341 rst.marginLeft = styles.marginLeft; 1342 rst.marginRight = styles.marginRight; // Adopt positioning 1343 1344 rst.cssFloat = styles.cssFloat; 1345 rst.styleFloat = styles.styleFloat; //ie8; 1346 1347 rst.position = styles.position; 1348 rst.top = styles.top; 1349 rst.right = styles.right; 1350 rst.bottom = styles.bottom; 1351 rst.left = styles.left; // rst.borderStyle = styles.borderStyle; 1352 1353 rst.display = styles.display; 1354 }, 1355 hide: function hide() { 1356 this.replacer.style.display = 'none'; 1357 }, 1358 _width: function _width() { 1359 return this.element.getBoundingClientRect().width + 'px'; 1360 }, 1361 _widthOffset: function _widthOffset() { 1362 return this.element.offsetWidth + 'px'; 1363 }, 1364 _height: function _height() { 1365 return jQuery(this.element).outerHeight() + 'px'; 1366 }, 1367 _heightOffset: function _heightOffset() { 1368 return this.element.offsetHeight + 'px'; 1369 }, 1370 destroy: function destroy() { 1371 $(this.replacer).remove(); // set properties to null to break references 1372 1373 for (var prop in this) { 1374 if (this.hasOwnProperty(prop)) { 1375 this[prop] = null; 1376 } 1377 } 1378 } 1379 }; 1380 var bcr = document.documentElement.getBoundingClientRect(); 1381 1382 if (!bcr.width) { 1383 MimicNode.prototype._width = MimicNode.prototype._widthOffset; 1384 MimicNode.prototype._height = MimicNode.prototype._heightOffset; 1385 } 1386 1387 return { 1388 MimicNode: MimicNode, 1389 computedStyle: computedStyle 1390 }; 1391 }(); // Class handles vendor prefixes 1392 1393 1394 function Prefix() { 1395 // Cached vendor will be stored when it is detected 1396 this._vendor = null; //this._dummy = document.createElement('div'); 1397 } 1398 1399 Prefix.prototype = { 1400 _vendors: { 1401 webkit: { 1402 cssPrefix: '-webkit-', 1403 jsPrefix: 'Webkit' 1404 }, 1405 moz: { 1406 cssPrefix: '-moz-', 1407 jsPrefix: 'Moz' 1408 }, 1409 ms: { 1410 cssPrefix: '-ms-', 1411 jsPrefix: 'ms' 1412 }, 1413 opera: { 1414 cssPrefix: '-o-', 1415 jsPrefix: 'O' 1416 } 1417 }, 1418 _prefixJsProperty: function _prefixJsProperty(vendor, prop) { 1419 return vendor.jsPrefix + prop[0].toUpperCase() + prop.substr(1); 1420 }, 1421 _prefixValue: function _prefixValue(vendor, value) { 1422 return vendor.cssPrefix + value; 1423 }, 1424 _valueSupported: function _valueSupported(prop, value, dummy) { 1425 // IE8 will throw Illegal Argument when you attempt to set a not supported value.
1426 try { 1427 dummy.style[prop] = value; 1428 return dummy.style[prop] === value; 1429 } catch (er) { 1430 return false; 1431 } 1432 }, 1433 1434 /** 1435 * Returns true if the property is supported 1436 * 1437 * @param {string} prop Property name 1438 * @return {boolean} 1439 */ 1440 propertySupported: function propertySupported(prop) { 1441 // Supported property will return either inine style value or an empty string. 1442 // Undefined means property is not supported. 1443 return document.documentElement.style[prop] !== undefined; 1444 }, 1445 1446 /** 1447 * Returns prefixed property name for js usage 1448 * 1449 * @param {string} prop Property name 1450 * @return {string|null} 1451 */ 1452 getJsProperty: function getJsProperty(prop) { 1453 // Try native property name first. 1454 if (this.propertySupported(prop)) { 1455 return prop; 1456 } // Prefix it if we know the vendor already 1457 1458 1459 if (this._vendor) { 1460 return this._prefixJsProperty(this._vendor, prop); 1461 } // We don't know the vendor, try all the possibilities 1462 1463 1464 var prefixed; 1465 1466 for (var vendor in this._vendors) { 1467 prefixed = this._prefixJsProperty(this._vendors[vendor], prop); 1468 1469 if (this.propertySupported(prefixed)) { 1470 // Vendor detected. Cache it. 1471 this._vendor = this._vendors[vendor]; 1472 return prefixed; 1473 } 1474 } // Nothing worked 1475 1476 1477 return null; 1478 }, 1479 1480 /** 1481 * Returns supported css value for css property. Could be used to check support or get prefixed value string. 1482 * 1483 * @param {string} prop Property 1484 * @param {string} value Value name 1485 * @return {string|null} 1486 */ 1487 getCssValue: function getCssValue(prop, value) { 1488 // Create dummy element to test value 1489 var dummy = document.createElement('div'); // Get supported property name 1490 1491 var jsProperty = this.getJsProperty(prop); // Try unprefixed value 1492 1493 if (this._valueSupported(jsProperty, value, dummy)) { 1494 return value; 1495 } 1496 1497 var prefixedValue; // If we know the vendor already try prefixed value 1498 1499 if (this._vendor) { 1500 prefixedValue = this._prefixValue(this._vendor, value); 1501 1502 if (this._valueSupported(jsProperty, prefixedValue, dummy)) { 1503 return prefixedValue; 1504 } 1505 } // Try all vendors 1506 1507 1508 for (var vendor in this._vendors) { 1509 prefixedValue = this._prefixValue(this._vendors[vendor], value); 1510 1511 if (this._valueSupported(jsProperty, prefixedValue, dummy)) { 1512 // Vendor detected. Cache it. 1513 this._vendor = this._vendors[vendor]; 1514 return prefixedValue; 1515 } 1516 } // No support for value 1517 1518 1519 return null; 1520 } 1521 }; 1522 var prefix = new Prefix(); // We will need this frequently. Lets have it as a global until we encapsulate properly. 1523 1524 var transformJsProperty = prefix.getJsProperty('transform'); // Will hold if browser creates a positioning context for fixed elements. 1525 1526 var fixedPositioningContext; // Checks if browser creates a positioning context for fixed elements. 1527 // Transform rule will create a positioning context on browsers who follow the spec. 1528 // Ie for example will fix it according to documentElement 1529 // TODO: Other css rules also effects. perspective creates at chrome but not in firefox. transform-style preserve3d effects. 1530 1531 function checkFixedPositioningContextSupport() { 1532 var support = false; 1533 var parent = document.createElement('div'); 1534 var child = document.createElement('div'); 1535 parent.appendChild(child); 1536 parent.style[transformJsProperty] = 'translate(0)'; // Make sure there is space on top of parent 1537 1538 parent.style.marginTop = '10px'; 1539 parent.style.visibility = 'hidden'; 1540 child.style.position = 'fixed'; 1541 child.style.top = 0; 1542 document.body.appendChild(parent); 1543 var rect = child.getBoundingClientRect(); // If offset top is greater than 0 meand transformed element created a positioning context. 1544 1545 if (rect.top > 0) { 1546 support = true; 1547 } // Remove dummy content 1548 1549 1550 document.body.removeChild(parent); 1551 return false; //support; 1552 } // It will return null if position sticky is not supported 1553 1554 1555 var nativeStickyValue = prefix.getCssValue('position', 'sticky'); // It will return null if position fixed is not supported 1556 1557 var fixedPositionValue = prefix.getCssValue('position', 'fixed'); // Dirty business 1558 1559 var ie = navigator.appName === 'Microsoft Internet Explorer'; 1560 var ieversion; 1561 1562 if (ie) { 1563 ieversion = parseFloat(navigator.appVersion.split('MSIE')[1]); 1564 } 1565 1566 function FixTo(child, parent, options) { 1567 this.child = child; 1568 this._$child = $(child); 1569 this.parent = parent; 1570 this.options = { 1571 className: 'fixto-fixed', 1572 startAfterNode: { 1573 enabled: false, 1574 selector: '' 1575 }, 1576 animations: { 1577 enabled: false, 1578 currentInAnimationClass: '', 1579 currentOutAnimationClass: '',
1580 allInAnimationsClasses: '', 1581 allOutAnimationsClasses: '', 1582 duration: 0 1583 }, 1584 top: 0, 1585 zIndex: '' 1586 }; 1587 1588 this._setOptions(options); 1589 1590 this._initAnimations(); 1591 } 1592 1593 FixTo.prototype = { 1594 // Returns the total outerHeight of the elements passed to mind option. Will return 0 if none. 1595 _mindtop: function _mindtop() { 1596 var top = 0; 1597 1598 if (this._$mind) { 1599 var el; 1600 var rect; 1601 var height; 1602 1603 for (var i = 0, l = this._$mind.length; i < l; i++) { 1604 el = this._$mind[i]; 1605 rect = el.getBoundingClientRect(); 1606 1607 if (rect.height) { 1608 top += rect.height; 1609 } else { 1610 var styles = computedStyle.getAll(el); 1611 top += el.offsetHeight + computedStyle.toFloat(styles.marginTop) + computedStyle.toFloat(styles.marginBottom); 1612 } 1613 } 1614 } 1615 1616 return top; 1617 }, 1618 _updateOutAnimationDuration: function _updateOutAnimationDuration() { 1619 var animationDuration = this.options.animations.duration; 1620 1621 if (isNaN(animationDuration)) { 1622 animationDuration = 0; 1623 } 1624 1625 this._animationDuration = animationDuration; 1626 }, 1627 _initAnimations: function _initAnimations() { 1628 var animations = this.options.animations; 1629 1630 this._$child.removeClass(animations.allInAnimationsClasses); 1631 1632 this._$child.removeClass(animations.allOutAnimationsClasses); 1633 1634 var self = this; 1635 1636 this._updateOutAnimationDuration(); 1637 1638 this._animationOutDebounce = $.debounce(function () { 1639 self._$child.removeClass(self.options.animations.allOutAnimationsClasses); 1640 1641 self._inOutAnimation = false; 1642 1643 self._unfix(); 1644 1645 self._removeTransitionFromOutAnimation(); 1646 }, 100); 1647 this._animationInDebounce = $.debounce(function () { 1648 self._inInAnimation = false; 1649 1650 self._$child.removeClass(self.options.animations.allInAnimationsClasses); 1651 }, this._animationDuration); 1652 }, 1653 _removeTransitionFromOutAnimation: function _removeTransitionFromOutAnimation() { 1654 var noTransitionClass = 'h-global-transition-disable'; 1655 1656 this._$child.addClass(noTransitionClass); 1657 1658 var childTransitionDuration = this._$child.css('transition-duration'); 1659 1660 var isNumberRegex = /\d+/; 1661 var transitionDurationInS = childTransitionDuration.match(isNumberRegex)[0]; 1662 1663 if (!transitionDurationInS) { 1664 transitionDurationInS = 0; 1665 } 1666 1667 var transitionDurationInMs = transitionDurationInS * 1000; 1668 var transitionBuffer = 500; 1669 var transitionDuration = transitionDurationInMs + transitionBuffer; 1670 var self = this; 1671 setTimeout(function () { 1672 if (!self._$child) { 1673 return; 1674 } 1675 1676 self._$child.removeClass(noTransitionClass); 1677 }, transitionDuration); 1678 }, 1679 _passedStartAfterNode: function _passedStartAfterNode() { 1680 var $startAfterNode = this._$startAfterNode; 1681 1682 if ($startAfterNode && $startAfterNode.length > 0) { 1683 var offsetTop = this._afterElementOffsetTop; 1684 var height = $startAfterNode.outerHeight(); 1685 return this._scrollTop > offsetTop + height; 1686 } 1687 1688 return true; 1689 }, 1690 // Public method to stop the behaviour of this instance. 1691 stop: function stop() { 1692 this._stop(); 1693 1694 this._running = false; 1695 }, 1696 // Public method starts the behaviour of this instance. 1697 start: function start() { 1698 // Start only if it is not running not to attach event listeners multiple times. 1699 if (!this._running) { 1700 this._start(); 1701 1702 this._running = true; 1703 } 1704 }, 1705 //Public method to destroy fixto behaviour 1706 destroy: function destroy() { 1707 this.stop(); 1708 1709 this._destroy(); // Remove jquery data from the element 1710 1711 1712 this._$child.removeData('fixto-instance'); // set properties to null to break references 1713 1714 1715 for (var prop in this) { 1716 if (this.hasOwnProperty(prop)) { 1717 this[prop] = null; 1718 } 1719 } 1720 }, 1721 _setOptions: function _setOptions(options) { 1722 $.extend(true, this.options, options); 1723 1724 if (this.options.mind) { 1725 this._$mind = $(this.options.mind); 1726 } 1727 1728 if (this.options.startAfterNode.enabled && this.options.startAfterNode.selector) { 1729 this._$startAfterNode = $(this.options.startAfterNode.selector); 1730 } 1731 }, 1732 setOptions: function setOptions(options) { 1733 this._setOptions(options); 1734 1735 this.refresh(); 1736 }, 1737 // Methods could be implemented by subclasses 1738 _stop: function _stop() {}, 1739 _start: function _start() {}, 1740 _destroy: function _destroy() {}, 1741 refresh: function refresh() {} 1742 }; // Class FixToContainer 1743 1744 function FixToContainer(child, parent, options) { 1745 /** 1746 * FIXME If you have a saved navigation with sticky, when you enter the page, this class creates two objects 1747 * and because of that there are two events listeners. There should be only one instance of this class for each 1748 * navigation 1749 */ 1750 //The script still is called two times but now both of the calls pass the check 1751 // if (!child || !this._scriptCallIsValid(child)) { 1752 // return; 1753 // } 1754 FixTo.call(this, child, parent, options); 1755 this._replacer = new mimicNode.MimicNode(child); 1756 this._ghostNode = this._replacer.replacer; 1757 1758 this._saveStyles(); 1759
1760 this._saveViewportHeight(); // Create anonymous functions and keep references to register and unregister events. 1761 1762 1763 this._proxied_onscroll = this._bind(this._onscroll, this); 1764 this._proxied_onresize = this._bind(this._onresize, this); 1765 this.start(); 1766 } 1767 1768 FixToContainer.prototype = new FixTo(); 1769 $.extend(FixToContainer.prototype, { 1770 // Returns an anonymous function that will call the given function in the given context 1771 _bind: function _bind(fn, context) { 1772 return function () { 1773 return fn.call(context); 1774 }; 1775 }, 1776 // at ie8 maybe only in vm window resize event fires everytime an element is resized. 1777 _toresize: ieversion === 8 ? document.documentElement : window, 1778 //TODO @catalin this is a temporary workaround, until the issue: #0030376 is fixed 1779 _scriptCallIsValid: function _scriptCallIsValid(child) { 1780 var isInCustomizer = Colibri.isCustomizerPreview(); 1781 1782 if (!isInCustomizer) { 1783 return true; 1784 } 1785 1786 var vueNavSelector = '.h-navigation_outer'; 1787 var vueNav = $(child).closest(vueNavSelector).get(0); 1788 1789 if (!vueNav) { 1790 return true; 1791 } 1792 1793 if (vueNav.__vue__) { 1794 return true; 1795 } 1796 1797 return false; 1798 }, 1799 _onscroll: function _onscroll() { 1800 /** 1801 * TODO @catalin, now sometimes the child height is 0, other times is correct that ruins the out animation logic, 1802 * until that is fixed this is a workaround to that problem. When the child height will always be correct remove 1803 * this condition. 1804 */ 1805 this._scrollingContainer = $('.edit-site-visual-editor')[0]; 1806 this._scrollTop = document.documentElement.scrollTop || document.body.scrollTop || (this._scrollingContainer ? this._scrollingContainer.scrollTop : 0); 1807 this._parentBottom = this.parent.offsetHeight + this._fullOffset('offsetTop', this.parent); 1808 1809 if (this.options.startAfterNode && !this._passedStartAfterNode()) { 1810 if (this.fixed && !this._inOutAnimation) { 1811 this._unfixFromScrollListener(); 1812 } 1813 1814 return; 1815 } // if (this.options.mindBottomPadding !== false) { 1816 // this._parentBottom -= computedStyle.getFloat(this.parent, 'paddingBottom'); 1817 // } 1818 // if (this.options.toBottom) { 1819 // this._fix(); 1820 // this._adjust(); 1821 // return 1822 // } 1823 // if (this.options.toBottom) { 1824 // this.options.top = this._viewportHeight - computedStyle.toFloat(computedStyle.getAll(this.child).height) - this.options.topSpacing; 1825 // } 1826 1827 1828 if (!this.fixed) { 1829 var childStyles = computedStyle.getAll(this.child); 1830 1831 if (this._scrollTop < this._parentBottom && this._scrollTop > this._fullOffset('offsetTop', this.child) - this.options.top - this._mindtop() && this._viewportHeight > this.child.offsetHeight + computedStyle.toFloat(childStyles.marginTop) + computedStyle.toFloat(childStyles.marginBottom) || this.options.toBottom) { 1832 this._fix(); 1833 1834 this._adjust(); 1835 } 1836 } else { 1837 if (this.options.toBottom) { 1838 if (this._scrollTop >= this._fullOffset('offsetTop', this._ghostNode)) { 1839 this._unfixFromScrollListener(); 1840 1841 return; 1842 } 1843 } else if (this._scrollTop > this._parentBottom || this._scrollTop <= this._fullOffset('offsetTop', this._ghostNode) - this.options.top - this._mindtop()) { 1844 this._unfixFromScrollListener(); 1845 1846 return; 1847 } 1848 1849 this._adjust(); 1850 } 1851 }, 1852 _adjust: function _adjust() { 1853 var top = 0; 1854 1855 var mindTop = this._mindtop(); 1856 1857 var diff = 0; 1858 var childStyles = computedStyle.getAll(this.child); 1859 var context = null; 1860 1861 if (fixedPositioningContext) { 1862 // Get positioning context. 1863 context = this._getContext(); 1864 1865 if (context) { 1866 // There is a positioning context. Top should be according to the context. 1867 top = Math.abs(context.getBoundingClientRect().top); 1868 } 1869 } 1870 1871 diff = this._parentBottom - this._scrollTop - (this.child.offsetHeight + computedStyle.toFloat(childStyles.marginBottom) + mindTop + this.options.top); 1872 1873 if (diff > 0) { 1874 diff = 0; 1875 } 1876 1877 if (this.options.toBottom) {// this.child.style.top = (diff + mindTop + top + this.options.top) - computedStyle.toFloat(childStyles.marginTop) + 'px'; 1878 } else { 1879 var _top = this.options.top; 1880 1881 if (_top === 0) { 1882 _top = $('body').offset().top; 1883 } 1884 1885 this.child.style.top = Math.round(diff + mindTop + top + _top - computedStyle.toFloat(childStyles.marginTop)) + 'px'; 1886 } 1887 }, 1888 // Calculate cumulative offset of the element. 1889 // Optionally according to context 1890 _fullOffset: function _fullOffset(offsetName, elm, context) { 1891 var offset = elm[offsetName]; 1892 var offsetParent = elm.offsetParent; // Add offset of the ascendent tree until we reach to the document root or to the given context 1893 1894 while (offsetParent !== null && offsetParent !== context) { 1895 offset = offset + offsetParent[offsetName]; 1896 offsetParent = offsetParent.offsetParent; 1897 } 1898 1899 return offset; 1900 }, 1901 // Get positioning context of the element. 1902 // We know that the closest parent that a transform rule applied will create a positioning context. 1903 _getContext: function _getContext() { 1904 var parent; 1905 var element = this.child; 1906 var context = null; 1907 var styles; // Climb up the treee until reaching the context 1908 1909 while (!context) { 1910 parent = element.parentNode; 1911 1912 if (parent === document.documentElement) { 1913 return null; 1914 } 1915 1916 styles = computedStyle.getAll(parent); // Element has a transform rule 1917
1918 if (styles[transformJsProperty] !== 'none') { 1919 context = parent; 1920 break; 1921 } 1922 1923 element = parent; 1924 } 1925 1926 return context; 1927 }, 1928 _fix: function _fix() { 1929 var child = this.child; 1930 var childStyle = child.style; 1931 var childStyles = computedStyle.getAll(child); 1932 var left = child.getBoundingClientRect().left; 1933 var width = childStyles.width; 1934 1935 this._$child.trigger('fixto-add'); 1936 1937 this._saveStyles(); 1938 1939 if (document.documentElement.currentStyle) { 1940 // Function for ie<9. When hasLayout is not triggered in ie7, he will report currentStyle as auto, clientWidth as 0. Thus using offsetWidth. 1941 // Opera also falls here 1942 width = child.offsetWidth; 1943 1944 if (childStyles.boxSizing !== 'border-box') { 1945 width = width - (computedStyle.toFloat(childStyles.paddingLeft) + computedStyle.toFloat(childStyles.paddingRight) + computedStyle.toFloat(childStyles.borderLeftWidth) + computedStyle.toFloat(childStyles.borderRightWidth)); 1946 } 1947 1948 width += 'px'; 1949 } // Ie still fixes the container according to the viewport. 1950 1951 1952 if (fixedPositioningContext) { 1953 var context = this._getContext(); // if(context) { 1954 // // There is a positioning context. Left should be according to the context. 1955 // left = child.getBoundingClientRect().left - context.getBoundingClientRect().left; 1956 // } else { 1957 1958 1959 left = this._$child.offset().left; // } 1960 } 1961 1962 this._replacer.replace(); 1963 1964 childStyle.left = 1965 /*left + "px"; */ 1966 left - computedStyle.toFloat(childStyles.marginLeft) + 'px'; 1967 childStyle.width = width; 1968 childStyle.position = 'fixed'; 1969 1970 if (this.options.toBottom) { 1971 childStyle.top = ''; 1972 childStyle.bottom = this.options.top + computedStyle.toFloat(childStyles.marginBottom) + 'px'; 1973 } else { 1974 childStyle.bottom = ''; 1975 var _top = this.options.top; 1976 1977 if (_top === 0) { 1978 _top = $('body').offset().top; 1979 } 1980 1981 childStyle.top = this._mindtop() + _top - computedStyle.toFloat(childStyles.marginTop) + 'px'; 1982 } 1983 1984 if (this.options.zIndex) { 1985 this.child.style.zIndex = this.options.zIndex; 1986 } 1987 1988 this._$child.addClass(this.options.className); 1989 1990 var animations = this.options.animations; 1991 1992 this._$child.removeClass(animations.allInAnimationsClasses); 1993 1994 if (animations.enabled) { 1995 this._$child.addClass(animations.currentInAnimationClass); 1996 1997 if (!this._inInAnimation) { 1998 this._inInAnimation = true; 1999 2000 this._animationInDebounce(); 2001 } 2002 } 2003 2004 this.fixed = true; 2005 2006 this._$child.trigger('fixto-added'); 2007 }, 2008 _unfixFromScrollListener: function _unfixFromScrollListener() { 2009 this._$child.trigger('fixto-unnfix-from-scroll'); 2010 2011 if (this.options.animations.enabled) { 2012 this._unfixTriggerAnimation(); 2013 } else { 2014 this._unfix(); 2015 } 2016 }, 2017 _getAfterElementOffsetTop: function _getAfterElementOffsetTop() { 2018 var $node = this._$startAfterNode; 2019 var defaultValue = 0; 2020 2021 if ($node && $node.length > 0) { 2022 var elem = $node.get(0); 2023 var distance = 0; 2024 2025 do { 2026 // Increase our distance counter 2027 distance += elem.offsetTop; // Set the element to it's parent 2028 2029 elem = elem.offsetParent; 2030 } while (elem); 2031 2032 distance = distance < defaultValue ? defaultValue : distance; 2033 return distance; 2034 } 2035 2036 return defaultValue; 2037 }, 2038 _unfix: function _unfix() { 2039 this._replacer.hide(); 2040 2041 var childStyle = this.child.style; 2042 childStyle.position = this._childOriginalPosition; 2043 childStyle.top = this._childOriginalTop; 2044 childStyle.bottom = this._childOriginalBottom; 2045 childStyle.width = this._childOriginalWidth; 2046 childStyle.left = this._childOriginalLeft; 2047 childStyle.zIndex = this._childOriginalZIndex; 2048 2049 if (!this.options.always) { 2050 this._$child.removeClass(this.options.className); 2051 2052 this._$child.trigger('fixto-removed'); 2053 } 2054 2055 this.fixed = false;
2056 }, 2057 _unfixTriggerAnimation: function _unfixTriggerAnimation() { 2058 this._$child.trigger('fixto-animated-remove'); 2059 2060 this._animationInDebounce.flush(); 2061 2062 var animations = this.options.animations; 2063 2064 this._$child.removeClass(animations.allInAnimationsClasses); 2065 2066 this._$child.removeClass(animations.allOutAnimationsClasses); 2067 2068 if (animations.enabled) { 2069 this._$child.addClass(animations.currentOutAnimationClass); 2070 } 2071 2072 this._inOutAnimation = true; 2073 2074 this._animationOutDebounce(); 2075 }, 2076 _saveStyles: function _saveStyles() { 2077 this._animationOutDebounce.flush(); 2078 2079 var childStyle = this.child.style; 2080 this._childOriginalPosition = childStyle.position; 2081 2082 if (this.options.toBottom) { 2083 this._childOriginalTop = ''; 2084 this._childOriginalBottom = childStyle.bottom; 2085 } else { 2086 this._childOriginalTop = childStyle.top; 2087 this._childOriginalBottom = ''; 2088 } 2089 2090 this._childOriginalWidth = childStyle.width; 2091 this._childOriginalLeft = childStyle.left; 2092 this._childOriginalZIndex = childStyle.zIndex; 2093 this._afterElementOffsetTop = this._getAfterElementOffsetTop(); 2094 }, 2095 _onresize: function _onresize() { 2096 this.refresh(); 2097 },
2098 _saveViewportHeight: function _saveViewportHeight() { 2099 // ie8 doesn't support innerHeight 2100 this._viewportHeight = window.innerHeight || document.documentElement.clientHeight; 2101 }, 2102 _stop: function _stop() { 2103 // Unfix the container immediately. 2104 this._unfix(); // remove event listeners 2105 2106 2107 window.removeEventListener('scroll', this._proxied_onscroll); 2108 window.removeEventListener('mousewheel', this._proxied_onscroll); 2109 }, 2110 _start: function _start() { 2111 // Trigger onscroll to have the effect immediately. 2112 this._onscroll(); 2113 2114 window.addEventListener('scroll', this._proxied_onscroll, { 2115 passive: true 2116 }); 2117 window.addEventListener('mousewheel', this._proxied_onscroll, { 2118 passive: true 2119 }); 2120 $(this._toresize).on('resize.fixto', this._proxied_onresize); 2121 }, 2122 _destroy: function _destroy() { 2123 // Destroy mimic node instance 2124 this._replacer.destroy(); 2125 }, 2126 refresh: function refresh() { 2127 this._saveViewportHeight(); 2128 2129 this._unfix(); 2130 2131 this._onscroll(); 2132 } 2133 }); 2134 2135 function NativeSticky(child, parent, options) { 2136 FixTo.call(this, child, parent, options); 2137 this.start(); 2138 } 2139 2140 NativeSticky.prototype = new FixTo(); 2141 $.extend(NativeSticky.prototype, { 2142 _start: function _start() { 2143 var childStyles = computedStyle.getAll(this.child); 2144 this._childOriginalPosition = childStyles.position; 2145 this._childOriginalTop = childStyles.top; 2146 this.child.style.position = nativeStickyValue; 2147 this.refresh(); 2148 }, 2149 _stop: function _stop() { 2150 this.child.style.position = this._childOriginalPosition; 2151 this.child.style.top = this._childOriginalTop; 2152 }, 2153 refresh: function refresh() { 2154 this.child.style.top = this._mindtop() + this.options.top + 'px'; 2155 } 2156 }); 2157 2158 var fixTo = function fixTo(childElement, parentElement, options) { 2159 if (nativeStickyValue && !options || nativeStickyValue && options && options.useNativeSticky !== false) { 2160 // Position sticky supported and user did not disabled the usage of it. 2161 return new NativeSticky(childElement, parentElement, options); 2162 } else if (fixedPositionValue) { 2163 // Position fixed supported 2164 if (fixedPositioningContext === undefined) { 2165 // We don't know yet if browser creates fixed positioning contexts. Check it. 2166 fixedPositioningContext = checkFixedPositioningContextSupport(); 2167 } 2168 2169 return new FixToContainer(childElement, parentElement, options); 2170 } 2171 2172 return 'Neither fixed nor sticky positioning supported'; 2173 }; 2174 /* 2175 No support for ie lt 8 2176 */ 2177 2178 2179 if (ieversion < 8) { 2180 fixTo = function fixTo() { 2181 return 'not supported'; 2182 }; 2183 } // Let it be a jQuery Plugin 2184 2185 2186 $.fn.fixTo = function (targetSelector, options) { 2187 var $targets = $(targetSelector); 2188 var i = 0; 2189 return this.each(function () { 2190 // Check the data of the element. 2191 var instance = $(this).data('fixto-instance'); // If the element is not bound to an instance, create the instance and save it to elements data. 2192 2193 if (!instance) { 2194 $(this).data('fixto-instance', fixTo(this, $targets[i], options)); 2195 } else { 2196 // If we already have the instance here, expect that targetSelector parameter will be a string 2197 // equal to a public methods name. Run the method on the instance without checking if 2198 // it exists or it is a public method or not. Cause nasty errors when necessary. 2199 var method = targetSelector; 2200 instance[method].call(instance, options); 2201 } 2202 2203 i++; 2204 }); 2205 }; 2206 /* 2207 Expose 2208 */ 2209 2210 2211 return { 2212 FixToContainer: FixToContainer, 2213 fixTo: fixTo, 2214 computedStyle: computedStyle, 2215 mimicNode: mimicNode 2216 }; 2217})(window.jQuery, window, document); 2218 2219/***/ }), 2220
2221/***/ "./kubio-plugin/src/packages/block-library/src/navigation/frontend/index.js": 2222/*!**********************************************************************************!*\ 2223 !*** ./kubio-plugin/src/packages/block-library/src/navigation/frontend/index.js ***! 2224 \**********************************************************************************/ 2225/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => { 2226 2227"use strict"; 2228/* harmony import */ var _fixto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./fixto */ "./kubio-plugin/src/packages/block-library/src/navigation/frontend/fixto.js"); 2229/* harmony import */ var _fixto__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_fixto__WEBPACK_IMPORTED_MODULE_0__); 2230/* harmony import */ var _navigation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./navigation */ "./kubio-plugin/src/packages/block-library/src/navigation/frontend/navigation.js"); 2231/* harmony import */ var _navigation__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_navigation__WEBPACK_IMPORTED_MODULE_1__); 2232/* harmony import */ var _overlap__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./overlap */ "./kubio-plugin/src/packages/block-library/src/navigation/frontend/overlap.js"); 2233/* harmony import */ var _overlap__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_overlap__WEBPACK_IMPORTED_MODULE_2__); 2234 2235 2236 2237 2238/***/ }), 2239
2240/***/ "./kubio-plugin/src/packages/block-library/src/navigation/frontend/navigation.js": 2241/*!***************************************************************************************!*\ 2242 !*** ./kubio-plugin/src/packages/block-library/src/navigation/frontend/navigation.js ***! 2243 \***************************************************************************************/ 2244/***/ (() => { 2245 2246(function ($, Colibri) { 2247 var className = 'navigation'; 2248 var animations = { 2249 slideDown: { 2250 "in": 'slideInDown', 2251 out: 'slideOutDownNavigation' 2252 }, 2253 fade: { 2254 "in": 'fadeIn fade-animation-without-other-transitions', 2255 out: 'fadeOut' 2256 }, 2257 none: { 2258 "in": 'h-global-transition-disable', 2259 out: 'h-global-transition-disable' 2260 } 2261 }; 2262 2263 var Component = function Component(element, options) { 2264 this.namespace = className; 2265 this.scrollingContainer = $('.edit-site-visual-editor'); 2266 this.defaults = { 2267 sticky: { 2268 className: 'h-navigation_sticky', 2269 topSpacing: 0, 2270 top: this.scrollingContainer.length ? this.scrollingContainer.offset().top : 0, 2271 stickyOnMobile: true, 2272 stickyOnTablet: true, 2273 startAfterNode: { 2274 enabled: false, 2275 selector: '.wp-block-kubio-header' 2276 }, 2277 animations: { 2278 enabled: false, 2279 name: 'none', 2280 duration: 0 2281 }, 2282 zIndex: 9999, 2283 responsiveWidth: true, 2284 center: true, 2285 useShrink: true, 2286 toBottom: false, 2287 useNativeSticky: false, 2288 always: false, 2289 prepare: true, 2290 onShow: false 2291 }, 2292 overlap: false, 2293 overlapIsActive: false 2294 }; // Parent Constructor 2295 2296 Colibri.apply(this, arguments); 2297 this.computeOverlapPaddingDelayed = jQuery.debounce(this.computeOverlapPadding.bind(this), 10); // Initialization 2298 2299 this.start(); 2300 }; 2301 2302 Component.prototype = { 2303 getStickyData: function getStickyData() { 2304 var animation = this.opts.sticky.animations; 2305 var duration = animation.duration; 2306 return $.extend(true, {}, this.opts.sticky, { 2307 animations: { 2308 allInAnimationsClasses: 'slideInDown fadeIn fade-animation-without-other-transitions h-global-transition-disable', 2309 allOutAnimationsClasses: 'slideOutDownNavigation fadeOut h-global-transition-disable', 2310 currentInAnimationClass: animations[animation.name]["in"], 2311 currentOutAnimationClass: animations[animation.name].out, 2312 duration: animation.name === 'none' ? 0 : duration * 1000 2313 } 2314 }); 2315 }, 2316 start: function start() { 2317 // console.error('this.opts.sticky->', this.opts.sticky); 2318 if (this.opts.sticky) { 2319 this.startSticky(this.getStickyData()); 2320 } 2321 2322 if (this.opts.overlap) { 2323 this.startOverlap(); 2324 } 2325 }, 2326 startOverlap: function startOverlap() { 2327 var self = this; 2328 var $target = this.$element.closest('.h-navigation_overlap'); //for backward compatibility reasons 2329 2330 if ($target.length === 0) { 2331 $target = this.$element; 2332 } 2333 2334 this.overlapTarget = $target.get(0); 2335 this.overlapIsActive = true; 2336 $(window).on('resize.overlap orientationchange.overlap', this.computeOverlapPaddingDelayed); 2337 window.addResizeListener(this.overlapTarget, this.computeOverlapPaddingDelayed); 2338 self.computeOverlapPadding(); 2339 }, 2340 stopOverlap: function stopOverlap() { 2341 this.overlapIsActive = false; 2342 2343 if (this.$sheet) { 2344 document.head.removeChild(this.$sheet); 2345 this.$sheet = null; 2346 } 2347 2348 $(window).off('.overlap'); 2349 window.removeResizeListener(this.overlapTarget, this.computeOverlapPaddingDelayed); 2350 }, 2351 computeOverlapPadding: function computeOverlapPadding() { 2352 if (!this.overlapIsActive) { 2353 return; 2354 } 2355 2356 if (!this.$sheet) { 2357 this.$sheet = document.createElement('style'); 2358 document.head.appendChild(this.$sheet); 2359 } 2360 2361 var paddingTop = this.overlapTarget.offsetHeight + 'px !important;'; 2362 this.$sheet.innerHTML = '.h-navigation-padding{padding-top:' + paddingTop + '}'; 2363 }, 2364 startSticky: function startSticky(data) { 2365 var self = this; 2366 this.$element.data('stickData', data); 2367 this.$element.fixTo('body', data); // console.warn('move ->', this.opts); 2368 2369 this.opts.sticky.prepare && this.prepareSticky(); 2370 this.$element.on('fixto-added.sticky', function () { 2371 self.$element.attr('data-in-sticky-state', true); 2372 }); 2373 this.$element.on('fixto-add.sticky', function () { 2374 self.clearResetTimeouts(); 2375 var navOuter = self.navigationWrapper(); 2376 navOuter.css('animation-duration', ''); 2377 navOuter.css('min-height', navOuter[0].offsetHeight); 2378 }); 2379 this.$element.on('fixto-removed.sticky', function () { 2380 self.$element.removeAttr('data-in-sticky-state'); 2381 self.resetParentHeight(); 2382 }); 2383 $(window).on('resize.sticky orientationchange.sticky', function () { 2384 setTimeout(self.resizeCallback.bind(self), 50); 2385 }); 2386 $(window).trigger('resize.sticky'); 2387 }, 2388 stopSticky: function stopSticky() { 2389 var instance = this.fixToInstance(); 2390 2391 if (instance) { 2392 // console.error('stop sticky', instance, this.$element); 2393 this.$element.off('.sticky'); 2394 instance.destroy(); 2395 $(window).off('.sticky'); 2396 this.$element.removeData('fixto-instance'); 2397 this.resetParentHeight(); 2398 } 2399 }, 2400 navigationWrapper: function navigationWrapper() { 2401 return this.$element.closest('[class*=navigation__outer]'); 2402 }, 2403 resetParentHeight: function resetParentHeight() { 2404 this.clearResetTimeouts(); 2405 var navOuter = this.navigationWrapper();
2406 var delay = parseFloat(this.$element.css('animation-duration')) * 1000; 2407 navOuter.css('animation-duration', '0s'); 2408 this.resetTimeoutHeight = setTimeout(function () { 2409 navOuter.css('min-height', ''); 2410 }, 1000); 2411 this.resetTimeoutAnimation = setTimeout(function () { 2412 navOuter.css('animation-duration', ''); 2413 }, delay + 50); 2414 }, 2415 clearResetTimeouts: function clearResetTimeouts() { 2416 clearTimeout(this.resetTimeoutHeight); 2417 clearTimeout(this.resetTimeoutAnimation); 2418 }, 2419 stop: function stop() { 2420 // console.error('stop sticky'); 2421 this.stopSticky(); 2422 this.stopOverlap(); 2423 }, 2424 prepareSticky: function prepareSticky() { 2425 var self = this; 2426 this.normal = this.$element.find('[data-nav-normal]'); 2427 this.sticky = this.$element.find('[data-nav-sticky]'); 2428 this.sticky.find('span[data-placeholder]').each(function () { 2429 $(this).parent().attr('data-placeholder', $(this).attr('data-placeholder')); 2430 $(this).remove(); 2431 }); 2432 2433 if (!this.sticky.length || !this.sticky.children().length) { 2434 return; 2435 } 2436 2437 this.$element.on('fixto-added.sticky', function () { 2438 self.moveElementsToSticky(); 2439 }); 2440 this.$element.on('fixto-removed.sticky', function () { 2441 self.moveElementsToNormal(); 2442 }); 2443 }, 2444 moveElementsToSticky: function moveElementsToSticky() { 2445 var stickyEls = this.sticky.find('[data-placeholder]'); 2446 var self = this; 2447 stickyEls.each(function (index, el) { 2448 $this = $(this); 2449 var type = $this.attr('data-placeholder'); 2450 var content = self.normal.find('[data-placeholder-provider=' + type + '] .h-column__content >'); 2451 var stickyEquiv = $this; 2452 2453 if (stickyEquiv && content.length) { 2454 $(stickyEquiv).append(content); 2455 } 2456 }); 2457 this.normal.hide(); 2458 this.sticky.show(); 2459 }, 2460 moveElementsToNormal: function moveElementsToNormal() { 2461 var stickyEls = this.sticky.find('[data-placeholder]'); 2462 var self = this; 2463 stickyEls.each(function (index, el) { 2464 $this = $(this); 2465 var type = $this.attr('data-placeholder'); 2466 var content = self.sticky.find('[data-placeholder=' + type + '] >'); 2467 var equiv = self.normal.find('[data-placeholder-provider=' + type + '] .h-column__content'); 2468 2469 if (equiv && content.length) { 2470 $(equiv).append(content); 2471 } 2472 }); 2473 this.normal.show(); 2474 this.sticky.hide(); 2475 }, 2476 fixToInstance: function fixToInstance() { 2477 var data = this.$element.data(); 2478 2479 if (data && data.fixtoInstance) { 2480 return data.fixtoInstance; 2481 } 2482 2483 return false; 2484 }, 2485 resizeCallback: function resizeCallback() { 2486 if (window.innerWidth < 1024) { 2487 var data = this.$element.data(); 2488 var stickData = data.stickData; 2489 2490 if (!stickData) { 2491 return; 2492 } 2493 2494 var fixToInstance = data.fixtoInstance; 2495 2496 if (!fixToInstance) { 2497 return true; 2498 } 2499 2500 if (window.innerWidth <= 767) { 2501 if (!stickData.stickyOnMobile) { 2502 fixToInstance.stop(); 2503 } 2504 } else if (!stickData.stickyOnTablet) { 2505 fixToInstance.stop(); 2506 } 2507 } else { 2508 var data = this.$element.data(); 2509 2510 if (!data) { 2511 return; 2512 } 2513 2514 var fixToInstance = data.fixtoInstance; 2515 2516 if (!fixToInstance) { 2517 return true; 2518 } 2519 2520 fixToInstance.refresh(); 2521 fixToInstance.start(); 2522 } 2523 } 2524 }; 2525 Component.inherits(Colibri); 2526 Colibri[className] = Component; 2527 Colibri.Plugin.create(className); 2528 Colibri.Plugin.autoload(className); 2529})(jQuery, Colibri); 2530 2531/***/ }), 2532
2533/***/ "./kubio-plugin/src/packages/block-library/src/navigation/frontend/overlap.js": 2534/*!************************************************************************************!*\ 2535 !*** ./kubio-plugin/src/packages/block-library/src/navigation/frontend/overlap.js ***! 2536 \************************************************************************************/ 2537/***/ (() => { 2538 2539(function ($, Colibri) { 2540 var className = 'overlap'; 2541 2542 var Component = function Component() { 2543 this.namespace = className; 2544 this.defaults = { 2545 data: {} 2546 }; // Parent Constructor 2547 2548 Colibri.apply(this, arguments); // Initialization 2549 2550 this.start(); 2551 }; 2552 2553 Component.prototype = { 2554 start: function start() { 2555 $(window).on('resize.overlap orientationchange.overlap', this.computePadding); 2556 this.overlapTarget = this.$element[0]; 2557 new ResizeObserver(this.computePadding).observe(this.overlapTarget); 2558 }, 2559 stop: function stop() { 2560 $(window).off('.overlap'); 2561 2562 if (this.$sheet) { 2563 document.head.removeChild(this.$sheet); 2564 this.$sheet = null; 2565 } 2566 }, 2567 computePadding: function computePadding(entries) { 2568 if (!entries || !entries[0] || !entries[0].target) { 2569 return; 2570 } 2571 2572 if (!this.$sheet) { 2573 this.$sheet = document.createElement('style'); 2574 document.head.appendChild(this.$sheet); 2575 } 2576 2577 var paddingTop = entries[0].target.offsetHeight + 'px !important;'; 2578 this.$sheet.innerHTML = '.h-navigation-padding{padding-top:' + paddingTop + '}'; 2579 }, 2580 resizeCallback: function resizeCallback() { 2581 this.computePadding(); 2582 } 2583 }; 2584 Component.inherits(Colibri); 2585 Colibri[className] = Component; 2586 Colibri.Plugin.create(className); 2587 Colibri.Plugin.autoload(className); 2588})(jQuery, Colibri); 2589 2590/***/ }), 2591
vendor: 4,096 bytes, lines 2592-2625
2592/***/ "./kubio-plugin/src/packages/scripts/src/background/slideshow/slideshow.js": 2593/*!*********************************************************************************!*\ 2594 !*** ./kubio-plugin/src/packages/scripts/src/background/slideshow/slideshow.js ***! 2595 \*********************************************************************************/ 2596/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 2597 2598"use strict"; 2599/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2600/* harmony export */ "default": () => (/* binding */ Slideshow) 2601/* harmony export */ }); 2602/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.debounce */ "./node_modules/lodash.debounce/index.js"); 2603/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_0__); 2604/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../base */ "./kubio-plugin/src/packages/scripts/src/base/index.js"); 2605function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 2606 2607function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 2608 2609function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 2610 2611function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 2612 2613function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 2614 2615function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 2616 2617function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 2618 2619function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } 2620 2621function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 2622 2623function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } 2624 2625function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); };
2625 return _getPrototypeOf(o); } 2626 2627 2628 2629 2630var Slideshow = /*#__PURE__*/function (_ColibriFrontComponen) { 2631 _inherits(Slideshow, _ColibriFrontComponen); 2632 2633 var _super = _createSuper(Slideshow); 2634 2635 function Slideshow() { 2636 _classCallCheck(this, Slideshow); 2637 2638 return _super.apply(this, arguments); 2639 } 2640 2641 _createClass(Slideshow, [{ 2642 key: "init", 2643 value: function init() { 2644 var _this = this; 2645 2646 this.currentIndex = 0; 2647 this.interval = -1; 2648 this.debouncedRestart = lodash_debounce__WEBPACK_IMPORTED_MODULE_0___default()(function () { 2649 _this.stop(); 2650 2651 _this.start(); 2652 }, 500); 2653 } 2654 }, { 2655 key: "addImageEffect", 2656 value: function addImageEffect(image, index) { 2657 var duration = this.opts.duration.replace('ms', ''); 2658 var speed = this.opts.speed.replace('ms', ''); 2659 var delay = parseInt(duration) - parseInt(speed); 2660 2661 if (delay < 0) { 2662 delay = 0; 2663 } 2664 2665 this.$(image).css({ 2666 transition: "opacity ".concat(speed, "ms ease ").concat(delay, "ms"), 2667 zIndex: this.$images.length - index 2668 }); 2669 } 2670 }, { 2671 key: "slideImage", 2672 value: function slideImage() { 2673 this.$images.eq(this.currentIndex).removeClass('current'); 2674 var nextIndex = this.currentIndex + 1 === this.$images.length ? 0 : this.currentIndex + 1; 2675 this.$images.eq(nextIndex).addClass('current').removeClass('next'); 2676 this.currentIndex = nextIndex; 2677 var futureIndex = this.currentIndex + 1 === this.$images.length ? 0 : this.currentIndex + 1; 2678 this.$images.eq(futureIndex).addClass('next'); 2679 } 2680 }, { 2681 key: "restart", 2682 value: function restart() { 2683 this.debouncedRestart(); 2684 } 2685 }, { 2686 key: "start", 2687 value: function start() { 2688 var _this2 = this; 2689 2690 this.$images = this.$element.find('.slideshow-image'); 2691 this.$images.removeClass('current'); 2692 2693 if (this.$images.length <= 1) { 2694 return; 2695 } 2696 2697 this.$images.eq(0).addClass('current'); 2698 this.currentIndex = 0; 2699 this.$images.each(function (index, image) { 2700 _this2.addImageEffect(image, index); 2701 }); 2702 this.interval = setInterval(function () { 2703 _this2.slideImage(); 2704 }, parseInt(this.opts.duration)); 2705 } 2706 }, { 2707 key: "stop", 2708 value: function stop() { 2709 clearInterval(this.interval); 2710 this.$images.css({ 2711 transition: '', 2712 opacity: '' 2713 }); 2714 this.$images.removeClass('current next'); 2715 this.$images.eq(0).addClass('current'); 2716 this.currentIndex = 0; 2717 } 2718 }], [{ 2719 key: "componentName", 2720 value: function componentName() { 2721 return 'slideshow'; 2722 } 2723 }]); 2724 2725 return Slideshow; 2726}(_base__WEBPACK_IMPORTED_MODULE_1__.ColibriFrontComponent); 2727 2728 2729 2730/***/ }), 2731
2732/***/ "./kubio-plugin/src/packages/scripts/src/background/video/handlers/base-handler.js": 2733/*!*****************************************************************************************!*\ 2734 !*** ./kubio-plugin/src/packages/scripts/src/background/video/handlers/base-handler.js ***! 2735 \*****************************************************************************************/ 2736/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 2737 2738"use strict"; 2739/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2740/* harmony export */ "default": () => (/* binding */ BaseHandler) 2741/* harmony export */ }); 2742function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 2743 2744function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 2745 2746function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 2747 2748var BaseHandler = /*#__PURE__*/function () { 2749 function BaseHandler(element, settings) { 2750 _classCallCheck(this, BaseHandler); 2751 2752 this.settings = settings; 2753 this.element = element; 2754 this.isPlaying = false; 2755 this.ready(); 2756 } 2757 2758 _createClass(BaseHandler, [{ 2759 key: "ready", 2760 value: function ready() {} 2761 }, { 2762 key: "play", 2763 value: function play() {} 2764 }, { 2765 key: "pause", 2766 value: function pause() {} 2767 }, { 2768 key: "isPaused", 2769 value: function isPaused() {} 2770 }, { 2771 key: "setVideo", 2772 value: function setVideo(node) { 2773 node.className = 'kubio-video-background-item'; 2774 this.element.innerHTML = ''; 2775 this.element.appendChild(node); 2776 this.addResizeBind(); 2777 } 2778 }, { 2779 key: "trigger", 2780 value: function trigger(name) { 2781 var evt; 2782 2783 if ('function' === typeof window.Event) { 2784 evt = new Event(name); 2785 } else { 2786 evt = document.createEvent('Event'); 2787 evt.initEvent(name, true, true); 2788 } 2789 2790 this.element.dispatchEvent(evt); 2791 } 2792 }, { 2793 key: "loaded", 2794 value: function loaded() { 2795 this.trigger('video-bg-loaded'); 2796 } 2797 }, { 2798 key: "addResizeBind", 2799 value: function addResizeBind() { 2800 var _this = this; 2801 2802 this.trigger('video-bg-resize'); 2803 this.onResize(function () { 2804 _this.trigger('video-bg-resize'); 2805 }); 2806 } 2807 }, { 2808 key: "onLoad", 2809 value: function onLoad(callback) { 2810 jQuery(this.element).on('video-bg-loaded', callback); 2811 } 2812 }, { 2813 key: "onResize", 2814 value: function onResize(callback) { 2815 var debounce = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100; 2816 callback = jQuery.debounce(callback, debounce); 2817 jQuery(window).resize(callback); 2818 jQuery(window).on('orientationchange', callback); 2819 } 2820 }], [{ 2821 key: "test", 2822 value: function test() { 2823 return false; 2824 } 2825 }]); 2826 2827 return BaseHandler; 2828}(); 2829 2830 2831 2832/***/ }), 2833
2834/***/ "./kubio-plugin/src/packages/scripts/src/background/video/handlers/handlers.js": 2835/*!*************************************************************************************!*\ 2836 !*** ./kubio-plugin/src/packages/scripts/src/background/video/handlers/handlers.js ***! 2837 \*************************************************************************************/ 2838/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 2839 2840"use strict"; 2841/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2842/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 2843/* harmony export */ }); 2844/* harmony import */ var _native_handler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./native-handler */ "./kubio-plugin/src/packages/scripts/src/background/video/handlers/native-handler.js"); 2845/* harmony import */ var _youtube_handler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./youtube-handler */ "./kubio-plugin/src/packages/scripts/src/background/video/handlers/youtube-handler.js"); 2846 2847 2848var Handlers = { 2849 "native": _native_handler__WEBPACK_IMPORTED_MODULE_0__["default"], 2850 youtube: _youtube_handler__WEBPACK_IMPORTED_MODULE_1__["default"] 2851}; 2852/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Handlers); 2853 2854/***/ }), 2855
vendor: 4,330 bytes, lines 2856-2906
2856/***/ "./kubio-plugin/src/packages/scripts/src/background/video/handlers/native-handler.js": 2857/*!*******************************************************************************************!*\ 2858 !*** ./kubio-plugin/src/packages/scripts/src/background/video/handlers/native-handler.js ***! 2859 \*******************************************************************************************/ 2860/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 2861 2862"use strict"; 2863/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2864/* harmony export */ "default": () => (/* binding */ NativeHandler) 2865/* harmony export */ }); 2866/* harmony import */ var _base_handler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base-handler */ "./kubio-plugin/src/packages/scripts/src/background/video/handlers/base-handler.js"); 2867function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 2868 2869function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 2870 2871function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 2872 2873function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 2874 2875function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 2876 2877function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 2878 2879function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 2880 2881function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } 2882 2883function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 2884 2885function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } 2886 2887function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 2888 2889 2890 2891var NativeHandler = /*#__PURE__*/function (_BaseHandler) { 2892 _inherits(NativeHandler, _BaseHandler); 2893 2894 var _super = _createSuper(NativeHandler); 2895 2896 function NativeHandler(element, settings) { 2897 var _this; 2898 2899 _classCallCheck(this, NativeHandler); 2900 2901 _this = _super.call(this, element, settings); 2902 return _possibleConstructorReturn(_this, _assertThisInitialized(_this)); 2903 } 2904 2905 _createClass(NativeHandler, [{ 2906 key: "isPaused",
2907 value: function isPaused() { 2908 return this.video.paused; 2909 } 2910 }, { 2911 key: "ready", 2912 value: function ready() { 2913 var _this2 = this; 2914 2915 if (this.settings.poster) { 2916 this.element.style.backgroundImage = "url(\"".concat(this.settings.poster, "\")"); 2917 } 2918 2919 if (!this.settings.videoUrl) { 2920 return; 2921 } 2922 2923 var video = document.createElement('video'); 2924 video.id = this.settings.id || ''; // video.autoplay = 'autoplay'; 2925 2926 video.loop = 'loop'; 2927 video.muted = 'muted'; 2928 video.autoplay = 'autoplay'; 2929 video.setAttribute('playsinline', true); 2930 2931 if (this.settings.width) { 2932 video.width = this.settings.width; 2933 } 2934 2935 if (this.settings.height) { 2936 video.height = this.settings.height; 2937 } 2938 2939 video.addEventListener('play', function () { 2940 _this2.trigger('play'); 2941 }); 2942 video.addEventListener('pause', function () { 2943 _this2.trigger('pause'); 2944 }); 2945 video.addEventListener('loadeddata', function () { 2946 _this2.loaded(); 2947 }); 2948 this.video = video; 2949 this.setVideo(video); 2950 video.src = this.settings.videoUrl; 2951 } 2952 }, { 2953 key: "pause", 2954 value: function pause() { 2955 this.video.pause(); 2956 } 2957 }, { 2958 key: "stopVideo", 2959 value: function stopVideo() { 2960 this.video.pause(); 2961 this.video.currentTime = 0; 2962 } 2963 }, { 2964 key: "play", 2965 value: function play() { 2966 this.video.play(); 2967 } 2968 }], [{ 2969 key: "test", 2970 value: function test(settings) { 2971 var video = document.createElement('video'); 2972 return video.canPlayType(settings.mimeType); 2973 } 2974 }]); 2975 2976 return NativeHandler; 2977}(_base_handler__WEBPACK_IMPORTED_MODULE_0__["default"]); 2978 2979 2980 2981/***/ }), 2982
vendor: 4,309 bytes, lines 2983-3017
2983/***/ "./kubio-plugin/src/packages/scripts/src/background/video/handlers/youtube-handler.js": 2984/*!********************************************************************************************!*\ 2985 !*** ./kubio-plugin/src/packages/scripts/src/background/video/handlers/youtube-handler.js ***! 2986 \********************************************************************************************/ 2987/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 2988 2989"use strict"; 2990/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2991/* harmony export */ "default": () => (/* binding */ YouTubeHandler) 2992/* harmony export */ }); 2993/* harmony import */ var _base_handler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base-handler */ "./kubio-plugin/src/packages/scripts/src/background/video/handlers/base-handler.js"); 2994function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 2995 2996function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 2997 2998function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 2999 3000function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 3001 3002function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } 3003 3004function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 3005 3006function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 3007 3008function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 3009 3010function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 3011 3012function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } 3013 3014function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 3015 3016function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } 3017
3018function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 3019 3020/** 3021 * @global 3022 */ 3023 3024var VIDEO_ID_REGEX = /^.*(?:(?:youtu\.be\/|v\/|vi\/|u\/\w\/|embed\/)|(?:(?:watch)?\?v(?:i)?=|&v(?:i)?=))([^#&?]*).*/; 3025 3026var YouTubeHandler = /*#__PURE__*/function (_BaseHandler) { 3027 _inherits(YouTubeHandler, _BaseHandler); 3028 3029 var _super = _createSuper(YouTubeHandler); 3030 3031 function YouTubeHandler(element, settings) { 3032 var _this; 3033 3034 _classCallCheck(this, YouTubeHandler); 3035 3036 _this = _super.call(this, element, settings); 3037 return _possibleConstructorReturn(_this, _assertThisInitialized(_this)); 3038 } 3039 3040 _createClass(YouTubeHandler, [{ 3041 key: "ready", 3042 value: function ready() { 3043 var _this2 = this; 3044 3045 if (this.settings.poster) { 3046 this.element.style.backgroundImage = "url(\"".concat(this.settings.poster, "\")"); 3047 } 3048 3049 if ('YT' in window) { 3050 window.YT.ready(function () { 3051 _this2.loadVideo(); 3052 }); 3053 } else { 3054 var tag = document.createElement('script'); 3055 tag.src = 'https://www.youtube.com/iframe_api'; 3056 3057 tag.onload = function () { 3058 window.YT.ready(function () { 3059 _this2.loadVideo(); 3060 }); 3061 }; 3062 3063 document.getElementsByTagName('head')[0].appendChild(tag); 3064 } 3065 } 3066 }, { 3067 key: "getVideoID", 3068 value: function getVideoID() { 3069 var matches = this.settings.videoUrl.match(VIDEO_ID_REGEX); 3070 3071 if (matches && matches.length >= 2) { 3072 return matches[1]; 3073 } 3074 3075 return null; 3076 } 3077 }, { 3078 key: "getYTOptions", 3079 value: function getYTOptions() { 3080 var _this3 = this; 3081 3082 var options = { 3083 videoId: this.getVideoID(), 3084 events: { 3085 onReady: function onReady(e) { 3086 var ytVideo = e.target; //added mute param, not sure if this mute function call is needed anymore. 3087 3088 ytVideo.mute(); 3089 top.yt1 = ytVideo; 3090 ytVideo.setPlaybackQuality('auto'); 3091 3092 _this3.play(); 3093 3094 _this3.loaded(); 3095 }, 3096 onStateChange: function onStateChange(e) { 3097 if (window.YT.PlayerState.PLAYING === e.data) { 3098 _this3.trigger('play'); 3099 } else if (window.YT.PlayerState.PAUSED === e.data) { 3100 _this3.trigger('pause'); 3101 } else if (window.YT.PlayerState.ENDED === e.data) { 3102 e.target.playVideo(); 3103 } 3104 }, 3105 onError: function onError(e) { 3106 _this3.player.getIframe().style.display = 'none'; 3107 } 3108 }, 3109 playerVars: { 3110 autoplay: 1, 3111 controls: 0, 3112 disablekb: 1, 3113 fs: 0, 3114 iv_load_policy: 3, 3115 loop: 1, 3116 modestbranding: 1, 3117 playsinline: 1, 3118 rel: 0, 3119 showinfo: 0, 3120 3121 /** 3122 * Sometimes the mute function used in the onRead event did not work, but using this options the videos are 3123 * always muted 3124 */ 3125 mute: 1 3126 } 3127 }; 3128 3129 if (this.settings.height) { 3130 options.height = this.settings.height; 3131 } else { 3132 options.height = 1080; 3133 } 3134 3135 if (this.settings.width) { 3136 options.width = this.settings.width; 3137 } else { 3138 options.width = 1920; 3139 } // height: this.settings.height, 3140 // width: this.settings.width, 3141 3142 3143 return options; 3144 } 3145 }, { 3146 key: "loadVideo", 3147 value: function loadVideo() { 3148 var video = document.createElement('div'), 3149 YT = window.YT; 3150 this.setVideo(video); 3151 this.player = new window.YT.Player(video, this.getYTOptions()); 3152 } 3153 }, { 3154 key: "updateVideoSize", 3155 value: function updateVideoSize() { 3156 if (!this.player) { 3157 return; 3158 } 3159 3160 var $iframe = jQuery(this.player.getIframe()), 3161 size = this.calcVideosSize(); 3162 $iframe.css(size); 3163 $iframe.addClass('ready'); 3164 } 3165 }, { 3166 key: "calcVideosSize", 3167 value: function calcVideosSize() { 3168 var width = jQuery(this.element).outerWidth(), 3169 height = jQuery(this.element).outerHeight(), 3170 aspectRatio = '16:9'.split(':'), 3171 proportion = aspectRatio[0] / aspectRatio[1], 3172 keepWidth = width / height > proportion, 3173 magnifier = 1; 3174 return { 3175 width: magnifier * (keepWidth ? width : height * proportion), 3176 height: magnifier * (keepWidth ? width / proportion : height) 3177 }; 3178 } 3179 }, { 3180 key: "play", 3181 value: function play() { 3182 if (!!this.player && !!this.player.playVideo) { 3183 if (!this.isPlaying) { 3184 this.isPlaying = true; 3185 this.player.playVideo(); 3186 } 3187 } 3188 } 3189 }, { 3190 key: "stopVideo", 3191 value: function stopVideo() { 3192 if (!!this.player && !!this.player.stopVideo) { 3193 if (this.isPlaying) { 3194 this.isPlaying = false;
3195 this.player.stopVideo(); 3196 } 3197 } 3198 } 3199 }, { 3200 key: "pause", 3201 value: function pause() { 3202 if (!!this.player && !!this.player.pauseVideo && !this.isPlaying) { 3203 this.isPlaying = false; 3204 this.player.pauseVideo(); 3205 } 3206 } 3207 }, { 3208 key: "isPaused", 3209 value: function isPaused() { 3210 return YT.PlayerState.PAUSED === this.player.getPlayerState(); 3211 } 3212 }, { 3213 key: "loaded", 3214 value: function loaded() { 3215 this.updateVideoSize(); 3216 3217 _get(_getPrototypeOf(YouTubeHandler.prototype), "loaded", this).call(this); 3218 } 3219 }, { 3220 key: "addResizeBind", 3221 value: function addResizeBind() { 3222 var _this4 = this; 3223 3224 this.onResize(function () { 3225 return _this4.updateVideoSize(); 3226 }, 50); 3227 3228 _get(_getPrototypeOf(YouTubeHandler.prototype), "addResizeBind", this).call(this); 3229 } 3230 }], [{ 3231 key: "test", 3232 value: function test(settings) { 3233 return 'video/x-youtube' === settings.mimeType; 3234 } 3235 }]); 3236 3237 return YouTubeHandler; 3238}(_base_handler__WEBPACK_IMPORTED_MODULE_0__["default"]); 3239 3240 3241 3242/***/ }), 3243
vendor: 4,123 bytes, lines 3244-3283
3244/***/ "./kubio-plugin/src/packages/scripts/src/background/video/video-bg.js": 3245/*!****************************************************************************!*\ 3246 !*** ./kubio-plugin/src/packages/scripts/src/background/video/video-bg.js ***! 3247 \****************************************************************************/ 3248/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 3249 3250"use strict"; 3251/* harmony export */ __webpack_require__.d(__webpack_exports__, { 3252/* harmony export */ "default": () => (/* binding */ VideoBackground) 3253/* harmony export */ }); 3254/* harmony import */ var _handlers_handlers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./handlers/handlers */ "./kubio-plugin/src/packages/scripts/src/background/video/handlers/handlers.js"); 3255/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../base */ "./kubio-plugin/src/packages/scripts/src/base/index.js"); 3256function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 3257 3258function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 3259 3260function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 3261 3262function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 3263 3264function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 3265 3266function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 3267 3268function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 3269 3270function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } 3271 3272function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 3273 3274function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } 3275 3276function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 3277 3278 3279 3280 3281var VideoBackground = /*#__PURE__*/function (_ColibriFrontComponen) { 3282 _inherits(VideoBackground, _ColibriFrontComponen); 3283
3284 var _super = _createSuper(VideoBackground); 3285 3286 function VideoBackground() { 3287 _classCallCheck(this, VideoBackground); 3288 3289 return _super.apply(this, arguments); 3290 } 3291 3292 _createClass(VideoBackground, [{ 3293 key: "init", 3294 value: function init() { 3295 var _this = this; 3296 3297 this.videoData = {}; 3298 this.handler = false; // eslint-disable-next-line no-undef 3299 3300 this.debouncedSetPosition = jQuery.debounce(this.updateVideoBackground.bind(this), 100); 3301 3302 this.resizeObserve = function (e) { 3303 _this.debouncedSetPosition(); 3304 }; 3305 3306 this.resizeObserver = new window.ResizeObserver(this.resizeObserve); 3307 } 3308 }, { 3309 key: "generateVideo", 3310 value: function generateVideo() { 3311 var _this2 = this; 3312 3313 for (var handle in _handlers_handlers__WEBPACK_IMPORTED_MODULE_0__["default"]) { 3314 if (_handlers_handlers__WEBPACK_IMPORTED_MODULE_0__["default"].hasOwnProperty(handle) && _handlers_handlers__WEBPACK_IMPORTED_MODULE_0__["default"][handle].test(this.videoData)) { 3315 this.$element.empty(); 3316 this.handler = new _handlers_handlers__WEBPACK_IMPORTED_MODULE_0__["default"][handle](this.$element[0], this.videoData); 3317 break; 3318 } 3319 } 3320 3321 if (!this.handler) { 3322 return; 3323 } 3324 3325 this.handler.onLoad(function () { 3326 // this.$element.children('iframe,video').addClass('h-hide-sm-force'); 3327 _this2.debouncedSetPosition(); 3328 3329 _this2.handler.onResize(function () { 3330 return _this2.debouncedSetPosition(); 3331 }); 3332 3333 _this2.resizeObserver.observe(_this2.handler.element); 3334 }); 3335 3336 if (window.hop) { 3337 window.addResizeListener(this.$element.closest('.background-wrapper').parent()[0], this.debouncedSetPosition); 3338 this.debouncedSetPosition(); 3339 } 3340 } 3341 }, { 3342 key: "stopVideo", 3343 value: function stopVideo() { 3344 if (this.handler.stopVideo) { 3345 this.handler.stopVideo(); 3346 } 3347 } 3348 }, { 3349 key: "play", 3350 value: function play() { 3351 if (this.handler.play) { 3352 this.handler.play(); 3353 } 3354 } 3355 }, { 3356 key: "updateVideoBackground", 3357 value: function updateVideoBackground() { 3358 if (this.handler.updateVideoSize) { 3359 this.handler.updateVideoSize(); 3360 } 3361 3362 this.setPosition(); 3363 } 3364 }, { 3365 key: "setPosition", 3366 value: function setPosition() { 3367 var _this3 = this; 3368 3369 this.handler.pause(); 3370 3371 if (this.$element.children('iframe,video').eq(0).css('display') === 'none') { 3372 return; 3373 } 3374 3375 var $video = this.$element.children('iframe,video').eq(0), 3376 posX = $video.is('iframe') ? 50 : this.opts.positionX, 3377 posY = $video.is('iframe') ? 50 : this.opts.positionY, 3378 x = Math.max($video.width() - this.$element.width(), 0) * parseFloat(posX) / 100, 3379 y = Math.max($video.height() - this.$element.height(), 0) * parseFloat(posY) / 100; 3380 $video.css({ 3381 transform: "translate(-".concat(x, "px,-").concat(y, "px)"), 3382 '-webkit-transform': "translate(-".concat(x, "px,-").concat(y, "px)") 3383 }); 3384 this.$element.addClass('visible'); 3385 setTimeout(function () { 3386 _this3.handler.play(); 3387 }, 100); 3388 } 3389 }, { 3390 key: "start", 3391 value: function start() { 3392 this.videoData = { 3393 mimeType: this.opts.mimeType, 3394 videoUrl: this.opts.video 3395 }; 3396 3397 if (typeof this.opts.poster === 'string') { 3398 this.poster = this.opts.poster; 3399 } 3400 3401 this.generateVideo(); 3402 } 3403 }, { 3404 key: "stop", 3405 value: function stop() { 3406 window.removeResizeListener(this.$element.closest('.background-wrapper').parent()[0], this.debouncedSetPosition); 3407 } 3408 }, { 3409 key: "restart", 3410 value: function restart() { 3411 this.stop(); 3412 this.start(); 3413 } 3414 }], [{ 3415 key: "componentName", 3416 value: function componentName() { 3417 return 'video-background'; 3418 } 3419 }]); 3420 3421 return VideoBackground; 3422}(_base__WEBPACK_IMPORTED_MODULE_1__.ColibriFrontComponent); 3423 3424 3425 3426/***/ }), 3427
3428/***/ "./kubio-plugin/src/packages/scripts/src/base/colibri-kube-component.js": 3429/*!******************************************************************************!*\ 3430 !*** ./kubio-plugin/src/packages/scripts/src/base/colibri-kube-component.js ***! 3431 \******************************************************************************/ 3432/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 3433 3434"use strict"; 3435/* harmony export */ __webpack_require__.d(__webpack_exports__, { 3436/* harmony export */ "default": () => (/* binding */ ColibriFrontComponent) 3437/* harmony export */ }); 3438/* harmony import */ var _colibri__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./colibri */ "./kubio-plugin/src/packages/scripts/src/base/colibri.js"); 3439function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 3440 3441function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 3442 3443function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 3444 3445 3446 3447var ColibriFrontComponent = /*#__PURE__*/function () { 3448 function ColibriFrontComponent(element, options) { 3449 _classCallCheck(this, ColibriFrontComponent); 3450 3451 this.$ = jQuery; 3452 this.namespace = this.constructor.componentName(); 3453 this.utils = new _colibri__WEBPACK_IMPORTED_MODULE_0__["default"].Utils(); 3454 this.detect = new _colibri__WEBPACK_IMPORTED_MODULE_0__["default"].Detect(); 3455 this.init(); 3456 _colibri__WEBPACK_IMPORTED_MODULE_0__["default"].apply(this, arguments); 3457 this.start(); 3458 3459 if (this.isCustomizerPreview()) { 3460 this.wpCustomize(wp.customize); 3461 } 3462 3463 return this; 3464 } 3465 3466 _createClass(ColibriFrontComponent, [{ 3467 key: "init", 3468 value: function init() {} 3469 }, { 3470 key: "isCustomizerPreview", 3471 value: function isCustomizerPreview() { 3472 return _colibri__WEBPACK_IMPORTED_MODULE_0__["default"].isCustomizerPreview(); 3473 } 3474 }, { 3475 key: "wpCustomize", 3476 value: function wpCustomize(api) {} 3477 }, { 3478 key: "wpSettingBind", 3479 value: function wpSettingBind(setting_id, callback) { 3480 window.wp.customize(setting_id, function (setting) { 3481 setting.bind(callback); 3482 }); 3483 } 3484 }, { 3485 key: "updateData", 3486 value: function updateData(data) { 3487 this.opts = jQuery.extend({}, this.opts, data); 3488 this.restart(); 3489 } 3490 }, { 3491 key: "restart", 3492 value: function restart() {} 3493 }, { 3494 key: "start", 3495 value: function start() {} 3496 }], [{ 3497 key: "componentName", 3498 value: function componentName() { 3499 throw new TypeError('name getter should be implemented'); 3500 } 3501 }]); 3502 3503 return ColibriFrontComponent; 3504}(); 3505 3506 3507 3508/***/ }), 3509
3510/***/ "./kubio-plugin/src/packages/scripts/src/base/colibri.js": 3511/*!***************************************************************!*\ 3512 !*** ./kubio-plugin/src/packages/scripts/src/base/colibri.js ***! 3513 \***************************************************************/ 3514/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 3515 3516"use strict"; 3517/* harmony export */ __webpack_require__.d(__webpack_exports__, { 3518/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 3519/* harmony export */ }); 3520function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 3521 3522function ColibriBase() { 3523 var $ = jQuery; 3524 3525 if (typeof jQuery === 'undefined') { 3526 throw new Error('Colibri requires jQuery'); 3527 } 3528 3529 (function () { 3530 var version = $.fn.jquery.split('.'); 3531 3532 if (version[0] === 1 && version[1] < 8) { 3533 throw new Error('Colibri requires at least jQuery v1.8'); 3534 } 3535 })(); 3536 3537 function debounce(func) { 3538 var _this = this; 3539 3540 var timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300; 3541 var timer; 3542 return function () { 3543 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 3544 args[_key] = arguments[_key]; 3545 } 3546 3547 clearTimeout(timer); 3548 timer = setTimeout(function () { 3549 func.apply(_this, args); 3550 }, timeout); 3551 }; 3552 } 3553 3554 var Colibri; 3555 var libName = 'kubio'; 3556 var libPrefix = libName + '.'; 3557 var settingsAttr = libName + '-settings'; 3558 3559 (function () { 3560 // Inherits 3561 Function.prototype.inherits = function (parent) { 3562 var F = function F() {}; 3563 3564 F.prototype = parent.prototype; 3565 var f = new F(); 3566 3567 for (var prop in this.prototype) { 3568 f[prop] = this.prototype[prop]; 3569 } 3570 3571 this.prototype = f; 3572 this.prototype["super"] = parent.prototype; 3573 }; // Core Class 3574 3575 3576 Colibri = function Colibri(element, options) { 3577 options = _typeof(options) === 'object' ? options : {}; 3578 this.$element = $(element); 3579 var elementData = this.$element.data(); 3580 this.settings = this.$element.data(settingsAttr) || {}; 3581 this.opts = $.extend(true, {}, this.defaults, $.fn[libPrefix + this.namespace].options, elementData, this.settings, options); 3582 this.$target = typeof this.opts.target === 'string' ? $(this.opts.target) : null; 3583 }; 3584 3585 Colibri.getScrollingElement = function () { 3586 var element = window; 3587 3588 if (this.isBlockEditor() && top === window) { 3589 element = document.querySelector('.interface-interface-skeleton__content'); 3590 } 3591 3592 return element; 3593 }; 3594 3595 Colibri.isCustomizerPreview = function () { 3596 return !!window.colibriCustomizerPreviewData; 3597 }; 3598 3599 Colibri.isBlockEditor = function () { 3600 var _top, _top$wp, _top2, _top2$kubio; 3601 3602 //the block library is added because of this https://mantis.iconvert.pro/view.php?id=54821. Some hosting providers add the blockEditor package in the frontend 3603 return !!((_top = top) !== null && _top !== void 0 && (_top$wp = _top.wp) !== null && _top$wp !== void 0 && _top$wp.blockEditor) && ((_top2 = top) === null || _top2 === void 0 ? void 0 : (_top2$kubio = _top2.kubio) === null || _top2$kubio === void 0 ? void 0 : _top2$kubio.blockLibrary); 3604 }; // Core Functionality 3605 3606 3607 Colibri.prototype = { 3608 updateOpts: function updateOpts(updatedData) { 3609 var newSetting = this.$element.attr('data-' + settingsAttr); 3610 3611 if (newSetting) { 3612 this.settings = JSON.parse(newSetting); 3613 } 3614 3615 var instanceData = $.extend(true, {}, this.defaults, this.settings); 3616 var updatedDataWithDefault = updatedData ? updatedData : {}; 3617 this.opts = $.extend(true, this.opts, instanceData, updatedDataWithDefault); 3618 }, 3619 getInstance: function getInstance() { 3620 return this.$element.data('fn.' + this.namespace); 3621 }, 3622 hasTarget: function hasTarget() { 3623 return !(this.$target === null); 3624 }, 3625 callback: function callback(type) { 3626 var args = [].slice.call(arguments).splice(1); // on element callback 3627 3628 if (this.$element) { 3629 args = this._fireCallback($._data(this.$element[0], 'events'), type, this.namespace, args); 3630 } // on target callback 3631 3632 3633 if (this.$target) { 3634 args = this._fireCallback($._data(this.$target[0], 'events'), type, this.namespace, args); 3635 } // opts callback 3636 3637 3638 if (this.opts && this.opts.callbacks && typeof this.opts.callbacks[type] === 'function') { 3639 return this.opts.callbacks[type].apply(this, args); 3640 } 3641 3642 return args; 3643 }, 3644 _fireCallback: function _fireCallback(events, type, eventNamespace, args) { 3645 var value; 3646 3647 if (events && typeof events[type] !== 'undefined') { 3648 var len = events[type].length; 3649 3650 for (var i = 0; i < len; i++) { 3651 var namespace = events[type][i].namespace; 3652 3653 if (namespace === eventNamespace) { 3654 value = events[type][i].handler.apply(this, args); 3655 } 3656 } 3657 } 3658 3659 return typeof value === 'undefined' ? args : value; 3660 } 3661 }; 3662 })(); 3663 3664 (function (Colibri_) { 3665 Colibri_.Plugin = { 3666 create: function create(classname, pluginname) { 3667 pluginname = typeof pluginname === 'undefined' ? classname.toLowerCase() : pluginname; 3668 pluginname = libPrefix + pluginname; 3669 3670 $.fn[pluginname] = function (method, options) { 3671 var args = Array.prototype.slice.call(arguments, 1); 3672 var name = 'fn.' + pluginname; 3673 var val = []; 3674 this.each(function () { 3675 var $this = $(this); 3676 var data = $this.data(name); 3677 options = _typeof(method) === 'object' ? method : options; 3678 3679 if (!data) { 3680 // Initialization 3681 $this.data(name, {}); 3682 data = new Colibri_[classname](this, options); 3683 $this.data(name, data); 3684 } // Call methods 3685 3686 3687 if (typeof method === 'string') { 3688 if ($.isFunction(data[method])) { 3689 var methodVal = data[method].apply(data, args); 3690 3691 if (methodVal !== undefined) { 3692 val.push(methodVal); 3693 } 3694 } else { 3695 $.error('No such method "' + method + '" for ' + classname); 3696 } 3697 } 3698 }); // eslint-disable-next-line no-nested-ternary 3699 3700 return val.length === 0 || val.length === 1 ? val.length === 0 ? this
3700: val[0] : val; 3701 }; 3702 3703 $.fn[pluginname].options = {}; 3704 return this; 3705 }, 3706 autoload: function autoload(pluginname) { 3707 var arr = pluginname.split(','); 3708 var len = arr.length; 3709 3710 for (var i = 0; i < len; i++) { 3711 var name = arr[i].toLowerCase().split(',').map(function (s) { 3712 return libPrefix + s.trim(); 3713 }).join(','); 3714 this.autoloadQueue.push(name); 3715 } 3716 3717 return this; 3718 }, 3719 autoloadQueue: [], 3720 startAutoload: function startAutoload() { 3721 if (!window.MutationObserver || this.autoloadQueue.length === 0) { 3722 return; 3723 } 3724 3725 if (this.observer) { 3726 this.observer.disconnect(); 3727 } 3728 3729 var self = this; 3730 var observer = new MutationObserver(function (mutations) { 3731 mutations.forEach(function (mutation) { 3732 var newNodes = mutation.addedNodes; 3733 3734 if (newNodes.length === 0 || newNodes.length === 1 && newNodes[0].nodeType === 3) { 3735 return; 3736 } 3737 3738 self.startAutoloadOnceDebounced(); 3739 }); 3740 }); 3741 this.observer = observer; // pass in the target node, as well as the observer options 3742 3743 var observedElement = document.querySelector('.editor-styles-wrapper .is-root-container.block-editor-block-list__layout'); 3744 3745 if (!observedElement) { 3746 observedElement = document; 3747 } 3748 3749 observer.observe(observedElement, { 3750 subtree: true, 3751 childList: true 3752 }); 3753 }, 3754 startAutoloadOnceDebounced: debounce(function () { 3755 Colibri.Plugin.startAutoloadOnce(); 3756 }, 300), 3757 startAutoloadOnce: function startAutoloadOnce() { 3758 var self = this; 3759 var attrName = libName + '-component'; 3760 var $nodes = $('[data-' + attrName + ']:not([data-loaded]):not([data-disabled])'); 3761 $nodes.each(function () { 3762 var $el = $(this); 3763 var pluginname = libPrefix + $el.data(attrName); 3764 3765 if (self.autoloadQueue.indexOf(pluginname) !== -1) { 3766 $el.attr('data-loaded', true); 3767 3768 try { 3769 $el[pluginname](); 3770 } catch (e) { 3771 // eslint-disable-next-line no-console 3772 console.error(e); 3773 } 3774 } 3775 }); 3776 }, 3777 stopWatcher: function stopWatcher() { 3778 var _this$observer, _this$observer$discon; 3779 3780 (_this$observer = this.observer) === null || _this$observer === void 0 ? void 0 : (_this$observer$discon = _this$observer.disconnect) === null || _this$observer$discon === void 0 ? void 0 : _this$observer$discon.call(_this$observer); 3781 }, 3782 watch: function watch() { 3783 Colibri_.Plugin.startAutoloadOnce(); 3784 Colibri_.Plugin.startAutoload(); 3785 }, 3786 init: function init() { 3787 if (window.isKubioBlockEditor && !window.isInsideIframe) { 3788 return; 3789 } 3790 3791 if ($.isReady) { 3792 Colibri_.Plugin.watch(); 3793 } else { 3794 $(document).ready(Colibri_.Plugin.watch); 3795 } 3796 } 3797 }; 3798 Colibri_.Plugin.init(); 3799 })(Colibri); 3800 3801 (function (Colibri_) { 3802 Colibri_.Animation = function (element, effect, callback) { 3803 this.namespace = 'animation'; 3804 this.defaults = {}; // Parent Constructor 3805 3806 Colibri_.apply(this, arguments); // Initialization 3807 3808 this.effect = effect; 3809 this.completeCallback = typeof callback === 'undefined' ? false : callback; 3810 this.prefixes = ['', '-moz-', '-o-animation-', '-webkit-']; 3811 this.queue = []; 3812 this.start(); 3813 }; 3814 3815 Colibri_.Animation.prototype = { 3816 start: function start() { 3817 if (this.isSlideEffect()) { 3818 this.setElementHeight(); 3819 } 3820 3821 this.addToQueue(); 3822 this.clean(); 3823 this.animate(); 3824 }, 3825 addToQueue: function addToQueue() { 3826 this.queue.push(this.effect); 3827 }, 3828 setElementHeight: function setElementHeight() { 3829 this.$element.height(this.$element.outerHeight()); 3830 }, 3831 removeElementHeight: function removeElementHeight() { 3832 this.$element.css('height', ''); 3833 },
3834 isSlideEffect: function isSlideEffect() { 3835 return this.effect === 'slideDown' || this.effect === 'slideUp'; 3836 }, 3837 isHideableEffect: function isHideableEffect() { 3838 var effects = ['fadeOut', 'slideUp', 'flipOut', 'zoomOut', 'slideOutUp', 'slideOutRight', 'slideOutLeft']; 3839 return $.inArray(this.effect, effects) !== -1; 3840 }, 3841 isToggleEffect: function isToggleEffect() { 3842 return this.effect === 'show' || this.effect === 'hide'; 3843 }, 3844 storeHideClasses: function storeHideClasses() { 3845 if (this.$element.hasClass('hide-sm')) { 3846 this.$element.data('hide-sm-class', true); 3847 } else if (this.$element.hasClass('hide-md')) { 3848 this.$element.data('hide-md-class', true); 3849 } 3850 }, 3851 revertHideClasses: function revertHideClasses() { 3852 if (this.$element.data('hide-sm-class')) { 3853 this.$element.addClass('hide-sm').removeData('hide-sm-class'); 3854 } else if (this.$element.data('hide-md-class')) { 3855 this.$element.addClass('hide-md').removeData('hide-md-class'); 3856 } else { 3857 this.$element.addClass('hide'); 3858 } 3859 }, 3860 removeHideClass: function removeHideClass() { 3861 if (this.$element.data('hide-sm-class')) { 3862 this.$element.removeClass('hide-sm'); 3863 } else if (this.$element.data('hide-md-class')) { 3864 this.$element.removeClass('hide-md'); 3865 } else { 3866 this.$element.removeClass('hide'); 3867 this.$element.removeClass('force-hide'); 3868 } 3869 }, 3870 animate: function animate() { 3871 this.storeHideClasses(); 3872 3873 if (this.isToggleEffect()) { 3874 return this.makeSimpleEffects(); 3875 } 3876 3877 this.$element.addClass('kubio-animated'); 3878 this.$element.addClass(this.queue[0]); 3879 this.removeHideClass(); 3880 3881 var _callback = this.queue.length > 1 ? null : this.completeCallback; 3882 3883 this.complete('AnimationEnd', $.proxy(this.makeComplete, this), _callback); 3884 }, 3885 makeSimpleEffects: function makeSimpleEffects() { 3886 if (this.effect === 'show') { 3887 this.removeHideClass(); 3888 } else if (this.effect === 'hide') { 3889 this.revertHideClasses(); 3890 } 3891 3892 if (typeof this.completeCallback === 'function') { 3893 this.completeCallback(this); 3894 } 3895 }, 3896 makeComplete: function makeComplete() { 3897 if (this.$element.hasClass(this.queue[0])) { 3898 this.clean(); 3899 this.queue.shift(); 3900 3901 if (this.queue.length) { 3902 this.animate(); 3903 } 3904 } 3905 }, 3906 complete: function complete(type, make, callback) { 3907 var events = type.split(' ').map(function (type_) { 3908 return type_.toLowerCase() + ' webkit' + type_ + ' o' + type_ + ' MS' + type_; 3909 }); 3910 this.$element.one(events.join(' '), $.proxy(function () { 3911 if (typeof make === 'function') { 3912 make(); 3913 } 3914 3915 if (this.isHideableEffect()) { 3916 this.revertHideClasses(); 3917 } 3918 3919 if (this.isSlideEffect()) { 3920 this.removeElementHeight(); 3921 } 3922 3923 if (typeof callback === 'function') { 3924 callback(this); 3925 } 3926 3927 this.$element.off(events.join(' ')); 3928 }, this)); 3929 }, 3930 clean: function clean() { 3931 this.$element.removeClass('kubio-animated').removeClass(this.queue[0]); 3932 } 3933 }; // Inheritance 3934 3935 Colibri_.Animation.inherits(Colibri_); 3936 })(Colibri); 3937 3938 (function () { 3939 var animationName = libPrefix + 'animation'; 3940 3941 $.fn[animationName] = function (effect, callback) { 3942 var name = 'fn.animation'; 3943 return this.each(function () { 3944 var $this = $(this); 3945 $this.data(name, {}); 3946 $this.data(name, new Colibri.Animation(this, effect, callback)); 3947 }); 3948 }; 3949 3950 $.fn[animationName].options = {}; 3951 3952 Colibri.animate = function ($target, effect, callback) { 3953 $target[animationName](effect, callback); 3954 return $target; 3955 }; 3956 })(); 3957 3958 (function (Colibri_) { 3959 Colibri_.Detect = function () {}; 3960 3961 Colibri_.Detect.prototype = { 3962 isMobile: function isMobile() { 3963 return /(iPhone|iPod|BlackBerry|Android)/.test(navigator.userAgent); 3964 }, 3965 isDesktop: function isDesktop() { 3966 return !/(iPhone|iPod|iPad|BlackBerry|Android)/.test(navigator.userAgent); 3967 }, 3968 isMobileScreen: function isMobileScreen() { 3969 return $(window).width() <= 768; 3970 }, 3971 isTabletScreen: function isTabletScreen() { 3972 return $(window).width() >= 768 && $(window).width() <= 1024; 3973 }, 3974 isDesktopScreen: function isDesktopScreen() { 3975 return $(window).width() > 1024; 3976 } 3977 }; 3978 })(Colibri); 3979 3980 (function (Colibri_) { 3981 Colibri_.Utils = function () {}; 3982 3983 Colibri_.Utils.prototype = { 3984 disableBodyScroll: function disableBodyScroll() { 3985 var $body = $('html'); 3986 var windowWidth = window.innerWidth; 3987 3988 if (!windowWidth) { 3989 var documentElementRect = document.documentElement.getBoundingClientRect(); 3990 windowWidth = documentElementRect.right - Math.abs(documentElementRect.left); 3991 } 3992 3993 var isOverflowing = document.body.clientWidth < windowWidth; 3994 var scrollbarWidth = this.measureScrollbar(); 3995 $body.css('overflow', 'hidden'); 3996 3997 if (isOverflowing) { 3998 $body.css('padding-right', scrollbarWidth); 3999 } 4000 }, 4001 measureScrollbar: function measureScrollbar() { 4002 var $body = $('body'); 4003 var scrollDiv = document.createElement('div'); 4004 scrollDiv.className = 'scrollbar-measure'; 4005 $body.append(scrollDiv); 4006 var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth; 4007 $body[0].removeChild(scrollDiv); 4008 return scrollbarWidth; 4009 }, 4010 enableBodyScroll: function enableBodyScroll() { 4011 $('html').css({ 4012 overflow: '', 4013 'padding-right': '' 4014 }); 4015 } 4016 }; 4017 })(Colibri); 4018 4019 return Colibri; 4020} 4021 4022var Base = ColibriBase(); 4023window.Colibri = Base; 4024/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Base); 4025 4026/***/ }), 4027
4028/***/ "./kubio-plugin/src/packages/scripts/src/base/index.js": 4029/*!*************************************************************!*\ 4030 !*** ./kubio-plugin/src/packages/scripts/src/base/index.js ***! 4031 \*************************************************************/ 4032/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 4033 4034"use strict"; 4035/* harmony export */ __webpack_require__.d(__webpack_exports__, { 4036/* harmony export */ "ColibriFrontend": () => (/* reexport safe */ _colibri__WEBPACK_IMPORTED_MODULE_0__["default"]), 4037/* harmony export */ "ColibriFrontComponent": () => (/* reexport safe */ _colibri_kube_component__WEBPACK_IMPORTED_MODULE_1__["default"]) 4038/* harmony export */ }); 4039/* harmony import */ var _colibri__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./colibri */ "./kubio-plugin/src/packages/scripts/src/base/colibri.js"); 4040/* harmony import */ var _colibri_kube_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./colibri-kube-component */ "./kubio-plugin/src/packages/scripts/src/base/colibri-kube-component.js"); 4041 4042 4043 4044_colibri__WEBPACK_IMPORTED_MODULE_0__["default"].registerPlugin = function (name, plugin, autoload) { 4045 if (typeof name.componentName === 'function') { 4046 autoload = plugin; 4047 plugin = name; 4048 name = plugin.componentName(); 4049 } 4050 4051 _colibri__WEBPACK_IMPORTED_MODULE_0__["default"][name] = plugin; // Colibri[name].inherits(Colibri); 4052 4053 _colibri__WEBPACK_IMPORTED_MODULE_0__["default"].Plugin.create(name); 4054 4055 if (autoload !== false) { 4056 _colibri__WEBPACK_IMPORTED_MODULE_0__["default"].Plugin.autoload(name); 4057 } 4058}; 4059 4060 4061 4062/***/ }), 4063
4064/***/ "./kubio-plugin/src/packages/scripts/src/detect-element-resize.js": 4065/*!************************************************************************!*\ 4066 !*** ./kubio-plugin/src/packages/scripts/src/detect-element-resize.js ***! 4067 \************************************************************************/ 4068/***/ (() => { 4069 4070/** 4071 * Detect Element Resize 4072 * 4073 * https://github.com/sdecima/javascript-detect-element-resize 4074 * Sebastian Decima 4075 * 4076 * version: 0.5.3 4077 */ 4078var attachEvent = document.attachEvent, 4079 stylesCreated = false; 4080 4081function resetTriggers(element) { 4082 var triggers = element.__resizeTriggers__, 4083 expand = triggers.firstElementChild, 4084 contract = triggers.lastElementChild, 4085 expandChild = expand.firstElementChild; 4086 contract.scrollLeft = contract.scrollWidth; 4087 contract.scrollTop = contract.scrollHeight; 4088 expandChild.style.width = expand.offsetWidth + 1 + 'px'; 4089 expandChild.style.height = expand.offsetHeight + 1 + 'px'; 4090 expand.scrollLeft = expand.scrollWidth; 4091 expand.scrollTop = expand.scrollHeight; 4092} 4093 4094function checkTriggers(element) { 4095 return element.offsetWidth != element.__resizeLast__.width || element.offsetHeight != element.__resizeLast__.height; 4096} 4097 4098function scrollListener(e) { 4099 var element = this; 4100 resetTriggers(this); 4101 4102 if (this.__resizeRAF__) { 4103 cancelFrame(this.__resizeRAF__); 4104 } 4105 4106 this.__resizeRAF__ = requestFrame(function () { 4107 if (checkTriggers(element)) { 4108 element.__resizeLast__.width = element.offsetWidth; 4109 element.__resizeLast__.height = element.offsetHeight; 4110 4111 element.__resizeListeners__.forEach(function (fn) { 4112 fn.call(element, e); 4113 }); 4114 } 4115 }); 4116} 4117 4118if (!attachEvent) { 4119 var requestFrame = function () { 4120 var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || function (fn) { 4121 return window.setTimeout(fn, 20); 4122 }; 4123 4124 return function (fn) { 4125 return raf(fn); 4126 }; 4127 }(); 4128 4129 var cancelFrame = function () { 4130 var cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.clearTimeout; 4131 return function (id) { 4132 return cancel(id); 4133 }; 4134 }(); 4135 /* Detect CSS Animations support to detect element display/re-attach */ 4136 4137 4138 var animation = false, 4139 animationstring = 'animation', 4140 keyframeprefix = '', 4141 animationstartevent = 'animationstart', 4142 domPrefixes = 'Webkit Moz O ms'.split(' '), 4143 startEvents = 'webkitAnimationStart animationstart oAnimationStart MSAnimationStart'.split(' '), 4144 pfx = ''; 4145 { 4146 var elm = document.createElement('fakeelement'); 4147 4148 if (elm.style.animationName !== undefined) { 4149 animation = true; 4150 } 4151 4152 if (animation === false) { 4153 for (var i = 0; i < domPrefixes.length; i++) { 4154 if (elm.style[domPrefixes[i] + 'AnimationName'] !== undefined) { 4155 pfx = domPrefixes[i]; 4156 animationstring = pfx + 'Animation'; 4157 keyframeprefix = '-' + pfx.toLowerCase() + '-'; 4158 animationstartevent = startEvents[i]; 4159 animation = true; 4160 break; 4161 } 4162 } 4163 } 4164 } 4165 var animationName = 'resizeanim'; 4166 var animationKeyframes = '@' + keyframeprefix + 'keyframes ' + animationName + ' { from { opacity: 0; } to { opacity: 0; } } '; 4167 var animationStyle = keyframeprefix + 'animation: 1ms ' + animationName + '; '; 4168} 4169 4170function createStyles() { 4171 if (!stylesCreated) { 4172 //opacity:0 works around a chrome bug https://code.google.com/p/chromium/issues/detail?id=286360 4173 var css = (animationKeyframes ? animationKeyframes : '') + '.resize-triggers { ' + (animationStyle ? animationStyle : '') + 'visibility: hidden; opacity: 0; } ' + '.resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', 4174 head = document.head || document.getElementsByTagName('head')[0], 4175 style = document.createElement('style'); 4176 style.type = 'text/css'; 4177 4178 if (style.styleSheet) { 4179 style.styleSheet.cssText = css; 4180 } else { 4181 style.appendChild(document.createTextNode(css)); 4182 } 4183 4184 head.appendChild(style); 4185 stylesCreated = true; 4186 } 4187} 4188 4189window.addResizeListener = function (element, fn) { 4190 if (attachEvent) { 4191 element.attachEvent('onresize', fn); 4192 } else { 4193 if (!element.__resizeTriggers__) { 4194 if (getComputedStyle(element).position == 'static') { 4195 element.style.position = 'relative'; 4196 } 4197 4198 createStyles(); 4199 element.__resizeLast__ = {}; 4200 element.__resizeListeners__ = []; 4201 (element.__resizeTriggers__ = document.createElement('div')).className = 'resize-triggers'; 4202 element.__resizeTriggers__.innerHTML = '<div class="expand-trigger"><div></div></div>' + '<div class="contract-trigger"></div>'; 4203 element.appendChild(element.__resizeTriggers__); 4204 resetTriggers(element); 4205 element.addEventListener('scroll', scrollListener, { 4206 passive: true 4207 }); 4208 /* Listen for a css animation to detect element display/re-attach */ 4209 4210 if (animationstartevent) { 4211 element.__resizeTriggers__.addEventListener(animationstartevent, function (e) { 4212 if (e.animationName == animationName) { 4213 resetTriggers(element); 4214 } 4215 }); 4216 } 4217 } 4218 4219 element.__resizeListeners__.push(fn); 4220 } 4221}; 4222 4223window.removeResizeListener = function (element, fn) { 4224 if (attachEvent) { 4225 element.detachEvent('onresize', fn); 4226 } else { 4227 if (!(element && element.__resizeListeners__ && element.__resizeTriggers__)) { 4228 return; 4229 } 4230 4231 element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1); 4232 4233 if (!element.__resizeListeners__.length) { 4234 element.removeEventListener('scroll', scrollListener); 4235 element.__resizeTriggers__ = !element.removeChild(element.__resizeTriggers__); 4236 } 4237 } 4238}; 4239 4240/***/ }), 4241
4242/***/ "./kubio-plugin/src/packages/scripts/src/jquery-extensions.js": 4243/*!********************************************************************!*\ 4244 !*** ./kubio-plugin/src/packages/scripts/src/jquery-extensions.js ***! 4245 \********************************************************************/ 4246/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => { 4247 4248"use strict"; 4249/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.debounce */ "./node_modules/lodash.debounce/index.js"); 4250/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_0__); 4251 4252 4253(function ($) { 4254 if (!$.throttle) { 4255 $.throttle = function (fn, threshhold, scope) { 4256 threshhold || (threshhold = 250); 4257 var last, deferTimer; 4258 return function () { 4259 var context = scope || this; 4260 var now = +new Date(), 4261 args = arguments; 4262 4263 if (last && now < last + threshhold) { 4264 // hold on to it 4265 clearTimeout(deferTimer); 4266 deferTimer = setTimeout(function () { 4267 last = now; 4268 fn.apply(context, args); 4269 }, threshhold); 4270 } else { 4271 last = now; 4272 fn.apply(context, args); 4273 } 4274 }; 4275 }; 4276 } 4277 4278 if (!$.debounce) { 4279 $.debounce = (lodash_debounce__WEBPACK_IMPORTED_MODULE_0___default()); // $.debounce = function(func, wait, immediate) { 4280 // var timeout; 4281 // return function() { 4282 // var context = this, 4283 // args = arguments; 4284 // var later = function() { 4285 // timeout = null; 4286 // if (!immediate) { 4287 // func.apply(context, args); 4288 // } 4289 // }; 4290 // var callNow = immediate && !timeout; 4291 // clearTimeout(timeout); 4292 // timeout = setTimeout(later, wait); 4293 // if (callNow) { 4294 // func.apply(context, args); 4295 // } 4296 // }; 4297 // }; 4298 } 4299 4300 if (!$.event.special.tap) { 4301 $.event.special.tap = { 4302 setup: function setup(data, namespaces) { 4303 var $elem = $(this); 4304 $elem.on('touchstart', $.event.special.tap.handler).on('touchmove', $.event.special.tap.handler).on('touchend', $.event.special.tap.handler); 4305 }, 4306 teardown: function teardown(namespaces) { 4307 var $elem = $(this); 4308 $elem.off('touchstart', $.event.special.tap.handler).off('touchmove', $.event.special.tap.handler).off('touchend', $.event.special.tap.handler); 4309 }, 4310 handler: function handler(event) { 4311 var $elem = $(this); 4312 $elem.data(event.type, 1); 4313 4314 if (event.type === 'touchend' && !$elem.data('touchmove')) { 4315 event.type = 'tap'; 4316 $.event.dispatch.call(this, event); 4317 } else if ($elem.data('touchend')) { 4318 $elem.removeData('touchstart touchmove touchend'); 4319 } 4320 } 4321 }; 4322 } //is not supported on ie 4323 4324 4325 if (!$.fn.respondToVisibility) { 4326 $.fn.respondToVisibility = function (callback) { 4327 //check for ie 4328 if (!('IntersectionObserver' in window) || !('IntersectionObserverEntry' in window) || !('intersectionRatio' in window.IntersectionObserverEntry.prototype)) { 4329 return null; 4330 } 4331 4332 var observer = new IntersectionObserver(function (entries, observer) { 4333 entries.forEach(function (entry) { 4334 callback(entry.intersectionRatio > 0); 4335 }); 4336 }); 4337 observer.observe(this.get(0)); 4338 return observer; 4339 }; 4340 } 4341})(window.jQuery); 4342 4343/***/ }), 4344
4345/***/ "./kubio-plugin/src/packages/scripts/src/kubio-smoothscroll.js": 4346/*!*********************************************************************!*\ 4347 !*** ./kubio-plugin/src/packages/scripts/src/kubio-smoothscroll.js ***! 4348 \*********************************************************************/ 4349/***/ (() => { 4350 4351var linksDefineSamePage = function linksDefineSamePage(link1, link2) { 4352 var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, 4353 _ref$compareQuery = _ref.compareQuery, 4354 compareQuery = _ref$compareQuery === void 0 ? false : _ref$compareQuery, 4355 _ref$compareHash = _ref.compareHash, 4356 compareHash = _ref$compareHash === void 0 ? false : _ref$compareHash; 4357 4358 if (!link1 || !link2) { 4359 return true; 4360 } 4361 4362 var url1 = null; 4363 var url2 = null; 4364 4365 try { 4366 url1 = new URL(link1); 4367 url2 = new URL(link2); 4368 } catch (e) { 4369 return false; 4370 } 4371 4372 var result = url1.origin === url2.origin && url1.pathname === url2.pathname; 4373 4374 if (compareQuery) { 4375 result = result && url1.search === url2.search; 4376 } 4377 4378 if (compareHash) { 4379 result = result && url1.hash === url2.hash; 4380 } 4381 4382 return result; 4383}; 4384 4385(function ($) { 4386 function isInsideKubioEditor() { 4387 try { 4388 var _top, _top$wp; 4389 4390 return window.isKubioBlockEditor || ((_top = top) === null || _top === void 0 ? void 0 : (_top$wp = _top.wp) === null || _top$wp === void 0 ? void 0 : _top$wp.blockEditor); 4391 } catch (e) { 4392 return false; 4393 } 4394 } 4395 4396 if (window.location.hash === '#page-top') { 4397 changeUrlHash('', 5); 4398 } 4399 4400 var __toCheckOnScroll = { 4401 items: {}, 4402 eachCategory: function eachCategory(callback) { 4403 for (var id in this.items) { 4404 if (!this.items.hasOwnProperty(id)) { 4405 continue; 4406 } 4407 4408 callback(this.items[id]); 4409 } 4410 }, 4411 addItem: function addItem(id, item) { 4412 if (!this.items[id]) { 4413 this.items[id] = []; 4414 } 4415 4416 this.items[id].push(item); 4417 }, 4418 all: function all() { 4419 var result = []; 4420 4421 for (var id in this.items) { 4422 if (!this.items.hasOwnProperty(id)) { 4423 continue; 4424 } 4425 4426 result = result.concat(this.items[id]); 4427 } 4428 4429 return result; 4430 } 4431 }; 4432 var __alreadyScrolling = false; 4433 4434 function getScrollToValue(elData) { 4435 var offset = !isNaN(parseFloat(elData.options.offset)) ? elData.options.offset : elData.options.offset.call(elData.target); 4436 var scrollToValue = elData.target.offset().top - offset - $('body').offset().top; 4437 return scrollToValue; 4438 } 4439 4440 function changeUrlHash(hash, timeout) { 4441 if (hash === location.hash.replace('#', '') || hash === 'page-top' && '' === location.hash.replace('#', '')) { 4442 return; 4443 } 4444 4445 setTimeout(function () { 4446 if (hash) { 4447 if (hash === 'page-top') { 4448 hash = ' '; 4449 } else { 4450 hash = '#' + hash; 4451 } 4452 } else { 4453 hash = ' '; 4454 } 4455 4456 if (history && history.replaceState) { 4457 history.replaceState({}, '', hash); 4458 } 4459 }, timeout || 100); 4460 /* safari issue fixed by throtteling the event */ 4461 } 4462 4463 function scrollItem(elData) { 4464 if (__alreadyScrolling) { 4465 return; 4466 } 4467 4468 __alreadyScrolling = true; 4469 var scrollToValue = getScrollToValue(elData); 4470 $('html, body').animate({ 4471 scrollTop: scrollToValue 4472 }, { 4473 easing: 'linear', 4474 complete: function complete() { 4475 // check for any updates 4476 var scrollToValue = getScrollToValue(elData); 4477 $('html, body').animate({ 4478 scrollTop: scrollToValue 4479 }, { 4480 easing: 'linear', 4481 duration: 100, 4482 complete: function complete() { 4483 __alreadyScrolling = false; 4484 changeUrlHash(elData.id, 5); 4485 } 4486 }); 4487 } 4488 }); 4489 } 4490 4491 function getPageBaseUrl() { 4492 return [location.protocol, '//', location.host, location.pathname].join(''); 4493 } 4494 4495 function fallbackUrlParse(url) { 4496 return url.split('?')[0].split('#')[0]; 4497 } 4498 4499 function getABaseUrl(element) { 4500 var href = jQuery(element)[0].href || ''; 4501 var url = '#'; 4502 4503 try { 4504 var _url = new window.URL(href); 4505 4506 url = [_url.protocol, '//', _url.host, _url.pathname].join(''); 4507 } catch (e) { 4508 url = fallbackUrlParse(href); 4509 } 4510 4511 return url; 4512 } 4513 4514 function getTargetForEl(element) { 4515 var targetId = (element.attr('href') || '').split('#').pop(), 4516 hrefBase = getABaseUrl(element), 4517 target = null, 4518 pageURL = getPageBaseUrl(); 4519 4520 if (hrefBase.length && hrefBase !== pageURL) { 4521 return target; 4522 } 4523 4524 if (targetId.trim().length) {
4525 try { 4526 target = $('[id="' + targetId + '"]'); 4527 } catch (e) {} 4528 } 4529 4530 if (target && target.length) { 4531 return target; 4532 } 4533 4534 return null; 4535 } 4536 4537 $.fn.smoothScrollAnchor = function (options) { 4538 if (isInsideKubioEditor()) { 4539 return; 4540 } 4541 4542 var elements = $(this); 4543 options = jQuery.extend({ 4544 offset: function offset() { 4545 var $fixed = $('.h-navigation_sticky'); 4546 4547 if ($fixed.length) { 4548 return $fixed[0].getBoundingClientRect().height; 4549 } 4550 4551 return 0; 4552 } 4553 }, options); 4554 elements.each(function () { 4555 var element = $(this); //if the target options is not set or the href is not for the same page don't add smoothscroll 4556 4557 if (!options.target && !linksDefineSamePage(document.location.href, this.href)) { 4558 return; 4559 } 4560 4561 var target = options.target || getTargetForEl(element); 4562 4563 if (target && target.length && !target.attr('skip-smooth-scroll')) { 4564 var targetId = target.attr('id'); 4565 var targetSel = null; 4566 4567 if (targetId) { 4568 targetSel = '[id="' + targetId.trim() + '"]'; 4569 } 4570 4571 var elData = { 4572 element: element, 4573 options: options, 4574 target: target, 4575 targetSel: options.targetSel || targetSel, 4576 id: (target.attr('id') || '').trim() 4577 }; 4578 element.off('click.smooth-scroll tap.smooth-scroll').on('click.smooth-scroll tap.smooth-scroll', function (event) { 4579 if ($(this).data('skip-smooth-scroll') || $(event.target).data('skip-smooth-scroll')) { 4580 return; 4581 } 4582 4583 event.preventDefault(); 4584 4585 if (!$(this).data('allow-propagation')) { 4586 event.stopPropagation(); 4587 } 4588 4589 scrollItem(elData); 4590 4591 if (elData.options.clickCallback) { 4592 elData.options.clickCallback.call(this, event); 4593 } 4594 }); 4595 } 4596 }); 4597 }; 4598 4599 $.fn.kubioScrollSpy = function (options) { 4600 if (isInsideKubioEditor()) { 4601 return; 4602 } 4603 4604 var elements = $(this); 4605 var id = 'spy-' + parseInt(Date.now() * Math.random()); 4606 elements.each(function () { 4607 var element = $(this); 4608 var settings = jQuery.extend({ 4609 onChange: function onChange() {}, 4610 onLeave: function onLeave() {}, 4611 clickCallback: function clickCallback() {}, 4612 smoothScrollAnchor: false, 4613 offset: 0 4614 }, options); 4615 4616 if (element.is('a') && (element.attr('href') || '').indexOf('#') !== -1 && (element.attr('href') || '').replace('#', '').length) { 4617 var target = getTargetForEl(element); 4618 4619 if (target && !target.attr('skip-scroll-spy')) { 4620 var elData = { 4621 element: element, 4622 options: settings, 4623 target: target, 4624 targetSel: '[id="' + target.attr('id').trim() + '"]', 4625 id: target.attr('id').trim() 4626 }; 4627 4628 __toCheckOnScroll.addItem(id, elData); 4629 4630 element.data('scrollSpy', elData); 4631 4632 if (options.smoothScrollAnchor) { 4633 element.smoothScrollAnchor(options); 4634 } 4635 } 4636 } 4637 }); 4638 }; 4639 4640 function update() { 4641 __toCheckOnScroll.eachCategory(function (items) { 4642 var ordered = items.sort(function (itemA, itemB) { 4643 return itemA.target.offset().top - itemB.target.offset().top; 4644 }); 4645 var lastItem = ordered.filter(function (item) { 4646 var scrollY = window.pageYOffset !== undefined ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop; 4647 return item.target.offset().top <= scrollY + window.innerHeight * 0.5; 4648 }).pop(); 4649 ordered.forEach(function (item) { 4650 if (lastItem && item.element.is(lastItem.element)) { 4651 changeUrlHash(item.id, 5); 4652 item.options.onChange.call(item.element); 4653 } else { 4654 item.options.onLeave.call(item.element); 4655 } 4656 }); 4657 }); 4658 } 4659 4660 function goToCurrentHash() { 4661 var hash = window.location.hash.replace('#', ''); 4662 4663 var currentItem = __toCheckOnScroll.all().filter(function (item) { 4664 return item.targetSel === '[id="' + decodeURIComponent(hash).trim() + '"]'; 4665 }); 4666 4667 if (!(document.readyState === 'complete' || document.readyState === 'interactive')) { 4668 $(window).on('load', function () { 4669 if (currentItem.length) { 4670 scrollItem(currentItem[0]); 4671 } 4672 4673 update(); 4674 }); 4675 } 4676 } 4677 4678 if (!isInsideKubioEditor()) { 4679 window.addEventListener('scroll', update, { 4680 passive: true 4681 }); 4682 $(window).on('smoothscroll.update', update); 4683 $(window).on('smoothscroll.update', goToCurrentHash); 4684 $(goToCurrentHash); 4685 } 4686})(jQuery); 4687 4688/***/ }), 4689
4690/***/ "./kubio-plugin/src/packages/scripts/src/masonry.js": 4691/*!**********************************************************!*\ 4692 !*** ./kubio-plugin/src/packages/scripts/src/masonry.js ***! 4693 \**********************************************************/ 4694/***/ (() => { 4695 4696(function ($, Colibri) { 4697 var className = 'masonry'; 4698 4699 var Component = function Component(element, options) { 4700 this.namespace = className; 4701 this.defaults = {}; // Parent Constructor 4702 4703 Colibri.apply(this, arguments); 4704 this.addResizeObserver(); 4705 this.bindedRestart = $.debounce(this.restart.bind(this), 50); 4706 4707 if (this.showMasonry()) { 4708 this.start(); 4709 } 4710 }; 4711 4712 function attributeExistsAndFalse($node, attrName) { 4713 if ($node[0].hasAttribute(attrName) && $node.attr(attrName) !== 'true') { 4714 return true; 4715 } 4716 } 4717 4718 Component.prototype = { 4719 start: function start() { 4720 this.stop(); 4721 var masonry = this.$element; 4722 4723 if (!this.$element.parent().length) { 4724 this.stop(); // stop for elements not attached to dom 4725 } 4726 4727 if (this.settings.targetSelector) { 4728 masonry = this.$element.find(this.settings.targetSelector).first(); 4729 } 4730 4731 this.$masonry = masonry; 4732 4733 if (!this.$masonry.masonry) { 4734 return; 4735 } 4736 4737 this.$masonry.masonry({ 4738 itemSelector: this.settings.itemSelector, 4739 columnWidth: this.settings.columnWidth, 4740 percentPosition: true 4741 }); 4742 this.addEventListeners(); 4743 4744 (function () { 4745 var images = masonry.find('img'); 4746 var loadedImages = 0; 4747 var completed = 0; 4748 4749 function imageLoaded() { 4750 loadedImages++; 4751 4752 if (images.length === loadedImages) { 4753 try { 4754 masonry.data().masonry.layout(); 4755 } catch (e) { 4756 console.error(e); 4757 } 4758 } 4759 } 4760 4761 images.each(function () { 4762 if (this.complete) { 4763 completed++; 4764 imageLoaded(); 4765 } else { 4766 $(this).on('load', imageLoaded); 4767 $(this).on('error', imageLoaded); 4768 } 4769 }); 4770 4771 if (images.length !== completed) { 4772 if (document.readyState === 'complete') { 4773 setTimeout(function () { 4774 masonry.data().masonry.layout(); 4775 }, 10); 4776 } 4777 } 4778 4779 $(function () { 4780 masonry.data().masonry.layout(); 4781 }); 4782 })(); 4783 }, 4784 showMasonry: function showMasonry() { 4785 if (attributeExistsAndFalse(this.$element, 'data-show-masonry') || attributeExistsAndFalse(this.$element, 'show-masonry')) { 4786 return false; 4787 } 4788 4789 return this.settings.enabled; 4790 }, 4791 stop: function stop() { 4792 this.removeEventListeners(); 4793 4794 try { 4795 if (this.$masonry.data().masonry) { 4796 this.$masonry.masonry('destroy'); 4797 } 4798 } catch (e) {} 4799 }, 4800 restart: function restart() { 4801 this.stop(); 4802 this.start(); 4803 }, 4804 addEventListeners: function addEventListeners() { 4805 this.addResizeListener(); 4806 this.$element.on('colibriContainerOpened', this.bindedRestart); 4807 }, 4808 removeEventListeners: function removeEventListeners() { 4809 this.removeResizeListener(); 4810 this.$element.off('colibriContainerOpened', this.bindedRestart); 4811 }, 4812 addResizeListener: function addResizeListener() { 4813 this.resizeCount = 0; 4814 4815 try { 4816 this.resizeObserver.observe(this.$masonry.children().get(0)); 4817 } catch (e) {} 4818 }, 4819 removeResizeListener: function removeResizeListener() { 4820 var _this$resizeObserver; 4821 4822 this === null || this === void 0 ? void 0 : (_this$resizeObserver = this.resizeObserver) === null || _this$resizeObserver === void 0 ? void 0 : _this$resizeObserver.disconnect(); 4823 }, 4824 addResizeObserver: function addResizeObserver() { 4825 var self = this; 4826 this.resizeObserver = new ResizeObserver(function (entries) { 4827 if (self.resizeCount === 0) { 4828 self.resizeCount++; 4829 return; 4830 } 4831 4832 self.restart(); 4833 }); 4834 }, 4835 loadImages: function loadImages() {} 4836 }; 4837 Component.inherits(Colibri); 4838 Colibri[className] = Component; 4839 Colibri.Plugin.create(className); 4840 Colibri.Plugin.autoload(className); 4841})(jQuery, Colibri); 4842 4843/***/ }), 4844
vendor: 879 bytes, lines 4845-4883
4845/***/ "./node_modules/domready/ready.js": 4846/*!****************************************!*\ 4847 !*** ./node_modules/domready/ready.js ***! 4848 \****************************************/ 4849/***/ ((module) => { 4850 4851/*! 4852 * domready (c) Dustin Diaz 2014 - License MIT 4853 */ 4854!function (name, definition) { 4855 4856 if (true) module.exports = definition() 4857 else {} 4858 4859}('domready', function () { 4860 4861 var fns = [], listener 4862 , doc = document 4863 , hack = doc.documentElement.doScroll 4864 , domContentLoaded = 'DOMContentLoaded' 4865 , loaded = (hack ? /^loaded|^c/ : /^loaded|^i|^c/).test(doc.readyState) 4866 4867 4868 if (!loaded) 4869 doc.addEventListener(domContentLoaded, listener = function () { 4870 doc.removeEventListener(domContentLoaded, listener) 4871 loaded = 1 4872 while (listener = fns.shift()) listener() 4873 }) 4874 4875 return function (fn) { 4876 loaded ? setTimeout(fn, 0) : fns.push(fn) 4877 } 4878 4879}); 4880 4881 4882/***/ }), 4883
vendor: 11,133 bytes, lines 4884-5270
4884/***/ "./node_modules/lodash.debounce/index.js": 4885/*!***********************************************!*\ 4886 !*** ./node_modules/lodash.debounce/index.js ***! 4887 \***********************************************/ 4888/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 4889 4890/** 4891 * lodash (Custom Build) <https://lodash.com/> 4892 * Build: `lodash modularize exports="npm" -o ./` 4893 * Copyright jQuery Foundation and other contributors <https://jquery.org/> 4894 * Released under MIT license <https://lodash.com/license> 4895 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 4896 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 4897 */ 4898 4899/** Used as the `TypeError` message for "Functions" methods. */ 4900var FUNC_ERROR_TEXT = 'Expected a function'; 4901 4902/** Used as references for various `Number` constants. */ 4903var NAN = 0 / 0; 4904 4905/** `Object#toString` result references. */ 4906var symbolTag = '[object Symbol]'; 4907 4908/** Used to match leading and trailing whitespace. */ 4909var reTrim = /^\s+|\s+$/g; 4910 4911/** Used to detect bad signed hexadecimal string values. */ 4912var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; 4913 4914/** Used to detect binary string values. */ 4915var reIsBinary = /^0b[01]+$/i; 4916 4917/** Used to detect octal string values. */ 4918var reIsOctal = /^0o[0-7]+$/i; 4919 4920/** Built-in method references without a dependency on `root`. */ 4921var freeParseInt = parseInt; 4922 4923/** Detect free variable `global` from Node.js. */ 4924var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g; 4925 4926/** Detect free variable `self`. */ 4927var freeSelf = typeof self == 'object' && self && self.Object === Object && self; 4928 4929/** Used as a reference to the global object. */ 4930var root = freeGlobal || freeSelf || Function('return this')(); 4931 4932/** Used for built-in method references. */ 4933var objectProto = Object.prototype; 4934 4935/** 4936 * Used to resolve the 4937 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 4938 * of values. 4939 */ 4940var objectToString = objectProto.toString; 4941 4942/* Built-in method references for those with the same name as other `lodash` methods. */ 4943var nativeMax = Math.max, 4944 nativeMin = Math.min; 4945 4946/** 4947 * Gets the timestamp of the number of milliseconds that have elapsed since 4948 * the Unix epoch (1 January 1970 00:00:00 UTC). 4949 * 4950 * @static 4951 * @memberOf _ 4952 * @since 2.4.0 4953 * @category Date 4954 * @returns {number} Returns the timestamp. 4955 * @example 4956 * 4957 * _.defer(function(stamp) { 4958 * console.log(_.now() - stamp); 4959 * }, _.now()); 4960 * // => Logs the number of milliseconds it took for the deferred invocation. 4961 */ 4962var now = function() { 4963 return root.Date.now(); 4964}; 4965 4966/** 4967 * Creates a debounced function that delays invoking `func` until after `wait` 4968 * milliseconds have elapsed since the last time the debounced function was 4969 * invoked. The debounced function comes with a `cancel` method to cancel 4970 * delayed `func` invocations and a `flush` method to immediately invoke them. 4971 * Provide `options` to indicate whether `func` should be invoked on the 4972 * leading and/or trailing edge of the `wait` timeout. The `func` is invoked 4973 * with the last arguments provided to the debounced function. Subsequent 4974 * calls to the debounced function return the result of the last `func` 4975 * invocation. 4976 * 4977 * **Note:** If `leading` and `trailing` options are `true`, `func` is 4978 * invoked on the trailing edge of the timeout only if the debounced function 4979 * is invoked more than once during the `wait` timeout. 4980 * 4981 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred 4982 * until to the next tick, similar to `setTimeout` with a timeout of `0`. 4983 * 4984 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) 4985 * for details over the differences between `_.debounce` and `_.throttle`. 4986 * 4987 * @static 4988 * @memberOf _ 4989 * @since 0.1.0 4990 * @category Function 4991 * @param {Function} func The function to debounce. 4992 * @param {number} [wait=0] The number of milliseconds to delay. 4993 * @param {Object} [options={}] The options object. 4994 * @param {boolean} [options.leading=false] 4995 * Specify invoking on the leading edge of the timeout. 4996 * @param {number} [options.maxWait] 4997 * The maximum time `func` is allowed to be delayed before it's invoked. 4998 * @param {boolean} [options.trailing=true] 4999 * Specify invoking on the trailing edge of the timeout. 5000 * @returns {Function} Returns the new debounced function. 5001 * @example 5002 * 5003 * // Avoid costly calculations while the window size is in flux. 5004 * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); 5005 * 5006 * // Invoke `sendMail` when clicked, debouncing subsequent calls. 5007 * jQuery(element).on('click', _.debounce(sendMail, 300, { 5008 * 'leading': true, 5009 * 'trailing': false 5010 * })); 5011 * 5012 * // Ensure `batchLog` is invoked once after 1 second of debounced calls. 5013 * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); 5014 * var source = new EventSource('/stream'); 5015 * jQuery(source).on('message', debounced); 5016 * 5017 * // Cancel the trailing debounced invocation. 5018 * jQuery(window).on('popstate', debounced.cancel); 5019 */ 5020function debounce(func, wait, options) { 5021 var lastArgs, 5022 lastThis, 5023 maxWait, 5024 result, 5025 timerId, 5026 lastCallTime, 5027 lastInvokeTime = 0, 5028 leading = false, 5029 maxing = false, 5030 trailing = true; 5031 5032 if (typeof func != 'function') { 5033 throw new TypeError(FUNC_ERROR_TEXT); 5034 } 5035 wait = toNumber(wait) || 0; 5036 if (isObject(options)) { 5037 leading = !!options.leading; 5038 maxing = 'maxWait' in options; 5039 maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; 5040 trailing = 'trailing' in options ? !!options.trailing : trailing; 5041 } 5042 5043 function invokeFunc(time) { 5044 var args = lastArgs, 5045 thisArg = lastThis; 5046 5047 lastArgs = lastThis = undefined; 5048 lastInvokeTime = time; 5049 result = func.apply(thisArg, args); 5050 return result; 5051 } 5052 5053 function leadingEdge(time) { 5054 // Reset any `maxWait` timer. 5055 lastInvokeTime = time; 5056 // Start the timer for the trailing edge. 5057 timerId = setTimeout(timerExpired, wait); 5058 // Invoke the leading edge. 5059 return leading ? invokeFunc(time) : result; 5060 } 5061 5062 function remainingWait(time) { 5063 var timeSinceLastCall = time - lastCallTime, 5064 timeSinceLastInvoke = time - lastInvokeTime, 5065 result = wait - timeSinceLastCall; 5066 5067 return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result; 5068 } 5069 5070 function shouldInvoke(time) { 5071 var timeSinceLastCall = time - lastCallTime, 5072 timeSinceLastInvoke = time - lastInvokeTime; 5073 5074 // Either this is the first call, activity has stopped and we're at the 5075 // trailing edge, the system time has gone backwards and we're treating 5076 // it as the trailing edge, or we've hit the `maxWait` limit. 5077 return (lastCallTime === undefined || (timeSinceLastCall >= wait) || 5078 (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); 5079 } 5080 5081 function timerExpired() { 5082 var time = now(); 5083 if (shouldInvoke(time)) { 5084 return trailingEdge(time); 5085 } 5086 // Restart the timer. 5087 timerId = setTimeout(timerExpired, remainingWait(time)); 5088 } 5089 5090 function trailingEdge(time) { 5091 timerId = undefined; 5092 5093 // Only invoke if we have `lastArgs` which means `func` has been 5094 // debounced at least once. 5095 if (trailing && lastArgs) { 5096 return invokeFunc(time); 5097 } 5098 lastArgs = lastThis = undefined; 5099 return result; 5100 } 5101 5102 function cancel() { 5103 if (timerId !== undefined) { 5104 clearTimeout(timerId); 5105 } 5106 lastInvokeTime = 0; 5107 lastArgs = lastCallTime = lastThis = timerId = undefined; 5108 } 5109 5110 function flush() { 5111 return timerId === undefined ? result : trailingEdge(now()); 5112 } 5113 5114 function debounced() { 5115 var time = now(), 5116 isInvoking = shouldInvoke(time); 5117 5118 lastArgs = arguments; 5119 lastThis = this; 5120 lastCallTime = time; 5121 5122 if (isInvoking) { 5123 if (timerId === undefined) { 5124 return leadingEdge(lastCallTime); 5125 } 5126 if (maxing) { 5127 // Handle invocations in a tight loop. 5128 timerId = setTimeout(timerExpired, wait); 5129 return invokeFunc(lastCallTime); 5130 } 5131 } 5132 if (timerId === undefined) { 5133 timerId = setTimeout(timerExpired, wait); 5134 } 5135 return result; 5136 } 5137 debounced.cancel = cancel; 5138 debounced.flush = flush; 5139 return debounced; 5140} 5141 5142/** 5143 * Checks if `value` is the 5144 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) 5145 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 5146 * 5147 * @static 5148 * @memberOf _ 5149 * @since 0.1.0 5150 * @category Lang 5151 * @param {*} value The value to check. 5152 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 5153 * @example 5154 * 5155 * _.isObject({}); 5156 * // => true 5157 * 5158 * _.isObject([1, 2, 3]); 5159 * // => true 5160 * 5161 * _.isObject(_.noop); 5162 * // => true 5163 * 5164 * _.isObject(null); 5165 * // => false 5166 */ 5167function isObject(value) { 5168 var type = typeof value; 5169 return !!value && (type == 'object' || type == 'function'); 5170} 5171 5172/** 5173 * Checks if `value` is object-like. A value is object-like if it's not `null` 5174 * and has a `typeof` result of "object". 5175 * 5176 * @static 5177 * @memberOf _ 5178 * @since 4.0.0 5179 * @category Lang 5180 * @param {*} value The value to check. 5181 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 5182 * @example 5183 * 5184 * _.isObjectLike({}); 5185 * // => true 5186 * 5187 * _.isObjectLike([1, 2, 3]); 5188 * // => true 5189 * 5190 * _.isObjectLike(_.noop); 5191 * // => false 5192 * 5193 * _.isObjectLike(null); 5194 * // => false 5195 */ 5196function isObjectLike(value) { 5197 return !!value && typeof value == 'object'; 5198} 5199 5200/** 5201 * Checks if `value` is classified as a `Symbol` primitive or object. 5202 * 5203 * @static 5204 * @memberOf _ 5205 * @since 4.0.0 5206 * @category Lang 5207 * @param {*} value The value to check. 5208 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. 5209 * @example 5210 * 5211 * _.isSymbol(Symbol.iterator); 5212 * // => true 5213 * 5214 * _.isSymbol('abc'); 5215 * // => false 5216 */ 5217function isSymbol(value) { 5218 return typeof value == 'symbol' || 5219 (isObjectLike(value) && objectToString.call(value) == symbolTag); 5220} 5221 5222/** 5223 * Converts `value` to a number. 5224 * 5225 * @static 5226 * @memberOf _ 5227 * @since 4.0.0 5228 * @category Lang 5229 * @param {*} value The value to process. 5230 * @returns {number} Returns the number. 5231 * @example 5232 * 5233 * _.toNumber(3.2); 5234 * // => 3.2 5235 * 5236 * _.toNumber(Number.MIN_VALUE); 5237 * // => 5e-324 5238 * 5239 * _.toNumber(Infinity); 5240 * // => Infinity 5241 * 5242 * _.toNumber('3.2'); 5243 * // => 3.2 5244 */ 5245function toNumber(value) { 5246 if (typeof value == 'number') { 5247 return value; 5248 } 5249 if (isSymbol(value)) { 5250 return NAN; 5251 } 5252 if (isObject(value)) { 5253 var other = typeof value.valueOf == 'function' ? value.valueOf() : value; 5254 value = isObject(other) ? (other + '') : other; 5255 } 5256 if (typeof value != 'string') { 5257 return value === 0 ? value : +value; 5258 } 5259 value = value.replace(reTrim, ''); 5260 var isBinary = reIsBinary.test(value); 5261 return (isBinary || reIsOctal.test(value)) 5262 ? freeParseInt(value.slice(2), isBinary ? 2 : 8) 5263 : (reIsBadHex.test(value) ? NAN : +value); 5264} 5265 5266module.exports = debounce; 5267 5268 5269/***/ }), 5270
5271/***/ "./assets/src/customizer/css/preview.scss": 5272/*!************************************************!*\ 5273 !*** ./assets/src/customizer/css/preview.scss ***! 5274 \************************************************/ 5275/***/ (() => { 5276 5277"use strict"; 5278// extracted by mini-css-extract-plugin 5279 5280 5281/***/ }), 5282
5283/***/ "./assets/src/theme/css/theme.scss": 5284/*!*****************************************!*\ 5285 !*** ./assets/src/theme/css/theme.scss ***! 5286 \*****************************************/ 5287/***/ (() => { 5288 5289"use strict"; 5290// extracted by mini-css-extract-plugin 5291 5292 5293/***/ }), 5294
5295/***/ "./assets/src/theme/css/fse-base-style.scss": 5296/*!**************************************************!*\ 5297 !*** ./assets/src/theme/css/fse-base-style.scss ***! 5298 \**************************************************/ 5299/***/ (() => { 5300 5301"use strict"; 5302// extracted by mini-css-extract-plugin 5303 5304 5305/***/ }), 5306
5307/***/ "./assets/src/customizer/css/customizer.scss": 5308/*!***************************************************!*\ 5309 !*** ./assets/src/customizer/css/customizer.scss ***! 5310 \***************************************************/ 5311/***/ (() => { 5312 5313"use strict"; 5314// extracted by mini-css-extract-plugin 5315 5316 5317/***/ }), 5318
5319/***/ "./assets/src/admin/css/admin.scss": 5320/*!*****************************************!*\ 5321 !*** ./assets/src/admin/css/admin.scss ***! 5322 \*****************************************/ 5323/***/ (() => { 5324 5325"use strict"; 5326// extracted by mini-css-extract-plugin 5327 5328 5329/***/ })
vendor: 8,053 bytes, lines 5329-5506
5329 5330 5331/******/ }); 5332/************************************************************************/ 5333/******/ // The module cache 5334/******/ var __webpack_module_cache__ = {}; 5335/******/ 5336/******/ // The require function 5337/******/ function __webpack_require__(moduleId) { 5338/******/ // Check if module is in cache 5339/******/ var cachedModule = __webpack_module_cache__[moduleId]; 5340/******/ if (cachedModule !== undefined) { 5341/******/ return cachedModule.exports; 5342/******/ } 5343/******/ // Create a new module (and put it into the cache) 5344/******/ var module = __webpack_module_cache__[moduleId] = { 5345/******/ // no module.id needed 5346/******/ // no module.loaded needed 5347/******/ exports: {} 5348/******/ }; 5349/******/ 5350/******/ // Execute the module function 5351/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 5352/******/ 5353/******/ // Return the exports of the module 5354/******/ return module.exports; 5355/******/ } 5356/******/ 5357/******/ // expose the modules object (__webpack_modules__) 5358/******/ __webpack_require__.m = __webpack_modules__; 5359/******/ 5360/************************************************************************/ 5361/******/ /* webpack/runtime/chunk loaded */ 5362/******/ (() => { 5363/******/ var deferred = []; 5364/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { 5365/******/ if(chunkIds) { 5366/******/ priority = priority || 0; 5367/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; 5368/******/ deferred[i] = [chunkIds, fn, priority]; 5369/******/ return; 5370/******/ } 5371/******/ var notFulfilled = Infinity; 5372/******/ for (var i = 0; i < deferred.length; i++) { 5373/******/ var [chunkIds, fn, priority] = deferred[i]; 5374/******/ var fulfilled = true; 5375/******/ for (var j = 0; j < chunkIds.length; j++) { 5376/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { 5377/******/ chunkIds.splice(j--, 1); 5378/******/ } else { 5379/******/ fulfilled = false; 5380/******/ if(priority < notFulfilled) notFulfilled = priority; 5381/******/ } 5382/******/ } 5383/******/ if(fulfilled) { 5384/******/ deferred.splice(i--, 1) 5385/******/ var r = fn(); 5386/******/ if (r !== undefined) result = r; 5387/******/ } 5388/******/ } 5389/******/ return result; 5390/******/ }; 5391/******/ })(); 5392/******/ 5393/******/ /* webpack/runtime/compat get default export */ 5394/******/ (() => { 5395/******/ // getDefaultExport function for compatibility with non-harmony modules 5396/******/ __webpack_require__.n = (module) => { 5397/******/ var getter = module && module.__esModule ? 5398/******/ () => (module['default']) : 5399/******/ () => (module); 5400/******/ __webpack_require__.d(getter, { a: getter }); 5401/******/ return getter; 5402/******/ }; 5403/******/ })(); 5404/******/ 5405/******/ /* webpack/runtime/define property getters */ 5406/******/ (() => { 5407/******/ // define getter functions for harmony exports 5408/******/ __webpack_require__.d = (exports, definition) => { 5409/******/ for(var key in definition) { 5410/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 5411/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 5412/******/ } 5413/******/ } 5414/******/ }; 5415/******/ })(); 5416/******/ 5417/******/ /* webpack/runtime/global */ 5418/******/ (() => { 5419/******/ __webpack_require__.g = (function() { 5420/******/ if (typeof globalThis === 'object') return globalThis; 5421/******/ try { 5422/******/ return this || new Function('return this')(); 5423/******/ } catch (e) { 5424/******/ if (typeof window === 'object') return window; 5425/******/ } 5426/******/ })(); 5427/******/ })(); 5428/******/ 5429/******/ /* webpack/runtime/hasOwnProperty shorthand */ 5430/******/ (() => { 5431/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 5432/******/ })(); 5433/******/ 5434/******/ /* webpack/runtime/jsonp chunk loading */ 5435/******/ (() => { 5436/******/ // no baseURI 5437/******/ 5438/******/ // object to store loaded and loading chunks 5439/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched 5440/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded 5441/******/ var installedChunks = { 5442/******/ "/theme/theme": 0, 5443/******/ "customizer/customizer": 0, 5444/******/ "admin/admin": 0, 5445/******/ "theme/fse-base-style": 0, 5446/******/ "theme/theme": 0, 5447/******/ "customizer/preview": 0 5448/******/ }; 5449/******/ 5450/******/ // no chunk on demand loading 5451/******/ 5452/******/ // no prefetching 5453/******/ 5454/******/ // no preloaded 5455/******/ 5456/******/ // no HMR 5457/******/ 5458/******/ // no HMR manifest 5459/******/ 5460/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); 5461/******/ 5462/******/ // install a JSONP callback for chunk loading 5463/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { 5464/******/ var [chunkIds, moreModules, runtime] = data; 5465/******/ // add "moreModules" to the modules object, 5466/******/ // then flag all "chunkIds" as loaded and fire callback 5467/******/ var moduleId, chunkId, i = 0; 5468/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { 5469/******/ for(moduleId in moreModules) { 5470/******/ if(__webpack_require__.o(moreModules, moduleId)) { 5471/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; 5472/******/ } 5473/******/ } 5474/******/ if(runtime) var result = runtime(__webpack_require__); 5475/******/ } 5476/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); 5477/******/ for(;i < chunkIds.length; i++) { 5478/******/ chunkId = chunkIds[i]; 5479/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { 5480/******/ installedChunks[chunkId][0](); 5481/******/ } 5482/******/ installedChunks[chunkIds[i]] = 0; 5483/******/ } 5484/******/ return __webpack_require__.O(result); 5485/******/ } 5486/******/ 5487/******/ var chunkLoadingGlobal = self["webpackChunkgutentag_theme"] = self["webpackChunkgutentag_theme"] || []; 5488/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); 5489/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); 5490/******/ })(); 5491/******/ 5492/************************************************************************/ 5493/******/ 5494/******/ // startup 5495/******/ // Load entry module and return exports 5496/******/ // This entry module depends on other loaded chunks and execution need to be delayed 5497/******/ __webpack_require__.O(undefined, ["customizer/customizer","admin/admin","theme/fse-base-style","theme/theme","customizer/preview"], () => (__webpack_require__("./assets/src/theme/js/theme.js"))) 5498/******/ __webpack_require__.O(undefined, ["customizer/customizer","admin/admin","theme/fse-base-style","theme/theme","customizer/preview"], () => (__webpack_require__("./assets/src/theme/css/theme.scss"))) 5499/******/ __webpack_require__.O(undefined, ["customizer/customizer","admin/admin","theme/fse-base-style","theme/theme","customizer/preview"], () => (__webpack_require__("./assets/src/theme/css/fse-base-style.scss"))) 5500/******/ __webpack_require__.O(undefined, ["customizer/customizer","admin/admin","theme/fse-base-style","theme/theme","customizer/preview"], () => (__webpack_require__("./assets/src/customizer/css/customizer.scss"))) 5501/******/ __webpack_require__.O(undefined, ["customizer/customizer","admin/admin","theme/fse-base-style","theme/theme","customizer/preview"], () => (__webpack_require__("./assets/src/admin/css/admin.scss"))) 5502/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["customizer/customizer","admin/admin","theme/fse-base-style","theme/theme","customizer/preview"], () => (__webpack_require__("./assets/src/customizer/css/preview.scss"))) 5503/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); 5504/******/ 5505/******/ })() 5506;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.