1/* 2* TypeWatch 3 3* 4* Examples/Docs: github.com/dennyferra/TypeWatch 5* 6* Dual licensed under the MIT and GPL licenses: 7* http://www.opensource.org/licenses/mit-license.php 8* http://www.gnu.org/licenses/gpl.html 9*/ 10 11!function(root, factory) { 12 if (typeof define === 'function' && define.amd) { 13 define(['jquery'], factory); 14 } else if (typeof exports === 'object') { 15 factory(require('jquery')); 16 } else { 17 factory(root.jQuery); 18 } 19}(this, function($) { 20 'use strict'; 21 $.fn.typeWatch = function(o) { 22 // The default input types that are supported 23 var _supportedInputTypes = 24 ['TEXT', 'TEXTAREA', 'PASSWORD', 'TEL', 'SEARCH', 'URL', 'EMAIL', 'DATETIME', 'DATE', 'MONTH', 'WEEK', 'TIME', 'DATETIME-LOCAL', 'NUMBER', 'RANGE', 'DIV']; 25 26 // Options 27 var options = $.extend({ 28 wait: 750, 29 callback: function() { }, 30 highlight: true, 31 captureLength: 2, 32 allowSubmit: false, 33 inputTypes: _supportedInputTypes 34 }, o); 35 36 function checkElement(timer, override) { 37 var value = timer.type === 'DIV' 38 ? jQuery(timer.el).html() 39 : jQuery(timer.el).val(); 40 41 // If has capture length and has changed value 42 // Or override and has capture length or allowSubmit option is true 43 // Or capture length is zero and changed value 44 if ((value.length >= options.captureLength && value != timer.text) 45 || (override && (value.length >= options.captureLength || options.allowSubmit)) 46 || (value.length == 0 && timer.text)) 47 { 48 timer.text = value; 49 timer.cb.call(timer.el, value); 50 } 51 }; 52 53 function watchElement(elem) { 54 var elementType = (elem.type || elem.nodeName).toUpperCase(); 55 if (jQuery.inArray(elementType, options.inputTypes) >= 0) { 56 57 // Allocate timer element 58 var timer = { 59 timer: null, 60 text: (elementType === 'DIV') ? jQuery(elem).html() : jQuery(elem).val(), 61 cb: options.callback, 62 el: elem, 63 type: elementType, 64 wait: options.wait 65 }; 66 67 // Set focus action (highlight) 68 if (options.highlight && elementType !== 'DIV') 69 jQuery(elem).focus(function() { this.select(); }); 70 71 // Key watcher / clear and reset the timer 72 var startWatch = function(evt) { 73 var timerWait = timer.wait; 74 var overrideBool = false; 75 var evtElementType = elementType; 76 77 // If enter key is pressed and not a TEXTAREA or DIV 78 if (typeof evt.keyCode != 'undefined' && evt.keyCode == 13 79 && evtElementType !== 'TEXTAREA' && elementType !== 'DIV') { 80 timerWait = 1; 81 overrideBool = true; 82 } 83 84 var timerCallbackFx = function() { 85 checkElement(timer, overrideBool) 86 } 87 88 // Clear timer 89 clearTimeout(timer.timer); 90 timer.timer = setTimeout(timerCallbackFx, timerWait); 91 }; 92 93 jQuery(elem).on('keydown paste cut input', startWatch); 94 } 95 }; 96 97 // Watch each element 98 return this.each(function() { 99 watchElement(this); 100 }); 101 }; 102}); 103; 104/** 105 * Featherlight - ultra slim jQuery lightbox 106 * Version 1.7.14-UMD - http://noelboss.github.io/featherlight/ 107 * 108 * Copyright 2019, Noël Raoul Bossart (http://www.noelboss.com) 109 * MIT Licensed. 110**/ 111(function (factory) { 112 if (typeof define === 'function' && define.amd) { 113 // AMD. Register as an anonymous module. 114 define(['jquery'], factory); 115 } else if (typeof module === 'object' && module.exports) { 116 // Node/CommonJS 117 module.exports = function (root, jQuery) { 118 if (jQuery === undefined) { 119 // require('jQuery') returns a factory that requires window to 120 // build a jQuery instance, we normalize how we use modules 121 // that require this pattern but the window provided is a noop 122 // if it's defined (how jquery works) 123 if (typeof window !== 'undefined') { 124 jQuery = require('jquery'); 125 } else { 126 jQuery = require('jquery')(root); 127 } 128 } 129 factory(jQuery); 130 return jQuery; 131 }; 132 } else { 133 // Browser globals 134 factory(jQuery); 135 } 136})(function ($) { 137 "use strict"; 138 139 if ('undefined' === typeof $) {
140 if ('console' in window) { window.console.info('Too much lightness, Featherlight needs jQuery.'); } 141 return; 142 } 143 if ($.fn.jquery.match(/-ajax/)) { 144 if ('console' in window) { window.console.info('Featherlight needs regular jQuery, not the slim version.'); } 145 return; 146 } 147 /* Featherlight is exported as $.featherlight. 148 It is a function used to open a featherlight lightbox. 149 [tech] 150 Featherlight uses prototype inheritance. 151 Each opened lightbox will have a corresponding object. 152 That object may have some attributes that override the 153 prototype's. 154 Extensions created with Featherlight.extend will have their 155 own prototype that inherits from Featherlight's prototype, 156 thus attributes can be overriden either at the object level, 157 or at the extension level. 158 To create callbacks that chain themselves instead of overriding, 159 use chainCallbacks. 160 For those familiar with CoffeeScript, this correspond to 161 Featherlight being a class and the Gallery being a class 162 extending Featherlight. 163 The chainCallbacks is used since we don't have access to 164 CoffeeScript's `super`. 165 */ 166 167 function Featherlight($content, config) { 168 if (this instanceof Featherlight) { /* called with new */ 169 this.id = Featherlight.id++; 170 this.setup($content, config); 171 this.chainCallbacks(Featherlight._callbackChain); 172 } else { 173 var fl = new Featherlight($content, config); 174 fl.open(); 175 return fl; 176 } 177 } 178 179 var opened = [], 180 pruneOpened = function (remove) { 181 opened = $.grep(opened, function (fl) { 182 return fl !== remove && fl.$instance.closest('body').length > 0; 183 }); 184 return opened; 185 }; 186 187 // Removes keys of `set` from `obj` and returns the removed key/values. 188 function slice(obj, set) { 189 var r = {}; 190 for (var key in obj) { 191 if (key in set) { 192 r[key] = obj[key]; 193 delete obj[key]; 194 } 195 } 196 return r; 197 } 198 199 // NOTE: List of available [iframe attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe). 200 var iFrameAttributeSet = { 201 allow: 1, allowfullscreen: 1, frameborder: 1, height: 1, longdesc: 1, marginheight: 1, marginwidth: 1, 202 mozallowfullscreen: 1, name: 1, referrerpolicy: 1, sandbox: 1, scrolling: 1, src: 1, srcdoc: 1, style: 1, 203 webkitallowfullscreen: 1, width: 1 204 }; 205 206 // Converts camelCased attributes to dasherized versions for given prefix: 207 // parseAttrs({hello: 1, hellFrozeOver: 2}, 'hell') => {froze-over: 2} 208 function parseAttrs(obj, prefix) { 209 var attrs = {}, 210 regex = new RegExp('^' + prefix + '([A-Z])(.*)'); 211 for (var key in obj) { 212 var match = key.match(regex); 213 if (match) { 214 var dasherized = (match[1] + match[2].replace(/([A-Z])/g, '-$1')).toLowerCase(); 215 attrs[dasherized] = obj[key]; 216 } 217 } 218 return attrs; 219 } 220 221 /* document wide key handler */ 222 var eventMap = { keyup: 'onKeyUp', resize: 'onResize' }; 223 224 var globalEventHandler = function (event) { 225 $.each(Featherlight.opened().reverse(), function () { 226 if (!event.isDefaultPrevented()) { 227 if (false === this[eventMap[event.type]](event)) { 228 event.preventDefault(); event.stopPropagation(); return false; 229 } 230 } 231 }); 232 }; 233 234 var toggleGlobalEvents = function (set) { 235 if (set !== Featherlight._globalHandlerInstalled) { 236 Featherlight._globalHandlerInstalled = set; 237 var events = $.map(eventMap, function (_, name) { return name + '.' + Featherlight.prototype.namespace; }).join(' '); 238 $(window)[set ? 'on' : 'off'](events, globalEventHandler); 239 } 240 }; 241 242 Featherlight.prototype = { 243 constructor: Featherlight, 244 /*** defaults ***/ 245 /* extend featherlight with defaults and methods */ 246 namespace: 'featherlight', /* Name of the events and css class prefix */ 247 targetAttr: 'data-featherlight', /* Attribute of the triggered element that contains the selector to the lightbox content */ 248 variant: null, /* Class that will be added to change look of the lightbox */ 249 resetCss: false, /* Reset all css */ 250 background: null, /* Custom DOM for the background, wrapper and the closebutton */ 251 openTrigger: 'click', /* Event that triggers the lightbox */ 252 closeTrigger: 'click', /* Event that triggers the closing of the lightbox */ 253 filter: null, /* Selector to filter events. Think $(...).on('click', filter, eventHandler) */ 254 root: 'body', /* Where to append featherlights */ 255 openSpeed: 250, /* Duration of opening animation */ 256 closeSpeed: 250, /* Duration of closing animation */ 257 closeOnClick: 'background', /* Close lightbox on click ('background', 'anywhere' or false) */ 258 closeOnEsc: true, /* Close lightbox when pressing esc */ 259 closeIcon: '✕', /* Close icon */ 260 loading: '', /* Content to show while initial content is loading */ 261 persist: false, /* If set, the content will persist and will be shown again when opened again. 'shared' is a special value when binding multiple elements for them to share the same content */ 262 otherClose: null, /* Selector for alternate close buttons (e.g. "a.close") */ 263 beforeOpen: $.noop, /* Called before open. can return false to prevent opening of lightbox. Gets event as parameter, this contains all data */ 264 beforeContent: $.noop, /* Called when content is loaded. Gets event as parameter, this contains all data */ 265 beforeClose: $.noop, /* Called before close. can return false to prevent closing of lightbox. Gets event as parameter, this contains all data */ 266 afterOpen: $.noop, /* Called after open. Gets event as parameter, this contains all data */ 267 afterContent: $.noop, /* Called after content is ready and has been set. Gets event as parameter, this contains all data */ 268 afterClose: $.noop, /* Called after close. Gets event as parameter, this contains all data */ 269 onKeyUp: $.noop, /* Called on key up for the frontmost featherlight */ 270 onResize: $.noop, /* Called after new content and when a window is resized */ 271 type: null, /* Specify type of lightbox. If unset, it will check for the targetAttrs value. */ 272 contentFilters: ['jquery', 'image', 'html', 'ajax', 'iframe', 'text'], /* List of content filters to use to determine the content */ 273 274 /*** methods ***/ 275 /* setup iterates over a single instance of featherlight and prepares the background and binds the events */ 276 setup: function (target, config) { 277 /* all arguments are optional */ 278 if (typeof target === 'object' && target instanceof $ === false && !config) { 279 config = target; 280 target = undefined; 281 } 282 283 var self = $.extend(this, config, { target: target }), 284 css = !self.resetCss ? self.namespace : self.namespace + '-reset', /* by adding -reset to the classname, we reset all the default css */ 285 $background = $(self.background || [ 286 '<div class="' + css + '-loading ' + css + '">', 287 '<div class="' + css + '-content">', 288 '<button class="' + css + '-close-icon ' + self.namespace + '-close" aria-label="Close">', 289 self.closeIcon, 290 '</button>', 291 '<div class="' + self.namespace + '-inner">' + self.loading + '</div>', 292 '</div>', 293 '</div>'].join('')), 294 closeButtonSelector = '.' + self.namespace + '-close' + (self.otherClose ? ',' + self.otherClose : ''); 295 296 self.$instance = $background.clone().addClass(self.variant); /* clone DOM for the background, wrapper and the close button */ 297 298 /* close when click on background/anywhere/null or closebox */ 299 self.$instance.on(self.closeTrigger + '.' + self.namespace, function (event) { 300 if (event.isDefaultPrevented()) { 301 return; 302 } 303 var $target = $(event.target); 304 if (('background' === self.closeOnClick && $target.is('.' + self.namespace)) 305 || 'anywhere' === self.closeOnClick 306 || $target.closest(closeButtonSelector).length) { 307 self.close(event); 308 event.preventDefault(); 309 } 310 }); 311 312 return this; 313 }, 314 315 /* this method prepares the content and converts it into a
315jQuery object or a promise */ 316 getContent: function () { 317 if (this.persist !== false && this.$content) { 318 return this.$content; 319 } 320 var self = this, 321 filters = this.constructor.contentFilters, 322 readTargetAttr = function (name) { return self.$currentTarget && self.$currentTarget.attr(name); }, 323 targetValue = readTargetAttr(self.targetAttr), 324 data = self.target || targetValue || ''; 325 326 /* Find which filter applies */ 327 var filter = filters[self.type]; /* check explicit type like {type: 'image'} */ 328 329 /* check explicit type like data-featherlight="image" */ 330 if (!filter && data in filters) { 331 filter = filters[data]; 332 data = self.target && targetValue; 333 } 334 data = data || readTargetAttr('href') || ''; 335 336 /* check explicity type & content like {image: 'photo.jpg'} */ 337 if (!filter) { 338 for (var filterName in filters) { 339 if (self[filterName]) { 340 filter = filters[filterName]; 341 data = self[filterName]; 342 } 343 } 344 } 345 346 /* otherwise it's implicit, run checks */ 347 if (!filter) { 348 var target = data; 349 data = null; 350 $.each(self.contentFilters, function () { 351 filter = filters[this]; 352 if (filter.test) { 353 data = filter.test(target); 354 } 355 if (!data && filter.regex && target.match && target.match(filter.regex)) { 356 data = target; 357 } 358 return !data; 359 }); 360 if (!data) { 361 if ('console' in window) { window.console.error('Featherlight: no content filter found ' + (target ? ' for "' + target + '"' : ' (no target specified)')); } 362 return false; 363 } 364 } 365 /* Process it */ 366 return filter.process.call(self, data); 367 }, 368 369 /* sets the content of $instance to $content */ 370 setContent: function ($content) { 371 this.$instance.removeClass(this.namespace + '-loading'); 372 373 /* we need a special class for the iframe */ 374 this.$instance.toggleClass(this.namespace + '-iframe', $content.is('iframe')); 375 376 /* replace content by appending to existing one before it is removed 377 this insures that featherlight-inner remain at the same relative 378 position to any other items added to featherlight-content */ 379 this.$instance.find('.' + this.namespace + '-inner') 380 .not($content) /* excluded new content, important if persisted */ 381 .slice(1).remove().end() /* In the unexpected event where there are many inner elements, remove all but the first one */ 382 .replaceWith($.contains(this.$instance[0], $content[0]) ? '' : $content); 383 384 this.$content = $content.addClass(this.namespace + '-inner'); 385 386 return this; 387 }, 388 389 /* opens the lightbox. "this" contains $instance with the lightbox, and with the config. 390 Returns a promise that is resolved after is successfully opened. */ 391 open: function (event) { 392 var self = this; 393 self.$instance.hide().appendTo(self.root); 394 if ((!event || !event.isDefaultPrevented()) 395 && self.beforeOpen(event) !== false) { 396 397 if (event) { 398 event.preventDefault(); 399 } 400 var $content = self.getContent(); 401 402 if ($content) { 403 opened.push(self); 404 405 toggleGlobalEvents(true); 406 407 self.$instance.fadeIn(self.openSpeed); 408 self.beforeContent(event); 409 410 /* Set content and show */ 411 return $.when($content) 412 .always(function ($openendContent) { 413 if ($openendContent) { 414 self.setContent($openendContent); 415 self.afterContent(event); 416 } 417 }) 418 .then(self.$instance.promise()) 419 /* Call afterOpen after fadeIn is done */ 420 .done(function () { self.afterOpen(event); }); 421 } 422 } 423 self.$instance.detach(); 424 return $.Deferred().reject().promise(); 425 }, 426 427 /* closes the lightbox. "this" contains $instance with the lightbox, and with the config 428 returns a promise, resolved after the lightbox is successfully closed. */ 429 close: function (event) { 430 var self = this, 431 deferred = $.Deferred(); 432 433 if (self.beforeClose(event) === false) { 434 deferred.reject(); 435 } else { 436 437 if (0 === pruneOpened(self).length) { 438 toggleGlobalEvents(false); 439 } 440 441 self.$instance.fadeOut(self.closeSpeed, function () { 442 self.$instance.detach(); 443 self.afterClose(event); 444 deferred.resolve(); 445 }); 446 } 447 return deferred.promise(); 448 }, 449 450 /* resizes the content so it fits in visible area and keeps the same aspect ratio. 451 Does nothing if either the width or the height is not specified. 452 Called automatically on window resize. 453 Override if you want different behavior. */ 454 resize: function (w, h) { 455 if (w && h) { 456 /* Reset apparent image size first so container grows */ 457 this.$content.css('width', '').css('height', ''); 458 /* Calculate the worst ratio so that dimensions fit */ 459 /* Note: -1 to avoid rounding errors */ 460 var ratio = Math.max( 461 w / (this.$content.parent().width() - 1), 462 h / (this.$content.parent().height() - 1)); 463 /* Resize content */ 464 if (ratio > 1) { 465 ratio = h / Math.floor(h / ratio); /* Round ratio down so height calc works */ 466 this.$content.css('width', '' + w / ratio + 'px').css('height', '' + h / ratio + 'px'); 467 } 468 } 469 }, 470 471 /* Utility function to chain callbacks 472 [Warning: guru-level] 473 Used be extensions that want to let users specify callbacks but 474 also need themselves to use the callbacks. 475 The argument 'chain' has callback names as keys and function(super, event) 476 as values. That function is meant to call `super` at some point. 477 */ 478 chainCallbacks: function (chain) { 479 for (var name in chain) { 480 this[name] = $.proxy(chain[name], this, $.proxy(this[name], this)); 481 } 482 } 483 }; 484 485 $.extend(Featherlight, { 486 id: 0, /* Used to id single featherlight instances */ 487 autoBind: '[data-featherlight]', /* Will automatically bind elements matching this selector. Clear or set before onReady */ 488 defaults: Featherlight.prototype, /* You can access and override all defaults using $.featherlight.defaults, which is just a synonym for $.featherlight.prototype */ 489 /* Contains the logic to determine content */ 490 contentFilters: { 491 jquery: { 492 regex: /^[#.]\w/, /* Anything that starts with a class name or identifiers */ 493 test: function (elem) { return elem instanceof $ && elem; }, 494 process: function (elem) { return this.persist !== false ? $(elem) : $(elem).clone(true); } 495 }, 496 image: { 497 regex: /\.(png|jpg|jpeg|gif|tiff?|bmp|svg)(\?\S*)?$/i, 498 process: function (url) { 499 var self = this, 500 deferred = $.Deferred(), 501 img = new Image(), 502 $img = $('<img src="' + url + '" alt="" class="' + self.namespace + '-image" />'); 503 img.onload = function () {
504 /* Store naturalWidth & height for IE8 */ 505 $img.naturalWidth = img.width; $img.naturalHeight = img.height; 506 deferred.resolve($img); 507 }; 508 img.onerror = function () { deferred.reject($img); }; 509 img.src = url; 510 return deferred.promise(); 511 } 512 }, 513 html: { 514 regex: /^\s*<[\w!][^<]*>/, /* Anything that starts with some kind of valid tag */ 515 process: function (html) { return $(html); } 516 }, 517 ajax: { 518 regex: /./, /* At this point, any content is assumed to be an URL */ 519 process: function (url) { 520 var self = this, 521 deferred = $.Deferred(); 522 /* we are using load so one can specify a target with: url.html #targetelement */ 523 var $container = $('<div></div>').load(url, function (response, status) { 524 if (status !== "error") { 525 deferred.resolve($container.contents()); 526 } 527 deferred.reject(); 528 }); 529 return deferred.promise(); 530 } 531 }, 532 iframe: { 533 process: function (url) { 534 var deferred = new $.Deferred(); 535 var $content = $('<iframe/>'); 536 var css = parseAttrs(this, 'iframe'); 537 var attrs = slice(css, iFrameAttributeSet); 538 $content.hide() 539 .attr('src', url) 540 .attr(attrs) 541 .css(css) 542 .on('load', function () { deferred.resolve($content.show()); }) 543 // We can't move an <iframe> and avoid reloading it, 544 // so let's put it in place ourselves right now: 545 .appendTo(this.$instance.find('.' + this.namespace + '-content')); 546 return deferred.promise(); 547 } 548 }, 549 text: { 550 process: function (text) { return $('<div>', { text: text }); } 551 } 552 }, 553 554 functionAttributes: ['beforeOpen', 'afterOpen', 'beforeContent', 'afterContent', 'beforeClose', 'afterClose'], 555 556 /*** class methods ***/ 557 /* read element's attributes starting with data-featherlight- */ 558 readElementConfig: function (element, namespace) { 559 var Klass = this, 560 regexp = new RegExp('^data-' + namespace + '-(.*)'), 561 config = {}; 562 if (element && element.attributes) { 563 $.each(element.attributes, function () { 564 var match = this.name.match(regexp); 565 if (match) { 566 var val = this.value, 567 name = $.camelCase(match[1]); 568 if ($.inArray(name, Klass.functionAttributes) >= 0) { /* jshint -W054 */ 569 val = new Function(val); /* jshint +W054 */ 570 } else { 571 try { val = JSON.parse(val); } 572 catch (e) { } 573 } 574 config[name] = val; 575 } 576 }); 577 } 578 return config; 579 }, 580 581 /* Used to create a Featherlight extension 582 [Warning: guru-level] 583 Creates the extension's prototype that in turn 584 inherits Featherlight's prototype. 585 Could be used to extend an extension too... 586 This is pretty high level wizardy, it comes pretty much straight 587 from CoffeeScript and won't teach you anything about Featherlight 588 as it's not really specific to this library. 589 My suggestion: move along and keep your sanity. 590 */ 591 extend: function (child, defaults) { 592 /* Setup class hierarchy, adapted from CoffeeScript */ 593 var Ctor = function () { this.constructor = child; }; 594 Ctor.prototype = this.prototype; 595 child.prototype = new Ctor(); 596 child.__super__ = this.prototype; 597 /* Copy class methods & attributes */ 598 $.extend(child, this, defaults); 599 child.defaults = child.prototype; 600 return child; 601 }, 602 603 attach: function ($source, $content, config) { 604 var Klass = this; 605 if (typeof $content === 'object' && $content instanceof $ === false && !config) { 606 config = $content; 607 $content = undefined; 608 } 609 /* make a copy */ 610 config = $.extend({}, config); 611 612 /* Only for openTrigger, filter & namespace... */ 613 var namespace = config.namespace || Klass.defaults.namespace, 614 tempConfig = $.extend({}, Klass.defaults, Klass.readElementConfig($source[0], namespace), c
614onfig), 615 sharedPersist; 616 var handler = function (event) { 617 var $target = $(event.currentTarget); 618 /* ... since we might as well compute the config on the actual target */ 619 var elemConfig = $.extend( 620 { $source: $source, $currentTarget: $target }, 621 Klass.readElementConfig($source[0], tempConfig.namespace), 622 Klass.readElementConfig(event.currentTarget, tempConfig.namespace), 623 config); 624 var fl = sharedPersist || $target.data('featherlight-persisted') || new Klass($content, elemConfig); 625 if (fl.persist === 'shared') { 626 sharedPersist = fl; 627 } else if (fl.persist !== false) { 628 $target.data('featherlight-persisted', fl); 629 } 630 if (elemConfig.$currentTarget.blur) { 631 elemConfig.$currentTarget.blur(); // Otherwise 'enter' key might trigger the dialog again 632 } 633 fl.open(event); 634 }; 635 636 $source.on(tempConfig.openTrigger + '.' + tempConfig.namespace, tempConfig.filter, handler); 637 638 return { filter: tempConfig.filter, handler: handler }; 639 }, 640 641 current: function () { 642 var all = this.opened(); 643 return all[all.length - 1] || null; 644 }, 645 646 opened: function () { 647 var klass = this; 648 pruneOpened(); 649 return $.grep(opened, function (fl) { return fl instanceof klass; }); 650 }, 651 652 close: function (event) { 653 var cur = this.current(); 654 if (cur) { return cur.close(event); } 655 }, 656 657 /* Does the auto binding on startup. 658 Meant only to be used by Featherlight and its extensions 659 */ 660 _onReady: function () { 661 var Klass = this; 662 if (Klass.autoBind) { 663 var $autobound = $(Klass.autoBind); 664 /* Bind existing elements */ 665 $autobound.each(function () { 666 Klass.attach($(this)); 667 }); 668 /* If a click propagates to the document level, then we have an item that was added later on */ 669 $(document).on('click', Klass.autoBind, function (evt) { 670 if (evt.isDefaultPrevented()) { 671 return; 672 } 673 var $cur = $(evt.currentTarget); 674 var len = $autobound.length; 675 $autobound = $autobound.add($cur); 676 if (len === $autobound.length) { 677 return; /* already bound */ 678 } 679 /* Bind featherlight */ 680 var data = Klass.attach($cur); 681 /* Dispatch event directly */ 682 if (!data.filter || $(evt.target).parentsUntil($cur, data.filter).length > 0) { 683 data.handler(evt); 684 } 685 }); 686 } 687 }, 688 689 /* Featherlight uses the onKeyUp callback to intercept the escape key. 690 Private to Featherlight. 691 */ 692 _callbackChain: { 693 onKeyUp: function (_super, event) { 694 if (27 === event.keyCode) { 695 if (this.closeOnEsc) { 696 $.featherlight.close(event); 697 } 698 return false; 699 } else { 700 return _super(event); 701 } 702 }, 703 704 beforeOpen: function (_super, event) { 705 // Used to disable scrolling 706 $(document.documentElement).addClass('with-featherlight'); 707 708 // Remember focus: 709 this._previouslyActive = document.activeElement; 710 711 // Disable tabbing: 712 // See http://stackoverflow.com/questions/1599660/which-html-elements-can-receive-focus 713 this._$previouslyTabbable = $("a, input, select, textarea, iframe, button, iframe, [contentEditable=true]") 714 .not('[tabindex]') 715 .not(this.$instance.find('button')); 716 717 this._$previouslyWithTabIndex = $('[tabindex]').not('[tabindex="-1"]'); 718 this._previousWithTabIndices = this._$previouslyWithTabIndex.map(function (_i, elem) { 719 return $(elem).attr('tabindex'); 720 }); 721 722 this._$previouslyWithTabIndex.add(this._$previouslyTabbable).attr('tabindex', -1); 723 724 if (document.activeElement.blur) { 725 document.activeElement.blur(); 726 } 727 return _super(event); 728 }, 729 730 afterClose: function (_super, event) { 731 var r = _super(event); 732 // Restore focus 733 var self = this; 734 this._$previouslyTabbable.removeAttr('tabindex'); 735 this._$previouslyWithTabIndex.each(function (i, elem) { 736 $(elem).attr('tabindex', self._previousWithTabIndices[i]); 737 }); 738 this._previouslyActive.focus(); 739 // Restore scroll 740 if (Featherlight.opened().length === 0) { 741 $(document.documentElement).removeClass('with-featherlight'); 742 } 743 return r; 744 }, 745 746 onResize: function (_super, event) {
vendor: 5,640 bytes, lines 747-772
747 this.resize(this.$content.naturalWidth, this.$content.naturalHeight); 748 return _super(event); 749 }, 750 751 afterContent: function (_super, event) { 752 var r = _super(event); 753 this.$instance.find('[autofocus]:not([disabled])').focus(); 754 this.onResize(event); 755 return r; 756 } 757 } 758 }); 759 760 $.featherlight = Featherlight; 761 762 /* bind jQuery elements to trigger featherlight */ 763 $.fn.featherlight = function ($content, config) { 764 Featherlight.attach(this, $content, config); 765 return this; 766 }; 767 768 /* bind featherlight on ready if config autoBind is set */ 769 $(document).ready(function () { Featherlight._onReady(); }); 770});; 771/*! Select2 4.0.10 | https://github.com/select2/select2/blob/master/LICENSE.md */ 772!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t),t}:n(jQuery)}(function(d){var e=function(){if(d&&d.fn&&d.fn.select2&&d.fn.select2.amd)var e=d.fn.select2.amd;var t,n,i,h,o,s,f,g,m,v,y,_,r,a,w,l;function b(e,t){return r.call(e,t)}function c(e,t){var n,i,r,o,s,a,l,c,u,d,p,h=t&&t.split("/"),f=y.map,g=f&&f["*"]||{};if(e){for(s=(e=e.split("/")).length-1,y.nodeIdCompat&&w.test(e[s])&&(e[s]=e[s].replace(w,"")),"."===e[0].charAt(0)&&h&&(e=h.slice(0,h.length-1).concat(e)),u=0;u<e.length;u++)if("."===(p=e[u]))e.splice(u,1),u-=1;else if(".."===p){if(0===u||1===u&&".."===e[2]||".."===e[u-1])continue;0<u&&(e.splice(u-1,2),u-=2)}e=e.join("/")}if((h||g)&&f){for(u=(n=e.split("/")).length;0<u;u-=1){if(i=n.slice(0,u).join("/"),h)for(d=h.length;0<d;d-=1)if(r=(r=f[h.slice(0,d).join("/")])&&r[i]){o=r,a=u;break}if(o)break;!l&&g&&g[i]&&(l=g[i],c=u)}!o&&l&&(o=l,a=c),o&&(n.splice(0,a,o),e=n.join("/"))}return e}function A(t,n){return function(){var e=a.call(arguments,0);return"string"!=typeof e[0]&&1===e.length&&e.push(null),s.apply(h,e.concat([t,n]))}}function x(t){return function(e){m[t]=e}}function S(e){if(b(v,e)){var t=v[e];delete v[e],_[e]=!0,o.apply(h,t)}if(!b(m,e)&&!b(_,e))throw new Error("No "+e);return m[e]}function u(e){var t,n=e?e.indexOf("!"):-1;return-1<n&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function D(e){return e?u(e):[]}return e&&e.requirejs||(e?n=e:e={},m={},v={},y={},_={},r=Object.prototype.hasOwnProperty,a=[].slice,w=/\.js$/,f=function(e,t){var n,i=u(e),r=i[0],o=t[1];return e=i[1],r&&(n=S(r=c(r,o))),r?e=n&&n.normalize?n.normalize(e,function(t){return function(e){return c(e,t)}}(o)):c(e,o):(r=(i=u(e=c(e,o)))[0],e=i[1],r&&(n=S(r))),{f:r?r+"!"+e:e,n:e,pr:r,p:n}},g={require:function(e){return A(e)},exports:function(e){var t=m[e];return void 0!==t?t:m[e]={}},module:function(e){return{id:e,uri:"",exports:m[e],config:function(e){return function(){return y&&y.config&&y.config[e]||{}}}(e)}}},o=function(e,t,n,i){var r,o,s,a,l,c,u,d=[],p=typeof n;if(c=D(i=i||e),"undefined"==p||"function"==p){for(t=!t.length&&n.length?["require","exports","module"]:t,l=0;l<t.length;l+=1)if("require"===(o=(a=f(t[l],c)).f))d[l]=g.require(e);else if("exports"===o)d[l]=g.exports(e),u=!0;else if("module"===o)r=d[l]=g.module(e);else if(b(m,o)||b(v,o)||b(_,o))d[l]=S(o);else{if(!a.p)throw new Error(e+" missing "+o);a.p.load(a.n,A(i,!0),x(o),{}),d[l]=m[o]}s=n?n.apply(m[e],d):void 0,e&&(r&&r.exports!==h&&r.exports!==m[e]?m[e]=r.exports:s===h&&u||(m[e]=s))}else e&&(m[e]=n)},t=n=s=function(e,t,n,i,r){if("string"==typeof e)return g[e]?g[e](t):S(f(e,D(t)).f);if(!e.splice){if((y=e).deps&&s(y.deps,y.callback),!t)return;t.splice?(e=t,t=n,n=null):e=h}return t=t||function(){},"function"==typeof n&&(n=i,i=r),i?o(h,e,t,n):setTimeout(function(){o(h,e,t,n)},4),s},s.config=function(e){return s(e)},t._defined=m,(i=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),b(m,e)||b(v,e)||(v[e]=[e,t,n])}).amd={jQuery:!0},e.requirejs=t,e.require=n,e.define=i),e.define("almond",function(){}),e.define("jquery",[],function(){var e=d||$;return null==e&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),e}),e.define("select2/utils",["jquery"],function(o){var r={};function u(e){var t=e.prototype,n=[];for(var i in t){"function"==typeof t[i]&&"constructor"!==i&&n.push(i)}return n}r.Extend=function(e,t){var n={}.hasOwnProperty;function i(){this.constructor=e}for(var r in t)n.call(t,r)&&(e[r]=t[r]);return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},r.Decorate=function(i,r){var e=u(r),t=u(i);function o(){var e=Array.prototype.unshift,t=r.prototype.constructor.length,n=i.prototype.constructor;0<t&&(e.call(arguments,i.prototype.constructor),n=r.prototype.constructor),n.apply(this,arguments)}r.displayName=i.displayName,o.prototype=new function(){this.constructor=o};for(var n=0;n<t.length;n++){var s=t[n];o.prototype[s]=i.prototype[s]}function a(e){var t=function(){};e in o.prototype&&(t=o.prototype[e]);var n=r.prototype[e];return function(){return Array.prototype.unshift.call(arguments,t),n.apply(this,arguments)}}for(var l=0;l<e.length;l++){var c=e[l];o.prototype[c]=a(c)}return o};function e(){this.listeners={}}e.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},e.prototype.trigger=function(e){var t=Array.prototype.slice,n=t.call(arguments,1
772);this.listeners=this.listeners||{},null==n&&(n=[]),0===n.length&&n.push({}),(n[0]._type=e)in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},e.prototype.invoke=function(e,t){for(var n=0,i=e.length;n<i;n++)e[n].apply(this,t)},r.Observable=e,r.generateChars=function(e){for(var t="",n=0;n<e;n++){t+=Math.floor(36*Math.random()).toString(36)}return t},r.bind=function(e,t){return function(){e.apply(t,arguments)}},r._convertData=function(e){for(var t in e){var n=t.split("-"),i=e;if(1!==n.length){for(var r=0;r<n.length;r++){var o=n[r];(o=o.substring(0,1).toLowerCase()+o.substring(1))in i||(i[o]={}),r==n.length-1&&(i[o]=e[t]),i=i[o]}delete e[t]}}return e},r.hasScroll=function(e,t){var n=o(t),i=t.style.overflowX,r=t.style.overflowY;return(i!==r||"hidden"!==r&&"visible"!==r)&&("scroll"===i||"scroll"===r||(n.innerHeight()<t.scrollHeight||n.innerWidth()<t.scrollWidth))},r.escapeMarkup=function(e){var t={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},r.appendMany=function(e,t){if("1.7"===o.fn.jquery.substr(0,3)){var n=o();o.map(t,function(e){n=n.add(e)}),t=n}e.append(t)},r.__cache={};var n=0;return r.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2-id");return null==t&&(e.id?(t=e.id,e.setAttribute("data-select2-id",t)):(e.setAttribute("data-select2-id",++n),t=n.toString())),t},r.StoreData=function(e,t,n){var i=r.GetUniqueElementId(e);r.__cache[i]||(r.__cache[i]={}),r.__cache[i][t]=n},r.GetData=function(e,t){var n=r.GetUniqueElementId(e);return t?r.__cache[n]&&null!=r.__cache[n][t]?r.__cache[n][t]:o(e).data(t):r.__cache[n]},r.RemoveData=function(e){var t=r.GetUniqueElementId(e);null!=r.__cache[t]&&delete r.__cache[t],e.removeAttribute("data-select2-id")},r}),e.define("select2/results",["jquery","./utils"],function(h,f){function i(e,t,n){this.$element=e,this.data=n,this.options=t,i.__super__.constructor.call(this)}return f.Extend(i,f.Observable),i.prototype.render=function(){var e=h('<ul class="select2-results__options" role="listbox"></ul>');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e},i.prototype.clear=function(){this.$results.empty()},i.prototype.displayMessage=function(e){var t=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var n=h('<li role="alert" aria-live="assertive" class="select2-results__option"></li>'),i=this.options.get("translations").get(e.message);n.append(t(i(e.args))),n[0].className+=" select2-results__message",this.$results.append(n)},i.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},i.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n<e.results.length;n++){var i=e.results[n],r=this.option(i);t.push(r)}this.$results.append(t)}else 0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"})},i.prototype.position=function(e,t){t.find(".select2-results").append(e)},i.prototype.sort=function(e){return this.options.get("sorter")(e)},i.prototype.highlightFirstItem=function(){var e=this.$results.find(".select2-results__option[aria-selected]"),t=e.filter("[aria-selected=true]");0<t.length?t.first().trigger("mouseenter"):e.first().trigger("mouseenter"),this.ensureHighlightVisible()},i.prototype.setClasses=function(){var t=this;this.data.current(function(e){var i=h.map(e,function(e){return e.id.toString()});t.$results.find(".select2-results__option[aria-selected]").each(function(){var e=h(this),t=f.GetData(this,"data"),n=""+t.id;null!=t.element&&t.element.selected||null==t.element&&-1<h.inArray(n,i)?e.attr("aria-selected","true"):e.attr("aria-selected","false")})})},i.prototype.showLoading=function(e){this.hideLoading();var t={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(e)},n=this.option(t);n.className+=" loading-results",this.$results.prepend(n)},i.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},i.prototype.option=function(e){var t=document.createElement("li");t.className="select2-results__option";var n={role:"option","aria-selected":"false"},i=window.Element.prototype.matches||window.Element.prototype.msMatchesSelector||window.Element.prototype.webkitMatchesSelector;for(var r in(null!=e.element&&i.call(e.element,":disabled")||null==e.element&&e.disabled)&&(delete n["aria-selected"],n["aria-disabled"]="true"),null==e.id&&delete n["aria-selected"],null!=e._resultId&&(t.id=e._resultId),e.title&&(t.title=e.title),e.children&&(n.role="group",n["aria-label"]=e.text,delete n["aria-selected"]),n){var o=n[r];t.setAttribute(r,o)}if(e.children){var s=h(t),a=document.createElement("strong");a.className="select2-results__group";h(a);this.template(e,a);for(var l=[],c=0;c<e.children.length;c++){var u=e.children[c],d=this.option(u);l.push(d)}var p=h("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});p.append(l),s.append(a),s.append(p)}else this.template(e,t);return f.StoreData(t,"data",e),t},i.prototype.bind=function(t,e){var l=this,n=t.id+"-results";this.$results.attr("id",n),t.on("results:all",function(e){l.clear(),l.append(e.data),t.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),t.on("results:append",function(e){l.append(e.data),t.isOpen()&&l.setClasses()}),t.on("query",function(e){l.hideMessages(),l.showLoading(e)}
772),t.on("select",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("open",function(){l.$results.attr("aria-expanded","true"),l.$results.attr("aria-hidden","false"),l.setClasses(),l.ensureHighlightVisible()}),t.on("close",function(){l.$results.attr("aria-expanded","false"),l.$results.attr("aria-hidden","true"),l.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=l.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=l.getHighlightedResults();if(0!==e.length){var t=f.GetData(e[0],"data");"true"==e.attr("aria-selected")?l.trigger("close",{}):l.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e);if(!(n<=0)){var i=n-1;0===e.length&&(i=0);var r=t.eq(i);r.trigger("mouseenter");var o=l.$results.offset().top,s=r.offset().top,a=l.$results.scrollTop()+(s-o);0===i?l.$results.scrollTop(0):s-o<0&&l.$results.scrollTop(a)}}),t.on("results:next",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e)+1;if(!(n>=t.length)){var i=t.eq(n);i.trigger("mouseenter");var r=l.$results.offset().top+l.$results.outerHeight(!1),o=i.offset().top+i.outerHeight(!1),s=l.$results.scrollTop()+o-r;0===n?l.$results.scrollTop(0):r<o&&l.$results.scrollTop(s)}}),t.on("results:focus",function(e){e.element.addClass("select2-results__option--highlighted")}),t.on("results:message",function(e){l.displayMessage(e)}),h.fn.mousewheel&&this.$results.on("mousewheel",function(e){var t=l.$results.scrollTop(),n=l.$results.get(0).scrollHeight-t+e.deltaY,i=0<e.deltaY&&t-e.deltaY<=0,r=e.deltaY<0&&n<=l.$results.height();i?(l.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):r&&(l.$results.scrollTop(l.$results.get(0).scrollHeight-l.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(e){var t=h(this),n=f.GetData(this,"data");"true"!==t.attr("aria-selected")?l.trigger("select",{originalEvent:e,data:n}):l.options.get("multiple")?l.trigger("unselect",{originalEvent:e,data:n}):l.trigger("close",{})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(e){var t=f.GetData(this,"data");l.getHighlightedResults().removeClass("select2-results__option--highlighted"),l.trigger("results:focus",{data:t,element:h(this)})})},i.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},i.prototype.destroy=function(){this.$results.remove()},i.prototype.ensureHighlightVisible=function(){var e=this.getHighlightedResults();if(0!==e.length){var t=this.$results.find("[aria-selected]").index(e),n=this.$results.offset().top,i=e.offset().top,r=this.$results.scrollTop()+(i-n),o=i-n;r-=2*e.outerHeight(!1),t<=2?this.$results.scrollTop(0):(o>this.$results.outerHeight()||o<0)&&this.$results.scrollTop(r)}},i.prototype.template=function(e,t){var n=this.options.get("templateResult"),i=this.options.get("escapeMarkup"),r=n(e,t);null==r?t.style.display="none":"string"==typeof r?t.innerHTML=i(r):h(t).append(r)},i}),e.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),e.define("select2/selection/base",["jquery","../utils","../keys"],function(n,i,r){function o(e,t){this.$element=e,this.options=t,o.__super__.constructor.call(this)}return i.Extend(o,i.Observable),o.prototype.render=function(){var e=n('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=i.GetData(this.$element[0],"old-tabindex")?this._tabindex=i.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),e.attr("aria-disabled","false"),this.$selection=e},o.prototype.bind=function(e,t){var n=this,i=e.id+"-results";this.container=e,this.$selection.on("focus",function(e){n.trigger("focus",e)}),this.$selection.on("blur",function(e){n._handleBlur(e)}),this.$selection.on("keydown",function(e){n.trigger("keypress",e),e.which===r.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){n.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){n.update(e.data)}),e.on("open",function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",i),n._attachCloseHandler(e)}),e.on("close",function(){n.$selection.attr("aria-expanded","fal
772se"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),n.$selection.trigger("focus"),n._detachCloseHandler(e)}),e.on("enable",function(){n.$selection.attr("tabindex",n._tabindex),n.$selection.attr("aria-disabled","false")}),e.on("disable",function(){n.$selection.attr("tabindex","-1"),n.$selection.attr("aria-disabled","true")})},o.prototype._handleBlur=function(e){var t=this;window.setTimeout(function(){document.activeElement==t.$selection[0]||n.contains(t.$selection[0],document.activeElement)||t.trigger("blur",e)},1)},o.prototype._attachCloseHandler=function(e){n(document.body).on("mousedown.select2."+e.id,function(e){var t=n(e.target).closest(".select2");n(".select2.select2-container--open").each(function(){this!=t[0]&&i.GetData(this,"element").select2("close")})})},o.prototype._detachCloseHandler=function(e){n(document.body).off("mousedown.select2."+e.id)},o.prototype.position=function(e,t){t.find(".selection").append(e)},o.prototype.destroy=function(){this._detachCloseHandler(this.container)},o.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},o}),e.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,i){function r(){r.__super__.constructor.apply(this,arguments)}return n.Extend(r,t),r.prototype.render=function(){var e=r.__super__.render.call(this);return e.addClass("select2-selection--single"),e.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),e},r.prototype.bind=function(t,e){var n=this;r.__super__.bind.apply(this,arguments);var i=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",i).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",i),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),t.on("focus",function(e){t.isOpen()||n.$selection.trigger("focus")})},r.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},r.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},r.prototype.selectionContainer=function(){return e("<span></span>")},r.prototype.update=function(e){if(0!==e.length){var t=e[0],n=this.$selection.find(".select2-selection__rendered"),i=this.display(t,n);n.empty().append(i);var r=t.title||t.text;r?n.attr("title",r):n.removeAttr("title")}else this.clear()},r}),e.define("select2/selection/multiple",["jquery","./base","../utils"],function(r,e,l){function n(e,t){n.__super__.constructor.apply(this,arguments)}return l.Extend(n,e),n.prototype.render=function(){var e=n.__super__.render.call(this);return e.addClass("select2-selection--multiple"),e.html('<ul class="select2-selection__rendered"></ul>'),e},n.prototype.bind=function(e,t){var i=this;n.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){i.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(e){if(!i.options.get("disabled")){var t=r(this).parent(),n=l.GetData(t[0],"data");i.trigger("unselect",{originalEvent:e,data:n})}})},n.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},n.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},n.prototype.selectionContainer=function(){return r('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">×</span></li>')},n.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=0;n<e.length;n++){var i=e[n],r=this.selectionContainer(),o=this.display(i,r);r.append(o);var s=i.title||i.text;s&&r.attr("title",s),l.StoreData(r[0],"data",i),t.push(r)}var a=this.$selection.find(".select2-selection__rendered");l.appendMany(a,t)}},n}),e.define("select2/selection/placeholder",["../utils"],function(e){function t(e,t,n){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n)}return t.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},t.prototype.createPlaceholder=function(e,t){var n=this.selectionContainer();return n.html(this.display(t)),n.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),n},t.prototype.update=function(e,t){var n=1==t.length&&t[0].id!=this.placeholder.id;if(1<t.length||n)return e.call(this,t);this.clear();var i=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(i)},t}
772),e.define("select2/selection/allowClear",["jquery","../keys","../utils"],function(r,i,a){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(e){i._handleClear(e)}),t.on("keypress",function(e){i._handleKeyboardClear(e,t)})},e.prototype._handleClear=function(e,t){if(!this.options.get("disabled")){var n=this.$selection.find(".select2-selection__clear");if(0!==n.length){t.stopPropagation();var i=a.GetData(n[0],"data"),r=this.$element.val();this.$element.val(this.placeholder.id);var o={data:i};if(this.trigger("clear",o),o.prevented)this.$element.val(r);else{for(var s=0;s<i.length;s++)if(o={data:i[s]},this.trigger("unselect",o),o.prevented)return void this.$element.val(r);this.$element.trigger("change"),this.trigger("toggle",{})}}}},e.prototype._handleKeyboardClear=function(e,t,n){n.isOpen()||t.which!=i.DELETE&&t.which!=i.BACKSPACE||this._handleClear(t)},e.prototype.update=function(e,t){if(e.call(this,t),!(0<this.$selection.find(".select2-selection__placeholder").length||0===t.length)){var n=this.options.get("translations").get("removeAllItems"),i=r('<span class="select2-selection__clear" title="'+n()+'">×</span>');a.StoreData(i[0],"data",t),this.$selection.find(".select2-selection__rendered").prepend(i)}},e}),e.define("select2/selection/search",["jquery","../utils","../keys"],function(i,a,l){function e(e,t,n){e.call(this,t,n)}return e.prototype.render=function(e){var t=i('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></li>');this.$searchContainer=t,this.$search=t.find("input");var n=e.call(this);return this._transferTabIndex(),n},e.prototype.bind=function(e,t,n){var i=this,r=t.id+"-results";e.call(this,t,n),t.on("open",function(){i.$search.attr("aria-controls",r),i.$search.trigger("focus")}),t.on("close",function(){i.$search.val(""),i.$search.removeAttr("aria-controls"),i.$search.removeAttr("aria-activedescendant"),i.$search.trigger("focus")}),t.on("enable",function(){i.$search.prop("disabled",!1),i._transferTabIndex()}),t.on("disable",function(){i.$search.prop("disabled",!0)}),t.on("focus",function(e){i.$search.trigger("focus")}),t.on("results:focus",function(e){e.data._resultId?i.$search.attr("aria-activedescendant",e.data._resultId):i.$search.removeAttr("aria-activedescendant")}),this.$selection.on("focusin",".select2-search--inline",function(e){i.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){i._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){if(e.stopPropagation(),i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented(),e.which===l.BACKSPACE&&""===i.$search.val()){var t=i.$searchContainer.prev(".select2-selection__choice");if(0<t.length){var n=a.GetData(t[0],"data");i.searchRemoveChoice(n),e.preventDefault()}}}),this.$selection.on("click",".select2-search--inline",function(e){i.$search.val()&&e.stopPropagation()});var o=document.documentMode,s=o&&o<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(e){s?i.$selection.off("input.search input.searchcheck"):i.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(e){if(s&&"input"===e.type)i.$selection.off("input.search input.searchcheck");else{var t=e.which;t!=l.SHIFT&&t!=l.CTRL&&t!=l.ALT&&t!=l.TAB&&i.handleSearch(e)}})},e.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},e.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},e.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),n&&this.$search.trigger("focus")},e.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},e.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},e.prototype.resizeSearch=function(){this.$search.css("width","25px");var e="";""!==this.$search.attr("placeholder")?e=this.$selection.find(".select2-selection__rendered").width():e=.75*(this.$search.val().length+1)+"em";this.$search.css("width",e)},e}),e.define("select2/selection/eventRelay",["jquery"],function(s){function e(){}return e.prototype.bind=function(e,t,n){var i=this,r=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],o=["opening","closing","selecting","unselecting","clearing"];e.call(this,t,n),t.on("*",function(e,t){if(-1!==s.inArray(e,r)){t=t||{};var n=s.Event("select2:"+e,{params:t});i.$element.trigger(n),-1!==s.inArray(e,o)&&(t.prevented=n.isDefaultPrevented())}})},e}),e.define("select2/translation",["jquery","require"],function(t,n){function i(e){this.dict=e||{}}return i.prototype.all=function(){return this.dict},i.prototype.get=function(e){return this.dict[e]},i.prototype.extend=function(e){this.dict=t.extend({},e.all(),this.dict)},i._cache={},i.loadPath=function(e){if(!(e in i._cache)){var t=n(e);i._cache[e]=t}return new i(i._cache[e])},i}),e.define("select2/diacritics",[],function(){return{"â¶":"A","A":"A","Ã":"A","Ã":"A","Ã":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ä":"A","Ä":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ç ":"A","Ã":"A","Ç":"A","Ả":"A","Ã
":"A","Ǻ":"A","Ç":"A","È":"A","È":"A","Ạ":"A","Ậ":"A","Ặ":"A","á¸":"A","Ä":"A","Ⱥ":"A","Ɐ":"A","ê²":"AA","Ã":"AE","Ǽ":"AE","Ç¢":"AE","ê´":"AO","ê¶":"AU","ê¸":"AV","êº":"AV","ê¼":"AY","â·":"B","ï¼¢":"B","á¸":"B","á¸":"B","á¸":"B","É":"B","Æ":"B","Æ":"B","â¸":"C","ï¼£":"C","Ä":"C","Ä":"C","Ä":"C","Ä":"C","Ã":"C","á¸":"C","Æ":"C","È»":"C","ê¾":"C","â¹":"D","D":"D","á¸":"D","Ä":"D","á¸":"D","á¸":"D","á¸":"D","á¸":"D","Ä":"D","Æ":"D","Æ":"D","Æ":"D","ê¹":"D","DZ":"DZ","Ç":"DZ","Dz":"Dz","Ç
":"Dz","âº":"E","ï¼¥":"E","Ã":"E","Ã":"E","Ã":"E","á»":"E","Ế":"E","á»":"E","á»":"E","Ẽ":"E","Ä":"E","á¸":"E","á¸":"E","Ä":"E","Ä":"E","Ã":"E","Ẻ":"E","Ä":"E","È":"E","È":"E","Ẹ":"E","á»":"E","Ȩ":"E","á¸":"E","Ä":"E","á¸":"E","á¸":"E","Æ":"E","Æ":"E","â»":"F","F":"F","á¸":"F","Æ":"F","ê»":"F","â¼":"G","ï¼§":"G","Ç´":"G","Ä":"G","Ḡ":"G","Ä":"G","Ä ":"G","Ǧ":"G","Ä¢":"G","Ǥ":"G","Æ":"G","ê ":"G","ê½":"G","ê¾":"G","â½":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","È":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","â±§":"H","â±µ":"H","ê":"H","â¾":"I","I":"I","Ã":"I","Ã":"I","Ã":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ã":"I","Ḯ":"I","á»":"I","Ç":"I","È":"I","È":"I","á»":"I","Ä®":"I","Ḭ":"I","Æ":"I","â¿":"J","J":"J","Ä´":"J","É":"J","â":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Æ":"K","Ⱪ":"K","ê":"K","ê":"K","ê":"K","ê¢":"K","â":"L","L":"L","Ä¿":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ä»":"L","Ḽ":"L","Ḻ":"L","Å":"L","Ƚ":"L","â±¢":"L","â± ":"L","ê":"L","ê":"L","ê":"L","Ç":"LJ","Ç":"Lj","â":"M","ï¼":"M","Ḿ":"M","á¹":"M","á¹":"M","â±®":"M","Æ":"M","â":"N","ï¼®":"N","Ǹ":"N","Å":"N","Ã":"N","á¹":"N","Å":"N","á¹":"N","Å
":"N","á¹":"N","á¹":"N","È ":"N","Æ":"N","ê":"N","ê¤":"N","Ç":"NJ","Ç":"Nj","â":"O","O":"O","Ã":"O","Ã":"O","Ã":"O","á»":"O","á»":"O","á»":"O","á»":"O","Ã":"O","á¹":"O","Ȭ":"O","á¹":"O","Å":"O","á¹":"O","á¹":"O","Å":"O","È®":"O","Ȱ":"O","Ã":"O","Ȫ":"O","á»":"O","Å":"O","Ç":"O","È":"O","È":"O","Æ ":"O","á»":"O","á»":"O","á» ":"O","á»":"O","Ợ":"O","á»":"O","á»":"O","Ǫ":"O","Ǭ":"O","Ã":"O","Ǿ":"O","Æ":"O","Æ":"O","ê":"O","ê":"O","Å":"OE","Æ¢":"OI","ê":"OO","È¢":"OU","â
":"P","ï¼°":"P","á¹":"P","á¹":"P","Ƥ":"P","â±£":"P","ê":"P","ê":"P","ê":"P","â":"Q","ï¼±":"Q","ê":"Q","ê":"Q","É":"Q","â":"R","ï¼²":"R","Å":"R","á¹":"R","Å":"R","È":"R","È":"R","á¹":"R","á¹":"R","Å":"R","á¹":"R","É":"R","Ɽ":"R","ê":"R","ê¦":"R","ê":"R","â":"S","ï¼³":"S","áº":"S","Å":"S","Ṥ":"S","Å":"S","á¹ ":"S","Å ":"S","Ṧ":"S","á¹¢":"S","Ṩ":"S","È":"S","Å":"S","â±¾":"S","ê¨":"S","ê":"S","â":"T","ï¼´":"T","Ṫ":"T","Ť":"T","Ṭ":"T","È":"T","Å¢":"T","á¹°":"T","á¹®":"T","Ŧ":"T","Ƭ":"T","Æ®":"T","Ⱦ":"T","ê":"T","ê¨":"TZ","â":"U","ï¼µ":"U","Ã":"U","Ã":"U","Ã":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ã":"U","Ç":"U","Ç":"U","Ç":"U","Ç":"U","Ủ":"U","Å®":"U","Ű":"U","Ç":"U","È":"U","È":"U","Ư":"U","Ừ":"U","Ứ":"U","á»®":"U","Ử":"U","á»°":"U","Ụ":"U","á¹²":"U","Ų":"U","á¹¶":"U","á¹´":"U","É":"U","â":"V","ï¼¶":"V","á¹¼":"V","á¹¾":"V","Ʋ":"
772V","ê":"V","É
":"V","ê ":"VY","â":"W","ï¼·":"W","áº":"W","áº":"W","Å´":"W","áº":"W","áº":"W","áº":"W","â±²":"W","â":"X","X":"X","áº":"X","áº":"X","â":"Y","ï¼¹":"Y","Ỳ":"Y","Ã":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","áº":"Y","Ÿ":"Y","á»¶":"Y","á»´":"Y","Ƴ":"Y","É":"Y","Ỿ":"Y","â":"Z","Z":"Z","Ź":"Z","áº":"Z","Å»":"Z","Ž":"Z","áº":"Z","áº":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","ê¢":"Z","â":"a","ï½":"a","áº":"a","à ":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","Ä":"a","Ä":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","Ç¡":"a","ä":"a","Ç":"a","ả":"a","Ã¥":"a","Ç»":"a","Ç":"a","È":"a","È":"a","ạ":"a","áº":"a","ặ":"a","á¸":"a","Ä
":"a","â±¥":"a","É":"a","ê³":"aa","æ":"ae","ǽ":"ae","Ç£":"ae","êµ":"ao","ê·":"au","ê¹":"av","ê»":"av","ê½":"ay","â":"b","ï½":"b","á¸":"b","á¸
":"b","á¸":"b","Æ":"b","Æ":"b","É":"b","â":"c","ï½":"c","Ä":"c","Ä":"c","Ä":"c","Ä":"c","ç":"c","á¸":"c","Æ":"c","ȼ":"c","ê¿":"c","â":"c","â":"d","ï½":"d","á¸":"d","Ä":"d","á¸":"d","á¸":"d","á¸":"d","á¸":"d","Ä":"d","Æ":"d","É":"d","É":"d","êº":"d","dz":"dz","Ç":"dz","â":"e","ï½
":"e","è":"e","é":"e","ê":"e","á»":"e","ế":"e","á»
":"e","á»":"e","ẽ":"e","Ä":"e","á¸":"e","á¸":"e","Ä":"e","Ä":"e","ë":"e","ẻ":"e","Ä":"e","È
":"e","È":"e","ẹ":"e","á»":"e","È©":"e","á¸":"e","Ä":"e","á¸":"e","á¸":"e","É":"e","É":"e","Ç":"e","â":"f","ï½":"f","á¸":"f","Æ":"f","ê¼":"f","â":"g","ï½":"g","ǵ":"g","Ä":"g","ḡ":"g","Ä":"g","Ä¡":"g","ǧ":"g","Ä£":"g","Ç¥":"g","É ":"g","ê¡":"g","áµ¹":"g","ê¿":"g","â":"h","ï½":"h","Ä¥":"h","ḣ":"h","ḧ":"h","È":"h","ḥ":"h","ḩ":"h","ḫ":"h","áº":"h","ħ":"h","ⱨ":"h","â±¶":"h","É¥":"h","Æ":"hv","â":"i","ï½":"i","ì":"i","Ã":"i","î":"i","Ä©":"i","Ä«":"i","Ä":"i","ï":"i","ḯ":"i","á»":"i","Ç":"i","È":"i","È":"i","á»":"i","į":"i","á¸":"i","ɨ":"i","ı":"i","â":"j","ï½":"j","ĵ":"j","ǰ":"j","É":"j","â":"k","ï½":"k","ḱ":"k","Ç©":"k","ḳ":"k","Ä·":"k","ḵ":"k","Æ":"k","ⱪ":"k","ê":"k","ê":"k","ê
":"k","ê£":"k","â":"l","ï½":"l","Å":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","Å¿":"l","Å":"l","Æ":"l","É«":"l","ⱡ":"l","ê":"l","ê":"l","ê":"l","Ç":"lj","â":"m","ï½":"m","ḿ":"m","á¹":"m","á¹":"m","ɱ":"m","ɯ":"m","â":"n","ï½":"n","ǹ":"n","Å":"n","ñ":"n","á¹
":"n","Å":"n","á¹":"n","Å":"n","á¹":"n","á¹":"n","Æ":"n","ɲ":"n","Å":"n","ê":"n","ê¥":"n","Ç":"nj","â":"o","ï½":"o","ò":"o","ó":"o","ô":"o","á»":"o","á»":"o","á»":"o","á»":"o","õ":"o","á¹":"o","È":"o","á¹":"o","Å":"o","á¹":"o","á¹":"o","Å":"o","ȯ":"o","ȱ":"o","ö":"o","È«":"o","á»":"o","Å":"o","Ç":"o","È":"o","È":"o","Æ¡":"o","á»":"o","á»":"o","ỡ":"o","á»":"o","ợ":"o","á»":"o","á»":"o","Ç«":"o","Ç":"o","ø":"o","Ç¿":"o","É":"o","ê":"o","ê":"o","ɵ":"o","Å":"oe","Æ£":"oi","È£":"ou","ê":"oo","â":"p","ï½":"p","á¹":"p","á¹":"p","Æ¥":"p","áµ½":"p","ê":"p","ê":"p","ê":"p","â ":"q","ï½":"q","É":"q","ê":"q","ê":"q","â¡":"r","ï½":"r","Å":"r","á¹":"r","Å":"r","È":"r","È":"r","á¹":"r","á¹":"r","Å":"r","á¹":"r","É":"r","ɽ":"r","ê":"r","ê§":"r","ê":"r","â¢":"s","ï½":"s","Ã":"s","Å":"s","á¹¥":"s","Å":"s","ṡ":"s","Å¡":"s","á¹§":"s","á¹£":"s","ṩ":"s","È":"s","Å":"s","È¿":"s","ê©":"s","ê
":"s","áº":"s","â£":"t","ï½":"t","ṫ":"t","áº":"t","Å¥":"t","á¹":"t","È":"t","Å£":"t","á¹±":"t","ṯ":"t","ŧ":"t","Æ":"t","Ê":"t","ⱦ":"t","ê":"t","ê©":"tz","â¤":"u","ï½":"u","ù":"u","ú":"u","û":"u","Å©":"u","á¹¹":"u","Å«":"u","á¹»":"u","Å":"u","ü":"u","Ç":"u","Ç":"u","Ç":"u","Ç":"u","á»§":"u","ů":"u","ű":"u","Ç":"u","È":"u","È":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","á»":"u","á»±":"u","ụ":"u","á¹³":"u","ų":"u","á¹·":"u","á¹µ":"u","Ê":"u","â¥":"v","ï½":"v","á¹½":"v","ṿ":"v","Ê":"v","ê":"v","Ê":"v","ê¡":"vy","â¦":"w","ï½":"w","áº":"w","áº":"w","ŵ":"w","áº":"w","áº
":"w","áº":"w","áº":"w","â±³":"w","â§":"x","ï½":"x","áº":"x","áº":"x","â¨":"y","ï½":"y","ỳ":"y","ý":"y","Å·":"y","ỹ":"y","ȳ":"y","áº":"y","ÿ":"y","á»·":"y","áº":"y","ỵ":"y","Æ´":"y","É":"y","ỿ":"y","â©":"z","ï½":"z","ź":"z","áº":"z","ż":"z","ž":"z","áº":"z","áº":"z","ƶ":"z","È¥":"z","É":"z","ⱬ":"z","ê£":"z","Î":"Î","Î":"Î","Î":"Î","Î":"Î","Ϊ":"Î","Î":"Î","Î":"Î¥","Ϋ":"Î¥","Î":"Ω","ά":"α","Î":"ε","ή":"η","ί":"ι","Ï":"ι","Î":"ι","Ï":"ο","Ï":"Ï
","Ï":"Ï
","ΰ":"Ï
","Ï":"Ï","Ï":"Ï","â":"'"}}),e.define("select2/data/base",["../utils"],function(i){function n(e,t){n.__super__.constructor.call(this)}return i.Extend(n,i.Observable),n.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},n.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},n.prototype.bind=function(e,t){},n.prototype.destroy=function(){},n.prototype.generateResultId=function(e,t){var n=e.id+"-result-";return n+=i.generateChars(4),null!=t.id?n+="-"+t.id.toString():n+="-"+i.generateChars(4),n},n}),e.define("select2/data/select",["./base","../utils","jquery"],function(e,a,l){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return a.Extend(n,e),n.prototype.current=function(e){var n=[],i=this;this.$element.find(":selected").each(function(){var e=l(this),t=i.item(e);n.push(t)}),e(n)},n.prototype.select=function(r){var o=this;if(r.selected=!0,l(r.element).is("option"))return r.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(e){var t=[];(r=[r]).push.apply(r,e);for(var n=0;n<r.length;n++){var i=r[n].id;-1===l.inArray(i,t)&&t.push(i)}o.$element.val(t),o.$element.trigger("change")});else{var e=r.id;this.$element.val(e),this.$element.trigger("change")}},n.prototype.unselect=function(r){var o=this;if(this.$element.prop("multiple")){if(r.selected=!1,l(r.element).is("option"))return r.element.selected=!1,void this.$element.trigger("change");this.current(function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n].id;i!==r.id&&-1===l.inArray(i,t)&&t.push(i)}o.$element.val(t),o.$element.trigger("change")})}},n.prototype.bind=function(e,t){var n=this;(this.container=e).on("select",function(e){n.select(e.data)}),e.on("unselect",function(e){n.unselect(e.data)})},n.prototype.destroy=function(){this.$element.find("*").each(function(){a.RemoveData(this)})},n.prototype.query=function(i,e){var r=[],o=this;this.$element.children().each(function(){var e=l(this);if(e.is("option")||e.is("optgroup")){var t=o.item(e),n=o.matches(i,t);null!==n&&r.push(n)}}),e({results:r})},n.prototype.addOptions=function(e){a.appendMany(this.$element,e)},n.prototype.option=function(e){var t;e.children?(t=document.createElement("optgroup")).label=e.text:void 0!==(t=document.createElement("option")).textContent?t.textContent=e.text:t.innerText=e.text,void 0!==e.id&&(t.value=e.id),e.disabled&&(t.disabled=!0),e.selected&&(t.selected=!0),e.title&&(t.title=e.title);var n=l(t),i=this._normalizeItem(e);return i.element=t,a.StoreData(t,"data",i),n},n.prototype.item=function(e){var t={};if(null!=(t=a.GetData(e[0],"data")))return t;if(e.is("option"))t={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if(e.is("optgroup")){t={text:e.prop("label"),children:[],title:e.prop("title")};for(var n=e.children("option"),i=[],r=0;r<n.length;r++){var o=l(n[r]),s=this.item(o);i.push(s)}t.children=i}return(t=this._normalizeItem(t)).element=e[0],a.StoreData(e[0],"data",t),t},n.prototype._normalizeItem=function(e){e!==Object(e)&&(e={id:e,text:e});return null!=(e=l.extend({},{text:""},e)).id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&null!=this.container&&(e._resultId=this.generateResultId(this.container,e)),l.extend({},{selected:!1,disabled:!1},e)},n.prototype.matches=function(e,t){return this.options.get("matcher")(e,t)},n}),e.define("select2/data/array",["./select","../utils","jquery"],function(e,f,g){function i(e,t){this._dataToConvert=t.get("data")||[],i.__super__.constructor.call(this,e,t)}return f.Extend(i,e),i.prototype.bind=function(e,t){i.__super__.bind.call(this,e,t),this.addOptions(this.convertToOptions(this._dataToConvert))},i.prototype.select=function(n){var e=this.$element.find("option").filter(function(e,t){return t.value==n.id.toString()});0===e.length&&(e=this.option(n),this.addOptions(e)),i.__super__.select.call(this,n)},i.prototype.convertToOptions=function(e){var t=this,n=this.$element.find("option"),i=n.map(function(){return t.item(g(this)).id}).get(),r=[];function o(e){return function(){return g(this).val()==e.id}}for(var s=0;s<e.length;s++){var a=this._normalizeItem(e[s]);
vendor: 10,993 bytes, line 772
772if(0<=g.inArray(a.id,i)){var l=n.filter(o(a)),c=this.item(l),u=g.extend(!0,{},a,c),d=this.option(u);l.replaceWith(d)}else{var p=this.option(a);if(a.children){var h=this.convertToOptions(a.children);f.appendMany(p,h)}r.push(p)}}return r},i}),e.define("select2/data/ajax",["./array","../utils","jquery"],function(e,t,o){function n(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),n.__super__.constructor.call(this,e,t)}return t.Extend(n,e),n.prototype._applyDefaults=function(e){var t={data:function(e){return o.extend({},e,{q:e.term})},transport:function(e,t,n){var i=o.ajax(e);return i.then(t),i.fail(n),i}};return o.extend({},t,e,!0)},n.prototype.processResults=function(e){return e},n.prototype.query=function(n,i){var r=this;null!=this._request&&(o.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var t=o.extend({type:"GET"},this.ajaxOptions);function e(){var e=t.transport(t,function(e){var t=r.processResults(e,n);r.options.get("debug")&&window.console&&console.error&&(t&&t.results&&o.isArray(t.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),i(t)},function(){"status"in e&&(0===e.status||"0"===e.status)||r.trigger("results:message",{message:"errorLoading"})});r._request=e}"function"==typeof t.url&&(t.url=t.url.call(this.$element,n)),"function"==typeof t.data&&(t.data=t.data.call(this.$element,n)),this.ajaxOptions.delay&&null!=n.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(e,this.ajaxOptions.delay)):e()},n}),e.define("select2/data/tags",["jquery"],function(u){function e(e,t,n){var i=n.get("tags"),r=n.get("createTag");void 0!==r&&(this.createTag=r);var o=n.get("insertTag");if(void 0!==o&&(this.insertTag=o),e.call(this,t,n),u.isArray(i))for(var s=0;s<i.length;s++){var a=i[s],l=this._normalizeItem(a),c=this.option(l);this.$element.append(c)}}return e.prototype.query=function(e,c,u){var d=this;this._removeOldTags(),null!=c.term&&null==c.page?e.call(this,c,function e(t,n){for(var i=t.results,r=0;r<i.length;r++){var o=i[r],s=null!=o.children&&!e({results:o.children},!0);if((o.text||"").toUpperCase()===(c.term||"").toUpperCase()||s)return!n&&(t.data=i,void u(t))}if(n)return!0;var a=d.createTag(c);if(null!=a){var l=d.option(a);l.attr("data-select2-tag",!0),d.addOptions([l]),d.insertTag(i,a)}t.results=i,u(t)}):e.call(this,c,u)},e.prototype.createTag=function(e,t){var n=u.trim(t.term);return""===n?null:{id:n,text:n}},e.prototype.insertTag=function(e,t,n){t.unshift(n)},e.prototype._removeOldTags=function(e){this.$element.find("option[data-select2-tag]").each(function(){this.selected||u(this).remove()})},e}),e.define("select2/data/tokenizer",["jquery"],function(d){function e(e,t,n){var i=n.get("tokenizer");void 0!==i&&(this.tokenizer=i),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){e.call(this,t,n),this.$search=t.dropdown.$search||t.selection.$search||n.find(".select2-search__field")},e.prototype.query=function(e,t,n){var i=this;t.term=t.term||"";var r=this.tokenizer(t,this.options,function(e){var t=i._normalizeItem(e);if(!i.$element.find("option").filter(function(){return d(this).val()===t.id}).length){var n=i.option(t);n.attr("data-select2-tag",!0),i._removeOldTags(),i.addOptions([n])}!function(e){i.trigger("select",{data:e})}(t)});r.term!==t.term&&(this.$search.length&&(this.$search.val(r.term),this.$search.trigger("focus")),t.term=r.term),e.call(this,t,n)},e.prototype.tokenizer=function(e,t,n,i){for(var r=n.get("tokenSeparators")||[],o=t.term,s=0,a=this.createTag||function(e){return{id:e.term,text:e.term}};s<o.length;){var l=o[s];if(-1!==d.inArray(l,r)){var c=o.substr(0,s),u=a(d.extend({},t,{term:c}));null!=u?(i(u),o=o.substr(s+1)||"",s=0):s++}else s++}return{term:o}},e}),e.define("select2/data/minimumInputLength",[],function(){function e(e,t,n){this.minimumInputLength=n.get("minimumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",t.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumInputLength",[],function(){function e(e,t,n){this.maximumInputLength=n.get("maximumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",0<this.maximumInputLength&&t.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("select",function(){i._checkIfMaximumSelected()})},e.prototype.query=function(e,t,n){var i=this;this._checkIfMaximumSelected(function(){e.call(i,t,n)})},e.prototype._checkIfMaximumSelected=function(e,n){var i=this;this.current(function(e){var t=null!=e?e.length:0;0<i.maximumSelectionLength&&t>=i.maximumSelectionLength?i.trigger("results:message",{message:"maximumSelected",args:{maximum:i.maximumSelectionLength}}):n&&n()})},e}),e.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('<span class="select2-dropdown"><span class="select2-results"></span></span>');return e.attr("dir",this.options.get("dir")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),e.define("select2/dropdown/search",["jquery","../utils"],function(o,e){function t(){}return t.prototype.render=function(e){var t=e.call(this),n=o('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></span>');return this.$searchContainer=n,this.$search=n.find("input"),t.prepend(n),t},t.prototype.bind=function(e,t,n){var i=this,r=t.id+"-results";e.call(this,t,n),this.$search.on("keydown",function(e){i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(e){o(this).off("keyup")}),this.$search.on("keyup input",function(e){i.handleSearch(e)}),t.on("open",function(){i.$search.attr("tabindex",0),i.$search.attr("aria-controls",r),i.$search.trigger("focus"),window.setTimeout(function(){i.$search.trigger("focus")},0)}),t.on("close",function(){i.$search.attr("tabindex",-1),i.$search.removeAttr("aria-controls"),i.$search.removeAttr("aria-activedescendant"),i.$search.val(""),i.$search.trigger("blur")}),t.on("focus",function(){t.isOpen()||i.$search.trigger("focus")}),t.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(i.showSearch(e)?i.$searchContainer.removeClass("select2-search--hide"):i.$searchContainer.addClass("select2-search--hide"))}),t.on("results:focus",function(e){e.data._resultId?i.$search.attr("aria-activedescendant",e.data._resultId):i.$search.removeAttr("aria-activedescendant")})},t.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},t.prototype.showSearch=function(e,t){return!0},t}),e.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,i){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,i)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),i=t.length-1;0<=i;i--){var r=t[i];this.placeholder.id===r.id&&n.splice(i,1)}return n},e}),e.define("select2/dropdown/infiniteScroll",["jquery"],function(n){function e(e,t,n,i){this.lastParams={},e.call(this,t,n,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("query",function(e){i.lastParams=e,i.loading=!0}),t.on("query:append",function(e){i.lastParams=e,i.loading=!0}),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},e.prototype.loadMoreIfNeeded=function(){var e=n.contains(document.documentElement,this.$loadingMore[0]);if(!this.loading&&e){var t=this.$results.offset().top+this.$results.outerHeight(!1);this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=t+50&&this.loadMore()}},e.prototype.loadMore=function(){this.loading=!0;var e=n.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=n('<li class="select2-results__option select2-results__option--load-more"role="option" aria-disabled="true"></li>'),t=this.options.get("translations").get("loadingMore");return e.html(t(this.lastParams)),e},e}),e.define("select2/dropdown/attachBody",["jquery","../utils"],function(f,a){function e(e,t,n){this.$dropdownParent=f(n.get("dropdownParent")||document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("open",function(){i._showDropdown(),i._attachPositioningHandler(t),i._bindContainerResultHandlers(t)}),t.on("close",function(){i._hideDropdown(),i._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=f("<span></span>"),n=e.call(this);return t.append(n),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._bindContainerResultHandlers=function(e,t){if(!this._containerResultsHandlersBound){var n=this;t.on("results:all",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:append",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:message",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("select",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("unselect",function(){n._positionDropdown(),n._resizeDropdown()}),this._containerResultsHandlersBound=!0}},e.prototype._attachPositioningHandler=function(e,t){var n=this,i="scroll.
772select2."+t.id,r="resize.select2."+t.id,o="orientationchange.select2."+t.id,s=this.$container.parents().filter(a.hasScroll);s.each(function(){a.StoreData(this,"select2-scroll-position",{x:f(this).scrollLeft(),y:f(this).scrollTop()})}),s.on(i,function(e){var t=a.GetData(this,"select2-scroll-position");f(this).scrollTop(t.y)}),f(window).on(i+" "+r+" "+o,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n="scroll.select2."+t.id,i="resize.select2."+t.id,r="orientationchange.select2."+t.id;this.$container.parents().filter(a.hasScroll).off(n),f(window).off(n+" "+i+" "+r)},e.prototype._positionDropdown=function(){var e=f(window),t=this.$dropdown.hasClass("select2-dropdown--above"),n=this.$dropdown.hasClass("select2-dropdown--below"),i=null,r=this.$container.offset();r.bottom=r.top+this.$container.outerHeight(!1);var o={height:this.$container.outerHeight(!1)};o.top=r.top,o.bottom=r.top+o.height;var s=this.$dropdown.outerHeight(!1),a=e.scrollTop(),l=e.scrollTop()+e.height(),c=a<r.top-s,u=l>r.bottom+s,d={left:r.left,top:o.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h=p.offset();d.top-=h.top,d.left-=h.left,t||n||(i="below"),u||!c||t?!c&&u&&t&&(i="below"):i="above",("above"==i||t&&"below"!==i)&&(d.top=o.top-h.top-s),null!=i&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+i),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+i)),this.$dropdownContainer.css(d)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),e.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,i){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,i)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,i=0;i<t.length;i++){var r=t[i];r.children?n+=e(r.children):n++}return n}(t.data.results)<this.minimumResultsForSearch)&&e.call(this,t)},e}),e.define("select2/dropdown/selectOnClose",["../utils"],function(o){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("close",function(e){i._handleSelectOnClose(e)})},e.prototype._handleSelectOnClose=function(e,t){if(t&&null!=t.originalSelect2Event){var n=t.originalSelect2Event;if("select"===n._type||"unselect"===n._type)return}var i=this.getHighlightedResults();if(!(i.length<1)){var r=o.GetData(i[0],"data");null!=r.element&&r.element.selected||null==r.element&&r.selected||this.trigger("select",{data:r})}},e}),e.define("select2/dropdown/closeOnSelect",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("select",function(e){i._selectTriggered(e)}),t.on("unselect",function(e){i._selectTriggered(e)})},e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;n&&(n.ctrlKey||n.metaKey)||this.trigger("close",{originalEvent:n,originalSelect2Event:t})},e}),e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return 1!=t&&(n+="s"),n},inputTooShort:function(e){return"Please enter "+(e.minimum-e.input.length)+" or more characters"},loadingMore:function(){return"Loading more resultsâ¦"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return 1!=e.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searchingâ¦"},removeAllItems:function(){return"Remove all items"}}}),e.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(c,u,d,p,h,f,g,m,v,y,s,t,_,w,$,b,A,x,S,D,C,E,O,T,q,j,L,I,e){function n(){this.reset()}return n.prototype.apply=function(e){if(null==(e=c.extend(!0,{},this.defaults,e)).dataAdapter){if(null!=e.ajax?e.dataAdapter=$:null!=e.data?e.dataAdapter=w:e.dataAdapter=_,0<e.minimumInputLength&&(e.dataAdapter=y.Decorate(e.dataAdapter,x)),0<e.maximumInputLength&&(e.dataAdapter=y.Decorate(e.dataAdapter,S)),0<e.maximumSelectionLength&&(e.dataAdapter=y.Decorate(e.dataAdapter,D)),e.tags&&(e.dataAdapter=y.Decorate(e.dataAdapter,b)),null==e.tokenSeparators&&null==e.tokenizer||(e.dataAdapter=y.Decorate(e.dataAdapter,A)),null!=e.query){var t=u(e.amdBase+"compat/query");e.dataAdapter=y.Decorate(e.dataAdapter,t)}if(null!=e.initSelection){var n=u(e.amdBase+"compat/initSelection");e.dataAdapter=y.Decorate(e.dataAdapter,n)}}if(null==e.resultsAdapter&&(e.resultsAdapter=d,null!=e.ajax&&(e.resultsAdapter=y.Decorate(e.resultsAdapter,T)),null!=e.placeholder&&(e.resultsAdapter=y.Decorate(e.resultsAdapter,O)),e.selectOnClose&&(e.resultsAdapter=y.Decorate(e.resultsAdapter,L))),null==e.dropdownAdapter){if(e.multiple)e.dropdownAdapter=C;else{var i=y.Decorate(C,E);e.dropdownAdapter=i}if(0!==e.minimumResultsForSearch&&(e.dropdownAdapter=y.Decorate(e.dropdownAdapter,j)),e.closeOnSelect&&(e.dropdownAdapter=y.Decorate(e.dropdownAdapter,I)),null!=e.dropdownCssClass||null!=e.dropdownCss||null!=e.adaptDropdownCssClass){var r=u(e.amdBase+"compat/dropdownCss");e.dropdownAdapter=y.Decorate(e.dropdownAdapter,r)}e.dropdownAdapter=y.Decorate(e.dropdownAdapter,q)}if(null==e.selectionAdapter){if(e.multiple?e.selectionAdapter=h:e.selectionAdapter=p,null!=e.placeholder&&(e.selectionAdapter=y.Decorate(e.selectionAdapter,f)),e.allowClear&&(e.selectionAdapter=y.Decorate(e.selectionAdapter,g)),e.multiple&&(e.selectionAdapter=y.Decorate(e.selectionAdapter,m)),null!=e.containerCssClass||null!=e.containerCss||null!=e.adaptC
772ontainerCssClass){var o=u(e.amdBase+"compat/containerCss");e.selectionAdapter=y.Decorate(e.selectionAdapter,o)}e.selectionAdapter=y.Decorate(e.selectionAdapter,v)}e.language=this._resolveLanguage(e.language),e.language.push("en");for(var s=[],a=0;a<e.language.length;a++){var l=e.language[a];-1===s.indexOf(l)&&s.push(l)}return e.language=s,e.translations=this._processTranslations(e.language,e.debug),e},n.prototype.reset=function(){function a(e){return e.replace(/[^\u0000-\u007E]/g,function(e){return t[e]||e})}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:y.escapeMarkup,language:{},matcher:function e(t,n){if(""===c.trim(t.term))return n;if(n.children&&0<n.children.length){for(var i=c.extend(!0,{},n),r=n.children.length-1;0<=r;r--)null==e(t,n.children[r])&&i.children.splice(r,1);return 0<i.children.length?i:e(t,i)}var o=a(n.text).toUpperCase(),s=a(t.term).toUpperCase();return-1<o.indexOf(s)?n:null},minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,scrollAfterSelect:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},n.prototype.applyFromElement=function(e,t){var n=e.language,i=this.defaults.language,r=t.prop("lang"),o=t.closest("[lang]").prop("lang"),s=Array.prototype.concat.call(this._resolveLanguage(r),this._resolveLanguage(n),this._resolveLanguage(i),this._resolveLanguage(o));return e.language=s,e},n.prototype._resolveLanguage=function(e){if(!e)return[];if(c.isEmptyObject(e))return[];if(c.isPlainObject(e))return[e];var t;t=c.isArray(e)?e:[e];for(var n=[],i=0;i<t.length;i++)if(n.push(t[i]),"string"==typeof t[i]&&0<t[i].indexOf("-")){var r=t[i].split("-")[0];n.push(r)}return n},n.prototype._processTranslations=function(e,t){for(var n=new s,i=0;i<e.length;i++){var r=new s,o=e[i];if("string"==typeof o)try{r=s.loadPath(o)}catch(e){try{o=this.defaults.amdLanguageBase+o,r=s.loadPath(o)}catch(e){t&&window.console&&console.warn&&console.warn('Select2: The language file for "'+o+'" could not be automatically loaded. A fallback will be used instead.')}}else r=c.isPlainObject(o)?new s(o):o;n.extend(r)}return n},n.prototype.set=function(e,t){var n={};n[c.camelCase(e)]=t;var i=y._convertData(n);c.extend(!0,this.defaults,i)},new n}),e.define("select2/options",["require","jquery","./defaults","./utils"],function(i,d,r,p){function e(e,t){if(this.options=e,null!=t&&this.fromElement(t),null!=t&&(this.options=r.applyFromElement(this.options,t)),this.options=r.apply(this.options),t&&t.is("input")){var n=i(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=p.Decorate(this.options.dataAdapter,n)}}return e.prototype.fromElement=function(e){var t=["select2"];null==this.options.multiple&&(this.options.multiple=e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=e.prop("disabled")),null==this.options.dir&&(e.prop("dir")?this.options.dir=e.prop("dir"):e.closest("[dir]").prop("dir")?this.options.dir=e.closest("[dir]").prop("dir"):this.options.dir="ltr"),e.prop("disabled",this.options.disabled),e.prop("multiple",this.options.multiple),p.GetData(e[0],"select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),p.StoreData(e[0],"data",p.GetData(e[0],"select2Tags")),p.StoreData(e[0],"tags",!0)),p.GetData(e[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),e.attr("ajax--url",p.GetData(e[0],"ajaxUrl")),p.StoreData(e[0],"ajax-Url",p.GetData(e[0],"ajaxUrl")));var n={};function i(e,t){return t.toUpperCase()}for(var r=0;r<e[0].attributes.length;r++){var o=e[0].attributes[r].name,s="data-";if(o.substr(0,s.length)==s){var a=o.substring(s.length),l=p.GetData(e[0],a);n[a.replace(/-([a-z])/g,i)]=l}}d.fn.jquery&&"1."==d.fn.jquery.substr(0,2)&&e[0].dataset&&(n=d.extend(!0,{},e[0].dataset,n));var c=d.extend(!0,{},p.GetData(e[0]),n);for(var u in c=p._convertData(c))-1<d.inArray(u,t)||(d.isPlainObject(this.options[u])?d.extend(this.options[u],c[u]):this.options[u]=c[u]);return this},e.prototype.get=function(e){return this.options[e]},e.prototype.set=function(e,t){this.options[e]=t},e}),e.define("select2/core",["jquery","./options","./utils","./keys"],function(r,c,u,i){var d=function(e,t){null!=u.GetData(e[0],"select2")&&u.GetData(e[0],"select2").destroy(),this.$element=e,this.id=this._generateId(e),t=t||{},this.options=new c(t,e),d.__super__.constructor.call(this);var n=e.attr("tabindex")||0;u.StoreData(e[0],"old-tabindex",n),e.attr("tabindex","-1");var i=this.options.get("dataAdapter");this.dataAdapter=new i(e,this.options);var r=this.render();this._placeContainer(r);var o=this.options.get("selectionAdapter");this.selection=new o(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,r);var s=this.options.get("dropdownAdapter");this.dropdown=new s(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,r);var a=this.options.get("resultsAdapter");this.results=new a(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var l=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){l.trigger("selection:update",{data:e})}),e.addClass("select2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),u.StoreData(e[0],"select2",this),e.data("select2",this)};return u.Extend(d,u.Observable),d.prototype._generateId=function(e){return"select2-"+(null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+u.generateChars(2):u.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,"")},d.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},d.prototype._resolveWidth=function(e,t){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t){var i=this._resolveWidth(e,"style");return null!=i?i:this._resolveWidth(e,"element")}if("element"==t){var r=e.outerWidth(!1);return r<=0?"auto":r+"px"}if("style"!=t)return"computedstyle"!=t?t:window.getComputedStyle(e[0]).width;var o=e.attr("style");if("string"!=typeof o)return null;for(var s=o.split(";"),a=0,l=s.length;a<l;a+=1){var c=s[a].replace(/\s/g,"").match(n);if(null!==c&&1<=c.length)return c[1]}return null},d.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},d.prototype._registerDomEvents=function(){var t=this;this.$element.on("change.select2",function(){t.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})}),this.$element.on("focus.select2",function(e){t.trigger("focus",e)}),this._syncA=u.bind(this._syncAttributes,this),this._syncS=u.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=e?(this._observer=new e(function(e){r.each(e,t._syncA),r.each(e,t._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",t._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",t._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",t._syncS,!1))},d.prototype._registerDataEvents=function(){var n=this;this.dataAdapter.on("*",function(e,t){n.trigger(e,t)})},d.prototype._registerSelectionEvents=function(){var n=this,i=["toggle","focus"];this.selection.on("toggle",function(){n.toggleDropdown()}),this.selection.on("focus",function(e){n.focus(e)}),this.selection.on("*",function(e,t){-1===r.inArray(e,i)&&n.trigger(e,t)})},d.prototype._registerDropdownEvents=function(){var n=this;this.dropdown.on("*",function(e,t){n.trigger(e,t)})},d.prototype._registerResultsEvents=function(){var n=this;this.results.on("*",function(e,t){n.trigger(e,t)})},d.prototype._registerEvents=function(){var n=this;this.on("open",function(){n.$container.addClass("select2-container--open")}),this.on("close",function(){n.$container.removeClass("select2-container--open")}),this.on("enable",function(){n.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){n.$container.addClass("select2-container--disabled")}),this.on("blur",function(){n.$container.removeClass("select2-container--focus")}),this.on("query",function(t){n.isOpen()||n.trigger("open",{}),this.dataAdapter.query(t,function(e){n.trigger("results:all",{data:e,query:t})})}),this.on("query:append",function(t){this.dataAdapter.query(t,function(e){n.trigger("results:append",{data:e,query:t})})}),this.on("keypress",function(e){var t=e.which;n.isOpen()?t===i.ESC||t===i.TAB||t===i.UP&&e.altKey?(n.close(),e.preventDefault()):t===i.ENTER?(n.trigger("results:select",{}),e.preventDefault()):t===i.SPACE&&e.ctrlKey?(n.trigger("results:toggle",{}),e.preventDefault()):t===i.UP?(n.trigger("results:previous",{}),e.preventDefault()):t===i.DOWN&&(n.trigger("results:next",{}),e.preventDefault()):(t===i.ENTER||t===i.SPACE||t===i.DOWN&&e.altKey)&&(n.open(),e.preventDefault())})},d.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},d.prototype._syncSubtree=function(e,t){var n=!1,i=this;if(!e||!e.target||"OPTION"===e.target.nodeName||"OPTGROUP"===e.target.nodeName){if(t)if(t.addedNodes&&0<t.addedNodes.length)for(var r=0;r<t.addedNodes.length;r++){t.addedNodes[r].selected&&(n=!0)}else t.removedNodes&&0<t.removedNodes.length&&(n=!0);else n=!0;n&&this.dataAdapter.current(function(e){i.trigger("selection:update",{data:e})})}},d.prototype.trigger=function(e,t){var n=d.__super__.trigger,i={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===t&&(t={}),e in i){var r=i[e],o={prevented:!1,name:e,args:t};if(n.call(this,r,o),o.prevented)return void(t.prevented=!0)}n.call(this,e,t)},d.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},d.prototype.open=function(){this.isOpen()||this.trigger("query",{})},d.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},d.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},d.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")}
772,d.prototype.focus=function(e){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},d.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=e&&0!==e.length||(e=[!0]);var t=!e[0];this.$element.prop("disabled",t)},d.prototype.data=function(){this.options.get("debug")&&0<arguments.length&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var t=[];return this.dataAdapter.current(function(e){t=e}),t},d.prototype.val=function(e){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==e||0===e.length)return this.$element.val();var t=e[0];r.isArray(t)&&(t=r.map(t,function(e){return e.toString()})),this.$element.val(t).trigger("change")},d.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",u.GetData(this.$element[0],"old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),u.RemoveData(this.$element[0]),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},d.prototype.render=function(){var e=r('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container.addClass("select2-container--"+this.options.get("theme")),u.StoreData(e[0],"element",this.$element),e},d}),e.define("select2/compat/utils",["jquery"],function(s){return{syncCssClasses:function(e,t,n){var i,r,o=[];(i=s.trim(e.attr("class")))&&s((i=""+i).split(/\s+/)).each(function(){0===this.indexOf("select2-")&&o.push(this)}),(i=s.trim(t.attr("class")))&&s((i=""+i).split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&null!=(r=n(this))&&o.push(r)}),e.attr("class",o.join(" "))}}}),e.define("select2/compat/containerCss",["jquery","./utils"],function(s,a){function l(e){return null}function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get("containerCssClass")||"";s.isFunction(n)&&(n=n(this.$element));var i=this.options.get("adaptContainerCssClass");if(i=i||l,-1!==n.indexOf(":all:")){n=n.replace(":all:","");var r=i;i=function(e){var t=r(e);return null!=t?t+" "+e:e}}
vendor: 2,672 bytes, line 772
772var o=this.options.get("containerCss")||{};return s.isFunction(o)&&(o=o(this.$element)),a.syncCssClasses(t,this.$element,i),t.css(o),t.addClass(n),t},e}),e.define("select2/compat/dropdownCss",["jquery","./utils"],function(s,a){function l(e){return null}function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get("dropdownCssClass")||"";s.isFunction(n)&&(n=n(this.$element));var i=this.options.get("adaptDropdownCssClass");if(i=i||l,-1!==n.indexOf(":all:")){n=n.replace(":all:","");var r=i;i=function(e){var t=r(e);return null!=t?t+" "+e:e}}var o=this.options.get("dropdownCss")||{};return s.isFunction(o)&&(o=o(this.$element)),a.syncCssClasses(t,this.$element,i),t.css(o),t.addClass(n),t},e}),e.define("select2/compat/initSelection",["jquery"],function(i){function e(e,t,n){n.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=n.get("initSelection"),this._isInitialized=!1,e.call(this,t,n)}return e.prototype.current=function(e,t){var n=this;this._isInitialized?e.call(this,t):this.initSelection.call(null,this.$element,function(e){n._isInitialized=!0,i.isArray(e)||(e=[e]),t(e)})},e}),e.define("select2/compat/inputData",["jquery","../utils"],function(s,i){function e(e,t,n){this._currentData=[],this._valueSeparator=n.get("valueSeparator")||",","hidden"===t.prop("type")&&n.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `<select>` element instead."),e.call(this,t,n)}return e.prototype.current=function(e,t){function i(e,t){var n=[];return e.selected||-1!==s.inArray(e.id,t)?(e.selected=!0,n.push(e)):e.selected=!1,e.children&&n.push.apply(n,i(e.children,t)),n}for(var n=[],r=0;r<this._currentData.length;r++){var o=this._currentData[r];n.push.apply(n,i(o,this.$element.val().split(this._valueSeparator)))}t(n)},e.prototype.select=function(e,t){if(this.options.get("multiple")){var n=this.$element.val();n+=this._valueSeparator+t.id,this.$element.val(n),this.$element.trigger("change")}else this.current(function(e){s.map(e,function(e){e.selected=!1})}),this.$element.val(t.id),this.$element.trigger("change")},e.prototype.unselect=function(e,r){var o=this;r.selected=!1,this.current(function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n];r.id!=i.id&&t.push(i.id)}
772o.$element.val(t.join(o._valueSeparator)),o.$element.trigger("change")})},e.prototype.query=function(e,t,n){for(var i=[],r=0;r<this._currentData.length;r++){var o=this._currentData[r],s=this.matches(t,o);null!==s&&i.push(s)}n({results:i})},e.prototype.addOptions=function(e,t){var n=s.map(t,function(e){return i.GetData(e[0],"data")});this._currentData.push.apply(this._currentData,n)},e}),e.define("select2/compat/matcher",["jquery"],function(s){return function(o){return function(e,t){var n=s.extend(!0,{},t);if(null==e.term||""===s.trim(e.term))return n;if(t.children){for(var i=t.children.length-1;0<=i;i--){var r=t.children[i];o(e.term,r.text,r)||n.children.splice(i,1)}if(0<n.children.length)return n}return o(e.term,t.text,t)?n:null}}}),e.define("select2/compat/query",[],function(){function e(e,t,n){n.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `query` option has been deprecated in favor of a custom data adapter that overrides the `query` method. Support will be removed for the `query` option in future versions of Select2."),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.callback=n,this.options.get("query").call(null,t)},e}),e.define("select2/dropdown/attachContainer",[],function(){function e(e,t,n){e.call(this,t,n)}return e.prototype.position=function(e,t,n){n.find(".dropdown-wrapper").append(t),t.addClass("select2-dropdown--below"),n.addClass("select2-container--below")},e}),e.define("select2/dropdown/stopPropagation",[],function(){function e(){}return e.prototype.bind=function(e,t,n){e.call(this,t,n);this.$dropdown.on(["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"].join(" "),function(e){e.stopPropagation()})},e}),e.define("select2/selection/stopPropagation",[],function(){function e(){}return e.prototype.bind=function(e,t,n){e.call(this,t,n);this.$selection.on(["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"].join(" "),function(e){e.stopPropagation()})},e}),l=function(p){var h,f,e=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],t="onwheel"in document||9<=document.documentMode?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],g=Array.prototype.slice;if(p.event.fixHooks)for(var n=e.length;n;)p.event.fixHooks[e[--n]]=p.event.mouseHooks;var m=p.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var e=t.length;e;)this.addEventListener(t[--e],i,!1);else this.onmousewheel=i;p.data(this,"mousewheel-line-height",m.getLineHeight(this)),p.data(this,"mousewheel-page-height",m.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var e=t.length;e;)this.removeEventListener(t[--e],i,!1);else this.onmousewheel=null;p.removeData(this,"mousewheel-line-height"),p.removeData(this,"mousewheel-page-height")},getLineHeight:function(e){var t=p(e),n=t["offsetParent"in p.fn?"offsetParent":"parent"]();return n.length||(n=p("body")),parseInt(n.css("fontSize"),10)||parseInt(t.css("fontSize"),10)||16},getPageHeight:function(e){return p(e).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};function i(e){var t,n=e||window.event,i=g.call(arguments,1),r=0,o=0,s=0,a=0,l=0;if((e=p.event.fix(n)).type="mousewheel","detail"in n&&(s=-1*n.detail),"wheelDelta"in n&&(s=n.wheelDelta),"wheelDeltaY"in n&&(s=n.wheelDeltaY),"wheelDeltaX"in n&&(o=-1*n.wheelDeltaX),"axis"in n&&n.axis===n.HORIZONTAL_AXIS&&(o=-1*s,s=0),r=0===s?o:s,"deltaY"in n&&(r=s=-1*n.deltaY),"deltaX"in n&&(o=n.deltaX,0===s&&(r=-1*o)),0!==s||0!==o){if(1===n.deltaMode){var c=p.data(this,"mousewheel-line-height");r*=c,s*=c,o*=c}else if(2===n.deltaMode){var u=p.data(this,"mousewheel-page-height");r*=u,s*=u,o*=u}if(t=Math.max(Math.abs(s),Math.abs(o)),(!f||t<f)&&y(n,f=t)&&(f/=40),y(n,t)&&(r/=40,o/=40,s/=40),r=Math[1<=r?"floor":"ceil"](r/f),o=Math[1<=o?"floor":"ceil"](o/f),s=Math[1<=s?"floor":"ceil"](s/f),m.settings.normalizeOffset&&this.getBoundingClientRect){var d=this.getBoundingClientRect();a=e.clientX-d.left,l=e.clientY-d.top}return e.deltaX=o,e.deltaY=s,e.deltaFactor=f,e.offsetX=a,e.offsetY=l,e.deltaMode=0,i.unshift(e,r,o,s),h&&clearTimeout(h),h=setTimeout(v,200),(p.event.dispatch||p.event.handle).apply(this,i)}}function v(){f=null}function y(e,t){return m.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120==0}p.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})},"function"==typeof e.define&&e.define.amd?e.define("jquery-mousewheel",["jquery"],l):"object"==typeof exports?module.exports=l:l(d),e.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],function(r,e,o,t,s){if(null==r.fn.select2){var a=["open","close","destroy"];r.fn.select2=function(t){if("object"==typeof(t=t||{}))return this.each(function(){var e=r.extend(!0,{},t);new o(r(this),e)}),this;if("string"!=typeof t)throw new Error("Invalid arguments for Select2: "+t);
vendor: 2,124 bytes, lines 772-773
772var n,i=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=s.GetData(this,"select2");null==e&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),n=e[t].apply(e,i)}),-1<r.inArray(t,a)?this:n}}return null==r.fn.select2.defaults&&(r.fn.select2.defaults=t),o}),{define:e.define,require:e.require}}(),t=e.require("jquery.select2");return d.fn.select2.amd=e,t});; 773/*! tooltipster v4.2.6 */!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){function b(a){this.$container,this.constraints=null,this.__$tooltip,this.__init(a)}function c(b,c){var d=!0;return a.each(b,function(a,e){return void 0===c[a]||b[a]!==c[a]?(d=!1,!1):void 0}),d}function d(b){var c=b.attr("id"),d=c?h.window.document.getElementById(c):null;return d?d===b[0]:a.contains(h.window.document.body,b[0])}function e(){if(!g)return!1;var a=g.document.body||g.document.documentElement,b=a.style,c="transition",d=["Moz","Webkit","Khtml","O","ms"];if("string"==typeof b[c])return!0;c=c.charAt(0).toUpperCase()+c.substr(1);for(var e=0;e<d.length;e++)if("string"==typeof b[d[e]+c])return!0;return!1}var f={animation:"fade",animationDuration:350,content:null,contentAsHTML:!1,contentCloning:!1,debug:!0,delay:300,delayTouch:[300,500],functionInit:null,functionBefore:null,functionReady:null,functionAfter:null,functionFormat:null,IEmin:6,interactive:!1,multiple:!1,parent:null,plugins:["sideTip"],repositionOnScroll:!1,restoration:"none",selfDestruction:!0,theme:[],timer:0,trackerInterval:500,trackOrigin:!1,trackTooltip:!1,trigger:"hover",triggerClose:{click:!1,mouseleave:!1,originClick:!1,scroll:!1,tap:!1,touchleave:!1},triggerOpen:{click:!1,mouseenter:!1,tap:!1,touchstart:!1},updateAnimation:"rotate",zIndex:9999999},g="undefined"!=typeof window?window:null,h={hasTouchCapability:!(!g||!("ontouchstart"in g||g.DocumentTouch&&g.document instanceof g.DocumentTouch||g.navigator.maxTouchPoints)),hasTransitions:e(),IE:!1,semVer:"4.2.6
vendor: 28,893 bytes, line 773
773",window:g},i=function(){this.__$emitterPrivate=a({}),this.__$emitterPublic=a({}),this.__instancesLatestArr=[],this.__plugins={},this._env=h};i.prototype={__bridge:function(b,c,d){if(!c[d]){var e=function(){};e.prototype=b;var g=new e;g.__init&&g.__init(c),a.each(b,function(a,b){0!=a.indexOf("__")&&(c[a]?f.debug&&console.log("The "+a+" method of the "+d+" plugin conflicts with another plugin or native methods"):(c[a]=function(){return g[a].apply(g,Array.prototype.slice.apply(arguments))},c[a].bridged=g))}),c[d]=g}return this},__setWindow:function(a){return h.window=a,this},_getRuler:function(a){return new b(a)},_off:function(){return this.__$emitterPrivate.off.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.__$emitterPrivate.on.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_one:function(){return this.__$emitterPrivate.one.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_plugin:function(b){var c=this;if("string"==typeof b){var d=b,e=null;return d.indexOf(".")>0?e=c.__plugins[d]:a.each(c.__plugins,function(a,b){return b.name.substring(b.name.length-d.length-1)=="."+d?(e=b,!1):void 0}),e}if(b.name.indexOf(".")<0)throw new Error("Plugins must be namespaced");return c.__plugins[b.name]=b,b.core&&c.__bridge(b.core,c,b.name),this},_trigger:function(){var a=Array.prototype.slice.apply(arguments);return"string"==typeof a[0]&&(a[0]={type:a[0]}),this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,a),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,a),this},instances:function(b){var c=[],d=b||".tooltipstered";return a(d).each(function(){var b=a(this),d=b.data("tooltipster-ns");d&&a.each(d,function(a,d){c.push(b.data(d))})}),c},instancesLatest:function(){return this.__instancesLatestArr},off:function(){return this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},origins:function(b){var c=b?b+" ":"";return a(c+".tooltipstered").toArray()},setDefaults:function(b){return a.extend(f,b),this},triggerHandler:function(){return this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},a.tooltipster=new i,a.Tooltipster=function(b,c){this.__callbacks={close:[],open:[]},this.__closingTime,this.__Content,this.__contentBcr,this.__destroyed=!1,this.__$emitterPrivate=a({}),this.__$emitterPublic=a({}),this.__enabled=!0,this.__garbageCollector,this.__Geometry,this.__lastPosition,this.__namespace="tooltipster-"+Math.round(1e6*Math.random()),this.__options,this.__$originParents,this.__pointerIsOverOrigin=!1,this.__previousThemes=[],this.__state="closed",this.__timeouts={close:[],open:null},this.__touchEvents=[],this.__tracker=null,this._$origin,this._$tooltip,this.__init(b,c)},a.Tooltipster.prototype={__init:function(b,c){var d=this;if(d._$origin=a(b),d.__options=a.extend(!0,{},f,c),d.__optionsFormat(),!h.IE||h.IE>=d.__options.IEmin){var e=null;if(void 0===d._$origin.data("tooltipster-initialTitle")&&(e=d._$origin.attr("title"),void 0===e&&(e=null),d._$origin.data("tooltipster-initialTitle",e)),null!==d.__options.content)d.__contentSet(d.__options.content);else{var g,i=d._$origin.attr("data-tooltip-content");i&&(g=a(i)),g&&g[0]?d.__contentSet(g.first()):d.__contentSet(e)}d._$origin.removeAttr("title").addClass("tooltipstered"),d.__prepareOrigin(),d.__prepareGC(),a.each(d.__options.plugins,function(a,b){d._plug(b)}),h.hasTouchCapability&&a(h.window.document.body).on("touchmove."+d.__namespace+"-triggerOpen",function(a){d._touchRecordEvent(a)}),d._on("created",function(){d.__prepareTooltip()})._on("repositioned",function(a){d.__lastPosition=a.position})}else d.__options.disabled=!0},__contentInsert:function(){var a=this,b=a._$tooltip.find(".tooltipster-content"),c=a.__Content,d=function(a){c=a};return a._trigger({type:"format",content:a.__Content,format:d}),a.__options.functionFormat&&(c=a.__options.functionFormat.call(a,a,{origin:a._$origin[0]},a.__Content)),"string"!=typeof c||a.__options.contentAsHTML?b.empty().append(c):b.text(c),a},__contentSet:function(b){return b instanceof a&&this.__options.contentCloning&&(b=b.clone(!0)),this.__Content=b,this._trigger({type:"updated",content:b}),this},__destroyError:function(){throw new Error("This tooltip has been destroyed and cannot execute your method call.")},__geometry:function(){var b=this,c=b._$origin,d=b._$origin.is("area");if(d){var e=b._$origin.parent().attr("name");c=a('img[usemap="#'+e+'"]')}var f=c[0].getBoundingClientRect(),g=a(h.window.document),i=a(h.window),j=c,k={available:{document:null,window:null},document:{size:{height:g.height(),width:g.width()}},window:{scroll:{left:h.window.scrollX||h.window.document.documentElement.scrollLeft,top:h.window.scrollY||h.window.document.documentElement.scrollTop},size:{height:i.height(),width:i.width()}},origin:{fixedLineage:!1,offset:{},size:{height:f.bottom-f.top,width:f.right-f.left},usemapImage:d?c[0]:null,windowOffset:{bottom:f.bottom,left:f.left,right:f.right,top:f.top}}};if(d){var l=b._$origin.attr("shape"),m=b._$origin.attr("coords");if(m&&(m=m.split(","),a.map(m,function(a,b){m[b]=parseInt(a)})),"default"!=l)switch(l){case"circle":var n=m[0],o=m[1],p=m[2],q=o-p,r=n-p;k.origin.size.height=2*p,k.origin.size.width=k.origin.size.height,k.origin.windowOffset.left+=r,k.origin.windowOffset.top+=q;break;case"rect":var s=m[0],t=m[1],u=m[2],v=m[3];k.origin.size.height=v-t,k.origin.size.width=u-s,k.origin.windowOffset.left+=s,k.origin.windowOffset.top+=t;break;case"poly":for(var w=0,x=0,y=0,z=0,A="even",B=0;B<m.length;B++){var C=m[B];"even"==A?(C>y&&(y=C,0===B&&(w=y)),w>C&&(w=C),A="odd"):(C>z&&(z=C,1==B&&(x=z)),x>C&&(x=C),A="even")}k.origin.size.height=z-x,k.origin.size.width=y-w,k.origin.windowOffset.left+=w,k.origin.windowOffset.top+=x}}var D=function(a){k.origin.size.height=a.height,k.origin.windowOffset.left=a.left,k.origin.windowOffset.top=a.top,k.origin.size.width=a.width};for(b._trigger({type:"geometry",edit:D,geometry:{height:k.origin.size.height,left:k.origin.windowOffset.left,top:k.origin.windowOffset.top,width:k.origin.size.width}}),k.origin.windowOffset.right=k.origin.windowOffset.left+k.origin.size.width,k.origin.windowOffset.bottom=k.origin.windowOffset.top+k.origin.size.height,k.origin.offset.left=k.origin.windowOffset.left+k.window.scroll.left,k.origin.offset.top=k.origin.windowOffset.top+k.window.scroll.top,k.origin.offset.bottom=k.origin.offset.top+k.origin.size.height,k.origin.offset.right=k.origin.offset.left+k.origin.size.width,k.available.document={bottom:{height:k.document.size.height-k.origin.offset.bottom,width:k.document.size.width},left:{height:k.document.size.height,width:k.origin.offset.left},right:{height:k.document.size.height,width:k.document.size.width-k.origin.offset.right},top:{height:k.origin.offset.top,width:k.document.size.width}},k.available.window={bottom:{height:Math.max(k.window.size.height-Math.max(k.origin.windowOffset.bottom,0),0),width:k.window.size.width},left:{height:k.window.size.height,width:Math.max(k.origin.windowOffset.left,0)},right:{height:k.window.size.height,width:Math.max(k.window.size.width-Math.max(k.origin.windowOffset.right,0),0)},top:{height:Math.max(k.origin.windowOffset.top,0),width:k.window.size.width}};"html"!=j[0].tagName.toLowerCase();){if("fixed"==j.css("position")){k.origin.fixedLineage=!0;break}j=j.parent()}return k},__optionsFormat:function(){return"number"==typeof this.__options.animationDuration&&(this.__options.animationDuration=[this.__options.animationDuration,this.__options.animationDuration]),"number"==typeof this.__options.delay&&(this.__options.delay=[this.__options.delay,this.__options.delay]),"number"==typeof this.__options.delayTouch&&(this.__options.delayTouch=[this.__options.delayTouch,this.__options.delayTouch]),"string"==typeof this.__options.theme&&(this.__options.theme=[this.__options.theme]),null===this.__options.parent?this.__options.parent=a(h.window.document.body):"string"==typeof this.__options.parent&&(this.__options.parent=a(this.__options.parent)),"hover"==this.__options.trigger?(this.__options.triggerOpen={mouseenter:!0,touchstart:!0},this.__options.triggerClose={mouseleave:!0,originClick:!0,touchleave:!0}):"click"==this.__options.trigger&&(this.__options.triggerOpen={click:!0,tap:!0},this.__options.triggerClose={click:!0,tap:!0}),this._trigger("options"),this},__prepareGC:function(){var b=this;return b.__options.selfDestruction?b.__garbageCollector=setInterval(function(){var c=(new Date).getTime();b.__touchEvents=a.grep(b.__touchEvents,function(a,b){return c-a.time>6e4}),d(b._$origin)||b.close(function(){b.destroy()})},2e4):clearInterval(b.__garbageCollector),b},__prepareOrigin:function(){var a=this;if(a._$origin.off("."+a.__namespace+"-triggerOpen"),h.hasTouchCapability&&a._$origin.on("touchstart."+a.__namespace+"-triggerOpen touchend."+a.__namespace+"-triggerOpen touchcancel."+a.__namespace+"-triggerOpen",function(b){a._touchRecordEvent(b)}),a.__options.triggerOpen.click||a.__options.triggerOpen.tap&&h.hasTouchCapability){var b="";a.__options.triggerOpen.click&&(b+="click."+a.__namespace+"-triggerOpen "),a.__options.triggerOpen.tap&&h.hasTouchCapability&&(b+="touchend."+a.__namespace+"-triggerOpen"),a._$origin.on(b,function(b){a._touchIsMeaningfulEvent(b)&&a._open(b)})}if(a.__options.triggerOpen.mouseenter||a.__options.triggerOpen.touchstart&&h.hasTouchCapability){var b="";a.__options.triggerOpen.mouseenter&&(b+="mouseenter."+a.__namespace+"-triggerOpen "),a.__options.triggerOpen.touchstart&&h.hasTouchCapability&&(b+="touchstart."+a.__namespace+"-triggerOpen"),a._$origin.on(b,function(b){!a._touchIsTouchEvent(b)&&a._touchIsEmulatedEvent(b)||(a.__pointerIsOverOrigin=!0,a._openShortly(b))})}if(a.__options.triggerClose.mouseleave||a.__options.triggerClose.touchleave&&h.hasTouchCapability){var b="";a.__options.triggerClose.mouseleave&&(b+="mouseleave."+a.__namespace+"-triggerOpen "),a.__options.triggerClose.touchleave&&h.hasTouchCapability&&(b+="touchend."+a.__namespace+"-triggerOpen touchcancel."+a.__namespace+"-triggerOpen"),a._$origin.on(b,function(b){a._touchIsMeaningfulEvent(b)&&(a.__pointerIsOverOrigin=!1)})}return a},__prepareTooltip:function(){var b=this,c=b.__options.interactive?"auto":"";return b._$tooltip.attr("id",b.__namespace).css({"pointer-events":c,zIndex:b.__options.zIndex}),a.each(b.__previousThemes,function(a,c){b._$tooltip.removeClass(c)}),a.each(b.__options.theme,function(a,c){b._$tooltip.addClass(c)}),b.__previousThemes=a.merge([],b.__options.theme),b},__scrollHandler:function(b){var c=this;if(c.__options.triggerClose.scroll)c._close(b);else if(d(c._$origin)&&d(c._$tooltip)){var e=null;if(b.target===h.window.document)c.__Geometry.origin.fixedLineage||c.__options.repositionOnScroll&&c.reposition(b);else{e=c.__geometry();var f=!1;if("fixed"!=c._$origin.css("position")&&c.__$originParents.each(function(b,c){var d=a(c),g=d.css("overflow-x"),h=d.css("overflow-y");if("visible"!=g||"visible"!=h){var i=c.getBoundingClientRect();if("visible"!=g&&(e.origin.windowOffset.left<i.left||e.origin.windowOffset.right>i.right))return f=!0,!1;if("visible"!=h&&(e.origin.windowOffset.top<i.top||e.origin.windowOffset.bottom>i.bottom))return f=!0,!1}return"fixed"==d.css("position")?!1:void 0}),f)c._$tooltip.css("visibility","hidden");else if(c._$tooltip.css("visibility","visible"),c.__options.repositionOnScroll)c.reposition(b);else{var g=e.origin.offset.left-c.__Geometry.origin.offset.left,i=e.origin.offset.top-c.__Geometry.origin.offset.top;c._$tooltip.css({left:c.__lastPosition.coord.left+g,top:c.__lastPosition.coord.top+i})}}c._trigger({type:"scroll",event:b,geo:e})}return c},__stateSet:function(a){return this.__state=a,this._trigger({type:"state",state:a}),this},__timeoutsClear:function(){return clearTimeout(this.__timeouts.open),this.__timeouts.open=null,a.each(this.__timeouts.close,function(a,b){clearTimeout(b)}),this.__timeouts.close=[],this},__trackerStart:function(){var a=this,b=a._$tooltip.find(".tooltipster-content");return a.__options.trackTooltip&&(a.__contentBcr=b[0].getBoundingClientRect()),a.__tracker=setInterval(function(){if(d(a._$origin)&&d(a._$tooltip)){if(a.__options.trackOrigin){var e=a.__geometry(),f=!1;c(e.origin.size,a.__Geometry.origin.size)&&(a.__Geometry.origin.fixedLineage?c(e.origin.windowOffset,a.__Geometry.origin.windowOffset)&&(f=!0):c(e.origin.offset,a.__Geometry.origin.offset)&&(f=!0)),f||(a.__options.triggerClose.mouseleave?a._close():a.reposition())}if(a.__options.trackTooltip){var g=b[0].getBoundingClientRect();g.height===a.__contentBcr.height&&g.width===a.__contentBcr.width||(a.reposition(),a.__contentBcr=g)}}else a._close()},a.__options.trackerInterval),a},_close:function(b,c,d){var e=this,f=!0;if(e._trigger({type:"close",event:b,stop:function(){f=!1}}),f||d){c&&e.__callbacks.close.push(c),e.__callbacks.open=[],e.__timeoutsClear();var g=function(){a.each(e.__callbacks.close,function(a,c){c.call(e,e,{event:b,origin:e._$origin[0]})}),e.__callbacks.close=[]};if("closed"!=e.__state){var i=!0,j=new Date,k=j.getTime(),l=k+e.__options.animationDuration[1];if("disappearing"==e.__state&&l>e.__closingTime&&e.__options.animationDuration[1]>0&&(i=!1),i){e.__closingTime=l,"disappearing"!=e.__state&&e.__stateSet("disappearing");var m=function(){clearInterval(e.__tracker),e._trigger({type:"closing",event:b}),e._$tooltip.off("."+e.__namespace+"-triggerClose").removeClass("tooltipster-dying"),a(h.window).off("."+e.__namespace+"-triggerClose"),e.__$originParents.each(function(b,c){a(c).off("scroll."+e.__namespace+"-triggerClose")}),e.__$originParents=null,a(h.window.document.body).off("."+e.__namespace+"-triggerClose"),e._$origin.off("."+e.__namespace+"-triggerClose"),e._off("dismissable"),e.__stateSet("closed"),e._trigger({type:"after",event:b}),e.__options.functionAfter&&e.__options.functionAfter.call(e,e,{event:b,origin:e._$origin[0]}),g()};h.hasTransitions?(e._$tooltip.css({"-moz-animation-duration":e.__options.animationDuration[1]+"ms","-ms-animation-duration":e.__options.animationDuration[1]+"ms","-o-animation-duration":e.__options.animationDuration[1]+"ms","-webkit-animation-duration":e.__options.animationDuration[1]+"ms","animation-duration":e.__options.animationDuration[1]+"ms","transition-duration":e.__options.animationDuration[1]+"ms"}),e._$tooltip.clearQueue().removeClass("tooltipster-show").addClass("tooltipster-dying"),e.__options.animationDuration[1]>0&&e._$tooltip.delay(e.__options.animationDuration[1]),e._$tooltip.queue(m)):e._$tooltip.stop().fadeOut(e.__options.animationDuration[1],m)}}else g()}return e},_off:function(){return this.__$emitterPrivate.off.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.__$emitterPrivate.on.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_one:function(){return this.__$emitterPrivate.one.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_open:function(b,c){var e=this;if(!e.__destroying&&d(e._$origin)&&e.__enabled){var f=!0;if("closed"==e.__state&&(e._trigger({type:"before",event:b,stop:function(){f=!1}}),f&&e.__options.functionBefore&&(f=e.__options.functionBefore.call(e,e,{event:b,origin:e._$origin[0]}))),f!==!1&&null!==e.__Content){c&&e.__callbacks.open.push(c),e.__callbacks.close=[],e.__timeoutsClear();var g,i=function(){"stable"!=e.__state&&e.__stateSet("stable"),a.each(e.__callbacks.open,function(a,b){b.call(e,e,{origin:e._$origin[0],tooltip:e._$tooltip[0]})}),e.__callbacks.open=[]};if("closed"!==e.__state)g=0,"disappearing"===e.__state?(e.__stateSet("appearing"),h.hasTransitions?(e._$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-show"),e.__options.animationDuration[0]>0&&e._$tooltip.delay(e.__options.animationDuration[0]),e._$tooltip.queue(i)):e._$tooltip.stop().fadeIn(i)):"stable"==e.__state&&i();else{if(e.__stateSet("appearing"),g=e.__options.animationDuration[0],e.__contentInsert(),e.reposition(b,!0),h.hasTransitions?(e._$tooltip.addClass("tooltipster-"+e.__options.animation).addClass("tooltipster-initial").css({"-moz-animation-duration":e.__options.animationDuration[0]+"ms","-ms-animation-duration":e.__options.animationDuration[0]+"ms","-o-animation-duration":e.__options.animationDuration[0]+"ms","-webkit-animation-duration":e.__options.animationDuration[0]+"ms","animation-duration":e.__options.animationDuration[0]+"ms","transition-duration":e.__options.animationDuration[0]+"ms"}),setTimeout(function(){"closed"!=e.__state&&(e._$tooltip.addClass("tooltipster-show").removeClass("tooltipster-initial"),e.__options.animationDuration[0]>0&&e._$tooltip.delay(e.__options.animationDuration[0]),e._$tooltip.queue(i))},0)):e._$tooltip.css("display","none").fadeIn(e.__options.animationDuration[0],i),e.__trackerStart(),a(h.window).on("resize."+e.__namespace+"-triggerClose",function(b){var c=a(document.activeElement);(c.is("input")||c.is("textarea"))&&a.contains(e._$tooltip[0],c[0])||e.reposition(b)}).on("scroll."+e.__namespace+"-triggerClose",function(a){e.__scrollHandler(a)}),e.__$originParents=e._$origin.parents(),e.__$originParents.each(function(b,c){a(c).on("scroll."+e.__namespace+"-triggerClose",function(a){e.__scrollHandler(a)})}),e.__options.triggerClose.mouseleave||e.__options.triggerClose.touchleave&&h.hasTouchCapability){e._on("dismissable",function(a){a.dismissable?a.delay?(m=setTimeout(function(){e._close(a.event)},a.delay),e.__timeouts.close.push(m)):e._close(a):clearTimeout(m)});var j=e._$origin,k="",l="",m=null;e.__options.interactive&&(j=j.add(e._$tooltip)),e.__options.triggerClose.mouseleave&&(k+="mouseenter."+e.__namespace+"-triggerClose ",l+="mouseleave."+e.__namespace+"-triggerClose "),e.__options.triggerClose.touchleave&&h.hasTouchCapability&&(k+="touchstart."+e.__namespace+"-triggerClose",l+="touchend."+e.__namespace+"-triggerClose touchcancel."+e.__namespace+"-triggerClose"),j.on(l,function(a){if(e._touchIsTouchEvent(a)||!e._touchIsEmulatedEvent(a)){var b="mouseleave"==a.type?e.__options.delay:e.__options.delayTouch;e._trigger({delay:b[1],dismissable:!0,event:a,type:"dismissable"})}}).on(k,function(a){!e._touchIsTouchEvent(a)&&e._touchIsEmulatedEvent(a)||e._trigger({dismissable:!1,event:a,type:"dismissable"})})}e.__options.triggerClose.originClick&&e._$origin.on("click."+e.__namespace+"-triggerClose",function(a){e._touchIsTouchEvent(a)||e._touchIsEmulatedEvent(a)||e._close(a)}),(e.__options.triggerClose.click||e.__options.triggerClose.tap&&h.hasTouchCapability)&&setTimeout(function(){if("closed"!=e.__state){var b="",c=a(h.window.document.body);e.__options.triggerClose.click&&(b+="click."+e.__namespace+"-triggerClose "),e.__options.triggerClose.tap&&h.hasTouchCapability&&(b+="touchend."+e.__namespace+"-triggerClose"),c.on(b,function(b){e._touchIsMeaningfulEvent(b)&&(e._touchRecordEvent(b),e.__options.interactive&&a.contains(e._$tooltip[0],b.target)||e._close(b))}),e.__options.triggerClose.tap&&h.hasTouchCapability&&c.on("touchstart."+e.__namespace+"-triggerClose",function(a){e._touchRecordEvent(a)})}},0),e._trigger("ready"),e.__options.functionReady&&e.__options.functionReady.call(e,e,{origin:e._$origin[0],tooltip:e._$tooltip[0]})}if(e.__options.timer>0){var m=setTimeout(function(){e._close()},e.__options.timer+g);e.__timeouts.close.push(m)}}}return e},_openShortly:function(a){var b=this,c=!0;if("stable"!=b.__state&&"appearing"!=b.__state&&!b.__timeouts.open&&(b._trigger({type:"start",event:a,stop:function(){c=!1}}),c)){var d=0==a.type.indexOf("touch")?b.__options.delayTouch:b.__options.delay;d[0]?b.__timeouts.open=setTimeout(function(){b.__timeouts.open=null,b.__pointerIsOverOrigin&&b._touchIsMeaningfulEvent(a)?(b._trigger("startend"),b._open(a)):b._trigger("startcancel")},d[0]):(b._trigger("startend"),b._open(a))}return b},_optionsExtract:function(b,c){var d=this,e=a.extend(!0,{},c),f=d.__options[b];return f||(f={},a.each(c,function(a,b){var c=d.__options[a];void 0!==c&&(f[a]=c)})),a.each(e,function(b,c){void 0!==f[b]&&("object"!=typeof c||c instanceof Array||null==c||"object"!=typeof f[b]||f[b]instanceof Array||null==f[b]?e[b]=f[b]:a.extend(e[b],f[b]))}),e},_plug:function(b){var c=a.tooltipster._plugin(b);if(!c)throw new Error('The "'+b+'" plugin is not defined');return c.instance&&a.tooltipster.__bridge(c.instance,this,c.name),this},_touchIsEmulatedEvent:function(a){for(var b=!1,c=(new Date).getTime(),d=this.__touchEvents.length-1;d>=0;d--){var e=this.__touchEvents[d];if(!(c-e.time<500))break;e.target===a.target&&(b=!0)}return b},_touchIsMeaningfulEvent:function(a){return this._touchIsTouchEvent(a)&&!this._touchSwiped(a.target)||!this._touchIsTouchEvent(a)&&!this._touchIsEmulatedEvent(a)},_touchIsTouchEvent:function(a){return 0==a.type.indexOf("touch")},_touchRecordEvent:function(a){return this._touchIsTouchEvent(a)&&(a.time=(new Date).getTime(),this.__touchEvents.push(a)),this},_touchSwiped:function(a){for(var b=!1,c=this.__touchEvents.length-1;c>=0;c--){var d=this.__touchEvents[c];if("touchmove"==d.type){b=!0;break}if("touchstart"==d.type&&a===d.target)break}return b},_trigger:function(){var b=Array.prototype.slice.apply(arguments);return"string"==typeof b[0]&&(b[0]={type:b[0]}),b[0].instance=this,b[0].origin=this._$origin?this._$origin[0]:null,b[0].tooltip=this._$tooltip?this._$tooltip[0]:null,this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,b),a.tooltipster._trigger.apply(a.tooltipster,b),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,b),this},_unplug:function(b){var c=this;if(c[b]){var d=a.tooltipster._plugin(b);d.instance&&a.each(d.instance,function(a,d){c[a]&&c[a].bridged===c[b]&&delete c[a]}),c[b].__destroy&&c[b].__destroy(),delete c[b]}return c},close:function(a){return this.__destroyed?this.__destroyError():this._close(null,a),this},content:function(a){var b=this;if(void 0===a)return b.__Content;if(b.__destroyed)b.__destroyError();else if(b.__contentSet(a),null!==b.__Content){if("closed"!==b.__state&&(b.__contentInsert(),b.reposition(),b.__options.updateAnimation))if(h.hasTransitions){var c=b.__options.updateAnimation;b._$tooltip.addClass("tooltipster-update-"+c),setTimeout(function(){"closed"!=b.__state&&b._$tooltip.removeClass("tooltipster-update-"+c)},1e3)}else b._$tooltip.fadeTo(200,.5,function(){"closed"!=b.__state&&b._$tooltip.fadeTo(200,1)})}else b._close();return b},destroy:function(){var b=this;if(b.__destroyed)b.__destroyError();else{"closed"!=b.__state?b.option("animationDuration",0)._close(null,null,!0):b.__timeoutsClear(),b._trigger("destroy"),b.__destroyed=!0,b._$origin.removeData(b.__namespace).off("."+b.__namespace+"-triggerOpen"),a(h.window.document.body).off("."+b.__namespace+"-triggerOpen");var c=b._$origin.data("tooltipster-ns");if(c)if(1===c.length){var d=null;"previous"==b.__options.restoration?d=b._$origin.data("tooltipster-initialTitle"):"current"==b.__options.restoration&&(d="string"==typeof b.__Content?b.__Content:a("<div></div>").append(b.__Content).html()),d&&b._$origin.attr("title",d),b._$origin.removeClass("tooltipstered"),b._$origin.removeData("tooltipster-ns").removeData("tooltipster-initialTitle")}else c=a.grep(c,function(a,c){return a!==b.__namespace}),b._$origin.data("tooltipster-ns",c);b._trigger("destroyed"),b._off(),b.off(),b.__Content=null,b.__$emitterPrivate=null,b.__$emitterPublic=null,b.__options.parent=null,b._$origin=null,b._$tooltip=null,a.tooltipster.__instancesLatestArr=a.grep(a.tooltipster.__instancesLatestArr,function(a,c){return b!==a}),clearInterval(b.__garbageCollector)}return b},disable:function(){return this.__destroyed?(this.__destroyError(),this):(this._close(),this.__enabled=!1,this)},elementOrigin:function(){return this.__destroyed?void this.__destroyError():this._$origin[0]},elementTooltip:function(){return this._$tooltip?this._$tooltip[0]:null},enable:function(){return this.__enabled=!0,this},hide:function(a){return this.close(a)},instance:function(){return this},off:function(){return this.__destroyed||this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},open:function(a){return this.__destroyed?this.__destroyError():this._open(null,a),this},option:function(b,c){return void 0===c?this.__options[b]:(this.__destroyed?this.__destroyError():(this.__options[b]=c,this.__optionsFormat(),a.inArray(b,["trigger","triggerClose","triggerOpen"])>=0&&this.__prepareOrigin(),"selfDestruction"===b&&this.__prepareGC()),this)},reposition:function(a,b){var c=this;return c.__destroyed?c.__destroyError():"closed"!=c.__state&&d(c._$origin)&&(b||d(c._$tooltip))&&(b||c._$tooltip.detach(),c.__Geometry=c.__geometry(),c._trigger({type:"reposition",event:a,helper:{geo:c.__Geometry}})),c},show:function(a){return this.open(a)},status:function(){return{destroyed:this.__destroyed,enabled:this.__enabled,open:"closed"!==this.__state,state:this.__state}},triggerHandler:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},a.fn.tooltipster=function(){var b=Array.prototype.slice.apply(arguments),c="You are using a single HTML element as content for several tooltips. You probably want to set the contentCloning option to TRUE.";if(0===this.length)return this;if("string"==typeof b[0]){var d="#*$~&";return this.each(function(){var e=a(this).data("tooltipster-ns"),f=e?a(this).data(e[0]):null;if(!f)throw new Error("You called Tooltipster's \""+b[0]+'" method on an uninitialized element');if("function"!=typeof f[b[0]])throw new Error('Unknown method "'+b[0]+'"');this.length>1&&"content"==b[0]&&(b[1]instanceof a||"object"==typeof b[1]&&null!=b[1]&&b[1].tagName)&&!f.__options.contentCloning&&f.__options.debug&&console.log(c);var g=f[b[0]](b[1],b[2]);return g!==f||"instance"===b[0]?(d=g,!1):void 0}),"#*$~&"!==d?d:this}a.tooltipster.__instancesLatestArr=[];var e=b[0]&&void 0!==b[0].multiple,g=e&&b[0].multiple||!e&&f.multiple,h=b[0]&&void 0!==b[0].content,i=h&&b[0].content||!h&&f.content,j=b[0]&&void 0!==b[0].contentCloning,k=j&&b[0].contentCloning||!j&&f.contentCloning,l=b[0]&&void 0!==b[0].debug,m=l&&b[0].debug||!l&&f.debug;return this.length>1&&(i instanceof a||"object"==typeof i&&null!=i&&i.tagName)&&!k&&m&&console.log(c),this.each(function(){var c=!1,d=a(this),e=d.data("tooltipster-ns"),f=null;e?g?c=!0:m&&(console.log("Tooltipster: one or more tooltips are already attached to the element below. Ignoring."),console.log(this)):c=!0,c&&(f=new a.Tooltipster(this,b[0]),e||(e=[]),e.push(f.__namespace),d.data("tooltipster-ns",e),d.data(f.__namespace,f),f.__options.functionInit&&f.__options.functionInit.call(f,f,{origin:this}),f._trigger("init")),a.tooltipster.__instancesLatestArr.push(f)}),this},b.prototype={__init:function(b){this.__$tooltip=b,this.__$tooltip.css({left:0,overflow:"hidden",position:"absolute",top:0}).find(".tooltipster-content").css("overflow","auto"),this.$container=a('<div class="tooltipster-ruler"></div>').append(this.__$tooltip).appendTo(h.window.document.body)},__forceRedraw:function(){var a=this.__$tooltip.parent();this.__$tooltip.detach(),this.__$tooltip.appendTo(a)},constrain:function(a,b){return this.constraints={width:a,height:b},this.__$tooltip.css({display:"block",height:"",overflow:"auto",width:a}),this},destroy:function(){this.__$tooltip.detach().find(".tooltipster-content").css({display:"",overflow:""}),this.$container.remove()},free:function(){return this.constraints=null,this.__$tooltip.css({display:"",height:"",overflow:"visible",width:""}),this},measure:function(){this.__forceRedraw();var a=this.__$tooltip[0].getBoundingClientRect(),b={size:{height:a.height||a.bottom-a.top,width:a.width||a.right-a.left}};if(this.constraints){var c=this.__$tooltip.find(".tooltipster-content"),d=this.__$tooltip.outerHeight(),e=c[0].getBoundingClientRect(),f={height:d<=this.constraints.height,width:a.width<=this.constraints.width&&e.width>=c[0].scrollWidth-1};b.fits=f.height&&f.width}return h.IE&&h.IE<=11&&b.size.width!==h.window.document.documentElement.clientWidth&&(b.size.width=Math.ceil(b.size.width)+1),b}};var j=navigator.userAgent.toLowerCase();-1!=j.indexOf("msie")?h.IE=parseInt(j.split("msie")[1]):-1!==j.toLowerCase().indexOf("trident")&&-1!==j.indexOf(" rv:11")?h.IE=11:-1!=j.toLowerCase().indexOf("edge/")&&(h.IE=parseInt(j.toLowerCase().split("edge/")[1]))
vendor: 9,665 bytes, lines 773-778
773;var k="tooltipster.sideTip";return a.tooltipster._plugin({name:k,instance:{__defaults:function(){return{arrow:!0,distance:6,functionPosition:null,maxWidth:null,minIntersection:16,minWidth:0,position:null,side:"top",viewportAware:!0}},__init:function(a){var b=this;b.__instance=a,b.__namespace="tooltipster-sideTip-"+Math.round(1e6*Math.random()),b.__previousState="closed",b.__options,b.__optionsFormat(),b.__instance._on("state."+b.__namespace,function(a){"closed"==a.state?b.__close():"appearing"==a.state&&"closed"==b.__previousState&&b.__create(),b.__previousState=a.state}),b.__instance._on("options."+b.__namespace,function(){b.__optionsFormat()}),b.__instance._on("reposition."+b.__namespace,function(a){b.__reposition(a.event,a.helper)})},__close:function(){this.__instance.content()instanceof a&&this.__instance.content().detach(),this.__instance._$tooltip.remove(),this.__instance._$tooltip=null},__create:function(){var b=a('<div class="tooltipster-base tooltipster-sidetip"><div class="tooltipster-box"><div class="tooltipster-content"></div></div><div class="tooltipster-arrow"><div class="tooltipster-arrow-uncropped"><div class="tooltipster-arrow-border"></div><div class="tooltipster-arrow-background"></div></div></div></div>');this.__options.arrow||b.find(".tooltipster-box").css("margin",0).end().find(".tooltipster-arrow").hide(),this.__options.minWidth&&b.css("min-width",this.__options.minWidth+"px"),this.__options.maxWidth&&b.css("max-width",this.__options.maxWidth+"px"), 774this.__instance._$tooltip=b,this.__instance._trigger("created")},__destroy:function(){this.__instance._off("."+self.__namespace)},__optionsFormat:function(){var b=this;if(b.__options=b.__instance._optionsExtract(k,b.__defaults()),b.__options.position&&(b.__options.side=b.__options.position),"object"!=typeof b.__options.distance&&(b.__options.distance=[b.__options.distance]),b.__options.distance.length<4&&(void 0===b.__options.distance[1]&&(b.__options.distance[1]=b.__options.distance[0]),void 0===b.__options.distance[2]&&(b.__options.distance[2]=b.__options.distance[0]),void 0===b.__options.distance[3]&&(b.__options.distance[3]=b.__options.distance[1]),b.__options.distance={top:b.__options.distance[0],right:b.__options.distance[1],bottom:b.__options.distance[2],left:b.__options.distance[3]}),"string"==typeof b.__options.side){var c={top:"bottom",right:"left",bottom:"top",left:"right"};b.__options.side=[b.__options.side,c[b.__options.side]],"left"==b.__options.side[0]||"right"==b.__options.side[0]?b.__options.side.push("top","bottom"):b.__options.side.push("right","left")}6===a.tooltipster._env.IE&&b.__options.arrow!==!0&&(b.__options.arrow=!1)},__reposition:function(b,c){var d,e=this,f=e.__targetFind(c),g=[];e.__instance._$tooltip.detach();var h=e.__instance._$tooltip.clone(),i=a.tooltipster._getRuler(h),j=!1,k=e.__instance.option("animation");switch(k&&h.removeClass("tooltipster-"+k),a.each(["window","document"],function(d,k){var l=null;if(e.__instance._trigger({container:k,helper:c,satisfied:j,takeTest:function(a){l=a},results:g,type:"positionTest"}),1==l||0!=l&&0==j&&("window"!=k||e.__options.viewportAware))for(var d=0;d<e.__options.side.length;d++){var m={horizontal:0,vertical:0},n=e.__options.side[d];"top"==n||"bottom"==n?m.vertical=e.__options.distance[n]:m.horizontal=e.__options.distance[n],e.__sideChange(h,n),a.each(["natural","constrained"],function(a,d){if(l=null,e.__instance._trigger({container:k,event:b,helper:c,mode:d,results:g,satisfied:j,side:n,takeTest:function(a){l=a},type:"positionTest"}),1==l||0!=l&&0==j){var h={container:k,distance:m,fits:null,mode:d,outerSize:null,side:n,size:null,target:f[n],whole:null},o="natural"==d?i.free():i.constrain(c.geo.available[k][n].width-m.horizontal,c.geo.available[k][n].height-m.vertical),p=o.measure();if(h.size=p.size,h.outerSize={height:p.size.height+m.vertical,width:p.size.width+m.horizontal},"natural"==d?c.geo.available[k][n].width>=h.outerSize.width&&c.geo.available[k][n].height>=h.outerSize.height?h.fits=!0:h.fits=!1:h.fits=p.fits,"window"==k&&(h.fits?"top"==n||"bottom"==n?h.whole=c.geo.origin.windowOffset.right>=e.__options.minIntersection&&c.geo.window.size.width-c.geo.origin.windowOffset.left>=e.__options.minIntersection:h.whole=c.geo.origin.windowOffset.bottom>=e.__options.minIntersection&&c.geo.window.size.height-c.geo.origin.windowOffset.top>=e.__options.minIntersection:h.whole=!1),g.push(h),h.whole)j=!0;else if("natural"==h.mode&&(h.fits||h.size.width<=c.geo.available[k][n].width))return!1}})}}),e.__instance._trigger({edit:function(a){g=a},event:b,helper:c,results:g,type:"positionTested"}),g.sort(function(a,b){if(a.whole&&!b.whole)return-1;if(!a.whole&&b.whole)return 1;if(a.whole&&b.whole){var c=e.__options.side.indexOf(a.side),d=e.__options.side.indexOf(b.side);return d>c?-1:c>d?1:"natural"==a.mode?-1:1}if(a.fits&&!b.fits)return-1;if(!a.fits&&b.fits)return 1;if(a.fits&&b.fits){var c=e.__options.side.indexOf(a.side),d=e.__options.side.indexOf(b.side);return d>c?-1:c>d?1:"natural"==a.mode?-1:1}return"document"==a.container&&"bottom"==a.side&&"natural"==a.mode?-1:1}),d=g[0],d.coord={},d.side){case"left":case"right":d.coord.top=Math.floor(d.target-d.size.height/2);break;case"bottom":case"top":d.coord.left=Math.floor(d.target-d.size.width/2)}switch(d.side){case"left":d.coord.left=c.geo.origin.windowOffset.left-d.outerSize.width;break;case"right":d.coord.left=c.geo.origin.windowOffset.right+d.distance.horizontal;break;case"top":d.coord.top=c.geo.origin.windowOffset.top-d.outerSize.height;break;case"bottom":d.coord.top=c.geo.origin.windowOffset.bottom+d.distance.vertical}"window"==d.container?"top"==d.side||"bottom"==d.side?d.coord.left<0?c.geo.origin.windowOffset.right-this.__options.minIntersection>=0?d.coord.left=0:d.coord.left=c.geo.origin.windowOffset.right-this.__options.minIntersection-1:d.coord.left>c.geo.window.size.width-d.size.width&&(c.geo.origin.windowOffset.left+this.__options.minIntersection<=c.geo.window.size.width?d.coord.left=c.geo.window.size.width-d.size.width:d.coord.left=c.geo.origin.windowOffset.left+this.__options.minIntersection+1-d.size.width):d.coord.top<0?c.geo.origin.windowOffset.bottom-this.__options.minIntersection>=0?d.coord.top=0:d.coord.top=c.geo.origin.windowOffset.bottom-this.__options.minIntersection-1:d.coord.top>c.geo.window.size.height-d.size.height&&(c.geo.origin.windowOffset.top+this.__options.minIntersection<=c.geo.window.size.height?d.coord.top=c.geo.window.size.height-d.size.height:d.coord.top=c.geo.origin.windowOffset.top+this.__options.minIntersection+1-d.size.height):(d.coord.left>c.geo.window.size.width-d.size.width&&(d.coord.left=c.geo.window.size.width-d.size.width),d.coord.left<0&&(d.coord.left=0)),e.__sideChange(h,d.side),c.tooltipClone=h[0],c.tooltipParent=e.__instance.option("parent").parent[0],c.mode=d.mode,c.whole=d.whole,c.origin=e.__instance._$origin[0],c.tooltip=e.__instance._$tooltip[0],delete d.container,delete d.fits,delete d.mode,delete d.outerSize,delete d.whole,d.distance=d.distance.horizontal||d.distance.vertical;var l=a.extend(!0,{},d);if(e.__instance._trigger({edit:function(a){d=a},event:b,helper:c,position:l,type:"position"}),e.__options.functionPosition){var m=e.__options.functionPosition.call(e,e.__instance,c,l);m&&(d=m)}i.destroy();var n,o;"top"==d.side||"bottom"==d.side?(n={prop:"left",val:d.target-d.coord.left},o=d.size.width-this.__options.minIntersection):(n={prop:"top",val:d.target-d.coord.top},o=d.size.height-this.__options.minIntersection),n.val<this.__options.minIntersection?n.val=this.__options.minIntersection:n.val>o&&(n.val=o);var p;p=c.geo.origin.fixedLineage?c.geo.origin.windowOffset:{left:c.geo.origin.windowOffset.left+c.geo.window.scroll.left,top:c.geo.origin.windowOffset.top+c.geo.window.scroll.top},d.coord={left:p.left+(d.coord.left-c.geo.origin.windowOffset.left),top:p.top+(d.coord.top-c.geo.origin.windowOffset.top)},e.__sideChange(e.__instance._$tooltip,d.side),c.geo.origin.fixedLineage?e.__instance._$tooltip.css("position","fixed"):e.__instance._$tooltip.css("position",""),e.__instance._$tooltip.css({left:d.coord.left,top:d.coord.top,height:d.size.height,width:d.size.width}).find(".tooltipster-arrow").css({left:"",top:""}).css(n.prop,n.val),e.__instance._$tooltip.appendTo(e.__instance.option("parent")),e.__instance._trigger({type:"repositioned",event:b,position:d})},__sideChange:function(a,b){a.removeClass("tooltipster-bottom").removeClass("tooltipster-left").removeClass("tooltipster-right").removeClass("tooltipster-top").addClass("tooltipster-"+b)},__targetFind:function(a){var b={},c=this.__instance._$origin[0].getClientRects();if(c.length>1){var d=this.__instance._$origin.css("opacity");1==d&&(this.__instance._$origin.css("opacity",.99),c=this.__instance._$origin[0].getClientRects(),this.__instance._$origin.css("opacity",1))}if(c.length<2)b.top=Math.floor(a.geo.origin.windowOffset.left+a.geo.origin.size.width/2),b.bottom=b.top,b.left=Math.floor(a.geo.origin.windowOffset.top+a.geo.origin.size.height/2),b.right=b.left;else{var e=c[0];b.top=Math.floor(e.left+(e.right-e.left)/2),e=c.length>2?c[Math.ceil(c.length/2)-1]:c[0],b.right=Math.floor(e.top+(e.bottom-e.top)/2),e=c[c.length-1],b.bottom=Math.floor(e.left+(e.right-e.left)/2),e=c.length>2?c[Math.ceil((c.length+1)/2)-1]:c[c.length-1],b.left=Math.floor(e.top+(e.bottom-e.top)/2)}return b}}}),a});; 775/*! Lity - v2.1.0 - 2016-09-19 776* http://sorgalla.com/lity/ 777* Copyright (c) 2015-2016 Jan Sorgalla; Licensed MIT */ 778!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(c){return b(a,c)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=b(a,require("jquery")):a.lity=b(
vendor: 4,762 bytes, line 778
778a,a.jQuery||a.Zepto)}("undefined"!=typeof window?window:this,function(a,b){"use strict";function c(a){var b=A();return L&&a.length?(a.one(L,b.resolve),setTimeout(b.resolve,500)):b.resolve(),b.promise()}function d(a,c,d){if(1===arguments.length)return b.extend({},a);if("string"==typeof c){if("undefined"==typeof d)return"undefined"==typeof a[c]?null:a[c];a[c]=d}else b.extend(a,c);return this}function e(a){for(var b,c=decodeURI(a.split("#")[0]).split("&"),d={},e=0,f=c.length;e<f;e++)c[e]&&(b=c[e].split("="),d[b[0]]=b[1]);return d}function f(a,c){return a+(a.indexOf("?")>-1?"&":"?")+b.param(c)}function g(a,b){var c=a.indexOf("#");return-1===c?b:(c>0&&(a=a.substr(c)),b+a)}function h(a){return b('<span class="lity-error"/>').append(a)}function i(a,c){var d=c.opener()&&c.opener().data("lity-desc")||"Image with no description",e=b('<img src="'+a+'" alt="'+d+'"/>'),f=A(),g=function(){f.reject(h("Failed loading image"))};return e.on("load",function(){return 0===this.naturalWidth?g():void f.resolve(e)}).on("error",g),f.promise()}function j(a,c){var d,e,f;try{d=b(a)}catch(a){return!1}return!!d.length&&(e=b('<i style="display:none !important"/>'),f=d.hasClass("lity-hide"),c.element().one("lity:remove",function(){e.before(d).remove(),f&&!d.closest(".lity-content").length&&d.addClass("lity-hide")}),d.removeClass("lity-hide").after(e))}function k(a){var c=I.exec(a);return!!c&&n(g(a,f("https://www.youtube"+(c[2]||"")+".com/embed/"+c[4],b.extend({autoplay:1},e(c[5]||"")))))}function l(a){var c=J.exec(a);return!!c&&n(g(a,f("https://player.vimeo.com/video/"+c[3],b.extend({autoplay:1},e(c[4]||"")))))}function m(a){var b=K.exec(a);return!!b&&n(g(a,f("https://www.google."+b[3]+"/maps?"+b[6],{output:b[6].indexOf("layer=c")>0?"svembed":"embed"})))}function n(a){return'<div class="lity-iframe-container"><iframe frameborder="0" allowfullscreen src="'+a+'"/></div>'}function o(){return y.documentElement.clientHeight?y.documentElement.clientHeight:Math.round(z.height())}function p(a){var b=u();b&&(27===a.keyCode&&b.close(),9===a.keyCode&&q(a,b))}function q(a,b){var c=b.element().find(F),d=c.index(y.activeElement);a.shiftKey&&d<=0?(c.get(c.length-1).focus(),a.preventDefault()):a.shiftKey||d!==c.length-1||(c.get(0).focus(),a.preventDefault())}function r(){b.each(C,function(a,b){b.resize()})}function s(a){1===C.unshift(a)&&(B.addClass("lity-active"),z.on({resize:r,keydown:p})),b("body > *").not(a.element()).addClass("lity-hidden").each(function(){var a=b(this);void 0===a.data(E)&&a.data(E,a.attr(D)||null)}).attr(D,"true")}function t(a){var c;a.element().attr(D,"true"),1===C.length&&(B.removeClass("lity-active"),z.off({resize:r,keydown:p})),C=b.grep(C,function(b){return a!==b}),c=C.length?C[0].element():b(".lity-hidden"),c.removeClass("lity-hidden").each(function(){var a=b(this),c=a.data(E);c?a.attr(D,c):a.removeAttr(D),a.removeData(E)})}function u(){return 0===C.length?null:C[0]}function v(a,c,d,e){var f,g="inline",h=b.extend({},d);return e&&h[e]?(f=h[e](a,c),g=e):(b.each(["inline","iframe"],function(a,b){delete h[b],h[b]=d[b]}),b.each(h,function(b,d){return!d||(!(!d.test||d.test(a,c))||(f=d(a,c),!1!==f?(g=b,!1):void 0))})),{handler:g,content:f||""}}function w(a,e,f,g){function h(a){k=b(a).css("max-height",o()+"px"),j.find(".lity-loader").each(function(){var a=b(this);c(a).always(function(){a.remove()})}),j.removeClass("lity-loading").find(".lity-content").empty().append(k),m=!0,k.trigger("lity:ready",[l])}var i,j,k,l=this,m=!1,n=!1;e=b.extend({},G,e),j=b(e.template),l.element=function(){return j},l.opener=function(){return f},l.options=b.proxy(d,l,e),l.handlers=b.proxy(d,l,e.handlers),l.resize=function(){m&&!n&&k.css("max-height",o()+"px").trigger("lity:resize",[l])},l.close=function(){if(m&&!n){n=!0,t(l);var a=A();return g&&b.contains(j,y.activeElement)&&g.focus(),k.trigger("lity:close",[l]),j.removeClass("lity-opened").addClass("lity-closed"),c(k.add(j)).always(function(){k.trigger("lity:remove",[l]),j.remove(),j=void 0,a.resolve()}),a.promise()}},i=v(a,l,e.handlers,e.handler),j.attr(D,"false").addClass("lity-loading lity-opened lity-"+i.handler).appendTo("body").focus().on("click","[data-lity-close]",function(a){b(a.target).is("[data-lity-close]")&&l.close()}).trigger("lity:open",[l]),s(l),b.when(i.content).always(h)}function x(a,c,d){a.preventDefault?(a.preventDefault(),d=b(this),a=d.data("lity-target")||d.attr("href")||d.attr("src")):d=b(d);var e=new w(a,b.extend({},d.data("lity-options")||d.data("lity"),c),d,y.activeElement);if(!a.preventDefault)return e}var y=a.document,z=b(a),A=b.Deferred,B=b("html"),C=[],D="aria-hidden",E="lity-"+D,F='a[href],area[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),iframe,object,embed,[contenteditable],[tabindex]:not
778([tabindex^="-"])',G={handler:null,handlers:{image:i,inline:j,youtube:k,vimeo:l,iframe:n},template:'<div class="lity" role="dialog" aria-label="Dialog Window (Press escape to close)" tabindex="-1"><div class="lity-wrap" data-lity-close role="document"><div class="lity-loader" aria-hidden="true">Loading...</div><div class="lity-container"><div class="lity-content"></div><button class="lity-close" type="button" aria-label="Close (Press escape to close)" data-lity-close>×</button></div></div></div>'},H=/(^data:image\/)|(\.(png|jpe?g|gif|svg|webp|bmp|ico|tiff?)(\?\S*)?$)/i,I=/(youtube(-nocookie)?\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?([\w-]{11})(.*)?/i,J=/(vimeo(pro)?.com)\/(?:[^\d]+)?(\d+)\??(.*)?$/,K=/((maps|www)\.)?google\.([^\/\?]+)\/?((maps\/?)?\?)(.*)/i,L=function(){var a=y.createElement("div"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return b[c];return!1}();return i.test=function(a){return H.test(a)},x.version="2.1.0",x.options=b.proxy(d,x,G),x.handlers=b.proxy(d,x,G.handlers),x.current=u,b(y).on("click.lity","[data-lity]",x),x});; 779/* 780 * colourBrightness.js 781 * 782 * Copyright 2013-2016, Jamie Brittain - http://jamiebrittain.com 783 * Released under the WTFPL license 784 * http://sam.zoy.org/wtfpl/ 785 * 786 * Github: http://github.com/jamiebrittain/colourBrightness.js 787 * Version: 1.2 788 */ 789!function(r){r.fn.colourBrightness=function(){function r(r){for(var t="";"html"!=r[0].tagName.toLowerCase()&&(t=r.css("background-color"),"rgba(0, 0, 0, 0)"==t||"transparent"==t);)r=r.parent();return t}var t,a,s,e,n=r(this);return n.match(/^rgb/)?(n=n.match(/rgba?\(([^)]+)\)/)[1],n=n.split(/ *, */).map(Number),t=n[0],a=n[1],s=n[2]):"#"==n[0]&&7==n.length?(t=parseInt(n.slice(1,3),16),a=parseInt(n.slice(3,5),16),s=parseInt(n.slice(5,7),16)):"#"==n[0]&&4==n.length&&(t=parseInt(n[1]+n[1],16),a=parseInt(n[2]+n[2],16),s=parseInt(n[3]+n[3],16)),e=(299*t+587*a+114*s)/1e3,125>e?this.removeClass("light").addClass("dark"):this.removeClass("dark").addClass("light"),this}}(jQuery); 790; 791/** 792 * Owl Carousel v2.3.4 793 * Copyright 2013-2018 David Deutsch 794 * Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE 795 */ 796/** 797 * Owl carousel 798 * @version 2.3.4 799 * @author Bartosz Wojciechowski 800 * @author David Deutsch 801 * @license The MIT License (MIT) 802 * @todo Lazy Load Icon 803 * @todo prevent animationend bubling 804 * @todo itemsScaleUp 805 * @todo Test Zepto 806 * @todo stagePadding calculate wrong active classes 807 */ 808; (function ($, window, document, undefined) { 809 810 /** 811 * Creates a carousel. 812 * @class The Owl Carousel. 813 * @public 814 * @param {HTMLElement|jQuery} element - The element to create the carousel for. 815 * @param {Object} [options] - The options 816 */ 817 function Owl(element, options) { 818 819 /** 820 * Current settings for the carousel. 821 * @public 822 */ 823 this.settings = null; 824 825 /** 826 * Current options set by the caller including defaults. 827 * @public 828 */ 829 this.options = $.extend({}, Owl.Defaults, options); 830 831 /** 832 * Plugin element. 833 * @public 834 */ 835 this.$element = $(element); 836 837 /** 838 * Proxied event handlers. 839 * @protected 840 */ 841 this._handlers = {}; 842 843 /** 844 * References to the running plugins of this carousel. 845 * @protected 846 */ 847 this._plugins = {}; 848 849 /** 850 * Currently suppressed events to prevent them from being retriggered. 851 * @protected 852 */ 853 this._supress = {}; 854 855 /** 856 * Absolute current position. 857 * @protected 858 */ 859 this._current = null; 860 861 /** 862 * Animation speed in milliseconds. 863 * @protected 864 */ 865 this._speed = null; 866 867 /** 868 * Coordinates of all items in pixel. 869 * @todo The name of this member is missleading. 870 * @protected 871 */ 872 this._coordinates = []; 873 874 /** 875 * Current breakpoint. 876 * @todo Real media queries would be nice. 877 * @protected 878 */ 879 this._breakpoint = null; 880 881 /** 882 * Current width of the plugin element. 883 */ 884 this._width = null; 885 886 /** 887 * All real items. 888 * @protected 889 */ 890 this._items = []; 891 892 /** 893 * All cloned items. 894 * @protected 895 */ 896 this._clones = []; 897 898 /** 899 * Merge values of all items. 900 * @todo Maybe this could be part of a plugin. 901 * @protected 902 */ 903 this._mergers = []; 904 905 /** 906 * Widths of all items. 907 */ 908 this._widths = []; 909 910 /** 911 * Invalidated parts within the update process. 912 * @protected 913 */ 914 this._invalidated = {}; 915 916 /** 917 * Ordered list of workers for the update process. 918 * @protected 919 */ 920 this._pipe = []; 921 922 /** 923 * Current state information for the drag operation. 924 * @todo #261 925 * @protected 926 */ 927 this._drag = { 928 time: null, 929 target: null, 930 pointer: null, 931 stage: { 932 start: null, 933 current: null 934 }, 935 direction: null 936 }; 937 938 /** 939 * Current state information and their tags. 940 * @type {Object} 941 * @protected 942 */ 943 this._states = { 944 current: {}, 945 tags: { 946 'initializing': ['busy'], 947 'animating': ['busy'], 948 'dragging': ['interacting'] 949 } 950 }; 951 952 $.each(['onResize', 'onThrottledResize'], $.proxy(function (i, handler) { 953 this._handlers[handler] = $.proxy(this[handler], this); 954 }, this)); 955 956 $.each(Owl.Plugins, $.proxy(function (key, plugin) { 957 this._plugins[key.charAt(0).toLowerCase() + key.slice(1)] 958 = new plugin(this); 959 }, this)); 960 961 $.each(Owl.Workers, $.proxy(function (priority, worker) { 962 this._pipe.push({ 963 'filter': worker.filter, 964 'run': $.proxy(worker.run, this) 965 }); 966 }, this)); 967 968 this.setup(); 969 this.initialize(); 970 } 971 972 /** 973 * Default options for the carousel. 974 * @public 975 */ 976 Owl.Defaults = { 977 items: 3, 978 loop: false, 979 center: false, 980 rewind: false, 981 checkVisibility: true, 982 983 mouseDrag: true, 984 touchDrag: true, 985 pullDrag: true, 986 freeDrag: false, 987 988 margin: 0, 989 stagePadding: 0, 990 991 merge: false, 992 mergeFit: true, 993 autoWidth: false, 994 995 startPosition: 0, 996 rtl: false, 997 998 smartSpeed: 250, 999 fluidSpeed: false, 1000 dragEndSpeed: false, 1001 1002 responsive: {}, 1003 responsiveRefreshRate: 200, 1004 responsiveBaseElement: window, 1005 1006 fallbackEasing: 'swing', 1007 slideTransition: '', 1008 1009 info: false, 1010 1011 nestedItemSelector: false, 1012 itemElement: 'div', 1013 stageElement: 'div', 1014 1015 refreshClass: 'owl-refresh', 1016 loadedClass: 'owl-loaded', 1017 loadingClass: 'owl-loading', 1018 rtlClass: 'owl-rtl', 1019 responsiveClass: 'owl-responsive', 1020 dragClass: 'owl-drag', 1021 itemClass: 'owl-item', 1022 stageClass: 'owl-stage',
vendor: 104,663 bytes, lines 1023-4234
1023 stageOuterClass: 'owl-stage-outer', 1024 grabClass: 'owl-grab' 1025 }; 1026 1027 /** 1028 * Enumeration for width. 1029 * @public 1030 * @readonly 1031 * @enum {String} 1032 */ 1033 Owl.Width = { 1034 Default: 'default', 1035 Inner: 'inner', 1036 Outer: 'outer' 1037 }; 1038 1039 /** 1040 * Enumeration for types. 1041 * @public 1042 * @readonly 1043 * @enum {String} 1044 */ 1045 Owl.Type = { 1046 Event: 'event', 1047 State: 'state' 1048 }; 1049 1050 /** 1051 * Contains all registered plugins. 1052 * @public 1053 */ 1054 Owl.Plugins = {}; 1055 1056 /** 1057 * List of workers involved in the update process. 1058 */ 1059 Owl.Workers = [{ 1060 filter: ['width', 'settings'], 1061 run: function () { 1062 this._width = this.$element.width(); 1063 } 1064 }, { 1065 filter: ['width', 'items', 'settings'], 1066 run: function (cache) { 1067 cache.current = this._items && this._items[this.relative(this._current)]; 1068 } 1069 }, { 1070 filter: ['items', 'settings'], 1071 run: function () { 1072 this.$stage.children('.cloned').remove(); 1073 } 1074 }, { 1075 filter: ['width', 'items', 'settings'], 1076 run: function (cache) { 1077 var margin = this.settings.margin || '', 1078 grid = !this.settings.autoWidth, 1079 rtl = this.settings.rtl, 1080 css = { 1081 'width': 'auto', 1082 'margin-left': rtl ? margin : '', 1083 'margin-right': rtl ? '' : margin 1084 }; 1085 1086 !grid && this.$stage.children().css(css); 1087 1088 cache.css = css; 1089 } 1090 }, { 1091 filter: ['width', 'items', 'settings'], 1092 run: function (cache) { 1093 var width = (this.width() / this.settings.items).toFixed(3) - this.settings.margin, 1094 merge = null, 1095 iterator = this._items.length, 1096 grid = !this.settings.autoWidth, 1097 widths = []; 1098 1099 cache.items = { 1100 merge: false, 1101 width: width 1102 }; 1103 1104 while (iterator--) { 1105 merge = this._mergers[iterator]; 1106 merge = this.settings.mergeFit && Math.min(merge, this.settings.items) || merge; 1107 1108 cache.items.merge = merge > 1 || cache.items.merge; 1109 1110 widths[iterator] = !grid ? this._items[iterator].width() : width * merge; 1111 } 1112 1113 this._widths = widths; 1114 } 1115 }, { 1116 filter: ['items', 'settings'], 1117 run: function () { 1118 var clones = [], 1119 items = this._items, 1120 settings = this.settings, 1121 // TODO: Should be computed from number of min width items in stage 1122 view = Math.max(settings.items * 2, 4), 1123 size = Math.ceil(items.length / 2) * 2, 1124 repeat = settings.loop && items.length ? settings.rewind ? view : Math.max(view, size) : 0, 1125 append = '', 1126 prepend = ''; 1127 1128 repeat /= 2; 1129 1130 while (repeat > 0) { 1131 // Switch to only using appended clones 1132 clones.push(this.normalize(clones.length / 2, true)); 1133 append = append + items[clones[clones.length - 1]][0].outerHTML; 1134 clones.push(this.normalize(items.length - 1 - (clones.length - 1) / 2, true)); 1135 prepend = items[clones[clones.length - 1]][0].outerHTML + prepend; 1136 repeat -= 1; 1137 } 1138 1139 this._clones = clones; 1140 1141 $(append).addClass('cloned').appendTo(this.$stage); 1142 $(prepend).addClass('cloned').prependTo(this.$stage); 1143 } 1144 }, { 1145 filter: ['width', 'items', 'settings'], 1146 run: function () { 1147 var rtl = this.settings.rtl ? 1 : -1, 1148 size = this._clones.length + this._items.length, 1149 iterator = -1, 1150 previous = 0, 1151 current = 0, 1152 coordinates = []; 1153 1154 while (++iterator < size) { 1155 previous = coordinates[iterator - 1] || 0; 1156 current = this._widths[this.relative(iterator)] + this.settings.margin; 1157 coordinates.push(previous + current * rtl); 1158 } 1159 1160 this._coordinates = coordinates; 1161 } 1162 }, { 1163 filter: ['width', 'items', 'settings'], 1164 run: function () { 1165 var padding = this.settings.stagePadding, 1166 coordinates = this._coordinates, 1167 css = { 1168 'width': Math.ceil(Math.abs(coordinates[coordinates.length - 1])) + padding * 2, 1169 'padding-left': padding || '', 1170 'padding-right': padding || '' 1171 }; 1172 1173 this.$stage.css(css); 1174 } 1175 }, { 1176 filter: ['width', 'items', 'settings'], 1177 run: function (cache) { 1178 var iterator = this._coordinates.length, 1179 grid = !this.settings.autoWidth, 1180 items = this.$stage.children(); 1181 1182 if (grid && cache.items.merge) { 1183 while (iterator--) { 1184 cache.css.width = this._widths[this.relative(iterator)]; 1185 items.eq(iterator).css(cache.css); 1186 } 1187 } else if (grid) { 1188 cache.css.width = cache.items.width; 1189 items.css(cache.css); 1190 } 1191 } 1192 }, { 1193 filter: ['items'], 1194 run: function () { 1195 this._coordinates.length < 1 && this.$stage.removeAttr('style'); 1196 } 1197 }, { 1198 filter: ['width', 'items', 'settings'], 1199 run: function (cache) { 1200 cache.current = cache.current ? this.$stage.children().index(cache.current) : 0; 1201 cache.current = Math.max(this.minimum(), Math.min(this.maximum(), cache.current)); 1202 this.reset(cache.current); 1203 } 1204 }, { 1205 filter: ['position'], 1206 run: function () { 1207 this.animate(this.coordinates(this._current)); 1208 } 1209 }, { 1210 filter: ['width', 'position', 'items', 'settings'], 1211 run: function () { 1212 var rtl = this.settings.rtl ? 1 : -1, 1213 padding = this.settings.stagePadding * 2, 1214 begin = this.coordinates(this.current()) + padding, 1215 end = begin + this.width() * rtl, 1216 inner, outer, matches = [], i, n; 1217 1218 for (i = 0, n = this._coordinates.length; i < n; i++) { 1219 inner = this._coordinates[i - 1] || 0; 1220 outer = Math.abs(this._coordinates[i]) + padding * rtl; 1221 1222 if ((this.op(inner, '<=', begin) && (this.op(inner, '>', end))) 1223 || (this.op(outer, '<', begin) && this.op(outer, '>', end))) { 1224 matches.push(i); 1225 } 1226 } 1227 1228 this.$stage.children('.active').removeClass('active'); 1229 this.$stage.children(':eq(' + matches.join('), :eq(') + ')').addClass('active'); 1230 1231 this.$stage.children('.center').removeClass('center'); 1232 if (this.settings.center) { 1233 this.$stage.children().eq(this.current()).addClass('center'); 1234 } 1235 } 1236 }]; 1237 1238 /** 1239 * Create the stage DOM element 1240 */ 1241 Owl.prototype.initializeStage = function () { 1242 this.$stage = this.$element.find('.' + this.settings.stageClass); 1243 1244 // if the stage is already in the DOM, grab it and skip stage initialization 1245 if (this.$stage.length) { 1246 return; 1247 } 1248 1249 this.$element.addClass(this.options.loadingClass); 1250 1251 // create stage 1252 this.$stage = $('<' + this.settings.stageElement + '>', { 1253 "class": this.settings.stageClass 1254 }).wrap($('<div/>', { 1255 "class": this.settings.stageOuterClass 1256 })); 1257 1258 // append stage 1259 this.$element.append(this.$stage.parent()); 1260 }; 1261 1262 /** 1263 * Create item DOM elements 1264 */ 1265 Owl.prototype.initializeItems = function () { 1266 var $items = this.$element.find('.owl-item'); 1267 1268 // if the items are already in the DOM, grab them and skip item initialization 1269 if ($items.length) { 1270 this._items = $items.get().map(function (item) { 1271 return $(item); 1272 }); 1273 1274 this._mergers = this._items.map(function () { 1275 return 1; 1276 }); 1277 1278 this.refresh(); 1279 1280 return; 1281 } 1282 1283 // append content 1284 this.replace(this.$element.children().not(this.$stage.parent())); 1285 1286 // check visibility 1287 if (this.isVisible()) { 1288 // update view 1289 this.refresh(); 1290 } else { 1291 // invalidate width 1292 this.invalidate('width'); 1293 } 1294 1295 this.$element 1296 .removeClass(this.options.loadingClass) 1297 .addClass(this.options.loadedClass); 1298 }; 1299 1300 /** 1301 * Initializes the carousel. 1302 * @protected 1303 */ 1304 Owl.prototype.initialize = function () { 1305 this.enter('initializing'); 1306 this.trigger('initialize'); 1307 1308 this.$element.toggleClass(this.settings.rtlClass, this.settings.rtl); 1309 1310 if (this.settings.autoWidth && !this.is('pre-loading')) { 1311 var imgs, nestedSelector, width; 1312 imgs = this.$element.find('img'); 1313 nestedSelector = this.settings.nestedItemSelector ? '.' + this.settings.nestedItemSelector : undefined; 1314 width = this.$element.children(nestedSelector).width(); 1315 1316 if (imgs.length && width <= 0) { 1317 this.preloadAutoWidthImages(imgs); 1318 } 1319 } 1320 1321 this.initializeStage(); 1322 this.initializeItems(); 1323 1324 // register event handlers 1325 this.registerEventHandlers(); 1326 1327 this.leave('initializing'); 1328 this.trigger('initialized'); 1329 }; 1330 1331 /** 1332 * @returns {Boolean} visibility of $element 1333 * if you know the carousel will always be visible you can set `checkVisibility` to `false` to 1334 * prevent the expensive browser layout forced reflow the $element.is(':visible') does 1335 */ 1336 Owl.prototype.isVisible = function () { 1337 return this.settings.checkVisibility 1338 ? this.$element.is(':visible') 1339 : true; 1340 }; 1341 1342 /** 1343 * Setups the current settings. 1344 * @todo Remove responsive classes. Why should adaptive designs be brought into IE8? 1345 * @todo Support for media queries by using `matchMedia` would be nice. 1346 * @public 1347 */ 1348 Owl.prototype.setup = function () { 1349 var viewport = this.viewport(), 1350 overwrites = this.options.responsive, 1351 match = -1, 1352 settings = null; 1353 1354 if (!overwrites) { 1355 settings = $.extend({}, this.options); 1356 } else { 1357 $.each(overwrites, function (breakpoint) { 1358 if (breakpoint <= viewport && breakpoint > match) { 1359 match = Number(breakpoint); 1360 } 1361 }); 1362 1363 settings = $.extend({}, this.options, overwrites[match]); 1364 if (typeof settings.stagePadding === 'function') { 1365 settings.stagePadding = settings.stagePadding(); 1366 } 1367 delete settings.responsive; 1368 1369 // responsive class 1370 if (settings.responsiveClass) { 1371 this.$element.attr('class', 1372 this.$element.attr('class').replace(new RegExp('(' + this.options.responsiveClass + '-)\\S+\\s', 'g'), '$1' + match) 1373 ); 1374 } 1375 } 1376 1377 this.trigger('change', { property: { name: 'settings', value: settings } }); 1378 this._breakpoint = match; 1379 this.settings = settings; 1380 this.invalidate('settings'); 1381 this.trigger('changed', { property: { name: 'settings', value: this.settings } }); 1382 }; 1383 1384 /** 1385 * Updates option logic if necessery. 1386 * @protected 1387 */ 1388 Owl.prototype.optionsLogic = function () { 1389 if (this.settings.autoWidth) { 1390 this.settings.stagePadding = false; 1391 this.settings.merge = false; 1392 } 1393 }; 1394 1395 /** 1396 * Prepares an item before add. 1397 * @todo Rename event parameter `content` to `item`. 1398 * @protected 1399 * @returns {jQuery|HTMLElement} - The item container. 1400 */ 1401 Owl.prototype.prepare = function (item) { 1402 var event = this.trigger('prepare', { content: item }); 1403 1404 if (!event.data) { 1405 event.data = $('<' + this.settings.itemElement + '/>') 1406 .addClass(this.options.itemClass).append(item) 1407 } 1408 1409 this.trigger('prepared', { content: event.data }); 1410 1411 return event.data; 1412 }; 1413 1414 /** 1415 * Updates the view. 1416 * @public 1417 */ 1418 Owl.prototype.update = function () { 1419 var i = 0, 1420 n = this._pipe.length, 1421 filter = $.proxy(function (p) { return this[p] }, this._invalidated), 1422 cache = {}; 1423 1424 while (i < n) { 1425 if (this._invalidated.all || $.grep(this._pipe[i].filter, filter).length > 0) { 1426 this._pipe[i].run(cache); 1427 } 1428 i++; 1429 } 1430 1431 this._invalidated = {}; 1432 1433 !this.is('valid') && this.enter('valid'); 1434 }; 1435 1436 /** 1437 * Gets the width of the view. 1438 * @public 1439 * @param {Owl.Width} [dimension=Owl.Width.Default] - The dimension to return. 1440 * @returns {Number} - The width of the view in pixel. 1441 */ 1442 Owl.prototype.width = function (dimension) { 1443 dimension = dimension || Owl.Width.Default; 1444 switch (dimension) { 1445 case Owl.Width.Inner: 1446 case Owl.Width.Outer: 1447 return this._width; 1448 default: 1449 return this._width - this.settings.stagePadding * 2 + this.settings.margin; 1450 } 1451 }; 1452 1453 /** 1454 * Refreshes the carousel primarily for adaptive purposes. 1455 * @public 1456 */ 1457 Owl.prototype.refresh = function () { 1458 this.enter('refreshing'); 1459 this.trigger('refresh'); 1460 1461 this.setup(); 1462 1463 this.optionsLogic(); 1464 1465 this.$element.addClass(this.options.refreshClass); 1466 1467 this.update(); 1468 1469 this.$element.removeClass(this.options.refreshClass); 1470 1471 this.leave('refreshing'); 1472 this.trigger('refreshed'); 1473 }; 1474 1475 /** 1476 * Checks window `resize` event. 1477 * @protected 1478 */ 1479 Owl.prototype.onThrottledResize = function () { 1480 window.clearTimeout(this.resizeTimer); 1481 this.resizeTimer = window.setTimeout(this._handlers.onResize, this.settings.responsiveRefreshRate); 1482 }; 1483 1484 /** 1485 * Checks window `resize` event. 1486 * @protected 1487 */ 1488 Owl.prototype.onResize = function () { 1489 if (!this._items.length) { 1490 return false; 1491 } 1492 1493 if (this._width === this.$element.width()) { 1494 return false; 1495 } 1496 1497 if (!this.isVisible()) { 1498 return false; 1499 } 1500 1501 this.enter('resizing'); 1502 1503 if (this.trigger('resize').isDefaultPrevented()) { 1504 this.leave('resizing'); 1505 return false; 1506 } 1507 1508 this.invalidate('width'); 1509 1510 this.refresh(); 1511 1512 this.leave('resizing'); 1513 this.trigger('resized'); 1514 }; 1515 1516 /** 1517 * Registers event handlers. 1518 * @todo Check `msPointerEnabled` 1519 * @todo #261 1520 * @protected 1521 */ 1522 Owl.prototype.registerEventHandlers = function () { 1523 if ($.support.transition) { 1524 this.$stage.on($.support.transition.end + '.owl.core', $.proxy(this.onTransitionEnd, this)); 1525 } 1526 1527 if (this.settings.responsive !== false) { 1528 this.on(window, 'resize', this._handlers.onThrottledResize); 1529 } 1530 1531 if (this.settings.mouseDrag) { 1532 this.$element.addClass(this.options.dragClass); 1533 this.$stage.on('mousedown.owl.core', $.proxy(this.onDragStart, this)); 1534 this.$stage.on('dragstart.owl.core selectstart.owl.core', function () { return false }); 1535 } 1536 1537 if (this.settings.touchDrag) { 1538 this.$stage.on('touchstart.owl.core', $.proxy(this.onDragStart, this)); 1539 this.$stage.on('touchcancel.owl.core', $.proxy(this.onDragEnd, this)); 1540 } 1541 }; 1542 1543 /** 1544 * Handles `touchstart` and `mousedown` events. 1545 * @todo Horizontal swipe threshold as option 1546 * @todo #261 1547 * @protected 1548 * @param {Event} event - The event arguments. 1549 */ 1550 Owl.prototype.onDragStart = function (event) { 1551 var stage = null; 1552 1553 if (event.which === 3) { 1554 return; 1555 } 1556 1557 if ($.support.transform) { 1558 stage = this.$stage.css('transform').replace(/.*\(|\)| /g, '').split(','); 1559 stage = { 1560 x: stage[stage.length === 16 ? 12 : 4], 1561 y: stage[stage.length === 16 ? 13 : 5] 1562 }; 1563 } else { 1564 stage = this.$stage.position(); 1565 stage = { 1566 x: this.settings.rtl ? 1567 stage.left + this.$stage.width() - this.width() + this.settings.margin : 1568 stage.left, 1569 y: stage.top 1570 }; 1571 } 1572 1573 if (this.is('animating')) { 1574 $.support.transform ? this.animate(stage.x) : this.$stage.stop() 1575 this.invalidate('position'); 1576 } 1577 1578 this.$element.toggleClass(this.options.grabClass, event.type === 'mousedown'); 1579 1580 this.speed(0); 1581 1582 this._drag.time = new Date().getTime(); 1583 this._drag.target = $(event.target); 1584 this._drag.stage.start = stage; 1585 this._drag.stage.current = stage; 1586 this._drag.pointer = this.pointer(event); 1587 1588 $(document).on('mouseup.owl.core touchend.owl.core', $.proxy(this.onDragEnd, this)); 1589 1590 $(document).one('mousemove.owl.core touchmove.owl.core', $.proxy(function (event) { 1591 var delta = this.difference(this._drag.pointer, this.pointer(event)); 1592 1593 $(document).on('mousemove.owl.core touchmove.owl.core', $.proxy(this.onDragMove, this)); 1594 1595 if (Math.abs(delta.x) < Math.abs(delta.y) && this.is('valid')) { 1596 return; 1597 } 1598 1599 event.preventDefault(); 1600 1601 this.enter('dragging'); 1602 this.trigger('drag'); 1603 }, this)); 1604 }; 1605 1606 /** 1607 * Handles the `touchmove` and `mousemove` events. 1608 * @todo #261 1609 * @protected 1610 * @param {Event} event - The event arguments. 1611 */ 1612 Owl.prototype.onDragMove = function (event) { 1613 var minimum = null, 1614 maximum = null, 1615 pull = null, 1616 delta = this.difference(this._drag.pointer, this.pointer(event)), 1617 stage = this.difference(this._drag.stage.start, delta); 1618 1619 if (!this.is('dragging')) { 1620 return; 1621 } 1622 1623 event.preventDefault(); 1624 1625 if (this.settings.loop) { 1626 minimum = this.coordinates(this.minimum()); 1627 maximum = this.coordinates(this.maximum() + 1) - minimum; 1628 stage.x = (((stage.x - minimum) % maximum + maximum) % maximum) + minimum; 1629 } else { 1630 minimum = this.settings.rtl ? this.coordinates(this.maximum()) : this.coordinates(this.minimum()); 1631 maximum = this.settings.rtl ? this.coordinates(this.minimum()) : this.coordinates(this.maximum()); 1632 pull = this.settings.pullDrag ? -1 * delta.x / 5 : 0; 1633 stage.x = Math.max(Math.min(stage.x, minimum + pull), maximum + pull); 1634 } 1635 1636 this._drag.stage.current = stage; 1637 1638 this.animate(stage.x); 1639 }; 1640 1641 /** 1642 * Handles the `touchend` and `mouseup` events. 1643 * @todo #261 1644 * @todo Threshold for click event 1645 * @protected 1646 * @param {Event} event - The event arguments. 1647 */ 1648 Owl.prototype.onDragEnd = function (event) { 1649 var delta = this.difference(this._drag.pointer, this.pointer(event)), 1650 stage = this._drag.stage.current, 1651 direction = delta.x > 0 ^ this.settings.rtl ? 'left' : 'right'; 1652 1653 $(document).off('.owl.core'); 1654 1655 this.$element.removeClass(this.options.grabClass); 1656 1657 if (delta.x !== 0 && this.is('dragging') || !this.is('valid')) { 1658 this.speed(this.settings.dragEndSpeed || this.settings.smartSpeed); 1659 this.current(this.closest(stage.x, delta.x !== 0 ? direction : this._drag.direction)); 1660 this.invalidate('position'); 1661 this.update(); 1662 1663 this._drag.direction = direction; 1664 1665 if (Math.abs(delta.x) > 3 || new Date().getTime() - this._drag.time > 300) { 1666 this._drag.target.one('click.owl.core', function () { return false; }); 1667 } 1668 } 1669 1670 if (!this.is('dragging')) { 1671 return; 1672 } 1673 1674 this.leave('dragging'); 1675 this.trigger('dragged'); 1676 }; 1677 1678 /** 1679 * Gets absolute position of the closest item for a coordinate. 1680 * @todo Setting `freeDrag` makes `closest` not reusable. See #165. 1681 * @protected 1682 * @param {Number} coordinate - The coordinate in pixel. 1683 * @param {String} direction - The direction to check for the closest item. Ether `left` or `right`. 1684 * @return {Number} - The absolute position of the closest item. 1685 */ 1686 Owl.prototype.closest = function (coordinate, direction) { 1687 var position = -1, 1688 pull = 30, 1689 width = this.width(), 1690 coordinates = this.coordinates(); 1691 1692 if (!this.settings.freeDrag) { 1693 // check closest item 1694 $.each(coordinates, $.proxy(function (index, value) { 1695 // on a left pull, check on current index 1696 if (direction === 'left' && coordinate > value - pull && coordinate < value + pull) { 1697 position = index; 1698 // on a right pull, check on previous index 1699 // to do so, subtract width from value and set position = index + 1 1700 } else if (direction === 'right' && coordinate > value - width - pull && coordinate < value - width + pull) { 1701 position = index + 1; 1702 } else if (this.op(coordinate, '<', value) 1703 && this.op(coordinate, '>', coordinates[index + 1] !== undefined ? coordinates[index + 1] : value - width)) { 1704 position = direction === 'left' ? index + 1 : index; 1705 } 1706 return position === -1; 1707 }, this)); 1708 } 1709 1710 if (!this.settings.loop) { 1711 // non loop boundries 1712 if (this.op(coordinate, '>', coordinates[this.minimum()])) { 1713 position = coordinate = this.minimum(); 1714 } else if (this.op(coordinate, '<', coordinates[this.maximum()])) { 1715 position = coordinate = this.maximum(); 1716 } 1717 } 1718 1719 return position; 1720 }; 1721 1722 /** 1723 * Animates the stage. 1724 * @todo #270 1725 * @public 1726 * @param {Number} coordinate - The coordinate in pixels. 1727 */ 1728 Owl.prototype.animate = function (coordinate) { 1729 var animate = this.speed() > 0; 1730 1731 this.is('animating') && this.onTransitionEnd(); 1732 1733 if (animate) { 1734 this.enter('animating'); 1735 this.trigger('translate'); 1736 } 1737 1738 if ($.support.transform3d && $.support.transition) { 1739 this.$stage.css({ 1740 transform: 'translate3d(' + coordinate + 'px,0px,0px)', 1741 transition: (this.speed() / 1000) + 's' + ( 1742 this.settings.slideTransition ? ' ' + this.settings.slideTransition : '' 1743 ) 1744 }); 1745 } else if (animate) { 1746 this.$stage.animate({ 1747 left: coordinate + 'px' 1748 }, this.speed(), this.settings.fallbackEasing, $.proxy(this.onTransitionEnd, this)); 1749 } else { 1750 this.$stage.css({ 1751 left: coordinate + 'px' 1752 }); 1753 } 1754 }; 1755 1756 /** 1757 * Checks whether the carousel is in a specific state or not. 1758 * @param {String} state - The state to check. 1759 * @returns {Boolean} - The flag which indicates if the carousel is busy. 1760 */ 1761 Owl.prototype.is = function (state) { 1762 return this._states.current[state] && this._states.current[state] > 0; 1763 }; 1764 1765 /** 1766 * Sets the absolute position of the current item. 1767 * @public 1768 * @param {Number} [position] - The new absolute position or nothing to leave it unchanged. 1769 * @returns {Number} - The absolute position of the current item. 1770 */ 1771 Owl.prototype.current = function (position) { 1772 if (position === undefined) { 1773 return this._current; 1774 } 1775 1776 if (this._items.length === 0) { 1777 return undefined; 1778 } 1779 1780 position = this.normalize(position); 1781 1782 if (this._current !== position) { 1783 var event = this.trigger('change', { property: { name: 'position', value: position } }); 1784 1785 if (event.data !== undefined) { 1786 position = this.normalize(event.data); 1787 } 1788 1789 this._current = position; 1790 1791 this.invalidate('position'); 1792 1793 this.trigger('changed', { property: { name: 'position', value: this._current } }); 1794 } 1795 1796 return this._current; 1797 }; 1798 1799 /** 1800 * Invalidates the given part of the update routine. 1801 * @param {String} [part] - The part to invalidate. 1802 * @returns {Array.<String>} - The invalidated parts. 1803 */ 1804 Owl.prototype.invalidate = function (part) { 1805 if ($.type(part) === 'string') { 1806 this._invalidated[part] = true; 1807 this.is('valid') && this.leave('valid'); 1808 } 1809 return $.map(this._invalidated, function (v, i) { return i }); 1810 }; 1811 1812 /** 1813 * Resets the absolute position of the current item. 1814 * @public 1815 * @param {Number} position - The absolute position of the new item. 1816 */ 1817 Owl.prototype.reset = function (position) { 1818 position = this.normalize(position); 1819 1820 if (position === undefined) { 1821 return; 1822 } 1823 1824 this._speed = 0; 1825 this._current = position; 1826 1827 this.suppress(['translate', 'translated']); 1828 1829 this.animate(this.coordinates(position)); 1830 1831 this.release(['translate', 'translated']); 1832 }; 1833 1834 /** 1835 * Normalizes an absolute or a relative position of an item. 1836 * @public 1837 * @param {Number} position - The absolute or relative position to normalize. 1838 * @param {Boolean} [relative=false] - Whether the given position is relative or not. 1839 * @returns {Number} - The normalized position. 1840 */ 1841 Owl.prototype.normalize = function (position, relative) { 1842 var n = this._items.length, 1843 m = relative ? 0 : this._clones.length; 1844 1845 if (!this.isNumeric(position) || n < 1) { 1846 position = undefined; 1847 } else if (position < 0 || position >= n + m) { 1848 position = ((position - m / 2) % n + n) % n + m / 2; 1849 } 1850 1851 return position; 1852 }; 1853 1854 /** 1855 * Converts an absolute position of an item into a relative one. 1856 * @public 1857 * @param {Number} position - The absolute position to convert. 1858 * @returns {Number} - The converted position. 1859 */ 1860 Owl.prototype.relative = function (position) { 1861 position -= this._clones.length / 2; 1862 return this.normalize(position, true); 1863 }; 1864 1865 /** 1866 * Gets the maximum position for the current item. 1867 * @public 1868 * @param {Boolean} [relative=false] - Whether to return an absolute position or a relative position. 1869 * @returns {Number} 1870 */ 1871 Owl.prototype.maximum = function (relative) { 1872 var settings = this.settings, 1873 maximum = this._coordinates.length, 1874 iterator, 1875 reciprocalItemsWidth, 1876 elementWidth; 1877 1878 if (settings.loop) { 1879 maximum = this._clones.length / 2 + this._items.length - 1; 1880 } else if (settings.autoWidth || settings.merge) { 1881 iterator = this._items.length; 1882 if (iterator) { 1883 reciprocalItemsWidth = this._items[--iterator].width(); 1884 elementWidth = this.$element.width(); 1885 while (iterator--) { 1886 reciprocalItemsWidth += this._items[iterator].width() + this.settings.margin; 1887 if (reciprocalItemsWidth > elementWidth) { 1888 break; 1889 } 1890 } 1891 } 1892 maximum = iterator + 1; 1893 } else if (settings.center) { 1894 maximum = this._items.length - 1; 1895 } else { 1896 maximum = this._items.length - settings.items; 1897 } 1898 1899 if (relative) { 1900 maximum -= this._clones.length / 2; 1901 } 1902 1903 return Math.max(maximum, 0); 1904 }; 1905 1906 /** 1907 * Gets the minimum position for the current item. 1908 * @public 1909 * @param {Boolean} [relative=false] - Whether to return an absolute position or a relative position. 1910 * @returns {Number} 1911 */ 1912 Owl.prototype.minimum = function (relative) { 1913 return relative ? 0 : this._clones.length / 2; 1914 }; 1915 1916 /** 1917 * Gets an item at the specified relative position. 1918 * @public 1919 * @param {Number} [position] - The relative position of the item. 1920 * @return {jQuery|Array.<jQuery>} - The item at the given position or all items if no position was given. 1921 */ 1922 Owl.prototype.items = function (position) { 1923 if (position === undefined) { 1924 return this._items.slice(); 1925 } 1926 1927 position = this.normalize(position, true); 1928 return this._items[position]; 1929 }; 1930 1931 /** 1932 * Gets an item at the specified relative position. 1933 * @public 1934 * @param {Number} [position] - The relative position of the item. 1935 * @return {jQuery|Array.<jQuery>} - The item at the given position or all items if no position was given. 1936 */ 1937 Owl.prototype.mergers = function (position) { 1938 if (position === undefined) { 1939 return this._mergers.slice(); 1940 } 1941 1942 position = this.normalize(position, true); 1943 return this._mergers[position]; 1944 }; 1945 1946 /** 1947 * Gets the absolute positions of clones for an item. 1948 * @public 1949 * @param {Number} [position] - The relative position of the item. 1950 * @returns {Array.<Number>} - The absolute positions of clones for the item or all if no position was given. 1951 */ 1952 Owl.prototype.clones = function (position) { 1953 var odd = this._clones.length / 2, 1954 even = odd + this._items.length, 1955 map = function (index) { return index % 2 === 0 ? even + index / 2 : odd - (index + 1) / 2 }; 1956 1957 if (position === undefined) { 1958 return $.map(this._clones, function (v, i) { return map(i) }); 1959 } 1960 1961 return $.map(this._clones, function (v, i) { return v === position ? map(i) : null }); 1962 }; 1963 1964 /** 1965 * Sets the current animation speed. 1966 * @public 1967 * @param {Number} [speed] - The animation speed in milliseconds or nothing to leave it unchanged. 1968 * @returns {Number} - The current animation speed in milliseconds. 1969 */ 1970 Owl.prototype.speed = function (speed) { 1971 if (speed !== undefined) { 1972 this._speed = speed; 1973 } 1974 1975 return this._speed; 1976 }; 1977 1978 /** 1979 * Gets the coordinate of an item. 1980 * @todo The name of this method is missleanding. 1981 * @public 1982 * @param {Number} position - The absolute position of the item within `minimum()` and `maximum()`. 1983 * @returns {Number|Array.<Number>} - The coordinate of the item in pixel or all coordinates. 1984 */ 1985 Owl.prototype.coordinates = function (position) { 1986 var multiplier = 1, 1987 newPosition = position - 1, 1988 coordinate; 1989 1990 if (position === undefined) { 1991 return $.map(this._coordinates, $.proxy(function (coordinate, index) { 1992 return this.coordinates(index); 1993 }, this)); 1994 } 1995 1996 if (this.settings.center) { 1997 if (this.settings.rtl) { 1998 multiplier = -1; 1999 newPosition = position + 1; 2000 } 2001 2002 coordinate = this._coordinates[position]; 2003 coordinate += (this.width() - coordinate + (this._coordinates[newPosition] || 0)) / 2 * multiplier; 2004 } else { 2005 coordinate = this._coordinates[newPosition] || 0; 2006 } 2007 2008 coordinate = Math.ceil(coordinate); 2009 2010 return coordinate; 2011 }; 2012 2013 /** 2014 * Calculates the speed for a translation. 2015 * @protected 2016 * @param {Number} from - The absolute position of the start item. 2017 * @param {Number} to - The absolute position of the target item. 2018 * @param {Number} [factor=undefined] - The time factor in milliseconds. 2019 * @returns {Number} - The time in milliseconds for the translation. 2020 */ 2021 Owl.prototype.duration = function (from, to, factor) { 2022 if (factor === 0) { 2023 return 0; 2024 } 2025 2026 return Math.min(Math.max(Math.abs(to - from), 1), 6) * Math.abs((factor || this.settings.smartSpeed)); 2027 }; 2028 2029 /** 2030 * Slides to the specified item. 2031 * @public 2032 * @param {Number} position - The position of the item. 2033 * @param {Number} [speed] - The time in milliseconds for the transition. 2034 */ 2035 Owl.prototype.to = function (position, speed) { 2036 var current = this.current(), 2037 revert = null, 2038 distance = position - this.relative(current), 2039 direction = (distance > 0) - (distance < 0), 2040 items = this._items.length, 2041 minimum = this.minimum(), 2042 maximum = this.maximum(); 2043 2044 if (this.settings.loop) { 2045 if (!this.settings.rewind && Math.abs(distance) > items / 2) { 2046 distance += direction * -1 * items; 2047 } 2048 2049 position = current + distance; 2050 revert = ((position - minimum) % items + items) % items + minimum; 2051 2052 if (revert !== position && revert - distance <= maximum && revert - distance > 0) { 2053 current = revert - distance; 2054 position = revert; 2055 this.reset(current); 2056 } 2057 } else if (this.settings.rewind) { 2058 maximum += 1; 2059 position = (position % maximum + maximum) % maximum; 2060 } else { 2061 position = Math.max(minimum, Math.min(maximum, position)); 2062 } 2063 2064 this.speed(this.duration(current, position, speed)); 2065 this.current(position); 2066 2067 if (this.isVisible()) { 2068 this.update(); 2069 } 2070 }; 2071 2072 /** 2073 * Slides to the next item. 2074 * @public 2075 * @param {Number} [speed] - The time in milliseconds for the transition. 2076 */ 2077 Owl.prototype.next = function (speed) { 2078 speed = speed || false; 2079 this.to(this.relative(this.current()) + 1, speed); 2080 }; 2081 2082 /** 2083 * Slides to the previous item. 2084 * @public 2085 * @param {Number} [speed] - The time in milliseconds for the transition. 2086 */ 2087 Owl.prototype.prev = function (speed) { 2088 speed = speed || false; 2089 this.to(this.relative(this.current()) - 1, speed); 2090 }; 2091 2092 /** 2093 * Handles the end of an animation. 2094 * @protected 2095 * @param {Event} event - The event arguments. 2096 */ 2097 Owl.prototype.onTransitionEnd = function (event) { 2098 2099 // if css2 animation then event object is undefined 2100 if (event !== undefined) { 2101 event.stopPropagation(); 2102 2103 // Catch only owl-stage transitionEnd event 2104 if ((event.target || event.srcElement || event.originalTarget) !== this.$stage.get(0)) { 2105 return false; 2106 } 2107 } 2108 2109 this.leave('animating'); 2110 this.trigger('translated'); 2111 }; 2112 2113 /** 2114 * Gets viewport width. 2115 * @protected 2116 * @return {Number} - The width in pixel. 2117 */ 2118 Owl.prototype.viewport = function () { 2119 var width; 2120 if (this.options.responsiveBaseElement !== window) { 2121 width = $(this.options.responsiveBaseElement).width(); 2122 } else if (window.innerWidth) { 2123 width = window.innerWidth; 2124 } else if (document.documentElement && document.documentElement.clientWidth) { 2125 width = document.documentElement.clientWidth; 2126 } else { 2127 console.warn('Can not detect viewport width.'); 2128 } 2129 return width; 2130 }; 2131 2132 /** 2133 * Replaces the current content. 2134 * @public 2135 * @param {HTMLElement|jQuery|String} content - The new content. 2136 */ 2137 Owl.prototype.replace = function (content) { 2138 this.$stage.empty(); 2139 this._items = []; 2140 2141 if (content) { 2142 content = (content instanceof jQuery) ? content : $(content); 2143 } 2144 2145 if (this.settings.nestedItemSelector) { 2146 content = content.find('.' + this.settings.nestedItemSelector); 2147 } 2148 2149 content.filter(function () { 2150 return this.nodeType === 1; 2151 }).each($.proxy(function (index, item) { 2152 item = this.prepare(item); 2153 this.$stage.append(item); 2154 this._items.push(item); 2155 this._mergers.push(item.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1); 2156 }, this)); 2157 2158 this.reset(this.isNumeric(this.settings.startPosition) ? this.settings.startPosition : 0); 2159 2160 this.invalidate('items'); 2161 }; 2162 2163 /** 2164 * Adds an item. 2165 * @todo Use `item` instead of `content` for the event arguments. 2166 * @public 2167 * @param {HTMLElement|jQuery|String} content - The item content to add. 2168 * @param {Number} [position] - The relative position at which to insert the item otherwise the item will be added to the end. 2169 */ 2170 Owl.prototype.add = function (content, position) { 2171 var current = this.relative(this._current); 2172 2173 position = position === undefined ? this._items.length : this.normalize(position, true); 2174 content = content instanceof jQuery ? content : $(content); 2175 2176 this.trigger('add', { content: content, position: position }); 2177 2178 content = this.prepare(content); 2179 2180 if (this._items.length === 0 || position === this._items.length) { 2181 this._items.length === 0 && this.$stage.append(content); 2182 this._items.length !== 0 && this._items[position - 1].after(content); 2183 this._items.push(content); 2184 this._mergers.push(content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1); 2185 } else { 2186 this._items[position].before(content); 2187 this._items.splice(position, 0, content); 2188 this._mergers.splice(position, 0, content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1); 2189 } 2190 2191 this._items[current] && this.reset(this._items[current].index()); 2192 2193 this.invalidate('items'); 2194 2195 this.trigger('added', { content: content, position: position }); 2196 }; 2197 2198 /** 2199 * Removes an item by its position. 2200 * @todo Use `item` instead of `content` for the event arguments. 2201 * @public 2202 * @param {Number} position - The relative position of the item to remove. 2203 */ 2204 Owl.prototype.remove = function (position) { 2205 position = this.normalize(position, true); 2206 2207 if (position === undefined) { 2208 return; 2209 } 2210 2211 this.trigger('remove', { content: this._items[position], position: position }); 2212 2213 this._items[position].remove(); 2214 this._items.splice(position, 1); 2215 this._mergers.splice(position, 1); 2216 2217 this.invalidate('items'); 2218 2219 this.trigger('removed', { content: null, position: position }); 2220 }; 2221 2222 /** 2223 * Preloads images with auto width. 2224 * @todo Replace by a more generic approach 2225 * @protected 2226 */ 2227 Owl.prototype.preloadAutoWidthImages = function (images) { 2228 images.each($.proxy(function (i, element) { 2229 this.enter('pre-loading'); 2230 element = $(element); 2231 $(new Image()).one('load', $.proxy(function (e) { 2232 element.attr('src', e.target.src); 2233 element.css('opacity', 1); 2234 this.leave('pre-loading'); 2235 !this.is('pre-loading') && !this.is('initializing') && this.refresh(); 2236 }, this)).attr('src', element.attr('src') || element.attr('data-src') || element.attr('data-src-retina')); 2237 }, this)); 2238 }; 2239 2240 /** 2241 * Destroys the carousel. 2242 * @public 2243 */ 2244 Owl.prototype.destroy = function () { 2245 2246 this.$element.off('.owl.core'); 2247 this.$stage.off('.owl.core'); 2248 $(document).off('.owl.core'); 2249 2250 if (this.settings.responsive !== false) { 2251 window.clearTimeout(this.resizeTimer); 2252 this.off(window, 'resize', this._handlers.onThrottledResize); 2253 } 2254 2255 for (var i in this._plugins) { 2256 this._plugins[i].destroy(); 2257 } 2258 2259 this.$stage.children('.cloned').remove(); 2260 2261 this.$stage.unwrap(); 2262 this.$stage.children().contents().unwrap(); 2263 this.$stage.children().unwrap(); 2264 this.$stage.remove(); 2265 this.$element 2266 .removeClass(this.options.refreshClass) 2267 .removeClass(this.options.loadingClass) 2268 .removeClass(this.options.loadedClass) 2269 .removeClass(this.options.rtlClass) 2270 .removeClass(this.options.dragClass) 2271 .removeClass(this.options.grabClass) 2272 .attr('class', this.$element.attr('class').replace(new RegExp(this.options.responsiveClass + '-\\S+\\s', 'g'), '')) 2273 .removeData('owl.carousel'); 2274 }; 2275 2276 /** 2277 * Operators to calculate right-to-left and left-to-right. 2278 * @protected 2279 * @param {Number} [a] - The left side operand. 2280 * @param {String} [o] - The operator. 2281 * @param {Number} [b] - The right side operand. 2282 */ 2283 Owl.prototype.op = function (a, o, b) { 2284 var rtl = this.settings.rtl; 2285 switch (o) { 2286 case '<': 2287 return rtl ? a > b : a < b; 2288 case '>': 2289 return rtl ? a < b : a > b; 2290 case '>=': 2291 return rtl ? a <= b : a >= b; 2292 case '<=': 2293 return rtl ? a >= b : a <= b; 2294 default: 2295 break; 2296 } 2297 }; 2298 2299 /** 2300 * Attaches to an internal event. 2301 * @protected 2302 * @param {HTMLElement} element - The event source. 2303 * @param {String} event - The event name. 2304 * @param {Function} listener - The event handler to attach. 2305 * @param {Boolean} capture - Wether the event should be handled at the capturing phase or not. 2306 */ 2307 Owl.prototype.on = function (element, event, listener, capture) { 2308 if (element.addEventListener) { 2309 element.addEventListener(event, listener, capture); 2310 } else if (element.attachEvent) { 2311 element.attachEvent('on' + event, listener); 2312 } 2313 }; 2314 2315 /** 2316 * Detaches from an internal event. 2317 * @protected 2318 * @param {HTMLElement} element - The event source. 2319 * @param {String} event - The event name. 2320 * @param {Function} listener - The attached event handler to detach. 2321 * @param {Boolean} capture - Wether the attached event handler was registered as a capturing listener or not. 2322 */ 2323 Owl.prototype.off = function (element, event, listener, capture) { 2324 if (element.removeEventListener) { 2325 element.removeEventListener(event, listener, capture); 2326 } else if (element.detachEvent) { 2327 element.detachEvent('on' + event, listener); 2328 } 2329 }; 2330 2331 /** 2332 * Triggers a public event. 2333 * @todo Remove `status`, `relatedTarget` should be used instead. 2334 * @protected 2335 * @param {String} name - The event name. 2336 * @param {*} [data=null] - The event data. 2337 * @param {String} [namespace=carousel] - The event namespace. 2338 * @param {String} [state] - The state which is associated with the event. 2339 * @param {Boolean} [enter=false] - Indicates if the call enters the specified state or not. 2340 * @returns {Event} - The event arguments. 2341 */ 2342 Owl.prototype.trigger = function (name, data, namespace, state, enter) { 2343 var status = { 2344 item: { count: this._items.length, index: this.current() } 2345 }, handler = $.camelCase( 2346 $.grep(['on', name, namespace], function (v) { return v }) 2347 .join('-').toLowerCase() 2348 ), event = $.Event( 2349 [name, 'owl', namespace || 'carousel'].join('.').toLowerCase(), 2350 $.extend({ relatedTarget: this }, status, data) 2351 ); 2352 2353 if (!this._supress[name]) { 2354 $.each(this._plugins, function (name, plugin) { 2355 if (plugin.onTrigger) { 2356 plugin.onTrigger(event); 2357 } 2358 }); 2359 2360 this.register({ type: Owl.Type.Event, name: name }); 2361 this.$element.trigger(event); 2362 2363 if (this.settings && typeof this.settings[handler] === 'function') { 2364 this.settings[handler].call(this, event); 2365 } 2366 } 2367 2368 return event; 2369 }; 2370 2371 /** 2372 * Enters a state. 2373 * @param name - The state name. 2374 */ 2375 Owl.prototype.enter = function (name) { 2376 $.each([name].concat(this._states.tags[name] || []), $.proxy(function (i, name) { 2377 if (this._states.current[name] === undefined) { 2378 this._states.current[name] = 0; 2379 } 2380 2381 this._states.current[name]++; 2382 }, this)); 2383 }; 2384 2385 /** 2386 * Leaves a state. 2387 * @param name - The state name. 2388 */ 2389 Owl.prototype.leave = function (name) { 2390 $.each([name].concat(this._states.tags[name] || []), $.proxy(function (i, name) { 2391 this._states.current[name]--; 2392 }, this)); 2393 }; 2394 2395 /** 2396 * Registers an event or state. 2397 * @public 2398 * @param {Object} object - The event or state to register. 2399 */ 2400 Owl.prototype.register = function (object) { 2401 if (object.type === Owl.Type.Event) { 2402 if (!$.event.special[object.name]) { 2403 $.event.special[object.name] = {}; 2404 } 2405 2406 if (!$.event.special[object.name].owl) { 2407 var _default = $.event.special[object.name]._default; 2408 $.event.special[object.name]._default = function (e) { 2409 if (_default && _default.apply && (!e.namespace || e.namespace.indexOf('owl') === -1)) { 2410 return _default.apply(this, arguments); 2411 } 2412 return e.namespace && e.namespace.indexOf('owl') > -1; 2413 }; 2414 $.event.special[object.name].owl = true; 2415 } 2416 } else if (object.type === Owl.Type.State) { 2417 if (!this._states.tags[object.name]) { 2418 this._states.tags[object.name] = object.tags; 2419 } else { 2420 this._states.tags[object.name] = this._states.tags[object.name].concat(object.tags); 2421 } 2422 2423 this._states.tags[object.name] = $.grep(this._states.tags[object.name], $.proxy(function (tag, i) { 2424 return $.inArray(tag, this._states.tags[object.name]) === i; 2425 }, this)); 2426 } 2427 }; 2428 2429 /** 2430 * Suppresses events. 2431 * @protected 2432 * @param {Array.<String>} events - The events to suppress. 2433 */ 2434 Owl.prototype.suppress = function (events) { 2435 $.each(events, $.proxy(function (index, event) { 2436 this._supress[event] = true; 2437 }, this)); 2438 }; 2439 2440 /** 2441 * Releases suppressed events. 2442 * @protected 2443 * @param {Array.<String>} events - The events to release. 2444 */ 2445 Owl.prototype.release = function (events) { 2446 $.each(events, $.proxy(function (index, event) { 2447 delete this._supress[event]; 2448 }, this)); 2449 }; 2450 2451 /** 2452 * Gets unified pointer coordinates from event. 2453 * @todo #261 2454 * @protected 2455 * @param {Event} - The `mousedown` or `touchstart` event. 2456 * @returns {Object} - Contains `x` and `y` coordinates of current pointer position. 2457 */ 2458 Owl.prototype.pointer = function (event) { 2459 var result = { x: null, y: null }; 2460 2461 event = event.originalEvent || event || window.event; 2462 2463 event = event.touches && event.touches.length ? 2464 event.touches[0] : event.changedTouches && event.changedTouches.length ? 2465 event.changedTouches[0] : event; 2466 2467 if (event.pageX) { 2468 result.x = event.pageX; 2469 result.y = event.pageY; 2470 } else { 2471 result.x = event.clientX; 2472 result.y = event.clientY; 2473 } 2474 2475 return result; 2476 }; 2477 2478 /** 2479 * Determines if the input is a Number or something that can be coerced to a Number 2480 * @protected 2481 * @param {Number|String|Object|Array|Boolean|RegExp|Function|Symbol} - The input to be tested 2482 * @returns {Boolean} - An indication if the input is a Number or can be coerced to a Number 2483 */ 2484 Owl.prototype.isNumeric = function (number) { 2485 return !isNaN(parseFloat(number)); 2486 }; 2487 2488 /** 2489 * Gets the difference of two vectors. 2490 * @todo #261 2491 * @protected 2492 * @param {Object} - The first vector. 2493 * @param {Object} - The second vector. 2494 * @returns {Object} - The difference. 2495 */ 2496 Owl.prototype.difference = function (first, second) { 2497 return { 2498 x: first.x - second.x, 2499 y: first.y - second.y 2500 }; 2501 }; 2502 2503 /** 2504 * The jQuery Plugin for the Owl Carousel 2505 * @todo Navigation plugin `next` and `prev` 2506 * @public 2507 */ 2508 $.fn.owlCarousel = function (option) { 2509 var args = Array.prototype.slice.call(arguments, 1); 2510 2511 return this.each(function () { 2512 var $this = $(this), 2513 data = $this.data('owl.carousel'); 2514 2515 if (!data) { 2516 data = new Owl(this, typeof option == 'object' && option); 2517 $this.data('owl.carousel', data); 2518 2519 $.each([ 2520 'next', 'prev', 'to', 'destroy', 'refresh', 'replace', 'add', 'remove' 2521 ], function (i, event) { 2522 data.register({ type: Owl.Type.Event, name: event }); 2523 data.$element.on(event + '.owl.carousel.core', $.proxy(function (e) { 2524 if (e.namespace && e.relatedTarget !== this) { 2525 this.suppress([event]); 2526 data[event].apply(this, [].slice.call(arguments, 1)); 2527 this.release([event]); 2528 } 2529 }, data)); 2530 }); 2531 } 2532 2533 if (typeof option == 'string' && option.charAt(0) !== '_') { 2534 data[option].apply(data, args); 2535 } 2536 }); 2537 }; 2538 2539 /** 2540 * The constructor for the jQuery Plugin 2541 * @public 2542 */ 2543 $.fn.owlCarousel.Constructor = Owl; 2544 2545})(window.Zepto || window.jQuery, window, document); 2546 2547/** 2548 * AutoRefresh Plugin 2549 * @version 2.3.4 2550 * @author Artus Kolanowski 2551 * @author David Deutsch 2552 * @license The MIT License (MIT) 2553 */ 2554; (function ($, window, document, undefined) { 2555 2556 /** 2557 * Creates the auto refresh plugin. 2558 * @class The Auto Refresh Plugin 2559 * @param {Owl} carousel - The Owl Carousel 2560 */ 2561 var AutoRefresh = function (carousel) { 2562 /** 2563 * Reference to the core. 2564 * @protected 2565 * @type {Owl} 2566 */ 2567 this._core = carousel; 2568 2569 /** 2570 * Refresh interval. 2571 * @protected 2572 * @type {number} 2573 */ 2574 this._interval = null; 2575 2576 /** 2577 * Whether the element is currently visible or not. 2578 * @protected 2579 * @type {Boolean} 2580 */ 2581 this._visible = null; 2582 2583 /** 2584 * All event handlers. 2585 * @protected 2586 * @type {Object} 2587 */ 2588 this._handlers = { 2589 'initialized.owl.carousel': $.proxy(function (e) { 2590 if (e.namespace && this._core.settings.autoRefresh) { 2591 this.watch(); 2592 } 2593 }, this) 2594 }; 2595 2596 // set default options 2597 this._core.options = $.extend({}, AutoRefresh.Defaults, this._core.options); 2598 2599 // register event handlers 2600 this._core.$element.on(this._handlers); 2601 }; 2602 2603 /** 2604 * Default options. 2605 * @public 2606 */ 2607 AutoRefresh.Defaults = { 2608 autoRefresh: true, 2609 autoRefreshInterval: 500 2610 }; 2611 2612 /** 2613 * Watches the element. 2614 */ 2615 AutoRefresh.prototype.watch = function () { 2616 if (this._interval) { 2617 return; 2618 } 2619 2620 this._visible = this._core.isVisible(); 2621 this._interval = window.setInterval($.proxy(this.refresh, this), this._core.settings.autoRefreshInterval); 2622 }; 2623 2624 /** 2625 * Refreshes the element. 2626 */ 2627 AutoRefresh.prototype.refresh = function () { 2628 if (this._core.isVisible() === this._visible) { 2629 return; 2630 } 2631 2632 this._visible = !this._visible; 2633 2634 this._core.$element.toggleClass('owl-hidden', !this._visible); 2635 2636 this._visible && (this._core.invalidate('width') && this._core.refresh()); 2637 }; 2638 2639 /** 2640 * Destroys the plugin. 2641 */ 2642 AutoRefresh.prototype.destroy = function () { 2643 var handler, property; 2644 2645 window.clearInterval(this._interval); 2646 2647 for (handler in this._handlers) { 2648 this._core.$element.off(handler, this._handlers[handler]); 2649 } 2650 for (property in Object.getOwnPropertyNames(this)) { 2651 typeof this[property] != 'function' && (this[property] = null); 2652 } 2653 }; 2654 2655 $.fn.owlCarousel.Constructor.Plugins.AutoRefresh = AutoRefresh; 2656 2657})(window.Zepto || window.jQuery, window, document); 2658 2659/** 2660 * Lazy Plugin 2661 * @version 2.3.4 2662 * @author Bartosz Wojciechowski 2663 * @author David Deutsch 2664 * @license The MIT License (MIT) 2665 */ 2666; (function ($, window, document, undefined) { 2667 2668 /** 2669 * Creates the lazy plugin. 2670 * @class The Lazy Plugin 2671 * @param {Owl} carousel - The Owl Carousel 2672 */ 2673 var Lazy = function (carousel) { 2674 2675 /** 2676 * Reference to the core. 2677 * @protected 2678 * @type {Owl} 2679 */ 2680 this._core = carousel; 2681 2682 /** 2683 * Already loaded items. 2684 * @protected 2685 * @type {Array.<jQuery>} 2686 */ 2687 this._loaded = []; 2688 2689 /** 2690 * Event handlers. 2691 * @protected 2692 * @type {Object} 2693 */ 2694 this._handlers = { 2695 'initialized.owl.carousel change.owl.carousel resized.owl.carousel': $.proxy(function (e) { 2696 if (!e.namespace) { 2697 return; 2698 } 2699 2700 if (!this._core.settings || !this._core.settings.lazyLoad) { 2701 return; 2702 } 2703 2704 if ((e.property && e.property.name == 'position') || e.type == 'initialized') { 2705 var settings = this._core.settings, 2706 n = (settings.center && Math.ceil(settings.items / 2) || settings.items), 2707 i = ((settings.center && n * -1) || 0), 2708 position = (e.property && e.property.value !== undefined ? e.property.value : this._core.current()) + i, 2709 clones = this._core.clones().length, 2710 load = $.proxy(function (i, v) { this.load(v) }, this); 2711 //TODO: Need documentation for this new option 2712 if (settings.lazyLoadEager > 0) { 2713 n += settings.lazyLoadEager; 2714 // If the carousel is looping also preload images that are to the "left" 2715 if (settings.loop) { 2716 position -= settings.lazyLoadEager; 2717 n++; 2718 } 2719 } 2720 2721 while (i++ < n) { 2722 this.load(clones / 2 + this._core.relative(position)); 2723 clones && $.each(this._core.clones(this._core.relative(position)), load); 2724 position++; 2725 } 2726 } 2727 }, this) 2728 }; 2729 2730 // set the default options 2731 this._core.options = $.extend({}, Lazy.Defaults, this._core.options); 2732 2733 // register event handler 2734 this._core.$element.on(this._handlers); 2735 }; 2736 2737 /** 2738 * Default options. 2739 * @public 2740 */ 2741 Lazy.Defaults = { 2742 lazyLoad: false, 2743 lazyLoadEager: 0 2744 }; 2745 2746 /** 2747 * Loads all resources of an item at the specified position. 2748 * @param {Number} position - The absolute position of the item. 2749 * @protected 2750 */ 2751 Lazy.prototype.load = function (position) { 2752 var $item = this._core.$stage.children().eq(position), 2753 $elements = $item && $item.find('.owl-lazy'); 2754 2755 if (!$elements || $.inArray($item.get(0), this._loaded) > -1) { 2756 return; 2757 } 2758 2759 $elements.each($.proxy(function (index, element) { 2760 var $element = $(element), image, 2761 url = (window.devicePixelRatio > 1 && $element.attr('data-src-retina')) || $element.attr('data-src') || $element.attr('data-srcset'); 2762 2763 this._core.trigger('load', { element: $element, url: url }, 'lazy'); 2764 2765 if ($element.is('img')) { 2766 $element.one('load.owl.lazy', $.proxy(function () { 2767 $element.css('opacity', 1); 2768 this._core.trigger('loaded', { element: $element, url: url }, 'lazy'); 2769 }, this)).attr('src', url); 2770 } else if ($element.is('source')) { 2771 $element.one('load.owl.lazy', $.proxy(function () { 2772 this._core.trigger('loaded', { element: $element, url: url }, 'lazy'); 2773 }, this)).attr('srcset', url); 2774 } else { 2775 image = new Image(); 2776 image.onload = $.proxy(function () { 2777 $element.css({ 2778 'background-image': 'url("' + url + '")', 2779 'opacity': '1' 2780 }); 2781 this._core.trigger('loaded', { element: $element, url: url }, 'lazy'); 2782 }, this); 2783 image.src = url; 2784 } 2785 }, this)); 2786 2787 this._loaded.push($item.get(0)); 2788 }; 2789 2790 /** 2791 * Destroys the plugin. 2792 * @public 2793 */ 2794 Lazy.prototype.destroy = function () { 2795 var handler, property; 2796 2797 for (handler in this.handlers) { 2798 this._core.$element.off(handler, this.handlers[handler]); 2799 } 2800 for (property in Object.getOwnPropertyNames(this)) { 2801 typeof this[property] != 'function' && (this[property] = null); 2802 } 2803 }; 2804 2805 $.fn.owlCarousel.Constructor.Plugins.Lazy = Lazy; 2806 2807})(window.Zepto || window.jQuery, window, document); 2808 2809/** 2810 * AutoHeight Plugin 2811 * @version 2.3.4 2812 * @author Bartosz Wojciechowski 2813 * @author David Deutsch 2814 * @license The MIT License (MIT) 2815 */ 2816; (function ($, window, document, undefined) { 2817 2818 /** 2819 * Creates the auto height plugin. 2820 * @class The Auto Height Plugin 2821 * @param {Owl} carousel - The Owl Carousel 2822 */ 2823 var AutoHeight = function (carousel) { 2824 /** 2825 * Reference to the core. 2826 * @protected 2827 * @type {Owl} 2828 */ 2829 this._core = carousel; 2830 2831 this._previousHeight = null; 2832 2833 /** 2834 * All event handlers. 2835 * @protected 2836 * @type {Object} 2837 */ 2838 this._handlers = { 2839 'initialized.owl.carousel refreshed.owl.carousel': $.proxy(function (e) { 2840 if (e.namespace && this._core.settings.autoHeight) { 2841 this.update(); 2842 } 2843 }, this), 2844 'changed.owl.carousel': $.proxy(function (e) { 2845 if (e.namespace && this._core.settings.autoHeight && e.property.name === 'position') { 2846 this.update(); 2847 } 2848 }, this), 2849 'loaded.owl.lazy': $.proxy(function (e) { 2850 if (e.namespace && this._core.settings.autoHeight 2851 && e.element.closest('.' + this._core.settings.itemClass).index() === this._core.current()) { 2852 this.update(); 2853 } 2854 }, this) 2855 }; 2856 2857 // set default options 2858 this._core.options = $.extend({}, AutoHeight.Defaults, this._core.options); 2859 2860 // register event handlers 2861 this._core.$element.on(this._handlers); 2862 this._intervalId = null; 2863 var refThis = this; 2864 2865 // These changes have been taken from a PR by gavrochelegnou proposed in #1575 2866 // and have been made compatible with the latest jQuery version 2867 $(window).on('load', function () { 2868 if (refThis._core.settings.autoHeight) { 2869 refThis.update(); 2870 } 2871 }); 2872 2873 // Autoresize the height of the carousel when window is resized 2874 // When carousel has images, the height is dependent on the width 2875 // and should also change on resize 2876 $(window).resize(function () { 2877 if (refThis._core.settings.autoHeight) { 2878 if (refThis._intervalId != null) { 2879 clearTimeout(refThis._intervalId); 2880 } 2881 2882 refThis._intervalId = setTimeout(function () { 2883 refThis.update(); 2884 }, 250); 2885 } 2886 }); 2887 2888 }; 2889 2890 /** 2891 * Default options. 2892 * @public 2893 */ 2894 AutoHeight.Defaults = { 2895 autoHeight: false, 2896 autoHeightClass: 'owl-height' 2897 }; 2898 2899 /** 2900 * Updates the view. 2901 */ 2902 AutoHeight.prototype.update = function () { 2903 var start = this._core._current, 2904 end = start + this._core.settings.items, 2905 lazyLoadEnabled = this._core.settings.lazyLoad, 2906 visible = this._core.$stage.children().toArray().slice(start, end), 2907 heights = [], 2908 maxheight = 0; 2909 2910 $.each(visible, function (index, item) { 2911 heights.push($(item).height()); 2912 }); 2913 2914 maxheight = Math.max.apply(null, heights); 2915 2916 if (maxheight <= 1 && lazyLoadEnabled && this._previousHeight) { 2917 maxheight = this._previousHeight; 2918 } 2919 2920 this._previousHeight = maxheight; 2921 2922 this._core.$stage.parent() 2923 .height(maxheight) 2924 .addClass(this._core.settings.autoHeightClass); 2925 }; 2926 2927 AutoHeight.prototype.destroy = function () { 2928 var handler, property; 2929 2930 for (handler in this._handlers) { 2931 this._core.$element.off(handler, this._handlers[handler]); 2932 } 2933 for (property in Object.getOwnPropertyNames(this)) { 2934 typeof this[property] !== 'function' && (this[property] = null); 2935 } 2936 }; 2937 2938 $.fn.owlCarousel.Constructor.Plugins.AutoHeight = AutoHeight; 2939 2940})(window.Zepto || window.jQuery, window, document); 2941 2942/** 2943 * Video Plugin 2944 * @version 2.3.4 2945 * @author Bartosz Wojciechowski 2946 * @author David Deutsch 2947 * @license The MIT License (MIT) 2948 */ 2949; (function ($, window, document, undefined) { 2950 2951 /** 2952 * Creates the video plugin. 2953 * @class The Video Plugin 2954 * @param {Owl} carousel - The Owl Carousel 2955 */ 2956 var Video = function (carousel) { 2957 /** 2958 * Reference to the core. 2959 * @protected 2960 * @type {Owl} 2961 */ 2962 this._core = carousel; 2963 2964 /** 2965 * Cache all video URLs. 2966 * @protected 2967 * @type {Object} 2968 */ 2969 this._videos = {}; 2970 2971 /** 2972 * Current playing item. 2973 * @protected 2974 * @type {jQuery} 2975 */ 2976 this._playing = null; 2977 2978 /** 2979 * All event handlers. 2980 * @todo The cloned content removale is too late 2981 * @protected 2982 * @type {Object} 2983 */ 2984 this._handlers = { 2985 'initialized.owl.carousel': $.proxy(function (e) { 2986 if (e.namespace) { 2987 this._core.register({ type: 'state', name: 'playing', tags: ['interacting'] }); 2988 } 2989 }, this), 2990 'resize.owl.carousel': $.proxy(function (e) { 2991 if (e.namespace && this._core.settings.video && this.isInFullScreen()) { 2992 e.preventDefault(); 2993 } 2994 }, this), 2995 'refreshed.owl.carousel': $.proxy(function (e) { 2996 if (e.namespace && this._core.is('resizing')) { 2997 this._core.$stage.find('.cloned .owl-video-frame').remove(); 2998 } 2999 }, this), 3000 'changed.owl.carousel': $.proxy(function (e) { 3001 if (e.namespace && e.property.name === 'position' && this._playing) { 3002 this.stop(); 3003 } 3004 }, this), 3005 'prepared.owl.carousel': $.proxy(function (e) { 3006 if (!e.namespace) { 3007 return; 3008 } 3009 3010 var $element = $(e.content).find('.owl-video'); 3011 3012 if ($element.length) { 3013 $element.css('display', 'none'); 3014 this.fetch($element, $(e.content)); 3015 } 3016 }, this) 3017 }; 3018 3019 // set default options 3020 this._core.options = $.extend({}, Video.Defaults, this._core.options); 3021 3022 // register event handlers 3023 this._core.$element.on(this._handlers); 3024 3025 this._core.$element.on('click.owl.video', '.owl-video-play-icon', $.proxy(function (e) { 3026 this.play(e); 3027 }, this)); 3028 }; 3029 3030 /** 3031 * Default options. 3032 * @public 3033 */ 3034 Video.Defaults = { 3035 video: false, 3036 videoHeight: false, 3037 videoWidth: false 3038 }; 3039 3040 /** 3041 * Gets the video ID and the type (YouTube/Vimeo/vzaar only). 3042 * @protected 3043 * @param {jQuery} target - The target containing the video data. 3044 * @param {jQuery} item - The item containing the video. 3045 */ 3046 Video.prototype.fetch = function (target, item) { 3047 var type = (function () { 3048 if (target.attr('data-vimeo-id')) { 3049 return 'vimeo'; 3050 } else if (target.attr('data-vzaar-id')) { 3051 return 'vzaar' 3052 } else { 3053 return 'youtube'; 3054 } 3055 })(), 3056 id = target.attr('data-vimeo-id') || target.attr('data-youtube-id') || target.attr('data-vzaar-id'), 3057 width = target.attr('data-width') || this._core.settings.videoWidth, 3058 height = target.attr('data-height') || this._core.settings.videoHeight, 3059 url = target.attr('href'); 3060 3061 if (url) { 3062 3063 /* 3064 Parses the id's out of the following urls (and probably more): 3065 https://www.youtube.com/watch?v=:id 3066 https://youtu.be/:id 3067 https://vimeo.com/:id 3068 https://vimeo.com/channels/:channel/:id 3069 https://vimeo.com/groups/:group/videos/:id 3070 https://app.vzaar.com/videos/:id 3071 3072 Visual example: https://regexper.com/#(http%3A%7Chttps%3A%7C)%5C%2F%5C%2F(player.%7Cwww.%7Capp.)%3F(vimeo%5C.com%7Cyoutu(be%5C.com%7C%5C.be%7Cbe%5C.googleapis%5C.com)%7Cvzaar%5C.com)%5C%2F(video%5C%2F%7Cvideos%5C%2F%7Cembed%5C%2F%7Cchannels%5C%2F.%2B%5C%2F%7Cgroups%5C%2F.%2B%5C%2F%7Cwatch%5C%3Fv%3D%7Cv%5C%2F)%3F(%5BA-Za-z0-9._%25-%5D*)(%5C%26%5CS%2B)%3F 3073 */ 3074 3075 id = url.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com|be\-nocookie\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/); 3076 3077 if (id[3].indexOf('youtu') > -1) { 3078 type = 'youtube'; 3079 } else if (id[3].indexOf('vimeo') > -1) { 3080 type = 'vimeo'; 3081 } else if (id[3].indexOf('vzaar') > -1) { 3082 type = 'vzaar'; 3083 } else { 3084 throw new Error('Video URL not supported.'); 3085 } 3086 id = id[6]; 3087 } else { 3088 throw new Error('Missing video URL.'); 3089 } 3090 3091 this._videos[url] = { 3092 type: type, 3093 id: id, 3094 width: width, 3095 height: height 3096 }; 3097 3098 item.attr('data-video', url); 3099 3100 this.thumbnail(target, this._videos[url]); 3101 }; 3102 3103 /** 3104 * Creates video thumbnail. 3105 * @protected 3106 * @param {jQuery} target - The target containing the video data. 3107 * @param {Object} info - The video info object. 3108 * @see `fetch` 3109 */ 3110 Video.prototype.thumbnail = function (target, video) { 3111 var tnLink, 3112 icon, 3113 path, 3114 dimensions = video.width && video.height ? 'width:' + video.width + 'px;height:' + video.height + 'px;' : '', 3115 customTn = target.find('img'), 3116 srcType = 'src', 3117 lazyClass = '', 3118 settings = this._core.settings, 3119 create = function (path) { 3120 icon = '<div class="owl-video-play-icon"></div>'; 3121 3122 if (settings.lazyLoad) { 3123 tnLink = $('<div/>', { 3124 "class": 'owl-video-tn ' + lazyClass, 3125 "srcType": path 3126 }); 3127 } else { 3128 tnLink = $('<div/>', { 3129 "class": "owl-video-tn", 3130 "style": 'opacity:1;background-image:url(' + path + ')' 3131 }); 3132 } 3133 target.after(tnLink); 3134 target.after(icon); 3135 }; 3136 3137 // wrap video content into owl-video-wrapper div 3138 target.wrap($('<div/>', { 3139 "class": "owl-video-wrapper", 3140 "style": dimensions 3141 })); 3142 3143 if (this._core.settings.lazyLoad) { 3144 srcType = 'data-src'; 3145 lazyClass = 'owl-lazy'; 3146 } 3147 3148 // custom thumbnail 3149 if (customTn.length) { 3150 create(customTn.attr(srcType)); 3151 customTn.remove(); 3152 return false; 3153 } 3154 3155 if (video.type === 'youtube') { 3156 path = "//img.youtube.com/vi/" + video.id + "/hqdefault.jpg"; 3157 create(path); 3158 } else if (video.type === 'vimeo') { 3159 $.ajax({ 3160 type: 'GET', 3161 url: '//vimeo.com/api/v2/video/' + video.id + '.json', 3162 jsonp: 'callback', 3163 dataType: 'jsonp', 3164 success: function (data) { 3165 path = data[0].thumbnail_large; 3166 create(path); 3167 } 3168 }); 3169 } else if (video.type === 'vzaar') { 3170 $.ajax({ 3171 type: 'GET', 3172 url: '//vzaar.com/api/videos/' + video.id + '.json', 3173 jsonp: 'callback', 3174 dataType: 'jsonp', 3175 success: function (data) { 3176 path = data.framegrab_url; 3177 create(path); 3178 } 3179 }); 3180 } 3181 }; 3182 3183 /** 3184 * Stops the current video. 3185 * @public 3186 */ 3187 Video.prototype.stop = function () { 3188 this._core.trigger('stop', null, 'video'); 3189 this._playing.find('.owl-video-frame').remove(); 3190 this._playing.removeClass('owl-video-playing'); 3191 this._playing = null; 3192 this._core.leave('playing'); 3193 this._core.trigger('stopped', null, 'video'); 3194 }; 3195 3196 /** 3197 * Starts the current video. 3198 * @public 3199 * @param {Event} event - The event arguments. 3200 */ 3201 Video.prototype.play = function (event) { 3202 var target = $(event.target), 3203 item = target.closest('.' + this._core.settings.itemClass), 3204 video = this._videos[item.attr('data-video')], 3205 width = video.width || '100%', 3206 height = video.height || this._core.$stage.height(), 3207 html, 3208 iframe; 3209 3210 if (this._playing) { 3211 return; 3212 } 3213 3214 this._core.enter('playing'); 3215 this._core.trigger('play', null, 'video'); 3216 3217 item = this._core.items(this._core.relative(item.index())); 3218 3219 this._core.reset(item.index()); 3220 3221 html = $('<iframe frameborder="0" allowfullscreen mozallowfullscreen webkitAllowFullScreen ></iframe>'); 3222 html.attr('height', height); 3223 html.attr('width', width); 3224 if (video.type === 'youtube') { 3225 html.attr('src', '//www.youtube.com/embed/' + video.id + '?autoplay=1&rel=0&v=' + video.id); 3226 } else if (video.type === 'vimeo') { 3227 html.attr('src', '//player.vimeo.com/video/' + video.id + '?autoplay=1'); 3228 } else if (video.type === 'vzaar') { 3229 html.attr('src', '//view.vzaar.com/' + video.id + '/player?autoplay=true'); 3230 } 3231 3232 iframe = $(html).wrap('<div class="owl-video-frame" />').insertAfter(item.find('.owl-video')); 3233 3234 this._playing = item.addClass('owl-video-playing'); 3235 }; 3236 3237 /** 3238 * Checks whether an video is currently in full screen mode or not. 3239 * @todo Bad style because looks like a readonly method but changes members. 3240 * @protected 3241 * @returns {Boolean} 3242 */ 3243 Video.prototype.isInFullScreen = function () { 3244 var element = document.fullscreenElement || document.mozFullScreenElement || 3245 document.webkitFullscreenElement; 3246 3247 return element && $(element).parent().hasClass('owl-video-frame'); 3248 }; 3249 3250 /** 3251 * Destroys the plugin. 3252 */ 3253 Video.prototype.destroy = function () { 3254 var handler, property; 3255 3256 this._core.$element.off('click.owl.video'); 3257 3258 for (handler in this._handlers) { 3259 this._core.$element.off(handler, this._handlers[handler]); 3260 } 3261 for (property in Object.getOwnPropertyNames(this)) { 3262 typeof this[property] != 'function' && (this[property] = null); 3263 } 3264 }; 3265 3266 $.fn.owlCarousel.Constructor.Plugins.Video = Video; 3267 3268})(window.Zepto || window.jQuery, window, document); 3269 3270/** 3271 * Animate Plugin 3272 * @version 2.3.4 3273 * @author Bartosz Wojciechowski 3274 * @author David Deutsch 3275 * @license The MIT License (MIT) 3276 */ 3277; (function ($, window, document, undefined) { 3278 3279 /** 3280 * Creates the animate plugin. 3281 * @class The Navigation Plugin 3282 * @param {Owl} scope - The Owl Carousel 3283 */ 3284 var Animate = function (scope) { 3285 this.core = scope; 3286 this.core.options = $.extend({}, Animate.Defaults, this.core.options); 3287 this.swapping = true; 3288 this.previous = undefined; 3289 this.next = undefined; 3290 3291 this.handlers = { 3292 'change.owl.carousel': $.proxy(function (e) { 3293 if (e.namespace && e.property.name == 'position') { 3294 this.previous = this.core.current(); 3295 this.next = e.property.value; 3296 } 3297 }, this), 3298 'drag.owl.carousel dragged.owl.carousel translated.owl.carousel': $.proxy(function (e) { 3299 if (e.namespace) { 3300 this.swapping = e.type == 'translated'; 3301 } 3302 }, this), 3303 'translate.owl.carousel': $.proxy(function (e) { 3304 if (e.namespace && this.swapping && (this.core.options.animateOut || this.core.options.animateIn)) { 3305 this.swap(); 3306 } 3307 }, this) 3308 }; 3309 3310 this.core.$element.on(this.handlers); 3311 }; 3312 3313 /** 3314 * Default options. 3315 * @public 3316 */ 3317 Animate.Defaults = { 3318 animateOut: false, 3319 animateIn: false 3320 }; 3321 3322 /** 3323 * Toggles the animation classes whenever an translations starts. 3324 * @protected 3325 * @returns {Boolean|undefined} 3326 */ 3327 Animate.prototype.swap = function () { 3328 3329 if (this.core.settings.items !== 1) { 3330 return; 3331 } 3332 3333 if (!$.support.animation || !$.support.transition) { 3334 return; 3335 } 3336 3337 this.core.speed(0); 3338 3339 var left, 3340 clear = $.proxy(this.clear, this), 3341 previous = this.core.$stage.children().eq(this.previous), 3342 next = this.core.$stage.children().eq(this.next), 3343 incoming = this.core.settings.animateIn, 3344 outgoing = this.core.settings.animateOut; 3345 3346 if (this.core.current() === this.previous) { 3347 return; 3348 } 3349 3350 if (outgoing) { 3351 left = this.core.coordinates(this.previous) - this.core.coordinates(this.next); 3352 previous.one($.support.animation.end, clear) 3353 .css({ 'left': left + 'px' }) 3354 .addClass('animated owl-animated-out') 3355 .addClass(outgoing); 3356 } 3357 3358 if (incoming) { 3359 next.one($.support.animation.end, clear) 3360 .addClass('animated owl-animated-in') 3361 .addClass(incoming); 3362 } 3363 }; 3364 3365 Animate.prototype.clear = function (e) { 3366 $(e.target).css({ 'left': '' }) 3367 .removeClass('animated owl-animated-out owl-animated-in') 3368 .removeClass(this.core.settings.animateIn) 3369 .removeClass(this.core.settings.animateOut); 3370 this.core.onTransitionEnd(); 3371 }; 3372 3373 /** 3374 * Destroys the plugin. 3375 * @public 3376 */ 3377 Animate.prototype.destroy = function () { 3378 var handler, property; 3379 3380 for (handler in this.handlers) { 3381 this.core.$element.off(handler, this.handlers[handler]); 3382 } 3383 for (property in Object.getOwnPropertyNames(this)) { 3384 typeof this[property] != 'function' && (this[property] = null); 3385 } 3386 }; 3387 3388 $.fn.owlCarousel.Constructor.Plugins.Animate = Animate; 3389 3390})(window.Zepto || window.jQuery, window, document); 3391 3392/** 3393 * Autoplay Plugin 3394 * @version 2.3.4 3395 * @author Bartosz Wojciechowski 3396 * @author Artus Kolanowski 3397 * @author David Deutsch 3398 * @author Tom De Caluwé 3399 * @license The MIT License (MIT) 3400 */ 3401; (function ($, window, document, undefined) { 3402 3403 /** 3404 * Creates the autoplay plugin. 3405 * @class The Autoplay Plugin 3406 * @param {Owl} scope - The Owl Carousel 3407 */ 3408 var Autoplay = function (carousel) { 3409 /** 3410 * Reference to the core. 3411 * @protected 3412 * @type {Owl} 3413 */ 3414 this._core = carousel; 3415 3416 /** 3417 * The autoplay timeout id. 3418 * @type {Number} 3419 */ 3420 this._call = null; 3421 3422 /** 3423 * Depending on the state of the plugin, this variable contains either 3424 * the start time of the timer or the current timer value if it's 3425 * paused. Since we start in a paused state we initialize the timer 3426 * value. 3427 * @type {Number} 3428 */ 3429 this._time = 0; 3430 3431 /** 3432 * Stores the timeout currently used. 3433 * @type {Number} 3434 */ 3435 this._timeout = 0; 3436 3437 /** 3438 * Indicates whenever the autoplay is paused. 3439 * @type {Boolean} 3440 */ 3441 this._paused = true; 3442 3443 /** 3444 * All event handlers. 3445 * @protected 3446 * @type {Object} 3447 */ 3448 this._handlers = { 3449 'changed.owl.carousel': $.proxy(function (e) { 3450 if (e.namespace && e.property.name === 'settings') { 3451 if (this._core.settings.autoplay) { 3452 this.play(); 3453 } else { 3454 this.stop(); 3455 } 3456 } else if (e.namespace && e.property.name === 'position' && this._paused) { 3457 // Reset the timer. This code is triggered when the position 3458 // of the carousel was changed through user interaction. 3459 this._time = 0; 3460 } 3461 }, this), 3462 'initialized.owl.carousel': $.proxy(function (e) { 3463 if (e.namespace && this._core.settings.autoplay) { 3464 this.play(); 3465 } 3466 }, this), 3467 'play.owl.autoplay': $.proxy(function (e, t, s) { 3468 if (e.namespace) { 3469 this.play(t, s); 3470 } 3471 }, this), 3472 'stop.owl.autoplay': $.proxy(function (e) { 3473 if (e.namespace) { 3474 this.stop(); 3475 } 3476 }, this), 3477 'mouseover.owl.autoplay': $.proxy(function () { 3478 if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) { 3479 this.pause(); 3480 } 3481 }, this), 3482 'mouseleave.owl.autoplay': $.proxy(function () { 3483 if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) { 3484 this.play(); 3485 } 3486 }, this), 3487 'touchstart.owl.core': $.proxy(function () { 3488 if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) { 3489 this.pause(); 3490 } 3491 }, this), 3492 'touchend.owl.core': $.proxy(function () { 3493 if (this._core.settings.autoplayHoverPause) { 3494 this.play(); 3495 } 3496 }, this) 3497 }; 3498 3499 // register event handlers 3500 this._core.$element.on(this._handlers); 3501 3502 // set default options 3503 this._core.options = $.extend({}, Autoplay.Defaults, this._core.options); 3504 }; 3505 3506 /** 3507 * Default options. 3508 * @public 3509 */ 3510 Autoplay.Defaults = { 3511 autoplay: false, 3512 autoplayTimeout: 5000, 3513 autoplayHoverPause: false, 3514 autoplaySpeed: false 3515 }; 3516 3517 /** 3518 * Transition to the next slide and set a timeout for the next transition. 3519 * @private 3520 * @param {Number} [speed] - The animation speed for the animations. 3521 */ 3522 Autoplay.prototype._next = function (speed) { 3523 this._call = window.setTimeout( 3524 $.proxy(this._next, this, speed), 3525 this._timeout * (Math.round(this.read() / this._timeout) + 1) - this.read() 3526 ); 3527 3528 if (this._core.is('interacting') || document.hidden) { 3529 return; 3530 } 3531 this._core.next(speed || this._core.settings.autoplaySpeed); 3532 } 3533 3534 /** 3535 * Reads the current timer value when the timer is playing. 3536 * @public 3537 */ 3538 Autoplay.prototype.read = function () { 3539 return new Date().getTime() - this._time; 3540 }; 3541 3542 /** 3543 * Starts the autoplay. 3544 * @public 3545 * @param {Number} [timeout] - The interval before the next animation starts. 3546 * @param {Number} [speed] - The animation speed for the animations. 3547 */ 3548 Autoplay.prototype.play = function (timeout, speed) { 3549 var elapsed; 3550 3551 if (!this._core.is('rotating')) { 3552 this._core.enter('rotating'); 3553 } 3554 3555 timeout = timeout || this._core.settings.autoplayTimeout; 3556 3557 // Calculate the elapsed time since the last transition. If the carousel 3558 // wasn't playing this calculation will yield zero. 3559 elapsed = Math.min(this._time % (this._timeout || timeout), timeout); 3560 3561 if (this._paused) { 3562 // Start the clock. 3563 this._time = this.read(); 3564 this._paused = false; 3565 } else { 3566 // Clear the active timeout to allow replacement. 3567 window.clearTimeout(this._call); 3568 } 3569 3570 // Adjust the origin of the timer to match the new timeout value. 3571 this._time += this.read() % timeout - elapsed; 3572 3573 this._timeout = timeout; 3574 this._call = window.setTimeout($.proxy(this._next, this, speed), timeout - elapsed); 3575 }; 3576 3577 /** 3578 * Stops the autoplay. 3579 * @public 3580 */ 3581 Autoplay.prototype.stop = function () { 3582 if (this._core.is('rotating')) { 3583 // Reset the clock. 3584 this._time = 0; 3585 this._paused = true; 3586 3587 window.clearTimeout(this._call); 3588 this._core.leave('rotating'); 3589 } 3590 }; 3591 3592 /** 3593 * Pauses the autoplay. 3594 * @public 3595 */ 3596 Autoplay.prototype.pause = function () { 3597 if (this._core.is('rotating') && !this._paused) { 3598 // Pause the clock. 3599 this._time = this.read(); 3600 this._paused = true; 3601 3602 window.clearTimeout(this._call); 3603 } 3604 }; 3605 3606 /** 3607 * Destroys the plugin. 3608 */ 3609 Autoplay.prototype.destroy = function () { 3610 var handler, property; 3611 3612 this.stop(); 3613 3614 for (handler in this._handlers) { 3615 this._core.$element.off(handler, this._handlers[handler]); 3616 } 3617 for (property in Object.getOwnPropertyNames(this)) { 3618 typeof this[property] != 'function' && (this[property] = null); 3619 } 3620 }; 3621 3622 $.fn.owlCarousel.Constructor.Plugins.autoplay = Autoplay; 3623 3624})(window.Zepto || window.jQuery, window, document); 3625 3626/** 3627 * Navigation Plugin 3628 * @version 2.3.4 3629 * @author Artus Kolanowski 3630 * @author David Deutsch 3631 * @license The MIT License (MIT) 3632 */ 3633; (function ($, window, document, undefined) { 3634 'use strict'; 3635 3636 /** 3637 * Creates the navigation plugin. 3638 * @class The Navigation Plugin 3639 * @param {Owl} carousel - The Owl Carousel. 3640 */ 3641 var Navigation = function (carousel) { 3642 /** 3643 * Reference to the core. 3644 * @protected 3645 * @type {Owl} 3646 */ 3647 this._core = carousel; 3648 3649 /** 3650 * Indicates whether the plugin is initialized or not. 3651 * @protected 3652 * @type {Boolean} 3653 */ 3654 this._initialized = false; 3655 3656 /** 3657 * The current paging indexes. 3658 * @protected 3659 * @type {Array} 3660 */ 3661 this._pages = []; 3662 3663 /** 3664 * All DOM elements of the user interface. 3665 * @protected 3666 * @type {Object} 3667 */ 3668 this._controls = {}; 3669 3670 /** 3671 * Markup for an indicator. 3672 * @protected 3673 * @type {Array.<String>} 3674 */ 3675 this._templates = []; 3676 3677 /** 3678 * The carousel element. 3679 * @type {jQuery} 3680 */ 3681 this.$element = this._core.$element; 3682 3683 /** 3684 * Overridden methods of the carousel. 3685 * @protected 3686 * @type {Object} 3687 */ 3688 this._overrides = { 3689 next: this._core.next, 3690 prev: this._core.prev, 3691 to: this._core.to 3692 }; 3693 3694 /** 3695 * All event handlers. 3696 * @protected 3697 * @type {Object} 3698 */ 3699 this._handlers = { 3700 'prepared.owl.carousel': $.proxy(function (e) { 3701 if (e.namespace && this._core.settings.dotsData) { 3702 this._templates.push('<div class="' + this._core.settings.dotClass + '">' + 3703 $(e.content).find('[data-dot]').addBack('[data-dot]').attr('data-dot') + '</div>'); 3704 } 3705 }, this), 3706 'added.owl.carousel': $.proxy(function (e) { 3707 if (e.namespace && this._core.settings.dotsData) { 3708 this._templates.splice(e.position, 0, this._templates.pop()); 3709 } 3710 }, this), 3711 'remove.owl.carousel': $.proxy(function (e) { 3712 if (e.namespace && this._core.settings.dotsData) { 3713 this._templates.splice(e.position, 1); 3714 } 3715 }, this), 3716 'changed.owl.carousel': $.proxy(function (e) { 3717 if (e.namespace && e.property.name == 'position') { 3718 this.draw(); 3719 } 3720 }, this), 3721 'initialized.owl.carousel': $.proxy(function (e) { 3722 if (e.namespace && !this._initialized) { 3723 this._core.trigger('initialize', null, 'navigation'); 3724 this.initialize(); 3725 this.update(); 3726 this.draw(); 3727 this._initialized = true; 3728 this._core.trigger('initialized', null, 'navigation'); 3729 } 3730 }, this), 3731 'refreshed.owl.carousel': $.proxy(function (e) { 3732 if (e.namespace && this._initialized) { 3733 this._core.trigger('refresh', null, 'navigation'); 3734 this.update(); 3735 this.draw(); 3736 this._core.trigger('refreshed', null, 'navigation'); 3737 } 3738 }, this) 3739 }; 3740 3741 // set default options 3742 this._core.options = $.extend({}, Navigation.Defaults, this._core.options); 3743 3744 // register event handlers 3745 this.$element.on(this._handlers); 3746 }; 3747 3748 /** 3749 * Default options. 3750 * @public 3751 * @todo Rename `slideBy` to `navBy` 3752 */ 3753 Navigation.Defaults = { 3754 nav: false, 3755 navText: [ 3756 '<span aria-label="' + 'Previous' + '">‹</span>', 3757 '<span aria-label="' + 'Next' + '">›</span>' 3758 ], 3759 navSpeed: false, 3760 navElement: 'button type="button" role="presentation"', 3761 navContainer: false, 3762 navContainerClass: 'owl-nav', 3763 navClass: [ 3764 'owl-prev', 3765 'owl-next' 3766 ], 3767 slideBy: 1, 3768 dotClass: 'owl-dot', 3769 dotsClass: 'owl-dots', 3770 dots: true, 3771 dotsEach: false, 3772 dotsData: false, 3773 dotsSpeed: false, 3774 dotsContainer: false 3775 }; 3776 3777 /** 3778 * Initializes the layout of the plugin and extends the carousel. 3779 * @protected 3780 */ 3781 Navigation.prototype.initialize = function () { 3782 var override, 3783 settings = this._core.settings; 3784 3785 // create DOM structure for relative navigation 3786 this._controls.$relative = (settings.navContainer ? $(settings.navContainer) 3787 : $('<div>').addClass(settings.navContainerClass).appendTo(this.$element)).addClass('disabled'); 3788 3789 this._controls.$previous = $('<' + settings.navElement + '>') 3790 .addClass(settings.navClass[0]) 3791 .html(settings.navText[0]) 3792 .prependTo(this._controls.$relative) 3793 .on('click', $.proxy(function (e) { 3794 this.prev(settings.navSpeed); 3795 }, this)); 3796 this._controls.$next = $('<' + settings.navElement + '>') 3797 .addClass(settings.navClass[1]) 3798 .html(settings.navText[1]) 3799 .appendTo(this._controls.$relative) 3800 .on('click', $.proxy(function (e) { 3801 this.next(settings.navSpeed); 3802 }, this)); 3803 3804 // create DOM structure for absolute navigation 3805 if (!settings.dotsData) { 3806 this._templates = [$('<button role="button">') 3807 .addClass(settings.dotClass) 3808 .append($('<span>')) 3809 .prop('outerHTML')]; 3810 } 3811 3812 this._controls.$absolute = (settings.dotsContainer ? $(settings.dotsContainer) 3813 : $('<div>').addClass(settings.dotsClass).appendTo(this.$element)).addClass('disabled'); 3814 3815 this._controls.$absolute.on('click', 'button', $.proxy(function (e) { 3816 var index = $(e.target).parent().is(this._controls.$absolute) 3817 ? $(e.target).index() : $(e.target).parent().index(); 3818 3819 e.preventDefault(); 3820 3821 this.to(index, settings.dotsSpeed); 3822 }, this)); 3823 3824 /*$el.on('focusin', function() { 3825 $(document).off(".carousel"); 3826 3827 $(document).on('keydown.carousel', function(e) { 3828 if(e.keyCode == 37) { 3829 $el.trigger('prev.owl') 3830 } 3831 if(e.keyCode == 39) { 3832 $el.trigger('next.owl') 3833 } 3834 }); 3835 });*/ 3836 3837 // override public methods of the carousel 3838 for (override in this._overrides) { 3839 this._core[override] = $.proxy(this[override], this); 3840 } 3841 }; 3842 3843 /** 3844 * Destroys the plugin. 3845 * @protected 3846 */ 3847 Navigation.prototype.destroy = function () { 3848 var handler, control, property, override, settings; 3849 settings = this._core.settings; 3850 3851 for (handler in this._handlers) { 3852 this.$element.off(handler, this._handlers[handler]); 3853 } 3854 for (control in this._controls) { 3855 if (control === '$relative' && settings.navContainer) { 3856 this._controls[control].html(''); 3857 } else { 3858 this._controls[control].remove(); 3859 } 3860 } 3861 for (override in this.overides) { 3862 this._core[override] = this._overrides[override]; 3863 } 3864 for (property in Object.getOwnPropertyNames(this)) { 3865 typeof this[property] != 'function' && (this[property] = null); 3866 } 3867 }; 3868 3869 /** 3870 * Updates the internal state. 3871 * @protected 3872 */ 3873 Navigation.prototype.update = function () { 3874 var i, j, k, 3875 lower = this._core.clones().length / 2, 3876 upper = lower + this._core.items().length, 3877 maximum = this._core.maximum(true), 3878 settings = this._core.settings, 3879 size = settings.center || settings.autoWidth || settings.dotsData 3880 ? 1 : settings.dotsEach || settings.items; 3881 3882 if (settings.slideBy !== 'page') { 3883 settings.slideBy = Math.min(settings.slideBy, settings.items); 3884 } 3885 3886 if (settings.dots || settings.slideBy == 'page') { 3887 this._pages = []; 3888 3889 for (i = lower, j = 0, k = 0; i < upper; i++) { 3890 if (j >= size || j === 0) { 3891 this._pages.push({ 3892 start: Math.min(maximum, i - lower), 3893 end: i - lower + size - 1 3894 }); 3895 if (Math.min(maximum, i - lower) === maximum) { 3896 break; 3897 } 3898 j = 0, ++k; 3899 } 3900 j += this._core.mergers(this._core.relative(i)); 3901 } 3902 } 3903 }; 3904 3905 /** 3906 * Draws the user interface. 3907 * @todo The option `dotsData` wont work. 3908 * @protected 3909 */ 3910 Navigation.prototype.draw = function () { 3911 var difference, 3912 settings = this._core.settings, 3913 disabled = this._core.items().length <= settings.items, 3914 index = this._core.relative(this._core.current()), 3915 loop = settings.loop || settings.rewind; 3916 3917 this._controls.$relative.toggleClass('disabled', !settings.nav || disabled); 3918 3919 if (settings.nav) { 3920 this._controls.$previous.toggleClass('disabled', !loop && index <= this._core.minimum(true)); 3921 this._controls.$next.toggleClass('disabled', !loop && index >= this._core.maximum(true)); 3922 } 3923 3924 this._controls.$absolute.toggleClass('disabled', !settings.dots || disabled); 3925 3926 if (settings.dots) { 3927 difference = this._pages.length - this._controls.$absolute.children().length; 3928 3929 if (settings.dotsData && difference !== 0) { 3930 this._controls.$absolute.html(this._templates.join('')); 3931 } else if (difference > 0) { 3932 this._controls.$absolute.append(new Array(difference + 1).join(this._templates[0])); 3933 } else if (difference < 0) { 3934 this._controls.$absolute.children().slice(difference).remove(); 3935 } 3936 3937 this._controls.$absolute.find('.active').removeClass('active'); 3938 this._controls.$absolute.children().eq($.inArray(this.current(), this._pages)).addClass('active'); 3939 } 3940 }; 3941 3942 /** 3943 * Extends event data. 3944 * @protected 3945 * @param {Event} event - The event object which gets thrown. 3946 */ 3947 Navigation.prototype.onTrigger = function (event) { 3948 var settings = this._core.settings; 3949 3950 event.page = { 3951 index: $.inArray(this.current(), this._pages), 3952 count: this._pages.length, 3953 size: settings && (settings.center || settings.autoWidth || settings.dotsData 3954 ? 1 : settings.dotsEach || settings.items) 3955 }; 3956 }; 3957 3958 /** 3959 * Gets the current page position of the carousel. 3960 * @protected 3961 * @returns {Number} 3962 */ 3963 Navigation.prototype.current = function () { 3964 var current = this._core.relative(this._core.current()); 3965 return $.grep(this._pages, $.proxy(function (page, index) { 3966 return page.start <= current && page.end >= current; 3967 }, this)).pop(); 3968 }; 3969 3970 /** 3971 * Gets the current succesor/predecessor position. 3972 * @protected 3973 * @returns {Number} 3974 */ 3975 Navigation.prototype.getPosition = function (successor) { 3976 var position, length, 3977 settings = this._core.settings; 3978 3979 if (settings.slideBy == 'page') { 3980 position = $.inArray(this.current(), this._pages); 3981 length = this._pages.length; 3982 successor ? ++position : --position; 3983 position = this._pages[((position % length) + length) % length].start; 3984 } else { 3985 position = this._core.relative(this._core.current()); 3986 length = this._core.items().length; 3987 successor ? position += settings.slideBy : position -= settings.slideBy; 3988 } 3989 3990 return position; 3991 }; 3992 3993 /** 3994 * Slides to the next item or page. 3995 * @public 3996 * @param {Number} [speed=false] - The time in milliseconds for the transition. 3997 */ 3998 Navigation.prototype.next = function (speed) { 3999 $.proxy(this._overrides.to, this._core)(this.getPosition(true), speed); 4000 }; 4001 4002 /** 4003 * Slides to the previous item or page. 4004 * @public 4005 * @param {Number} [speed=false] - The time in milliseconds for the transition. 4006 */ 4007 Navigation.prototype.prev = function (speed) { 4008 $.proxy(this._overrides.to, this._core)(this.getPosition(false), speed); 4009 }; 4010 4011 /** 4012 * Slides to the specified item or page. 4013 * @public 4014 * @param {Number} position - The position of the item or page. 4015 * @param {Number} [speed] - The time in milliseconds for the transition. 4016 * @param {Boolean} [standard=false] - Whether to use the standard behaviour or not. 4017 */ 4018 Navigation.prototype.to = function (position, speed, standard) { 4019 var length; 4020 4021 if (!standard && this._pages.length) { 4022 length = this._pages.length; 4023 $.proxy(this._overrides.to, this._core)(this._pages[((position % length) + length) % length].start, speed); 4024 } else { 4025 $.proxy(this._overrides.to, this._core)(position, speed); 4026 } 4027 }; 4028 4029 $.fn.owlCarousel.Constructor.Plugins.Navigation = Navigation; 4030 4031})(window.Zepto || window.jQuery, window, document); 4032 4033/** 4034 * Hash Plugin 4035 * @version 2.3.4 4036 * @author Artus Kolanowski 4037 * @author David Deutsch 4038 * @license The MIT License (MIT) 4039 */ 4040; (function ($, window, document, undefined) { 4041 'use strict'; 4042 4043 /** 4044 * Creates the hash plugin. 4045 * @class The Hash Plugin 4046 * @param {Owl} carousel - The Owl Carousel 4047 */ 4048 var Hash = function (carousel) { 4049 /** 4050 * Reference to the core. 4051 * @protected 4052 * @type {Owl} 4053 */ 4054 this._core = carousel; 4055 4056 /** 4057 * Hash index for the items. 4058 * @protected 4059 * @type {Object} 4060 */ 4061 this._hashes = {}; 4062 4063 /** 4064 * The carousel element. 4065 * @type {jQuery} 4066 */ 4067 this.$element = this._core.$element; 4068 4069 /** 4070 * All event handlers. 4071 * @protected 4072 * @type {Object} 4073 */ 4074 this._handlers = { 4075 'initialized.owl.carousel': $.proxy(function (e) { 4076 if (e.namespace && this._core.settings.startPosition === 'URLHash') { 4077 $(window).trigger('hashchange.owl.navigation'); 4078 } 4079 }, this), 4080 'prepared.owl.carousel': $.proxy(function (e) { 4081 if (e.namespace) { 4082 var hash = $(e.content).find('[data-hash]').addBack('[data-hash]').attr('data-hash'); 4083 4084 if (!hash) { 4085 return; 4086 } 4087 4088 this._hashes[hash] = e.content; 4089 } 4090 }, this), 4091 'changed.owl.carousel': $.proxy(function (e) { 4092 if (e.namespace && e.property.name === 'position') { 4093 var current = this._core.items(this._core.relative(this._core.current())), 4094 hash = $.map(this._hashes, function (item, hash) { 4095 return item === current ? hash : null; 4096 }).join(); 4097 4098 if (!hash || window.location.hash.slice(1) === hash) { 4099 return; 4100 } 4101 4102 window.location.hash = hash; 4103 } 4104 }, this) 4105 }; 4106 4107 // set default options 4108 this._core.options = $.extend({}, Hash.Defaults, this._core.options); 4109 4110 // register the event handlers 4111 this.$element.on(this._handlers); 4112 4113 // register event listener for hash navigation 4114 $(window).on('hashchange.owl.navigation', $.proxy(function (e) { 4115 var hash = window.location.hash.substring(1), 4116 items = this._core.$stage.children(), 4117 position = this._hashes[hash] && items.index(this._hashes[hash]); 4118 4119 if (position === undefined || position === this._core.current()) { 4120 return; 4121 } 4122 4123 this._core.to(this._core.relative(position), false, true); 4124 }, this)); 4125 }; 4126 4127 /** 4128 * Default options. 4129 * @public 4130 */ 4131 Hash.Defaults = { 4132 URLhashListener: false 4133 }; 4134 4135 /** 4136 * Destroys the plugin. 4137 * @public 4138 */ 4139 Hash.prototype.destroy = function () { 4140 var handler, property; 4141 4142 $(window).off('hashchange.owl.navigation'); 4143 4144 for (handler in this._handlers) { 4145 this._core.$element.off(handler, this._handlers[handler]); 4146 } 4147 for (property in Object.getOwnPropertyNames(this)) { 4148 typeof this[property] != 'function' && (this[property] = null); 4149 } 4150 }; 4151 4152 $.fn.owlCarousel.Constructor.Plugins.Hash = Hash; 4153 4154})(window.Zepto || window.jQuery, window, document); 4155 4156/** 4157 * Support Plugin 4158 * 4159 * @version 2.3.4 4160 * @author Vivid Planet Software GmbH 4161 * @author Artus Kolanowski 4162 * @author David Deutsch 4163 * @license The MIT License (MIT) 4164 */ 4165; (function ($, window, document, undefined) { 4166 4167 var style = $('<support>').get(0).style, 4168 prefixes = 'Webkit Moz O ms'.split(' '), 4169 events = { 4170 transition: { 4171 end: { 4172 WebkitTransition: 'webkitTransitionEnd', 4173 MozTransition: 'transitionend', 4174 OTransition: 'oTransitionEnd', 4175 transition: 'transitionend' 4176 } 4177 }, 4178 animation: { 4179 end: { 4180 WebkitAnimation: 'webkitAnimationEnd', 4181 MozAnimation: 'animationend', 4182 OAnimation: 'oAnimationEnd', 4183 animation: 'animationend' 4184 } 4185 } 4186 }, 4187 tests = { 4188 csstransforms: function () { 4189 return !!test('transform'); 4190 }, 4191 csstransforms3d: function () { 4192 return !!test('perspective'); 4193 }, 4194 csstransitions: function () { 4195 return !!test('transition'); 4196 }, 4197 cssanimations: function () { 4198 return !!test('animation'); 4199 } 4200 }; 4201 4202 function test(property, prefixed) { 4203 var result = false, 4204 upper = property.charAt(0).toUpperCase() + property.slice(1); 4205 4206 $.each((property + ' ' + prefixes.join(upper + ' ') + upper).split(' '), function (i, property) { 4207 if (style[property] !== undefined) { 4208 result = prefixed ? property : true; 4209 return false; 4210 } 4211 }); 4212 4213 return result; 4214 } 4215 4216 function prefixed(property) { 4217 return test(property, true); 4218 } 4219 4220 if (tests.csstransitions()) { 4221 /* jshint -W053 */ 4222 $.support.transition = new String(prefixed('transition')) 4223 $.support.transition.end = events.transition.end[$.support.transition]; 4224 } 4225 4226 if (tests.cssanimations()) { 4227 /* jshint -W053 */ 4228 $.support.animation = new String(prefixed('animation')) 4229 $.support.animation.end = events.animation.end[$.support.animation]; 4230 } 4231 4232 if (tests.csstransforms()) { 4233 /* jshint -W053 */ 4234 $.support.transform = new String(prefixed('transform'));
4235 $.support.transform3d = tests.csstransforms3d(); 4236 } 4237 4238})(window.Zepto || window.jQuery, window, document); 4239; 4240/** 4241 * PDFObject v2.1.1 4242 * https://github.com/pipwerks/PDFObject 4243 * @license 4244 * Copyright (c) 2008-2018 Philip Hutchison 4245 * MIT-style license: http://pipwerks.mit-license.org/ 4246 * UMD module pattern from https://github.com/umdjs/umd/blob/master/templates/returnExports.js 4247 * 4248 * Locally patched: generateEmbedElement/generateIframeElement/generatePDFJSiframe 4249 * now build elements via createElement/setAttribute instead of innerHTML string 4250 * concatenation, to prevent DOM XSS from unsanitized URLs reaching this library. 4251 */ 4252((e,t)=>{"function"==typeof define&&define.amd?define([],t):"object"==typeof module&&module.exports?module.exports=t():e.PDFObject=t()})(this,function(){var e,b,t,m,o,n,g,i,v,h,r,y,w,P,s,A,T,j;return"undefined"!=typeof window&&"undefined"!=typeof navigator&&(n=window.navigator.userAgent,e=void 0!==navigator.mimeTypes&&void 0!==navigator.mimeTypes["application/pdf"],b=void 0!==window.Promise,t=-1!==n.indexOf("irefox")&&-1===n.indexOf("Mobile")&&-1===n.indexOf("Tablet")&&18<parseInt(n.split("rv:")[1].split(".")[0],10),m=/iphone|ipad|ipod/i.test(n.toLowerCase()),o=function(e){var t;try{t=new ActiveXObject(e)}catch(e){t=null}return t},n=function(){return!!(window.ActiveXObject||"ActiveXObject"in window)},g=!m&&navigator.vendor&&-1!==navigator.vendor.indexOf("Apple")&&navigator.userAgent&&-1!==navigator.userAgent.indexOf("Safari"),i=function(){return!(!o("AcroPDF.PDF")&&!o("PDF.PdfCtrl"))},v=!m&&(t||e||n()&&i()),h=function(e){var t,o="";if(e){for(t in e)e.hasOwnProperty(t)&&(o+=encodeURIComponent(t)+"="+encodeURIComponent(e[t])+"&");o=o&&(o="#"+o).slice(0,o.length-1)}return o},r=function(e){"undefined"!=typeof console&&console.log&&console.log("[PDFObject] "+e)},y=function(e){return r(e),!1},w=function(e){var t=document.body;return"string"==typeof e?t=document.querySelector(e):"undefined"!=typeof jQuery&&e instanceof jQuery&&e.length?t=e.get(0):void 0!==e.nodeType&&1===e.nodeType&&(t=e),t},P=function(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},s=function(e){var t="pdfobject-container",o=e.className.split(/\s+/);-1===o.indexOf(t)&&(o.push(t),e.className=o.join(" "))},A=function(e,t,o,n,i){n=n+"?file="+encodeURIComponent(t)+o,t=m?"-webkit-overflow-scrolling: touch; overflow-y: scroll; ":"overflow: hidden; ",o=document.createElement("div"),o.style.cssText=t+"position: absolute; top: 0; right: 0; bottom: 0; left: 0;",t=document.createElement("iframe");return t.setAttribute("src",n),t.setAttribute("frameborder","0"),t.style.cssText="border: none; width: 100%; height: 100%;",i&&(t.id=i),o.appendChild(t),s(e),e.style.position="relative",e.style.overflow="auto",e.innerHTML="",e.appendChild(o),t},T=function(e,t,o,n,i,r,d){var a="",a=t&&t!==document.body?"width: "+i+"; height: "+r+";":"position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%;",t=(s(e),document.createElement("embed"));return t.setAttribute("class","pdfobject"),t.setAttribute("src",o+n),t.setAttribute("type","application/pdf"),t.style.cssText="overflow: auto; "+a,d&&(t.id=d),e.innerHTML="",e.appendChild(t),t},j=function(e,t,o,n,i,r,d){var a="",a=t&&t!==document.body?"width: "+i+"; height: "+r+";":"position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%;",t=(e.className+=" pdfobject-container",document.createElement("iframe"));return t.setAttribute("class","pdfobject"),t.setAttribute("src",o+n),t.setAttribute("type","application/pdf"),t.style.cssText="border: none; "+a,d&&(t.id=d),e.innerHTML="",e.appendChild(t),t},{embed:function(e,t,o){var n,i,r,d,a,s,p,c,l,u,f;return"string"!=typeof e?y("URL is not valid"):(n=(o=void 0!==o?o:{}).id&&"string"==typeof o.id?o.id:"",i=o.page||!1,r=o.pdfOpenParams||{},d=void 0===o.fallbackLink||o.fallbackLink,a=o.width||"100%",s=o.height||"100%",p="boolean"!=typeof o.assumptionMode||o.assumptionMode,c="boolean"==typeof o.forcePDFJS&&o.forcePDFJS,l="boolean"==typeof o.supportRedirect&&o.supportRedirect,o=o.PDFJS_URL||!1,f="",(u=w(t=void 0!==t&&t))?(i&&(r.page=i),f=h(r),c&&o?A(u,e,f,o,n):v||p&&b&&!m?(l&&g?j:T)(u,t,e,f,a,s,n):o?A(u,e,f,o,n):(d&&(u.innerHTML=("string"==typeof d?d:"<p>This browser does not support inline PDFs. Please download the PDF to view it: <a href='[url]'>Download PDF</a></p>").replace(/\[url\]/g,P(e))),y("This browser does not support embedded PDFs"))):y("Target element cannot be determined"))},pdfobjectversion:"2.1.1",supportsPDFs:v})});; 4253jQuery(function(n){n(".ead-iframe-wrapper").each(function(){var e=n(this),t=e.find(".ead-iframe"),i=e.parent(".ead-document").data("viewer"),i=void 0!==i&&0<i.length&&i,a=t.data("src"),d=t.attr("loading"),r=!1,s=t;(r=void 0!==a&&0<a.length||void 0!==d&&"lazy"===d?!0:r)||(s=n('<iframe class="ead-iframe"></iframe>')).attr({src:t.attr("src"),style:t.attr("style"),title:t.attr("title")}),i||s.css("visibility","visible"),s.on("load",function(){n(this).parents(".ead-document").find(".ead-document-loading").css("display","none")}),r||e.html(s)}),n(".ead-document[data-pdf-src]").each(function(){var e=n(this),t=e.find(".ead-iframe"),i=e.data("pdfSrc"),a=e.data("viewer");if("string"==typeof i&&/^https?:\/\//i.test(i)){var a=void 0!==a&&0<i.length&&0<a.length&&a,d="pdfjs"in eadPublic&&0<eadPublic.pdfjs.length&&"built-in"===a;if(a&&("browser"===a||d))if(PDFObject.supportsPDFs||d){a={},a=d?{forcePDFJS:!0,PDFJS_URL:eadPublic.pdfjs}:{width:t.css("width"),height:t.css("height")};try{PDFObject.embed(i,e[0],a)}catch(e){console.error("PDFObject failed to embed:",e)}}else t.css("visibility","visible")}}),n(document).on("click",".ead-reload-btn",function(e){e.preventDefault();var e=n(this).parents(".ead-document"),t=e.find(".ead-iframe").attr("src");e.find(".ead-iframe").attr("src",t)})});;
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.