/******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 148); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["b"] = __extends; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _assign; }); /* unused harmony export __rest */ /* unused harmony export __decorate */ /* unused harmony export __param */ /* unused harmony export __metadata */ /* unused harmony export __awaiter */ /* unused harmony export __generator */ /* unused harmony export __exportStar */ /* harmony export (immutable) */ __webpack_exports__["e"] = __values; /* harmony export (immutable) */ __webpack_exports__["c"] = __read; /* harmony export (immutable) */ __webpack_exports__["d"] = __spread; /* unused harmony export __await */ /* unused harmony export __asyncGenerator */ /* unused harmony export __asyncDelegator */ /* unused harmony export __asyncValues */ /* unused harmony export __makeTemplateObject */ /* unused harmony export __importStar */ /* unused harmony export __importDefault */ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ /* global Reflect, Promise */ var _extendStatics = function extendStatics(d, b) { _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) d[p] = b[p]; } }; return _extendStatics(d, b); }; function __extends(d, b) { _extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } var _assign = function __assign() { _assign = Object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } } return t; }; return _assign.apply(this, arguments); }; function __rest(s, e) { var t = {}; for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; }if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0) t[p[i]] = s[p[i]]; }return t; } function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) { if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; }return c > 3 && r && Object.defineProperty(target, key, r), r; } function __param(paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); }; } function __metadata(metadataKey, metadataValue) { if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); } function __awaiter(thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } function __generator(thisArg, body) { var _ = { label: 0, sent: function sent() { if (t[0] & 1) throw t[1];return t[1]; }, trys: [], ops: [] }, f, y, t, g; return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (_) { try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0:case 1: t = op;break; case 4: _.label++;return { value: op[1], done: false }; case 5: _.label++;y = op[1];op = [0];continue; case 7: op = _.ops.pop();_.trys.pop();continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0;continue; } if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { _.label = op[1];break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1];t = op;break; } if (t && _.label < t[2]) { _.label = t[2];_.ops.push(op);break; } if (t[2]) _.ops.pop(); _.trys.pop();continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e];y = 0; } finally { f = t = 0; } }if (op[0] & 5) throw op[1];return { value: op[0] ? op[1] : void 0, done: true }; } } function __exportStar(m, exports) { for (var p in m) { if (!exports.hasOwnProperty(p)) exports[p] = m[p]; } } function __values(o) { var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; if (m) return m.call(o); return { next: function next() { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; } function __read(o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) { ar.push(r.value); } } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; } function __spread() { for (var ar = [], i = 0; i < arguments.length; i++) { ar = ar.concat(__read(arguments[i])); }return ar; } function __await(v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } function __asyncGenerator(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g = generator.apply(thisArg, _arguments || []), i, q = []; return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } } function __asyncDelegator(o) { var i, p; return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } } function __asyncValues(o) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var m = o[Symbol.asyncIterator], i; return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); } } function __makeTemplateObject(cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; }; function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) { if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; }result.default = mod; return result; } function __importDefault(mod) { return mod && mod.__esModule ? mod : { default: mod }; } /***/ }), /* 1 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VBaseComponent; }); /* harmony export (immutable) */ __webpack_exports__["d"] = hookupComponentsManually; /* harmony export (immutable) */ __webpack_exports__["c"] = hookupComponents; /* harmony export (immutable) */ __webpack_exports__["e"] = unhookupComponents; /* harmony export (immutable) */ __webpack_exports__["b"] = getRootNode; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__events_errors__ = __webpack_require__(31); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var VBaseComponent = function () { function VBaseComponent(element, mdcComponent) { _classCallCheck(this, VBaseComponent); this.root = getRootNode(element); this.element = element; this.element.vComponent = this; this.mdcComponent = mdcComponent; this.element.classList.add('v-component'); } _createClass(VBaseComponent, [{ key: 'destroy', value: function destroy() { // Work in progress - this will ultimately be cleaning up other items like events, etc. (more to come) if (this.mdcComponent && this.mdcComponent.destroy) { this.mdcComponent.destroy(); } } }, { key: 'validate', value: function validate(formData) { return true; } }, { key: 'onShow', value: function onShow() {} }, { key: 'onHide', value: function onHide() {} // Invoked after event handlers have been initialized. }, { key: 'afterInit', value: function afterInit() {} }, { key: 'parentComponent', value: function parentComponent(selector) { if (!this.element.parentElement) { return null; } var element = this.element.parentElement.closest(selector); if (!(element && element.vComponent)) { return null; } return element.vComponent; } // Event actions results bubble up to their containers }, { key: 'actionsStarted', value: function actionsStarted(vEvent) { var ev = new Event('V:actionsStarted', { bubbles: true, cancelable: false, detail: vEvent, composed: true }); this.element.dispatchEvent(ev); } // Event actions results bubble up to their containers }, { key: 'actionsHalted', value: function actionsHalted(vEvent) { var ev = new Event('V:actionsHalted', { bubbles: true, cancelable: false, detail: vEvent, composed: true }); this.element.dispatchEvent(ev); } }, { key: 'actionsSucceeded', value: function actionsSucceeded(vEvent) { var ev = new CustomEvent('V:actionsSucceeded', { bubbles: true, cancelable: false, detail: vEvent, composed: true }); this.element.dispatchEvent(ev); } }, { key: 'actionsFinished', value: function actionsFinished(vEvent) { var ev = new CustomEvent('V:actionsFinished', { bubbles: true, cancelable: false, detail: vEvent, composed: true }); this.element.dispatchEvent(ev); } }, { key: 'hasHandlers', value: function hasHandlers() { return this.eventsHandler && Object.keys(this.eventsHandler).length > 0; } }, { key: 'clearErrors', value: function clearErrors() { new __WEBPACK_IMPORTED_MODULE_0__events_errors__["a" /* VErrors */](this.root).clearErrors(); } }, { key: 'respondTo', value: function respondTo(method) { return typeof this[method] === 'function'; } }, { key: 'is', value: function is(name) { return this.constructor.name === name; } }]); return VBaseComponent; }(); function getCandidateElements(root, selector) { var elements = Array.from(root.querySelectorAll(selector)); if (root && typeof root.matches === 'function' && root.matches(selector)) { elements.unshift(root); } return elements; } // `fn` is a unary function accepting a HTMLElement and returning an instance of // VBaseComponent. function hookupComponentsManually(root, selector, fn) { var elements = getCandidateElements(root, selector); var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = elements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var element = _step.value; if (element.mdcComponent || element.vComponent) { continue; } fn(element); } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } } function hookupComponents(root, selector, VoomClass, MDCClass) { var ctor = componentFactory(VoomClass, MDCClass); hookupComponentsManually(root, selector, ctor); } // Returns a function capable of constructing a Voom component. function componentFactory(VoomClass, MDCClass) { return function (element) { return new VoomClass(element, typeof MDCClass === 'function' ? new MDCClass(element) : null); }; } function unhookupComponents(root, selector) { var elements = getCandidateElements(root, selector); var _iteratorNormalCompletion2 = true; var _didIteratorError2 = false; var _iteratorError2 = undefined; try { for (var _iterator2 = elements[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { var element = _step2.value; if (element.vComponent) { element.vComponent.destroy(); } } } catch (err) { _didIteratorError2 = true; _iteratorError2 = err; } finally { try { if (!_iteratorNormalCompletion2 && _iterator2.return) { _iterator2.return(); } } finally { if (_didIteratorError2) { throw _iteratorError2; } } } } // Retrieve the element's owning document or shadow root. function getRootNode(node) { if (!node.parentNode || isShadowRoot(node)) { return node; } return getRootNode(node.parentNode); } function isShadowRoot(node) { return node.constructor.name === 'ShadowRoot'; } /***/ }), /* 2 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCFoundation; }); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCFoundation = /** @class */function () { function MDCFoundation(adapter) { if (adapter === void 0) { adapter = {}; } this.adapter_ = adapter; } Object.defineProperty(MDCFoundation, "cssClasses", { get: function get() { // Classes extending MDCFoundation should implement this method to return an object which exports every // CSS class the foundation class needs as a property. e.g. {ACTIVE: 'mdc-component--active'} return {}; }, enumerable: true, configurable: true }); Object.defineProperty(MDCFoundation, "strings", { get: function get() { // Classes extending MDCFoundation should implement this method to return an object which exports all // semantic strings as constants. e.g. {ARIA_ROLE: 'tablist'} return {}; }, enumerable: true, configurable: true }); Object.defineProperty(MDCFoundation, "numbers", { get: function get() { // Classes extending MDCFoundation should implement this method to return an object which exports all // of its semantic numbers as constants. e.g. {ANIMATION_DELAY_MS: 350} return {}; }, enumerable: true, configurable: true }); Object.defineProperty(MDCFoundation, "defaultAdapter", { get: function get() { // Classes extending MDCFoundation may choose to implement this getter in order to provide a convenient // way of viewing the necessary methods of an adapter. In the future, this could also be used for adapter // validation. return {}; }, enumerable: true, configurable: true }); MDCFoundation.prototype.init = function () { // Subclasses should override this method to perform initialization routines (registering events, etc.) }; MDCFoundation.prototype.destroy = function () { // Subclasses should override this method to perform de-initialization routines (de-registering events, etc.) }; return MDCFoundation; }(); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 3 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCComponent; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(2); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCComponent = /** @class */function () { function MDCComponent(root, foundation) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } this.root_ = root; this.initialize.apply(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["d" /* __spread */](args)); // Note that we initialize foundation here and not within the constructor's default param so that // this.root_ is defined and can be used within the foundation class. this.foundation_ = foundation === undefined ? this.getDefaultFoundation() : foundation; this.foundation_.init(); this.initialSyncWithDOM(); } MDCComponent.attachTo = function (root) { // Subclasses which extend MDCBase should provide an attachTo() method that takes a root element and // returns an instantiated component with its root set to that element. Also note that in the cases of // subclasses, an explicit foundation class will not have to be passed in; it will simply be initialized // from getDefaultFoundation(). return new MDCComponent(root, new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* MDCFoundation */]({})); }; /* istanbul ignore next: method param only exists for typing purposes; it does not need to be unit tested */ MDCComponent.prototype.initialize = function () { var _args = []; for (var _i = 0; _i < arguments.length; _i++) { _args[_i] = arguments[_i]; } // Subclasses can override this to do any additional setup work that would be considered part of a // "constructor". Essentially, it is a hook into the parent constructor before the foundation is // initialized. Any additional arguments besides root and foundation will be passed in here. }; MDCComponent.prototype.getDefaultFoundation = function () { // Subclasses must override this method to return a properly configured foundation class for the // component. throw new Error('Subclasses must override getDefaultFoundation to return a properly configured ' + 'foundation class'); }; MDCComponent.prototype.initialSyncWithDOM = function () { // Subclasses should override this method if they need to perform work to synchronize with a host DOM // object. An example of this would be a form control wrapper that needs to synchronize its internal state // to some property or attribute of the host DOM. Please note: this is *not* the place to perform DOM // reads/writes that would cause layout / paint, as this is called synchronously from within the constructor. }; MDCComponent.prototype.destroy = function () { // Subclasses may implement this method to release any resources / deregister any listeners they have // attached. An example of this might be deregistering a resize event from the window object. this.foundation_.destroy(); }; MDCComponent.prototype.listen = function (evtType, handler, options) { this.root_.addEventListener(evtType, handler, options); }; MDCComponent.prototype.unlisten = function (evtType, handler, options) { this.root_.removeEventListener(evtType, handler, options); }; /** * Fires a cross-browser-compatible custom event from the component root of the given type, with the given data. */ MDCComponent.prototype.emit = function (evtType, evtData, shouldBubble) { if (shouldBubble === void 0) { shouldBubble = false; } var evt; if (typeof CustomEvent === 'function') { evt = new CustomEvent(evtType, { bubbles: shouldBubble, detail: evtData }); } else { evt = document.createEvent('CustomEvent'); evt.initCustomEvent(evtType, shouldBubble, false, evtData); } this.root_.dispatchEvent(evt); }; return MDCComponent; }(); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCComponent); //# sourceMappingURL=component.js.map /***/ }), /* 4 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return eventHandlerMixin; }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var eventHandlerMixin = function eventHandlerMixin(Base) { return function (_Base) { _inherits(_class, _Base); function _class() { _classCallCheck(this, _class); return _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments)); } _createClass(_class, [{ key: 'initEventListener', // idempotent event handling initialization value: function initEventListener(eventName, eventHandler, eventOptions) { if (typeof this.element.eventsHandler === 'undefined') { this.element.eventsHandler = {}; } if (typeof this.element.eventsHandler[eventName] === 'undefined') { this.element.eventsHandler[eventName] = []; } this.element.eventsHandler[eventName].push(eventHandler); this.element.addEventListener(eventName, eventHandler, eventOptions); } }]); return _class; }(Base); }; /***/ }), /* 5 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = closest; /* harmony export (immutable) */ __webpack_exports__["b"] = matches; /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ /** * @fileoverview A "ponyfill" is a polyfill that doesn't modify the global prototype chain. * This makes ponyfills safer than traditional polyfills, especially for libraries like MDC. */ function closest(element, selector) { if (element.closest) { return element.closest(selector); } var el = element; while (el) { if (matches(el, selector)) { return el; } el = el.parentElement; } return null; } function matches(element, selector) { var nativeMatches = element.matches || element.webkitMatchesSelector || element.msMatchesSelector; return nativeMatches.call(element, selector); } //# sourceMappingURL=ponyfill.js.map /***/ }), /* 6 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCRipple; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_dom_events__ = __webpack_require__(8); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_dom_ponyfill__ = __webpack_require__(5); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation__ = __webpack_require__(9); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util__ = __webpack_require__(30); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCRipple = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCRipple, _super); function MDCRipple() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.disabled = false; return _this; } MDCRipple.attachTo = function (root, opts) { if (opts === void 0) { opts = { isUnbounded: undefined }; } var ripple = new MDCRipple(root); // Only override unbounded behavior if option is explicitly specified if (opts.isUnbounded !== undefined) { ripple.unbounded = opts.isUnbounded; } return ripple; }; MDCRipple.createAdapter = function (instance) { return { addClass: function addClass(className) { return instance.root_.classList.add(className); }, browserSupportsCssVars: function browserSupportsCssVars() { return __WEBPACK_IMPORTED_MODULE_5__util__["b" /* supportsCssVariables */](window); }, computeBoundingRect: function computeBoundingRect() { return instance.root_.getBoundingClientRect(); }, containsEventTarget: function containsEventTarget(target) { return instance.root_.contains(target); }, deregisterDocumentInteractionHandler: function deregisterDocumentInteractionHandler(evtType, handler) { return document.documentElement.removeEventListener(evtType, handler, Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_events__["a" /* applyPassive */])()); }, deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) { return instance.root_.removeEventListener(evtType, handler, Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_events__["a" /* applyPassive */])()); }, deregisterResizeHandler: function deregisterResizeHandler(handler) { return window.removeEventListener('resize', handler); }, getWindowPageOffset: function getWindowPageOffset() { return { x: window.pageXOffset, y: window.pageYOffset }; }, isSurfaceActive: function isSurfaceActive() { return Object(__WEBPACK_IMPORTED_MODULE_3__material_dom_ponyfill__["b" /* matches */])(instance.root_, ':active'); }, isSurfaceDisabled: function isSurfaceDisabled() { return Boolean(instance.disabled); }, isUnbounded: function isUnbounded() { return Boolean(instance.unbounded); }, registerDocumentInteractionHandler: function registerDocumentInteractionHandler(evtType, handler) { return document.documentElement.addEventListener(evtType, handler, Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_events__["a" /* applyPassive */])()); }, registerInteractionHandler: function registerInteractionHandler(evtType, handler) { return instance.root_.addEventListener(evtType, handler, Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_events__["a" /* applyPassive */])()); }, registerResizeHandler: function registerResizeHandler(handler) { return window.addEventListener('resize', handler); }, removeClass: function removeClass(className) { return instance.root_.classList.remove(className); }, updateCssVariable: function updateCssVariable(varName, value) { return instance.root_.style.setProperty(varName, value); } }; }; Object.defineProperty(MDCRipple.prototype, "unbounded", { get: function get() { return Boolean(this.unbounded_); }, set: function set(unbounded) { this.unbounded_ = Boolean(unbounded); this.setUnbounded_(); }, enumerable: true, configurable: true }); MDCRipple.prototype.activate = function () { this.foundation_.activate(); }; MDCRipple.prototype.deactivate = function () { this.foundation_.deactivate(); }; MDCRipple.prototype.layout = function () { this.foundation_.layout(); }; MDCRipple.prototype.getDefaultFoundation = function () { return new __WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* MDCRippleFoundation */](MDCRipple.createAdapter(this)); }; MDCRipple.prototype.initialSyncWithDOM = function () { var root = this.root_; this.unbounded = 'mdcRippleIsUnbounded' in root.dataset; }; /** * Closure Compiler throws an access control error when directly accessing a * protected or private property inside a getter/setter, like unbounded above. * By accessing the protected property inside a method, we solve that problem. * That's why this function exists. */ MDCRipple.prototype.setUnbounded_ = function () { this.foundation_.setUnbounded(Boolean(this.unbounded_)); }; return MDCRipple; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 7 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var check = function check(it) { return it && it.Math == Math && it; }; // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 module.exports = // eslint-disable-next-line no-undef check((typeof globalThis === 'undefined' ? 'undefined' : _typeof(globalThis)) == 'object' && globalThis) || check((typeof window === 'undefined' ? 'undefined' : _typeof(window)) == 'object' && window) || check((typeof self === 'undefined' ? 'undefined' : _typeof(self)) == 'object' && self) || check((typeof global === 'undefined' ? 'undefined' : _typeof(global)) == 'object' && global) || // eslint-disable-next-line no-new-func Function('return this')(); /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(15))) /***/ }), /* 8 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = applyPassive; /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ /** * Stores result from applyPassive to avoid redundant processing to detect * passive event listener support. */ var supportsPassive_; /** * Determine whether the current browser supports passive event listeners, and * if so, use them. */ function applyPassive(globalObj, forceRefresh) { if (globalObj === void 0) { globalObj = window; } if (forceRefresh === void 0) { forceRefresh = false; } if (supportsPassive_ === undefined || forceRefresh) { var isSupported_1 = false; try { globalObj.document.addEventListener('test', function () { return undefined; }, { get passive() { isSupported_1 = true; return isSupported_1; } }); } catch (e) {} // tslint:disable-line:no-empty cannot throw error due to tests. tslint also disables console.log. supportsPassive_ = isSupported_1; } return supportsPassive_ ? { passive: true } : false; } //# sourceMappingURL=events.js.map /***/ }), /* 9 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCRippleFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(60); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(30); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ // Activation events registered on the root element of each instance for activation var ACTIVATION_EVENT_TYPES = ['touchstart', 'pointerdown', 'mousedown', 'keydown']; // Deactivation events registered on documentElement when a pointer-related down event occurs var POINTER_DEACTIVATION_EVENT_TYPES = ['touchend', 'pointerup', 'mouseup', 'contextmenu']; // simultaneous nested activations var activatedTargets = []; var MDCRippleFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCRippleFoundation, _super); function MDCRippleFoundation(adapter) { var _this = _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCRippleFoundation.defaultAdapter, adapter)) || this; _this.activationAnimationHasEnded_ = false; _this.activationTimer_ = 0; _this.fgDeactivationRemovalTimer_ = 0; _this.fgScale_ = '0'; _this.frame_ = { width: 0, height: 0 }; _this.initialSize_ = 0; _this.layoutFrame_ = 0; _this.maxRadius_ = 0; _this.unboundedCoords_ = { left: 0, top: 0 }; _this.activationState_ = _this.defaultActivationState_(); _this.activationTimerCallback_ = function () { _this.activationAnimationHasEnded_ = true; _this.runDeactivationUXLogicIfReady_(); }; _this.activateHandler_ = function (e) { return _this.activate_(e); }; _this.deactivateHandler_ = function () { return _this.deactivate_(); }; _this.focusHandler_ = function () { return _this.handleFocus(); }; _this.blurHandler_ = function () { return _this.handleBlur(); }; _this.resizeHandler_ = function () { return _this.layout(); }; return _this; } Object.defineProperty(MDCRippleFoundation, "cssClasses", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCRippleFoundation, "strings", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCRippleFoundation, "numbers", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCRippleFoundation, "defaultAdapter", { get: function get() { return { addClass: function addClass() { return undefined; }, browserSupportsCssVars: function browserSupportsCssVars() { return true; }, computeBoundingRect: function computeBoundingRect() { return { top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0 }; }, containsEventTarget: function containsEventTarget() { return true; }, deregisterDocumentInteractionHandler: function deregisterDocumentInteractionHandler() { return undefined; }, deregisterInteractionHandler: function deregisterInteractionHandler() { return undefined; }, deregisterResizeHandler: function deregisterResizeHandler() { return undefined; }, getWindowPageOffset: function getWindowPageOffset() { return { x: 0, y: 0 }; }, isSurfaceActive: function isSurfaceActive() { return true; }, isSurfaceDisabled: function isSurfaceDisabled() { return true; }, isUnbounded: function isUnbounded() { return true; }, registerDocumentInteractionHandler: function registerDocumentInteractionHandler() { return undefined; }, registerInteractionHandler: function registerInteractionHandler() { return undefined; }, registerResizeHandler: function registerResizeHandler() { return undefined; }, removeClass: function removeClass() { return undefined; }, updateCssVariable: function updateCssVariable() { return undefined; } }; }, enumerable: true, configurable: true }); MDCRippleFoundation.prototype.init = function () { var _this = this; var supportsPressRipple = this.supportsPressRipple_(); this.registerRootHandlers_(supportsPressRipple); if (supportsPressRipple) { var _a = MDCRippleFoundation.cssClasses, ROOT_1 = _a.ROOT, UNBOUNDED_1 = _a.UNBOUNDED; requestAnimationFrame(function () { _this.adapter_.addClass(ROOT_1); if (_this.adapter_.isUnbounded()) { _this.adapter_.addClass(UNBOUNDED_1); // Unbounded ripples need layout logic applied immediately to set coordinates for both shade and ripple _this.layoutInternal_(); } }); } }; MDCRippleFoundation.prototype.destroy = function () { var _this = this; if (this.supportsPressRipple_()) { if (this.activationTimer_) { clearTimeout(this.activationTimer_); this.activationTimer_ = 0; this.adapter_.removeClass(MDCRippleFoundation.cssClasses.FG_ACTIVATION); } if (this.fgDeactivationRemovalTimer_) { clearTimeout(this.fgDeactivationRemovalTimer_); this.fgDeactivationRemovalTimer_ = 0; this.adapter_.removeClass(MDCRippleFoundation.cssClasses.FG_DEACTIVATION); } var _a = MDCRippleFoundation.cssClasses, ROOT_2 = _a.ROOT, UNBOUNDED_2 = _a.UNBOUNDED; requestAnimationFrame(function () { _this.adapter_.removeClass(ROOT_2); _this.adapter_.removeClass(UNBOUNDED_2); _this.removeCssVars_(); }); } this.deregisterRootHandlers_(); this.deregisterDeactivationHandlers_(); }; /** * @param evt Optional event containing position information. */ MDCRippleFoundation.prototype.activate = function (evt) { this.activate_(evt); }; MDCRippleFoundation.prototype.deactivate = function () { this.deactivate_(); }; MDCRippleFoundation.prototype.layout = function () { var _this = this; if (this.layoutFrame_) { cancelAnimationFrame(this.layoutFrame_); } this.layoutFrame_ = requestAnimationFrame(function () { _this.layoutInternal_(); _this.layoutFrame_ = 0; }); }; MDCRippleFoundation.prototype.setUnbounded = function (unbounded) { var UNBOUNDED = MDCRippleFoundation.cssClasses.UNBOUNDED; if (unbounded) { this.adapter_.addClass(UNBOUNDED); } else { this.adapter_.removeClass(UNBOUNDED); } }; MDCRippleFoundation.prototype.handleFocus = function () { var _this = this; requestAnimationFrame(function () { return _this.adapter_.addClass(MDCRippleFoundation.cssClasses.BG_FOCUSED); }); }; MDCRippleFoundation.prototype.handleBlur = function () { var _this = this; requestAnimationFrame(function () { return _this.adapter_.removeClass(MDCRippleFoundation.cssClasses.BG_FOCUSED); }); }; /** * We compute this property so that we are not querying information about the client * until the point in time where the foundation requests it. This prevents scenarios where * client-side feature-detection may happen too early, such as when components are rendered on the server * and then initialized at mount time on the client. */ MDCRippleFoundation.prototype.supportsPressRipple_ = function () { return this.adapter_.browserSupportsCssVars(); }; MDCRippleFoundation.prototype.defaultActivationState_ = function () { return { activationEvent: undefined, hasDeactivationUXRun: false, isActivated: false, isProgrammatic: false, wasActivatedByPointer: false, wasElementMadeActive: false }; }; /** * supportsPressRipple Passed from init to save a redundant function call */ MDCRippleFoundation.prototype.registerRootHandlers_ = function (supportsPressRipple) { var _this = this; if (supportsPressRipple) { ACTIVATION_EVENT_TYPES.forEach(function (evtType) { _this.adapter_.registerInteractionHandler(evtType, _this.activateHandler_); }); if (this.adapter_.isUnbounded()) { this.adapter_.registerResizeHandler(this.resizeHandler_); } } this.adapter_.registerInteractionHandler('focus', this.focusHandler_); this.adapter_.registerInteractionHandler('blur', this.blurHandler_); }; MDCRippleFoundation.prototype.registerDeactivationHandlers_ = function (evt) { var _this = this; if (evt.type === 'keydown') { this.adapter_.registerInteractionHandler('keyup', this.deactivateHandler_); } else { POINTER_DEACTIVATION_EVENT_TYPES.forEach(function (evtType) { _this.adapter_.registerDocumentInteractionHandler(evtType, _this.deactivateHandler_); }); } }; MDCRippleFoundation.prototype.deregisterRootHandlers_ = function () { var _this = this; ACTIVATION_EVENT_TYPES.forEach(function (evtType) { _this.adapter_.deregisterInteractionHandler(evtType, _this.activateHandler_); }); this.adapter_.deregisterInteractionHandler('focus', this.focusHandler_); this.adapter_.deregisterInteractionHandler('blur', this.blurHandler_); if (this.adapter_.isUnbounded()) { this.adapter_.deregisterResizeHandler(this.resizeHandler_); } }; MDCRippleFoundation.prototype.deregisterDeactivationHandlers_ = function () { var _this = this; this.adapter_.deregisterInteractionHandler('keyup', this.deactivateHandler_); POINTER_DEACTIVATION_EVENT_TYPES.forEach(function (evtType) { _this.adapter_.deregisterDocumentInteractionHandler(evtType, _this.deactivateHandler_); }); }; MDCRippleFoundation.prototype.removeCssVars_ = function () { var _this = this; var rippleStrings = MDCRippleFoundation.strings; var keys = Object.keys(rippleStrings); keys.forEach(function (key) { if (key.indexOf('VAR_') === 0) { _this.adapter_.updateCssVariable(rippleStrings[key], null); } }); }; MDCRippleFoundation.prototype.activate_ = function (evt) { var _this = this; if (this.adapter_.isSurfaceDisabled()) { return; } var activationState = this.activationState_; if (activationState.isActivated) { return; } // Avoid reacting to follow-on events fired by touch device after an already-processed user interaction var previousActivationEvent = this.previousActivationEvent_; var isSameInteraction = previousActivationEvent && evt !== undefined && previousActivationEvent.type !== evt.type; if (isSameInteraction) { return; } activationState.isActivated = true; activationState.isProgrammatic = evt === undefined; activationState.activationEvent = evt; activationState.wasActivatedByPointer = activationState.isProgrammatic ? false : evt !== undefined && (evt.type === 'mousedown' || evt.type === 'touchstart' || evt.type === 'pointerdown'); var hasActivatedChild = evt !== undefined && activatedTargets.length > 0 && activatedTargets.some(function (target) { return _this.adapter_.containsEventTarget(target); }); if (hasActivatedChild) { // Immediately reset activation state, while preserving logic that prevents touch follow-on events this.resetActivationState_(); return; } if (evt !== undefined) { activatedTargets.push(evt.target); this.registerDeactivationHandlers_(evt); } activationState.wasElementMadeActive = this.checkElementMadeActive_(evt); if (activationState.wasElementMadeActive) { this.animateActivation_(); } requestAnimationFrame(function () { // Reset array on next frame after the current event has had a chance to bubble to prevent ancestor ripples activatedTargets = []; if (!activationState.wasElementMadeActive && evt !== undefined && (evt.key === ' ' || evt.keyCode === 32)) { // If space was pressed, try again within an rAF call to detect :active, because different UAs report // active states inconsistently when they're called within event handling code: // - https://bugs.chromium.org/p/chromium/issues/detail?id=635971 // - https://bugzilla.mozilla.org/show_bug.cgi?id=1293741 // We try first outside rAF to support Edge, which does not exhibit this problem, but will crash if a CSS // variable is set within a rAF callback for a submit button interaction (#2241). activationState.wasElementMadeActive = _this.checkElementMadeActive_(evt); if (activationState.wasElementMadeActive) { _this.animateActivation_(); } } if (!activationState.wasElementMadeActive) { // Reset activation state immediately if element was not made active. _this.activationState_ = _this.defaultActivationState_(); } }); }; MDCRippleFoundation.prototype.checkElementMadeActive_ = function (evt) { return evt !== undefined && evt.type === 'keydown' ? this.adapter_.isSurfaceActive() : true; }; MDCRippleFoundation.prototype.animateActivation_ = function () { var _this = this; var _a = MDCRippleFoundation.strings, VAR_FG_TRANSLATE_START = _a.VAR_FG_TRANSLATE_START, VAR_FG_TRANSLATE_END = _a.VAR_FG_TRANSLATE_END; var _b = MDCRippleFoundation.cssClasses, FG_DEACTIVATION = _b.FG_DEACTIVATION, FG_ACTIVATION = _b.FG_ACTIVATION; var DEACTIVATION_TIMEOUT_MS = MDCRippleFoundation.numbers.DEACTIVATION_TIMEOUT_MS; this.layoutInternal_(); var translateStart = ''; var translateEnd = ''; if (!this.adapter_.isUnbounded()) { var _c = this.getFgTranslationCoordinates_(), startPoint = _c.startPoint, endPoint = _c.endPoint; translateStart = startPoint.x + "px, " + startPoint.y + "px"; translateEnd = endPoint.x + "px, " + endPoint.y + "px"; } this.adapter_.updateCssVariable(VAR_FG_TRANSLATE_START, translateStart); this.adapter_.updateCssVariable(VAR_FG_TRANSLATE_END, translateEnd); // Cancel any ongoing activation/deactivation animations clearTimeout(this.activationTimer_); clearTimeout(this.fgDeactivationRemovalTimer_); this.rmBoundedActivationClasses_(); this.adapter_.removeClass(FG_DEACTIVATION); // Force layout in order to re-trigger the animation. this.adapter_.computeBoundingRect(); this.adapter_.addClass(FG_ACTIVATION); this.activationTimer_ = setTimeout(function () { return _this.activationTimerCallback_(); }, DEACTIVATION_TIMEOUT_MS); }; MDCRippleFoundation.prototype.getFgTranslationCoordinates_ = function () { var _a = this.activationState_, activationEvent = _a.activationEvent, wasActivatedByPointer = _a.wasActivatedByPointer; var startPoint; if (wasActivatedByPointer) { startPoint = Object(__WEBPACK_IMPORTED_MODULE_3__util__["a" /* getNormalizedEventCoords */])(activationEvent, this.adapter_.getWindowPageOffset(), this.adapter_.computeBoundingRect()); } else { startPoint = { x: this.frame_.width / 2, y: this.frame_.height / 2 }; } // Center the element around the start point. startPoint = { x: startPoint.x - this.initialSize_ / 2, y: startPoint.y - this.initialSize_ / 2 }; var endPoint = { x: this.frame_.width / 2 - this.initialSize_ / 2, y: this.frame_.height / 2 - this.initialSize_ / 2 }; return { startPoint: startPoint, endPoint: endPoint }; }; MDCRippleFoundation.prototype.runDeactivationUXLogicIfReady_ = function () { var _this = this; // This method is called both when a pointing device is released, and when the activation animation ends. // The deactivation animation should only run after both of those occur. var FG_DEACTIVATION = MDCRippleFoundation.cssClasses.FG_DEACTIVATION; var _a = this.activationState_, hasDeactivationUXRun = _a.hasDeactivationUXRun, isActivated = _a.isActivated; var activationHasEnded = hasDeactivationUXRun || !isActivated; if (activationHasEnded && this.activationAnimationHasEnded_) { this.rmBoundedActivationClasses_(); this.adapter_.addClass(FG_DEACTIVATION); this.fgDeactivationRemovalTimer_ = setTimeout(function () { _this.adapter_.removeClass(FG_DEACTIVATION); }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].FG_DEACTIVATION_MS); } }; MDCRippleFoundation.prototype.rmBoundedActivationClasses_ = function () { var FG_ACTIVATION = MDCRippleFoundation.cssClasses.FG_ACTIVATION; this.adapter_.removeClass(FG_ACTIVATION); this.activationAnimationHasEnded_ = false; this.adapter_.computeBoundingRect(); }; MDCRippleFoundation.prototype.resetActivationState_ = function () { var _this = this; this.previousActivationEvent_ = this.activationState_.activationEvent; this.activationState_ = this.defaultActivationState_(); // Touch devices may fire additional events for the same interaction within a short time. // Store the previous event until it's safe to assume that subsequent events are for new interactions. setTimeout(function () { return _this.previousActivationEvent_ = undefined; }, MDCRippleFoundation.numbers.TAP_DELAY_MS); }; MDCRippleFoundation.prototype.deactivate_ = function () { var _this = this; var activationState = this.activationState_; // This can happen in scenarios such as when you have a keyup event that blurs the element. if (!activationState.isActivated) { return; } var state = __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, activationState); if (activationState.isProgrammatic) { requestAnimationFrame(function () { return _this.animateDeactivation_(state); }); this.resetActivationState_(); } else { this.deregisterDeactivationHandlers_(); requestAnimationFrame(function () { _this.activationState_.hasDeactivationUXRun = true; _this.animateDeactivation_(state); _this.resetActivationState_(); }); } }; MDCRippleFoundation.prototype.animateDeactivation_ = function (_a) { var wasActivatedByPointer = _a.wasActivatedByPointer, wasElementMadeActive = _a.wasElementMadeActive; if (wasActivatedByPointer || wasElementMadeActive) { this.runDeactivationUXLogicIfReady_(); } }; MDCRippleFoundation.prototype.layoutInternal_ = function () { var _this = this; this.frame_ = this.adapter_.computeBoundingRect(); var maxDim = Math.max(this.frame_.height, this.frame_.width); // Surface diameter is treated differently for unbounded vs. bounded ripples. // Unbounded ripple diameter is calculated smaller since the surface is expected to already be padded appropriately // to extend the hitbox, and the ripple is expected to meet the edges of the padded hitbox (which is typically // square). Bounded ripples, on the other hand, are fully expected to expand beyond the surface's longest diameter // (calculated based on the diagonal plus a constant padding), and are clipped at the surface's border via // `overflow: hidden`. var getBoundedRadius = function getBoundedRadius() { var hypotenuse = Math.sqrt(Math.pow(_this.frame_.width, 2) + Math.pow(_this.frame_.height, 2)); return hypotenuse + MDCRippleFoundation.numbers.PADDING; }; this.maxRadius_ = this.adapter_.isUnbounded() ? maxDim : getBoundedRadius(); // Ripple is sized as a fraction of the largest dimension of the surface, then scales up using a CSS scale transform this.initialSize_ = Math.floor(maxDim * MDCRippleFoundation.numbers.INITIAL_ORIGIN_SCALE); this.fgScale_ = "" + this.maxRadius_ / this.initialSize_; this.updateLayoutCssVars_(); }; MDCRippleFoundation.prototype.updateLayoutCssVars_ = function () { var _a = MDCRippleFoundation.strings, VAR_FG_SIZE = _a.VAR_FG_SIZE, VAR_LEFT = _a.VAR_LEFT, VAR_TOP = _a.VAR_TOP, VAR_FG_SCALE = _a.VAR_FG_SCALE; this.adapter_.updateCssVariable(VAR_FG_SIZE, this.initialSize_ + "px"); this.adapter_.updateCssVariable(VAR_FG_SCALE, this.fgScale_); if (this.adapter_.isUnbounded()) { this.unboundedCoords_ = { left: Math.round(this.frame_.width / 2 - this.initialSize_ / 2), top: Math.round(this.frame_.height / 2 - this.initialSize_ / 2) }; this.adapter_.updateCssVariable(VAR_LEFT, this.unboundedCoords_.left + "px"); this.adapter_.updateCssVariable(VAR_TOP, this.unboundedCoords_.top + "px"); } }; return MDCRippleFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCRippleFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 10 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VBaseContainer; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__base_component__ = __webpack_require__(1); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var VBaseContainer = function (_VBaseComponent) { _inherits(VBaseContainer, _VBaseComponent); function VBaseContainer(element, mdcComponent) { _classCallCheck(this, VBaseContainer); var _this = _possibleConstructorReturn(this, (VBaseContainer.__proto__ || Object.getPrototypeOf(VBaseContainer)).call(this, element, mdcComponent)); _this.element.classList.add('v-container'); return _this; } _createClass(VBaseContainer, [{ key: 'components', value: function components() { return Array.from(this.element.querySelectorAll('.v-component')).filter(function (element) { return element.vComponent; }).map(function (element) { return element.vComponent; }); } }, { key: 'inputs', value: function inputs() { return this.element.querySelectorAll('.v-input'); } }, { key: 'inputComponents', value: function inputComponents() { return Array.from(this.inputs()).filter(function (element) { return element.vComponent; }).map(function (element) { return element.vComponent; }); } // Called to collect data for submission }, { key: 'prepareSubmit', value: function prepareSubmit(params) { var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = this.inputComponents()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var comp = _step.value; if (comp.respondTo('prepareSubmit')) { comp.prepareSubmit(params); } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } } }, { key: 'clear', value: function clear() { var _iteratorNormalCompletion2 = true; var _didIteratorError2 = false; var _iteratorError2 = undefined; try { for (var _iterator2 = this.inputComponents()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { var comp = _step2.value; if (comp.respondTo('clear')) { comp.clear(); } } } catch (err) { _didIteratorError2 = true; _iteratorError2 = err; } finally { try { if (!_iteratorNormalCompletion2 && _iterator2.return) { _iterator2.return(); } } finally { if (_didIteratorError2) { throw _iteratorError2; } } } } }, { key: 'reset', value: function reset() { var _iteratorNormalCompletion3 = true; var _didIteratorError3 = false; var _iteratorError3 = undefined; try { for (var _iterator3 = this.inputComponents()[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { var comp = _step3.value; if (comp.respondTo('reset')) { comp.reset(); } } } catch (err) { _didIteratorError3 = true; _iteratorError3 = err; } finally { try { if (!_iteratorNormalCompletion3 && _iterator3.return) { _iterator3.return(); } } finally { if (_didIteratorError3) { throw _iteratorError3; } } } } }, { key: 'onShow', value: function onShow() { var _iteratorNormalCompletion4 = true; var _didIteratorError4 = false; var _iteratorError4 = undefined; try { for (var _iterator4 = this.inputComponents()[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { var comp = _step4.value; if (comp.respondTo('onShow')) { comp.onShow(); } } } catch (err) { _didIteratorError4 = true; _iteratorError4 = err; } finally { try { if (!_iteratorNormalCompletion4 && _iterator4.return) { _iterator4.return(); } } finally { if (_didIteratorError4) { throw _iteratorError4; } } } } // Called whenever a container is about to be submitted. // returns true on success // returns on failure return an error object that can be processed by VErrors: // { email: ["email must be filled", "email must be from your domain"] } // { :page: ["must be filled"] } }, { key: 'validate', value: function validate(form, params) { console.debug('Form validate', form, params); var errors = []; var _iteratorNormalCompletion5 = true; var _didIteratorError5 = false; var _iteratorError5 = undefined; try { for (var _iterator5 = this.inputComponents()[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { var comp = _step5.value; if (comp.respondTo('validate')) { var result = comp.validate(form, params); if (result !== true) { errors.push(result); } } } } catch (err) { _didIteratorError5 = true; _iteratorError5 = err; } finally { try { if (!_iteratorNormalCompletion5 && _iterator5.return) { _iterator5.return(); } } finally { if (_didIteratorError5) { throw _iteratorError5; } } } return errors; } }, { key: 'isDirty', value: function isDirty() { // A container is dirty if any of its dirtyable inputs is dirty: return this.inputComponents().filter(function (component) { return component.respondTo('isDirty'); }).map(function (component) { return component.isDirty(); }).some(Boolean); } }]); return VBaseContainer; }(__WEBPACK_IMPORTED_MODULE_0__base_component__["a" /* VBaseComponent */]); /***/ }), /* 11 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return dirtyableMixin; }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var dirtyableMixin = function dirtyableMixin(Base) { return function (_Base) { _inherits(_class, _Base); function _class() { _classCallCheck(this, _class); return _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments)); } _createClass(_class, [{ key: 'isDirty', value: function isDirty() { // Implement in extending classes. throw new Error('Implement isDirty()'); } }, { key: 'originalValue', get: function get() { return this._originalValue; }, set: function set(value) { this._originalValue = value; } }, { key: 'dirtyable', get: function get() { if (!this.element) { return false; } return this.element.hasAttribute('data-dirtyable'); } }]); return _class; }(Base); }; /***/ }), /* 12 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VBase; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_core_js_features_array_flat__ = __webpack_require__(61); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_core_js_features_array_flat___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_core_js_features_array_flat__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_core_js_features_array_flat_map__ = __webpack_require__(191); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_core_js_features_array_flat_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_core_js_features_array_flat_map__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__errors__ = __webpack_require__(31); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_urls__ = __webpack_require__(195); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var VBase = function (_VUrls) { _inherits(VBase, _VUrls); function VBase(options, root) { _classCallCheck(this, VBase); var _this = _possibleConstructorReturn(this, (VBase.__proto__ || Object.getPrototypeOf(VBase)).call(this)); _this.options = options; _this.root = root; return _this; } _createClass(VBase, [{ key: 'clearErrors', value: function clearErrors() { new __WEBPACK_IMPORTED_MODULE_2__errors__["a" /* VErrors */](this.root).clearErrors(); } }, { key: 'parentElement', value: function parentElement() { return this.root.getElementById(this.options.__parent_id__); } /** * taggedInputs retrieves all components matching this event's input_tag * value. * @return {NodeList} */ }, { key: 'taggedInputs', value: function taggedInputs() { var inputTag = this.options.input_tag; if (!inputTag) { return []; } var selector = '[data-input-tag="' + inputTag + '"]'; var inputs = this.root.querySelectorAll(selector); if (inputs.length < 1) { console.warn('input_tag ' + inputTag + ' matched 0 elements. Are you sure' + 'you\'ve specified the correct value?'); } return inputs; } /** * inputs retrieves relevant input elements for this event. * * - If an `input_tag` has been provided, all matching tagged elements are * included. * - If this component is a input element, it is included. * - If this component has input elements, its input elements are included. * If not, the input elements of the nearest container (dialog or content) * are included. * @return {Array<HTMLElement>} */ }, { key: 'inputs', value: function inputs() { var components = []; // Collect tagged components, if applicable: if (this.options.input_tag) { var taggedComponents = Array.from(this.taggedInputs()).filter(function (element) { return element.vComponent; }).map(function (element) { return element.vComponent; }); components.push(taggedComponents); } var comp = this.component(); if (comp) { // Include ourselves if we're a form field component, but not a // container: if (comp.respondTo('prepareSubmit') && !comp.respondTo('inputs')) { components.push(comp); } else if (!comp.respondTo('inputs')) { // Defer to the component's closest container (card, content, // dialog, or form) if the component itself does not respond to // `inputs`: comp = this.closestContainer(); } } // If the caller requested tagged_inputs assume they only want those inputs posted and // DO NOT include additional input from the component // I reverted this temporarily as it caused some unintended behavior in. I am going to discuss with the dev // team and revisit in a later release. if (comp && comp.respondTo('inputs')) { //} && !this.options.input_tag) { components.push(comp); } // Map components to elements. // Containers are mapped to their child elements. // Form field components are mapped to their own element. var elements = components.flat().flatMap(function (comp) { if (comp.respondTo('inputs')) { return Array.from(comp.inputs()); } else if (comp.respondTo('prepareSubmit')) { return comp.element; } }); // Deduplicate: return Array.from(new Set(elements)); } /** * inputComponents retrieves the Component for each of this event's * relevant input elements. * @return {Array<VBaseComponent>} */ }, { key: 'inputComponents', value: function inputComponents() { return this.inputs().filter(function (element) { return element.vComponent; }).map(function (element) { return element.vComponent; }); } /** * inputValues retrieves submit values for each of this event's relevant * input elements. * @return {Array} */ }, { key: 'inputValues', value: function inputValues() { var params = []; this.inputComponents().filter(function (comp) { return comp.respondTo('prepareSubmit'); }).map(function (comp) { return comp.prepareSubmit(params); }); return params; } }, { key: 'component', value: function component() { var parent = this.parentElement(); return parent ? parent.vComponent : null; } }, { key: 'validate', value: function validate(formData) { return this.inputComponents().filter(function (comp) { return comp.respondTo('validate'); }).map(function (comp) { return comp.validate(formData); }).filter(function (errors) { return errors !== true && errors !== undefined; }); } }, { key: 'closestContainer', value: function closestContainer() { var element = this.closestContainerElement(); if (!element) { return null; } return element.vComponent; } }, { key: 'closestContainerElement', value: function closestContainerElement() { var comp = this.component(); if (!(comp && comp.element)) { return null; } return comp.element.closest('[data-is-container]'); } }]); return VBase; }(__WEBPACK_IMPORTED_MODULE_3__utils_urls__["a" /* VUrls */]); /***/ }), /* 13 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; }); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var cssClasses = { FIXED_CLASS: 'mdc-top-app-bar--fixed', FIXED_SCROLLED_CLASS: 'mdc-top-app-bar--fixed-scrolled', SHORT_CLASS: 'mdc-top-app-bar--short', SHORT_COLLAPSED_CLASS: 'mdc-top-app-bar--short-collapsed', SHORT_HAS_ACTION_ITEM_CLASS: 'mdc-top-app-bar--short-has-action-item' }; var numbers = { DEBOUNCE_THROTTLE_RESIZE_TIME_MS: 100, MAX_TOP_APP_BAR_HEIGHT: 128 }; var strings = { ACTION_ITEM_SELECTOR: '.mdc-top-app-bar__action-item', NAVIGATION_EVENT: 'MDCTopAppBar:nav', NAVIGATION_ICON_SELECTOR: '.mdc-top-app-bar__navigation-icon', ROOT_SELECTOR: '.mdc-top-app-bar', TITLE_SELECTOR: '.mdc-top-app-bar__title' }; //# sourceMappingURL=constants.js.map /***/ }), /* 14 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["c"] = __extends; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _assign; }); /* unused harmony export __rest */ /* unused harmony export __decorate */ /* unused harmony export __param */ /* unused harmony export __metadata */ /* harmony export (immutable) */ __webpack_exports__["b"] = __awaiter; /* harmony export (immutable) */ __webpack_exports__["d"] = __generator; /* unused harmony export __exportStar */ /* unused harmony export __values */ /* unused harmony export __read */ /* unused harmony export __spread */ /* unused harmony export __spreadArrays */ /* unused harmony export __await */ /* unused harmony export __asyncGenerator */ /* unused harmony export __asyncDelegator */ /* unused harmony export __asyncValues */ /* unused harmony export __makeTemplateObject */ /* unused harmony export __importStar */ /* unused harmony export __importDefault */ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ /* global Reflect, Promise */ var _extendStatics = function extendStatics(d, b) { _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) d[p] = b[p]; } }; return _extendStatics(d, b); }; function __extends(d, b) { _extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } var _assign = function __assign() { _assign = Object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } } return t; }; return _assign.apply(this, arguments); }; function __rest(s, e) { var t = {}; for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; }if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; } function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) { if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; }return c > 3 && r && Object.defineProperty(target, key, r), r; } function __param(paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); }; } function __metadata(metadataKey, metadataValue) { if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); } function __awaiter(thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } function __generator(thisArg, body) { var _ = { label: 0, sent: function sent() { if (t[0] & 1) throw t[1];return t[1]; }, trys: [], ops: [] }, f, y, t, g; return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (_) { try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0:case 1: t = op;break; case 4: _.label++;return { value: op[1], done: false }; case 5: _.label++;y = op[1];op = [0];continue; case 7: op = _.ops.pop();_.trys.pop();continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0;continue; } if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { _.label = op[1];break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1];t = op;break; } if (t && _.label < t[2]) { _.label = t[2];_.ops.push(op);break; } if (t[2]) _.ops.pop(); _.trys.pop();continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e];y = 0; } finally { f = t = 0; } }if (op[0] & 5) throw op[1];return { value: op[0] ? op[1] : void 0, done: true }; } } function __exportStar(m, exports) { for (var p in m) { if (!exports.hasOwnProperty(p)) exports[p] = m[p]; } } function __values(o) { var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; if (m) return m.call(o); return { next: function next() { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; } function __read(o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) { ar.push(r.value); } } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; } function __spread() { for (var ar = [], i = 0; i < arguments.length; i++) { ar = ar.concat(__read(arguments[i])); }return ar; } function __spreadArrays() { for (var s = 0, i = 0, il = arguments.length; i < il; i++) { s += arguments[i].length; }for (var r = Array(s), k = 0, i = 0; i < il; i++) { for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) { r[k] = a[j]; } }return r; }; function __await(v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } function __asyncGenerator(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g = generator.apply(thisArg, _arguments || []), i, q = []; return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } } function __asyncDelegator(o) { var i, p; return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } } function __asyncValues(o) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var m = o[Symbol.asyncIterator], i; return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); } } function __makeTemplateObject(cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; }; function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) { if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; }result.default = mod; return result; } function __importDefault(mod) { return mod && mod.__esModule ? mod : { default: mod }; } /***/ }), /* 15 */ /***/ (function(module, exports) { var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var g; // This works in non-strict mode g = function () { return this; }(); try { // This works if eval is allowed (see CSP) g = g || Function("return this")() || (1, eval)("this"); } catch (e) { // This works if the window reference is available if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === "object") g = window; } // g can still be undefined, but nothing to do about it... // We return undefined, instead of nothing here, so it's // easier to handle this case. if(!global) { ...} module.exports = g; /***/ }), /* 16 */ /***/ (function(module, exports, __webpack_require__) { var fails = __webpack_require__(17); // Thank's IE8 for his funny defineProperty module.exports = !fails(function () { return Object.defineProperty({}, 'a', { get: function get() { return 7; } }).a != 7; }); /***/ }), /* 17 */ /***/ (function(module, exports) { module.exports = function (exec) { try { return !!exec(); } catch (error) { return true; } }; /***/ }), /* 18 */ /***/ (function(module, exports) { var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; module.exports = function (it) { return (typeof it === 'undefined' ? 'undefined' : _typeof(it)) === 'object' ? it !== null : typeof it === 'function'; }; /***/ }), /* 19 */ /***/ (function(module, exports) { var hasOwnProperty = {}.hasOwnProperty; module.exports = function (it, key) { return hasOwnProperty.call(it, key); }; /***/ }), /* 20 */ /***/ (function(module, exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__(16); var definePropertyModule = __webpack_require__(33); var createPropertyDescriptor = __webpack_require__(64); module.exports = DESCRIPTORS ? function (object, key, value) { return definePropertyModule.f(object, key, createPropertyDescriptor(1, value)); } : function (object, key, value) { object[key] = value; return object; }; /***/ }), /* 21 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(18); module.exports = function (it) { if (!isObject(it)) { throw TypeError(String(it) + ' is not an object'); }return it; }; /***/ }), /* 22 */ /***/ (function(module, exports, __webpack_require__) { var IS_PURE = __webpack_require__(157); var store = __webpack_require__(158); (module.exports = function (key, value) { return store[key] || (store[key] = value !== undefined ? value : {}); })('versions', []).push({ version: '3.3.2', mode: IS_PURE ? 'pure' : 'global', copyright: '© 2019 Denis Pushkarev (zloirock.ru)' }); /***/ }), /* 23 */ /***/ (function(module, exports, __webpack_require__) { var toInteger = __webpack_require__(36); var min = Math.min; // `ToLength` abstract operation // https://tc39.github.io/ecma262/#sec-tolength module.exports = function (argument) { return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 }; /***/ }), /* 24 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = expandParam; /* harmony export (immutable) */ __webpack_exports__["b"] = expandParams; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var VActionParameter = function () { function VActionParameter(options) { _classCallCheck(this, VActionParameter); this.value = options.value; this.response_index = options.response_index; } _createClass(VActionParameter, [{ key: 'fetchValue', value: function fetchValue(results) { var result = results[results.length - this.response_index - 1]; return this.resolve(this.value, JSON.parse(result.content)); } }, { key: 'resolve', value: function resolve(path, obj) { return this.value.reduce(function (prev, curr) { return prev ? prev[curr] : null; }, obj || self); } }]); return VActionParameter; }(); function isObject(thing) { return thing && (typeof thing === 'undefined' ? 'undefined' : _typeof(thing)) === 'object'; } /** * expandParam resolves an parameter `value` to a primitive value * according to the given path for the parameter in `results`. * If the `value` is not an action_parameter, it is returned unaltered. * @param {Object} results An action's results * @param {*} value The value of the parameter * @return {*} A resolved primitive value */ function expandParam(results, value) { if (isObject(value) && value.type === 'action_parameter') { return new VActionParameter(value).fetchValue(results); } return value; } /** * expandParams resolves all values in `params` to primitive values. * * Primitive values are passed through unaltered. * Values of action_parameter parameters are resolved to primitive values * via `results`. * @param {Object} results An action's results * @param {Object} params An action's parameters * @return {Object} */ function expandParams(results, params) { var expandedParams = {}; var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = Object.entries(params)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var _ref = _step.value; var _ref2 = _slicedToArray(_ref, 2); var key = _ref2[0]; var value = _ref2[1]; if (!isObject(value) || value.type === 'action_parameter') { expandedParams[key] = expandParam(results, value); } else { expandedParams[key] = expandParams(results, value); } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } return expandedParams; } /***/ }), /* 25 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return cssClasses; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return strings; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return numbers; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return CornerBit; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Corner; }); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var cssClasses = { ANCHOR: 'mdc-menu-surface--anchor', ANIMATING_CLOSED: 'mdc-menu-surface--animating-closed', ANIMATING_OPEN: 'mdc-menu-surface--animating-open', FIXED: 'mdc-menu-surface--fixed', OPEN: 'mdc-menu-surface--open', ROOT: 'mdc-menu-surface' }; // tslint:disable:object-literal-sort-keys var strings = { CLOSED_EVENT: 'MDCMenuSurface:closed', OPENED_EVENT: 'MDCMenuSurface:opened', FOCUSABLE_ELEMENTS: ['button:not(:disabled)', '[href]:not([aria-disabled="true"])', 'input:not(:disabled)', 'select:not(:disabled)', 'textarea:not(:disabled)', '[tabindex]:not([tabindex="-1"]):not([aria-disabled="true"])'].join(', ') }; // tslint:enable:object-literal-sort-keys var numbers = { /** Total duration of menu-surface open animation. */ TRANSITION_OPEN_DURATION: 120, /** Total duration of menu-surface close animation. */ TRANSITION_CLOSE_DURATION: 75, /** Margin left to the edge of the viewport when menu-surface is at maximum possible height. */ MARGIN_TO_EDGE: 32, /** Ratio of anchor width to menu-surface width for switching from corner positioning to center positioning. */ ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO: 0.67 }; /** * Enum for bits in the {@see Corner) bitmap. */ var CornerBit; (function (CornerBit) { CornerBit[CornerBit["BOTTOM"] = 1] = "BOTTOM"; CornerBit[CornerBit["CENTER"] = 2] = "CENTER"; CornerBit[CornerBit["RIGHT"] = 4] = "RIGHT"; CornerBit[CornerBit["FLIP_RTL"] = 8] = "FLIP_RTL"; })(CornerBit || (CornerBit = {})); /** * Enum for representing an element corner for positioning the menu-surface. * * The START constants map to LEFT if element directionality is left * to right and RIGHT if the directionality is right to left. * Likewise END maps to RIGHT or LEFT depending on the directionality. */ var Corner; (function (Corner) { Corner[Corner["TOP_LEFT"] = 0] = "TOP_LEFT"; Corner[Corner["TOP_RIGHT"] = 4] = "TOP_RIGHT"; Corner[Corner["BOTTOM_LEFT"] = 1] = "BOTTOM_LEFT"; Corner[Corner["BOTTOM_RIGHT"] = 5] = "BOTTOM_RIGHT"; Corner[Corner["TOP_START"] = 8] = "TOP_START"; Corner[Corner["TOP_END"] = 12] = "TOP_END"; Corner[Corner["BOTTOM_START"] = 9] = "BOTTOM_START"; Corner[Corner["BOTTOM_END"] = 13] = "BOTTOM_END"; })(Corner || (Corner = {})); //# sourceMappingURL=constants.js.map /***/ }), /* 26 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return cssClasses; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return strings; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return numbers; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DefaultFocusState; }); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var cssClasses = { MENU_SELECTED_LIST_ITEM: 'mdc-menu-item--selected', MENU_SELECTION_GROUP: 'mdc-menu__selection-group', ROOT: 'mdc-menu' }; var strings = { ARIA_CHECKED_ATTR: 'aria-checked', ARIA_DISABLED_ATTR: 'aria-disabled', CHECKBOX_SELECTOR: 'input[type="checkbox"]', LIST_SELECTOR: '.mdc-list', SELECTED_EVENT: 'MDCMenu:selected' }; var numbers = { FOCUS_ROOT_INDEX: -1 }; var DefaultFocusState; (function (DefaultFocusState) { DefaultFocusState[DefaultFocusState["NONE"] = 0] = "NONE"; DefaultFocusState[DefaultFocusState["LIST_ROOT"] = 1] = "LIST_ROOT"; DefaultFocusState[DefaultFocusState["FIRST_ITEM"] = 2] = "FIRST_ITEM"; DefaultFocusState[DefaultFocusState["LAST_ITEM"] = 3] = "LAST_ITEM"; })(DefaultFocusState || (DefaultFocusState = {})); //# sourceMappingURL=constants.js.map /***/ }), /* 27 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VBaseToggle; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__base_component__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_event_handler__ = __webpack_require__(4); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__mixins_dirtyable__ = __webpack_require__(11); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var VBaseToggle = function (_dirtyableMixin) { _inherits(VBaseToggle, _dirtyableMixin); function VBaseToggle(element, mdcComponent) { _classCallCheck(this, VBaseToggle); var _this = _possibleConstructorReturn(this, (VBaseToggle.__proto__ || Object.getPrototypeOf(VBaseToggle)).call(this, element, mdcComponent)); _this.input = element.querySelector('input') || element; element.addEventListener('V:postFailed', function (event) { // Revert to previous checked state on failed post. _this.mdcComponent.checked = !_this.mdcComponent.checked; }); _this.originalValue = _this.input.checked; return _this; } _createClass(VBaseToggle, [{ key: 'prepareSubmit', value: function prepareSubmit(params) { if (this.submittedValue()) { params.push([this.name(), this.submittedValue()]); } } }, { key: 'submittedValue', value: function submittedValue() { return this.input.checked ? this.value() : this.offValue(); } }, { key: 'name', value: function name() { return this.input.name; } }, { key: 'value', value: function value() { return this.input.value; } }, { key: 'offValue', value: function offValue() { return this.input.dataset.off; } }, { key: 'clear', value: function clear() { this.input.checked = false; } }, { key: 'reset', value: function reset() { this.input.checked = this.originalValue; } }, { key: 'setValue', value: function setValue(value) { this.input.value = value; } }, { key: 'isDirty', value: function isDirty() { return this.dirtyable && this.input.checked !== this.originalValue; } }]); return VBaseToggle; }(Object(__WEBPACK_IMPORTED_MODULE_2__mixins_dirtyable__["a" /* dirtyableMixin */])(Object(__WEBPACK_IMPORTED_MODULE_1__mixins_event_handler__["a" /* eventHandlerMixin */])(__WEBPACK_IMPORTED_MODULE_0__base_component__["a" /* VBaseComponent */]))); /***/ }), /* 28 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; }); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var cssClasses = { CLOSING: 'mdc-snackbar--closing', OPEN: 'mdc-snackbar--open', OPENING: 'mdc-snackbar--opening' }; var strings = { ACTION_SELECTOR: '.mdc-snackbar__action', ARIA_LIVE_LABEL_TEXT_ATTR: 'data-mdc-snackbar-label-text', CLOSED_EVENT: 'MDCSnackbar:closed', CLOSING_EVENT: 'MDCSnackbar:closing', DISMISS_SELECTOR: '.mdc-snackbar__dismiss', LABEL_SELECTOR: '.mdc-snackbar__label', OPENED_EVENT: 'MDCSnackbar:opened', OPENING_EVENT: 'MDCSnackbar:opening', REASON_ACTION: 'action', REASON_DISMISS: 'dismiss', SURFACE_SELECTOR: '.mdc-snackbar__surface' }; var numbers = { DEFAULT_AUTO_DISMISS_TIMEOUT_MS: 5000, MAX_AUTO_DISMISS_TIMEOUT_MS: 10000, MIN_AUTO_DISMISS_TIMEOUT_MS: 4000, // These variables need to be kept in sync with the values in _variables.scss. SNACKBAR_ANIMATION_CLOSE_TIME_MS: 75, SNACKBAR_ANIMATION_OPEN_TIME_MS: 150, /** * Number of milliseconds to wait between temporarily clearing the label text * in the DOM and subsequently restoring it. This is necessary to force IE 11 * to pick up the `aria-live` content change and announce it to the user. */ ARIA_LIVE_DELAY_MS: 1000 }; //# sourceMappingURL=constants.js.map /***/ }), /* 29 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["b"] = getCorrectPropertyName; /* harmony export (immutable) */ __webpack_exports__["a"] = getCorrectEventName; /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var cssPropertyNameMap = { animation: { prefixed: '-webkit-animation', standard: 'animation' }, transform: { prefixed: '-webkit-transform', standard: 'transform' }, transition: { prefixed: '-webkit-transition', standard: 'transition' } }; var jsEventTypeMap = { animationend: { cssProperty: 'animation', prefixed: 'webkitAnimationEnd', standard: 'animationend' }, animationiteration: { cssProperty: 'animation', prefixed: 'webkitAnimationIteration', standard: 'animationiteration' }, animationstart: { cssProperty: 'animation', prefixed: 'webkitAnimationStart', standard: 'animationstart' }, transitionend: { cssProperty: 'transition', prefixed: 'webkitTransitionEnd', standard: 'transitionend' } }; function isWindow(windowObj) { return Boolean(windowObj.document) && typeof windowObj.document.createElement === 'function'; } function getCorrectPropertyName(windowObj, cssProperty) { if (isWindow(windowObj) && cssProperty in cssPropertyNameMap) { var el = windowObj.document.createElement('div'); var _a = cssPropertyNameMap[cssProperty], standard = _a.standard, prefixed = _a.prefixed; var isStandard = standard in el.style; return isStandard ? standard : prefixed; } return cssProperty; } function getCorrectEventName(windowObj, eventType) { if (isWindow(windowObj) && eventType in jsEventTypeMap) { var el = windowObj.document.createElement('div'); var _a = jsEventTypeMap[eventType], standard = _a.standard, prefixed = _a.prefixed, cssProperty = _a.cssProperty; var isStandard = cssProperty in el.style; return isStandard ? standard : prefixed; } return eventType; } //# sourceMappingURL=util.js.map /***/ }), /* 30 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["b"] = supportsCssVariables; /* harmony export (immutable) */ __webpack_exports__["a"] = getNormalizedEventCoords; /** * Stores result from supportsCssVariables to avoid redundant processing to * detect CSS custom variable support. */ var supportsCssVariables_; function detectEdgePseudoVarBug(windowObj) { // Detect versions of Edge with buggy var() support // See: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/11495448/ var document = windowObj.document; var node = document.createElement('div'); node.className = 'mdc-ripple-surface--test-edge-var-bug'; // Append to head instead of body because this script might be invoked in the // head, in which case the body doesn't exist yet. The probe works either way. document.head.appendChild(node); // The bug exists if ::before style ends up propagating to the parent element. // Additionally, getComputedStyle returns null in iframes with display: "none" in Firefox, // but Firefox is known to support CSS custom properties correctly. // See: https://bugzilla.mozilla.org/show_bug.cgi?id=548397 var computedStyle = windowObj.getComputedStyle(node); var hasPseudoVarBug = computedStyle !== null && computedStyle.borderTopStyle === 'solid'; if (node.parentNode) { node.parentNode.removeChild(node); } return hasPseudoVarBug; } function supportsCssVariables(windowObj, forceRefresh) { if (forceRefresh === void 0) { forceRefresh = false; } var CSS = windowObj.CSS; var supportsCssVars = supportsCssVariables_; if (typeof supportsCssVariables_ === 'boolean' && !forceRefresh) { return supportsCssVariables_; } var supportsFunctionPresent = CSS && typeof CSS.supports === 'function'; if (!supportsFunctionPresent) { return false; } var explicitlySupportsCssVars = CSS.supports('--css-vars', 'yes'); // See: https://bugs.webkit.org/show_bug.cgi?id=154669 // See: README section on Safari var weAreFeatureDetectingSafari10plus = CSS.supports('(--css-vars: yes)') && CSS.supports('color', '#00000000'); if (explicitlySupportsCssVars || weAreFeatureDetectingSafari10plus) { supportsCssVars = !detectEdgePseudoVarBug(windowObj); } else { supportsCssVars = false; } if (!forceRefresh) { supportsCssVariables_ = supportsCssVars; } return supportsCssVars; } function getNormalizedEventCoords(evt, pageOffset, clientRect) { if (!evt) { return { x: 0, y: 0 }; } var x = pageOffset.x, y = pageOffset.y; var documentX = x + clientRect.left; var documentY = y + clientRect.top; var normalizedX; var normalizedY; // Determine touch point relative to the ripple container. if (evt.type === 'touchstart') { var touchEvent = evt; normalizedX = touchEvent.changedTouches[0].pageX - documentX; normalizedY = touchEvent.changedTouches[0].pageY - documentY; } else { var mouseEvent = evt; normalizedX = mouseEvent.pageX - documentX; normalizedY = mouseEvent.pageY - documentY; } return { x: normalizedX, y: normalizedY }; } //# sourceMappingURL=util.js.map /***/ }), /* 31 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VErrors; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_core_js_features_array_flat__ = __webpack_require__(61); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_core_js_features_array_flat___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_core_js_features_array_flat__); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /** * mapObject transforms an object's key-value pairs via the provided function. * @param {Object} object * @param {Function} fn A mapping function suitable for use with Array.map * @return {Object} */ function mapObject(object, fn) { return Object.entries(object).map(fn).reduce(function (obj, _ref) { var _ref2 = _slicedToArray(_ref, 2), k = _ref2[0], v = _ref2[1]; return Object.assign(obj, _defineProperty({}, [k], v)); }, {}); } /* Attempt to interpret and serialize the following cases for display: A: Rails errors: 1. { "name": ["Requires name"] } B: Validation errors: 1. { :email => ["must be filled"] } 2. { :fees => 0 => { :fee => ["must be filled", "must be greater than zero"] } } C: Custom errors and client-side exceptions: 1. { :email => "must be filled" } 2. { exception: 'Something bad happened' } D: Logical errors: 1. "undefined method `map' for nil:NilClass" */ var VErrors = function () { function VErrors(root, target) { _classCallCheck(this, VErrors); this.root = root; this.target = target; } _createClass(VErrors, [{ key: 'clearErrors', value: function clearErrors() { var errorMessages = this.root.querySelectorAll('.v-error-message'); for (var i = 0; i < errorMessages.length; i++) { errorMessages[i].remove(); } } /** * normalize attempts to convert the various error structures described * above into a single consistent structure by replacing error arrays * with joined strings. * @param {Object} errors * @return {Object} */ }, { key: 'normalize', value: function normalize(errors) { var _this = this; if (!errors) { return {}; } // Normalize case D into case C-1: if (typeof errors === 'string') { errors = { error: errors }; } return mapObject(errors, function (_ref3) { var _ref4 = _slicedToArray(_ref3, 2), k = _ref4[0], v = _ref4[1]; var result = null; // Case C, a single key-value pair: if (typeof v === 'string') { // Normalize case C into case A/B-1: v = [v]; } if (Array.isArray(v)) { // Case A and B-1: an array of error messages: result = v.join(', '); } else if (v.constructor === Object) { // Case B-2: a nested structure: result = _this.normalize(v); } else { throw new Error('Cannot normalize value of type ' + (typeof v === 'undefined' ? 'undefined' : _typeof(v))); } return [k, result]; }); } /** * flatten attempts to extract all human-readable error messages from an * arbitrary error structure, yielding a flat array of strings. * @param {Object} errors * @return {Array<String>} */ }, { key: 'flatten', value: function flatten(errors) { var _this2 = this; if (!errors) { return []; } // Normalize case D into case C-1: if (typeof errors === 'string') { errors = { error: errors }; } var object = mapObject(errors, function (_ref5) { var _ref6 = _slicedToArray(_ref5, 2), k = _ref6[0], v = _ref6[1]; var result = null; if (typeof v === 'string') { result = v; } else if (v.constructor === Object) { result = _this2.flatten(v); } else { throw new Error('Cannot flatten value of type ' + (typeof v === 'undefined' ? 'undefined' : _typeof(v))); } return [k, result]; }); return Object.values(object).flat(); } }, { key: 'displayErrors', value: function displayErrors(result) { var statusCode = result.statusCode, contentType = result.contentType, content = result.content; var responseErrors = null; if (contentType && contentType.includes('application/json')) { responseErrors = JSON.parse(content); } else if (contentType && contentType.includes('v/errors')) { responseErrors = content; } if (responseErrors) { if (!Array.isArray(responseErrors)) { responseErrors = [responseErrors]; } var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = responseErrors[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var response = _step.value; var normalizedResponse = this.normalize(response); var errors = normalizedResponse.errors ? normalizedResponse.errors : normalizedResponse; if (errors.constructor === String) { this.prependErrors([errors]); } else { for (var key in errors) { if (!this.displayInputError(key, errors[key])) { // If not handled at the field level, display at the page level if (errors[key].length > 0) { this.prependErrors([errors[key]]); } } } } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } } else if (statusCode === 0) { this.prependErrors(['Unable to contact server. Please check that you are online and retry.']); } else { this.prependErrors(['The server returned an unexpected response! Status: ' + statusCode]); } } // Sets the helper text on the field // Returns true if it was able to set the error on the control }, { key: 'displayInputError', value: function displayInputError(id, message) { var currentEl = this.root.getElementById(id) || this.root.getElementsByName(id)[0]; if (!currentEl) { return false; } var helperText = this.root.getElementById(currentEl.id + '-helper-text'); if (!helperText) { return false; } helperText.innerHTML = message; currentEl.classList.add('mdc-text-field--invalid'); helperText.classList.add('mdc-text-field-helper-text--validation-msg'); helperText.classList.remove('v-hidden'); return true; } // Creates a div before the element with the same id as the error // Used to display an error message without their being an input field to // attach the error to }, { key: 'prependErrors', value: function prependErrors(messages) { var errorsDiv = this.findNearestErrorDiv(); if (!errorsDiv) { console.error('Unable to display Errors! ', messages); return false; } var newDiv = document.createElement('div'); newDiv.classList.add('v-error-message'); newDiv.insertAdjacentHTML('beforeend', messages.join('<br>')); // add the newly created element and its content into the DOM if (errorsDiv.clientTop < 10) { errorsDiv.scrollIntoView(); } errorsDiv.insertAdjacentElement('beforebegin', newDiv); return true; } }, { key: 'findNearestErrorDiv', value: function findNearestErrorDiv() { if (this.target) { return this.target.closest('.v-errors'); } return this.root.querySelector('.v-errors'); } }]); return VErrors; }(); /***/ }), /* 32 */ /***/ (function(module, exports, __webpack_require__) { // toObject with fallback for non-array-like ES3 strings var IndexedObject = __webpack_require__(155); var requireObjectCoercible = __webpack_require__(66); module.exports = function (it) { return IndexedObject(requireObjectCoercible(it)); }; /***/ }), /* 33 */ /***/ (function(module, exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__(16); var IE8_DOM_DEFINE = __webpack_require__(68); var anObject = __webpack_require__(21); var toPrimitive = __webpack_require__(67); var nativeDefineProperty = Object.defineProperty; // `Object.defineProperty` method // https://tc39.github.io/ecma262/#sec-object.defineproperty exports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) { anObject(O); P = toPrimitive(P, true); anObject(Attributes); if (IE8_DOM_DEFINE) try { return nativeDefineProperty(O, P, Attributes); } catch (error) {/* empty */} if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; /***/ }), /* 34 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(7); var createNonEnumerableProperty = __webpack_require__(20); module.exports = function (key, value) { try { createNonEnumerableProperty(global, key, value); } catch (error) { global[key] = value; }return value; }; /***/ }), /* 35 */ /***/ (function(module, exports) { module.exports = {}; /***/ }), /* 36 */ /***/ (function(module, exports) { var ceil = Math.ceil; var floor = Math.floor; // `ToInteger` abstract operation // https://tc39.github.io/ecma262/#sec-tointeger module.exports = function (argument) { return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument); }; /***/ }), /* 37 */ /***/ (function(module, exports) { // IE8- don't enum bug keys module.exports = ['constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf']; /***/ }), /* 38 */ /***/ (function(module, exports, __webpack_require__) { var tabbable = __webpack_require__(177); var xtend = __webpack_require__(178); var activeFocusDelay; var activeFocusTraps = function () { var trapQueue = []; return { activateTrap: function activateTrap(trap) { if (trapQueue.length > 0) { var activeTrap = trapQueue[trapQueue.length - 1]; if (activeTrap !== trap) { activeTrap.pause(); } } var trapIndex = trapQueue.indexOf(trap); if (trapIndex === -1) { trapQueue.push(trap); } else { // move this existing trap to the front of the queue trapQueue.splice(trapIndex, 1); trapQueue.push(trap); } }, deactivateTrap: function deactivateTrap(trap) { var trapIndex = trapQueue.indexOf(trap); if (trapIndex !== -1) { trapQueue.splice(trapIndex, 1); } if (trapQueue.length > 0) { trapQueue[trapQueue.length - 1].unpause(); } } }; }(); function focusTrap(element, userOptions) { var doc = document; var container = typeof element === 'string' ? doc.querySelector(element) : element; var config = xtend({ returnFocusOnDeactivate: true, escapeDeactivates: true }, userOptions); var state = { firstTabbableNode: null, lastTabbableNode: null, nodeFocusedBeforeActivation: null, mostRecentlyFocusedNode: null, active: false, paused: false }; var trap = { activate: activate, deactivate: deactivate, pause: pause, unpause: unpause }; return trap; function activate(activateOptions) { if (state.active) return; updateTabbableNodes(); state.active = true; state.paused = false; state.nodeFocusedBeforeActivation = doc.activeElement; var onActivate = activateOptions && activateOptions.onActivate ? activateOptions.onActivate : config.onActivate; if (onActivate) { onActivate(); } addListeners(); return trap; } function deactivate(deactivateOptions) { if (!state.active) return; clearTimeout(activeFocusDelay); removeListeners(); state.active = false; state.paused = false; activeFocusTraps.deactivateTrap(trap); var onDeactivate = deactivateOptions && deactivateOptions.onDeactivate !== undefined ? deactivateOptions.onDeactivate : config.onDeactivate; if (onDeactivate) { onDeactivate(); } var returnFocus = deactivateOptions && deactivateOptions.returnFocus !== undefined ? deactivateOptions.returnFocus : config.returnFocusOnDeactivate; if (returnFocus) { delay(function () { tryFocus(state.nodeFocusedBeforeActivation); }); } return trap; } function pause() { if (state.paused || !state.active) return; state.paused = true; removeListeners(); } function unpause() { if (!state.paused || !state.active) return; state.paused = false; updateTabbableNodes(); addListeners(); } function addListeners() { if (!state.active) return; // There can be only one listening focus trap at a time activeFocusTraps.activateTrap(trap); // Delay ensures that the focused element doesn't capture the event // that caused the focus trap activation. activeFocusDelay = delay(function () { tryFocus(getInitialFocusNode()); }); doc.addEventListener('focusin', checkFocusIn, true); doc.addEventListener('mousedown', checkPointerDown, { capture: true, passive: false }); doc.addEventListener('touchstart', checkPointerDown, { capture: true, passive: false }); doc.addEventListener('click', checkClick, { capture: true, passive: false }); doc.addEventListener('keydown', checkKey, { capture: true, passive: false }); return trap; } function removeListeners() { if (!state.active) return; doc.removeEventListener('focusin', checkFocusIn, true); doc.removeEventListener('mousedown', checkPointerDown, true); doc.removeEventListener('touchstart', checkPointerDown, true); doc.removeEventListener('click', checkClick, true); doc.removeEventListener('keydown', checkKey, true); return trap; } function getNodeForOption(optionName) { var optionValue = config[optionName]; var node = optionValue; if (!optionValue) { return null; } if (typeof optionValue === 'string') { node = doc.querySelector(optionValue); if (!node) { throw new Error('`' + optionName + '` refers to no known node'); } } if (typeof optionValue === 'function') { node = optionValue(); if (!node) { throw new Error('`' + optionName + '` did not return a node'); } } return node; } function getInitialFocusNode() { var node; if (getNodeForOption('initialFocus') !== null) { node = getNodeForOption('initialFocus'); } else if (container.contains(doc.activeElement)) { node = doc.activeElement; } else { node = state.firstTabbableNode || getNodeForOption('fallbackFocus'); } if (!node) { throw new Error("You can't have a focus-trap without at least one focusable element"); } return node; } // This needs to be done on mousedown and touchstart instead of click // so that it precedes the focus event. function checkPointerDown(e) { if (container.contains(e.target)) return; if (config.clickOutsideDeactivates) { deactivate({ returnFocus: !tabbable.isFocusable(e.target) }); return; } // This is needed for mobile devices. // (If we'll only let `click` events through, // then on mobile they will be blocked anyways if `touchstart` is blocked.) if (config.allowOutsideClick && config.allowOutsideClick(e)) { return; } e.preventDefault(); } // In case focus escapes the trap for some strange reason, pull it back in. function checkFocusIn(e) { // In Firefox when you Tab out of an iframe the Document is briefly focused. if (container.contains(e.target) || e.target instanceof Document) { return; } e.stopImmediatePropagation(); tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode()); } function checkKey(e) { if (config.escapeDeactivates !== false && isEscapeEvent(e)) { e.preventDefault(); deactivate(); return; } if (isTabEvent(e)) { checkTab(e); return; } } // Hijack Tab events on the first and last focusable nodes of the trap, // in order to prevent focus from escaping. If it escapes for even a // moment it can end up scrolling the page and causing confusion so we // kind of need to capture the action at the keydown phase. function checkTab(e) { updateTabbableNodes(); if (e.shiftKey && e.target === state.firstTabbableNode) { e.preventDefault(); tryFocus(state.lastTabbableNode); return; } if (!e.shiftKey && e.target === state.lastTabbableNode) { e.preventDefault(); tryFocus(state.firstTabbableNode); return; } } function checkClick(e) { if (config.clickOutsideDeactivates) return; if (container.contains(e.target)) return; if (config.allowOutsideClick && config.allowOutsideClick(e)) { return; } e.preventDefault(); e.stopImmediatePropagation(); } function updateTabbableNodes() { var tabbableNodes = tabbable(container); state.firstTabbableNode = tabbableNodes[0] || getInitialFocusNode(); state.lastTabbableNode = tabbableNodes[tabbableNodes.length - 1] || getInitialFocusNode(); } function tryFocus(node) { if (node === doc.activeElement) return; if (!node || !node.focus) { tryFocus(getInitialFocusNode()); return; } node.focus(); state.mostRecentlyFocusedNode = node; if (isSelectableInput(node)) { node.select(); } } } function isSelectableInput(node) { return node.tagName && node.tagName.toLowerCase() === 'input' && typeof node.select === 'function'; } function isEscapeEvent(e) { return e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27; } function isTabEvent(e) { return e.key === 'Tab' || e.keyCode === 9; } function delay(fn) { return setTimeout(fn, 0); } module.exports = focusTrap; /***/ }), /* 39 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCNotchedOutline; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_floating_label_foundation__ = __webpack_require__(89); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(40); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation__ = __webpack_require__(91); /** * @license * Copyright 2017 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCNotchedOutline = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCNotchedOutline, _super); function MDCNotchedOutline() { return _super !== null && _super.apply(this, arguments) || this; } MDCNotchedOutline.attachTo = function (root) { return new MDCNotchedOutline(root); }; MDCNotchedOutline.prototype.initialSyncWithDOM = function () { this.notchElement_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].NOTCH_ELEMENT_SELECTOR); var label = this.root_.querySelector('.' + __WEBPACK_IMPORTED_MODULE_2__material_floating_label_foundation__["a" /* MDCFloatingLabelFoundation */].cssClasses.ROOT); if (label) { label.style.transitionDuration = '0s'; this.root_.classList.add(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].OUTLINE_UPGRADED); requestAnimationFrame(function () { label.style.transitionDuration = ''; }); } else { this.root_.classList.add(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].NO_LABEL); } }; /** * Updates classes and styles to open the notch to the specified width. * @param notchWidth The notch width in the outline. */ MDCNotchedOutline.prototype.notch = function (notchWidth) { this.foundation_.notch(notchWidth); }; /** * Updates classes and styles to close the notch. */ MDCNotchedOutline.prototype.closeNotch = function () { this.foundation_.closeNotch(); }; MDCNotchedOutline.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. var adapter = { addClass: function addClass(className) { return _this.root_.classList.add(className); }, removeClass: function removeClass(className) { return _this.root_.classList.remove(className); }, setNotchWidthProperty: function setNotchWidthProperty(width) { return _this.notchElement_.style.setProperty('width', width + 'px'); }, removeNotchWidthProperty: function removeNotchWidthProperty() { return _this.notchElement_.style.removeProperty('width'); } }; // tslint:enable:object-literal-sort-keys return new __WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* MDCNotchedOutlineFoundation */](adapter); }; return MDCNotchedOutline; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 40 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; }); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var strings = { NOTCH_ELEMENT_SELECTOR: '.mdc-notched-outline__notch' }; var numbers = { // This should stay in sync with $mdc-notched-outline-padding * 2. NOTCH_ELEMENT_PADDING: 8 }; var cssClasses = { NO_LABEL: 'mdc-notched-outline--no-label', OUTLINE_NOTCHED: 'mdc-notched-outline--notched', OUTLINE_UPGRADED: 'mdc-notched-outline--upgraded' }; //# sourceMappingURL=constants.js.map /***/ }), /* 41 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTextFieldCharacterCounterFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(93); /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCTextFieldCharacterCounterFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCTextFieldCharacterCounterFoundation, _super); function MDCTextFieldCharacterCounterFoundation(adapter) { return _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCTextFieldCharacterCounterFoundation.defaultAdapter, adapter)) || this; } Object.defineProperty(MDCTextFieldCharacterCounterFoundation, "cssClasses", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCTextFieldCharacterCounterFoundation, "strings", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCTextFieldCharacterCounterFoundation, "defaultAdapter", { /** * See {@link MDCTextFieldCharacterCounterAdapter} for typing information on parameters and return types. */ get: function get() { return { setContent: function setContent() { return undefined; } }; }, enumerable: true, configurable: true }); MDCTextFieldCharacterCounterFoundation.prototype.setCounterValue = function (currentLength, maxLength) { currentLength = Math.min(currentLength, maxLength); this.adapter_.setContent(currentLength + " / " + maxLength); }; return MDCTextFieldCharacterCounterFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTextFieldCharacterCounterFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 42 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return cssClasses; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return strings; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return numbers; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return VALIDATION_ATTR_WHITELIST; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ALWAYS_FLOAT_TYPES; }); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var strings = { ARIA_CONTROLS: 'aria-controls', ICON_SELECTOR: '.mdc-text-field__icon', INPUT_SELECTOR: '.mdc-text-field__input', LABEL_SELECTOR: '.mdc-floating-label', LINE_RIPPLE_SELECTOR: '.mdc-line-ripple', OUTLINE_SELECTOR: '.mdc-notched-outline' }; var cssClasses = { DENSE: 'mdc-text-field--dense', DISABLED: 'mdc-text-field--disabled', FOCUSED: 'mdc-text-field--focused', FULLWIDTH: 'mdc-text-field--fullwidth', HELPER_LINE: 'mdc-text-field-helper-line', INVALID: 'mdc-text-field--invalid', NO_LABEL: 'mdc-text-field--no-label', OUTLINED: 'mdc-text-field--outlined', ROOT: 'mdc-text-field', TEXTAREA: 'mdc-text-field--textarea', WITH_LEADING_ICON: 'mdc-text-field--with-leading-icon', WITH_TRAILING_ICON: 'mdc-text-field--with-trailing-icon' }; var numbers = { DENSE_LABEL_SCALE: 0.923, LABEL_SCALE: 0.75 }; /** * Whitelist based off of https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation * under the "Validation-related attributes" section. */ var VALIDATION_ATTR_WHITELIST = ['pattern', 'min', 'max', 'required', 'step', 'minlength', 'maxlength']; /** * Label should always float for these types as they show some UI even if value is empty. */ var ALWAYS_FLOAT_TYPES = ['color', 'date', 'datetime-local', 'month', 'range', 'time', 'week']; //# sourceMappingURL=constants.js.map /***/ }), /* 43 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTextFieldHelperTextFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(96); /** * @license * Copyright 2017 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCTextFieldHelperTextFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCTextFieldHelperTextFoundation, _super); function MDCTextFieldHelperTextFoundation(adapter) { return _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCTextFieldHelperTextFoundation.defaultAdapter, adapter)) || this; } Object.defineProperty(MDCTextFieldHelperTextFoundation, "cssClasses", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCTextFieldHelperTextFoundation, "strings", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCTextFieldHelperTextFoundation, "defaultAdapter", { /** * See {@link MDCTextFieldHelperTextAdapter} for typing information on parameters and return types. */ get: function get() { // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { addClass: function addClass() { return undefined; }, removeClass: function removeClass() { return undefined; }, hasClass: function hasClass() { return false; }, setAttr: function setAttr() { return undefined; }, removeAttr: function removeAttr() { return undefined; }, setContent: function setContent() { return undefined; } }; // tslint:enable:object-literal-sort-keys }, enumerable: true, configurable: true }); /** * Sets the content of the helper text field. */ MDCTextFieldHelperTextFoundation.prototype.setContent = function (content) { this.adapter_.setContent(content); }; /** * @param isPersistent Sets the persistency of the helper text. */ MDCTextFieldHelperTextFoundation.prototype.setPersistent = function (isPersistent) { if (isPersistent) { this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT); } else { this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT); } }; /** * @param isValidation True to make the helper text act as an error validation message. */ MDCTextFieldHelperTextFoundation.prototype.setValidation = function (isValidation) { if (isValidation) { this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG); } else { this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG); } }; /** * Makes the helper text visible to the screen reader. */ MDCTextFieldHelperTextFoundation.prototype.showToScreenReader = function () { this.adapter_.removeAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_HIDDEN); }; /** * Sets the validity of the helper text based on the input validity. */ MDCTextFieldHelperTextFoundation.prototype.setValidity = function (inputIsValid) { var helperTextIsPersistent = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT); var helperTextIsValidationMsg = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG); var validationMsgNeedsDisplay = helperTextIsValidationMsg && !inputIsValid; if (validationMsgNeedsDisplay) { this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ROLE, 'alert'); } else { this.adapter_.removeAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ROLE); } if (!helperTextIsPersistent && !validationMsgNeedsDisplay) { this.hide_(); } }; /** * Hides the help text from screen readers. */ MDCTextFieldHelperTextFoundation.prototype.hide_ = function () { this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_HIDDEN, 'true'); }; return MDCTextFieldHelperTextFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTextFieldHelperTextFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 44 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return visibilityObserverMixin; }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var visibilityObserverMixin = function visibilityObserverMixin(Base) { return function (_Base) { _inherits(_class, _Base); function _class() { _classCallCheck(this, _class); return _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments)); } _createClass(_class, [{ key: 'recalcWhenVisible', value: function recalcWhenVisible(vComponent) { vComponent.hidden_on_create = vComponent.element.offsetParent === null; if (vComponent.hidden_on_create) { // If the component is hidden in DOM for any number of reasons (parent is hidden) then the // Text Field may no render correctly. In this case we observe the DOM watching for a point at which the // element become visible in the DOM and at that point using the MDCComponent to properly re-render that // element vComponent.mutationObserver = new MutationObserver(function (mutations) { if (this.vComponent.hidden_on_create) { if (this.vComponent.element.offsetParent !== null) { // Parent is now visible. Re-run the MDC layout and disconnect from the observer this.vComponent.hidden_on_create = false; this.vComponent.mdcComponent.layout(); // I changed this to addtionally force a resize event on the element after mdcComponent.layout(); // method. In some scenarios with the MDCSlider going from hidden to visible calling layout // didn't work. Firing the 'resize' event did. var event = document.createEvent('HTMLEvents'); event.initEvent('resize', true, false); this.vComponent.element.dispatchEvent(event); this.disconnect(); } } }); vComponent.mutationObserver.vComponent = vComponent; vComponent.mutationObserver.observe(vComponent.root.documentElement || vComponent.root.host, { attributes: true, subtree: true }); } } }]); return _class; }(Base); }; /***/ }), /* 45 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VEvents; }); /* harmony export (immutable) */ __webpack_exports__["b"] = initEvents; /* harmony export (immutable) */ __webpack_exports__["c"] = removeEvents; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__events_loads__ = __webpack_require__(190); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__events_posts__ = __webpack_require__(196); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__events_replaces__ = __webpack_require__(198); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__events_dialog__ = __webpack_require__(107); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__events_errors__ = __webpack_require__(31); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__events_toggle_visibility__ = __webpack_require__(203); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__events_toggle_disabled__ = __webpack_require__(204); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__events_autocomplete__ = __webpack_require__(205); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__events_prompt_if_dirty__ = __webpack_require__(206); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__events_snackbar__ = __webpack_require__(207); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__events_clears__ = __webpack_require__(208); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__events_close_dialog__ = __webpack_require__(209); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__events_post_message__ = __webpack_require__(210); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__events_removes__ = __webpack_require__(211); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__events_stepper__ = __webpack_require__(212); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__events_navigates__ = __webpack_require__(213); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__events_plugin__ = __webpack_require__(214); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__root_document__ = __webpack_require__(215); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__drag_n_drop__ = __webpack_require__(108); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__get_event_target__ = __webpack_require__(102); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var EVENTS_SELECTOR = '[data-events]'; var VEvents = function () { // [[type, url, target, params]] function VEvents(actions, event, root, vComponent) { var _this = this; _classCallCheck(this, VEvents); this.event = event; this.root = root; this.actions = actions.map(function (action) { return _this.constructor.action_class(action, event, root); }); this.vComponent = vComponent; } _createClass(VEvents, [{ key: 'call', value: function call() { var _this2 = this; var event = this.event; var target = Object(__WEBPACK_IMPORTED_MODULE_19__get_event_target__["a" /* getEventTarget */])(event); var eventParams = {}; if (Object(__WEBPACK_IMPORTED_MODULE_18__drag_n_drop__["b" /* hasDragDropData */])(event)) { eventParams = Object.assign(eventParams, Object(__WEBPACK_IMPORTED_MODULE_18__drag_n_drop__["a" /* extractDragDropData */])(event)); } else if (event.detail && event.detail.constructor === Object) { eventParams = Object.assign(eventParams, event.detail); } // Adapted from http://www.datchley.name/promise-patterns-anti-patterns/#executingpromisesinseries var fnlist = this.actions.map(function (action) { return function (results) { return Promise.resolve(action.call(results, eventParams)); }; }); // Execute a list of Promise return functions in series function pseries(list) { var p = Promise.resolve([]); return list.reduce(function (pacc, fn) { return pacc = pacc.then(fn); }, p); } var ev = new CustomEvent('V:eventsStarted', { bubbles: true, cancelable: false, detail: this }); target.dispatchEvent(ev); if (this.vComponent) { this.vComponent.actionsStarted(this); } new __WEBPACK_IMPORTED_MODULE_4__events_errors__["a" /* VErrors */](this.root).clearErrors(); pseries(fnlist).then(function (results) { var result = results.pop(); var contentType = result.contentType; var responseURL = result.responseURL; if (contentType && contentType.indexOf('text/html') !== -1 && typeof responseURL !== 'undefined') { window.location = responseURL; } var ev = new CustomEvent('V:eventsSucceeded', { bubbles: true, cancelable: false, detail: _this2 }); target.dispatchEvent(ev); if (_this2.vComponent) { _this2.vComponent.actionsSucceeded(_this2); } }).catch(function (results) { console.log('If you got here it may not be what you think:', results); var result = results; if (typeof results.pop === 'function') { result = results.pop(); } if (!result.squelch) { new __WEBPACK_IMPORTED_MODULE_4__events_errors__["a" /* VErrors */](_this2.root, target).displayErrors(result); } var ev = new CustomEvent('V:eventsHalted', { bubbles: true, cancelable: false, detail: _this2 }); target.dispatchEvent(ev); if (_this2.vComponent) { _this2.vComponent.actionsHalted(_this2); } }).finally(function () { var ev = new CustomEvent('V:eventsFinished', { bubbles: true, cancelable: false, detail: _this2 }); target.dispatchEvent(ev); if (_this2.vComponent) { _this2.vComponent.actionsFinished(_this2); } }); } }], [{ key: 'action_class', value: function action_class(action, event, root) { var action_type = action[0]; var url = action[1]; var options = action[2]; var params = action[3]; switch (action_type) { case 'loads': return new __WEBPACK_IMPORTED_MODULE_0__events_loads__["a" /* VLoads */](options, url, params, event, root); case 'replaces': return new __WEBPACK_IMPORTED_MODULE_2__events_replaces__["a" /* VReplaces */](options, url, params, event, root); case 'post': return new __WEBPACK_IMPORTED_MODULE_1__events_posts__["a" /* VPosts */](options, url, params, 'POST', event, root); case 'update': return new __WEBPACK_IMPORTED_MODULE_1__events_posts__["a" /* VPosts */](options, url, params, 'PUT', event, root); case 'delete': return new __WEBPACK_IMPORTED_MODULE_1__events_posts__["a" /* VPosts */](options, url, params, 'DELETE', event, root); case 'dialog': return new __WEBPACK_IMPORTED_MODULE_3__events_dialog__["a" /* VDialog */](options, params, event, root); case 'toggle_visibility': return new __WEBPACK_IMPORTED_MODULE_5__events_toggle_visibility__["a" /* VToggleVisibility */](options, params, event, root); case 'toggle_disabled': return new __WEBPACK_IMPORTED_MODULE_6__events_toggle_disabled__["a" /* VToggleDisabled */](options, params, event, root); case 'prompt_if_dirty': return new __WEBPACK_IMPORTED_MODULE_8__events_prompt_if_dirty__["a" /* VPromptIfDirty */](options, params, event, root); case 'remove': return new __WEBPACK_IMPORTED_MODULE_13__events_removes__["a" /* VRemoves */](options, params, event, root); case 'snackbar': return new __WEBPACK_IMPORTED_MODULE_9__events_snackbar__["a" /* VSnackbarEvent */](options, params, event, root); case 'autocomplete': return new __WEBPACK_IMPORTED_MODULE_7__events_autocomplete__["a" /* VAutoComplete */](options, url, params, event, root); case 'clear': return new __WEBPACK_IMPORTED_MODULE_10__events_clears__["a" /* VClears */](options, params, event, root); case 'close_dialog': return new __WEBPACK_IMPORTED_MODULE_11__events_close_dialog__["a" /* VCloseDialog */](options, params, event, root); case 'post_message': return new __WEBPACK_IMPORTED_MODULE_12__events_post_message__["a" /* VPostMessage */](options, params, event, root); case 'stepper': return new __WEBPACK_IMPORTED_MODULE_14__events_stepper__["a" /* VStepperEvent */](options, params, event, root); case 'navigates': return new __WEBPACK_IMPORTED_MODULE_15__events_navigates__["a" /* VNavigates */](options, params, event, root); default: return new __WEBPACK_IMPORTED_MODULE_16__events_plugin__["a" /* VPluginEventAction */](action_type, options, params, event, root); } } }]); return VEvents; }(); // This is used to get a proper binding of the actionData // https://stackoverflow.com/questions/750486/javascript-closure-inside-loops-simple-practical-example function createEventHandler(actionsData, root, vComponent) { return function (event) { event.stopPropagation(); new VEvents(actionsData, event, root, vComponent).call(); }; } function getEventElements(root) { var elements = Array.from(root.querySelectorAll(EVENTS_SELECTOR)); // Include `root` if it has events: if (typeof root.matches === 'function' && root.matches(EVENTS_SELECTOR)) { elements.unshift(root); } return elements; } function initEvents(e) { console.debug('\tEvents'); var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = getEventElements(e)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var eventElem = _step.value; var eventsData = JSON.parse(eventElem.dataset.events); for (var j = 0; j < eventsData.length; j++) { var eventData = eventsData[j]; var eventName = eventData[0]; var eventOptions = eventData[2]; eventOptions.passive = true; var actionsData = eventData[1]; var vComponent = eventElem.vComponent; var eventHandler = createEventHandler(actionsData, Object(__WEBPACK_IMPORTED_MODULE_17__root_document__["a" /* default */])(e), vComponent); // allow override of event handler by component if (vComponent && vComponent.createEventHandler) { eventHandler = vComponent.createEventHandler(actionsData, Object(__WEBPACK_IMPORTED_MODULE_17__root_document__["a" /* default */])(e), vComponent); } // Delegate to the component if possible if (vComponent && vComponent.initEventListener) { vComponent.initEventListener(eventName, eventHandler, eventOptions); } else { if (typeof eventElem.eventsHandler === 'undefined') { eventElem.eventsHandler = {}; } if (typeof eventElem.eventsHandler[eventName] === 'undefined') { eventElem.eventsHandler[eventName] = []; } eventElem.eventsHandler[eventName].push(eventHandler); eventElem.addEventListener(eventName, eventHandler, eventOptions); } if (vComponent) { vComponent.afterInit(); } } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } fireAfterLoad(e); } function removeEvents(elem) { console.debug('\tuninitEvents'); var _iteratorNormalCompletion2 = true; var _didIteratorError2 = false; var _iteratorError2 = undefined; try { for (var _iterator2 = getEventElements(elem)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { var eventElem = _step2.value; var eventsData = JSON.parse(eventElem.dataset.events); for (var j = 0; j < eventsData.length; j++) { var eventData = eventsData[j]; var eventName = eventData[0]; var eventOptions = eventData[2]; eventOptions.passive = true; var _iteratorNormalCompletion3 = true; var _didIteratorError3 = false; var _iteratorError3 = undefined; try { for (var _iterator3 = eventElem.eventsHandler[eventName][Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { var handler = _step3.value; eventElem.removeEventListener(eventName, handler, eventOptions); } } catch (err) { _didIteratorError3 = true; _iteratorError3 = err; } finally { try { if (!_iteratorNormalCompletion3 && _iterator3.return) { _iterator3.return(); } } finally { if (_didIteratorError3) { throw _iteratorError3; } } } } } } catch (err) { _didIteratorError2 = true; _iteratorError2 = err; } finally { try { if (!_iteratorNormalCompletion2 && _iterator2.return) { _iterator2.return(); } } finally { if (_didIteratorError2) { throw _iteratorError2; } } } } function fireAfterLoad(e) { var _iteratorNormalCompletion4 = true; var _didIteratorError4 = false; var _iteratorError4 = undefined; try { for (var _iterator4 = getEventElements(e)[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { var eventElem = _step4.value; var eventsData = JSON.parse(eventElem.dataset.events); for (var j = 0; j < eventsData.length; j++) { var eventData = eventsData[j]; var eventName = eventData[0]; if (eventName === 'after_init') { var event = new Event('after_init', { composed: true }); // Dispatch the event. eventElem.dispatchEvent(event); } } } } catch (err) { _didIteratorError4 = true; _iteratorError4 = err; } finally { try { if (!_iteratorNormalCompletion4 && _iterator4.return) { _iterator4.return(); } } finally { if (_didIteratorError4) { throw _iteratorError4; } } } } /***/ }), /* 46 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; }); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var cssClasses = { LIST_ITEM_ACTIVATED_CLASS: 'mdc-list-item--activated', LIST_ITEM_CLASS: 'mdc-list-item', LIST_ITEM_DISABLED_CLASS: 'mdc-list-item--disabled', LIST_ITEM_SELECTED_CLASS: 'mdc-list-item--selected', ROOT: 'mdc-list' }; var strings = { ACTION_EVENT: 'MDCList:action', ARIA_CHECKED: 'aria-checked', ARIA_CHECKED_CHECKBOX_SELECTOR: '[role="checkbox"][aria-checked="true"]', ARIA_CHECKED_RADIO_SELECTOR: '[role="radio"][aria-checked="true"]', ARIA_CURRENT: 'aria-current', ARIA_DISABLED: 'aria-disabled', ARIA_ORIENTATION: 'aria-orientation', ARIA_ORIENTATION_HORIZONTAL: 'horizontal', ARIA_ROLE_CHECKBOX_SELECTOR: '[role="checkbox"]', ARIA_SELECTED: 'aria-selected', CHECKBOX_RADIO_SELECTOR: 'input[type="checkbox"]:not(:disabled), input[type="radio"]:not(:disabled)', CHECKBOX_SELECTOR: 'input[type="checkbox"]:not(:disabled)', CHILD_ELEMENTS_TO_TOGGLE_TABINDEX: "\n ." + cssClasses.LIST_ITEM_CLASS + " button:not(:disabled),\n ." + cssClasses.LIST_ITEM_CLASS + " a\n ", FOCUSABLE_CHILD_ELEMENTS: "\n ." + cssClasses.LIST_ITEM_CLASS + " button:not(:disabled),\n ." + cssClasses.LIST_ITEM_CLASS + " a,\n ." + cssClasses.LIST_ITEM_CLASS + " input[type=\"radio\"]:not(:disabled),\n ." + cssClasses.LIST_ITEM_CLASS + " input[type=\"checkbox\"]:not(:disabled)\n ", RADIO_SELECTOR: 'input[type="radio"]:not(:disabled)' }; var numbers = { UNSET_INDEX: -1 }; //# sourceMappingURL=constants.js.map /***/ }), /* 47 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCListFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(46); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var ELEMENTS_KEY_ALLOWED_IN = ['input', 'button', 'textarea', 'select']; function isNumberArray(selectedIndex) { return selectedIndex instanceof Array; } var MDCListFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCListFoundation, _super); function MDCListFoundation(adapter) { var _this = _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCListFoundation.defaultAdapter, adapter)) || this; _this.wrapFocus_ = false; _this.isVertical_ = true; _this.isSingleSelectionList_ = false; _this.selectedIndex_ = __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].UNSET_INDEX; _this.focusedItemIndex_ = __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].UNSET_INDEX; _this.useActivatedClass_ = false; _this.ariaCurrentAttrValue_ = null; _this.isCheckboxList_ = false; _this.isRadioList_ = false; return _this; } Object.defineProperty(MDCListFoundation, "strings", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCListFoundation, "cssClasses", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCListFoundation, "numbers", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCListFoundation, "defaultAdapter", { get: function get() { return { addClassForElementIndex: function addClassForElementIndex() { return undefined; }, focusItemAtIndex: function focusItemAtIndex() { return undefined; }, getAttributeForElementIndex: function getAttributeForElementIndex() { return null; }, getFocusedElementIndex: function getFocusedElementIndex() { return 0; }, getListItemCount: function getListItemCount() { return 0; }, hasCheckboxAtIndex: function hasCheckboxAtIndex() { return false; }, hasRadioAtIndex: function hasRadioAtIndex() { return false; }, isCheckboxCheckedAtIndex: function isCheckboxCheckedAtIndex() { return false; }, isFocusInsideList: function isFocusInsideList() { return false; }, isRootFocused: function isRootFocused() { return false; }, notifyAction: function notifyAction() { return undefined; }, removeClassForElementIndex: function removeClassForElementIndex() { return undefined; }, setAttributeForElementIndex: function setAttributeForElementIndex() { return undefined; }, setCheckedCheckboxOrRadioAtIndex: function setCheckedCheckboxOrRadioAtIndex() { return undefined; }, setTabIndexForListItemChildren: function setTabIndexForListItemChildren() { return undefined; } }; }, enumerable: true, configurable: true }); MDCListFoundation.prototype.layout = function () { if (this.adapter_.getListItemCount() === 0) { return; } if (this.adapter_.hasCheckboxAtIndex(0)) { this.isCheckboxList_ = true; } else if (this.adapter_.hasRadioAtIndex(0)) { this.isRadioList_ = true; } }; /** * Sets the private wrapFocus_ variable. */ MDCListFoundation.prototype.setWrapFocus = function (value) { this.wrapFocus_ = value; }; /** * Sets the isVertical_ private variable. */ MDCListFoundation.prototype.setVerticalOrientation = function (value) { this.isVertical_ = value; }; /** * Sets the isSingleSelectionList_ private variable. */ MDCListFoundation.prototype.setSingleSelection = function (value) { this.isSingleSelectionList_ = value; }; /** * Sets the useActivatedClass_ private variable. */ MDCListFoundation.prototype.setUseActivatedClass = function (useActivated) { this.useActivatedClass_ = useActivated; }; MDCListFoundation.prototype.getSelectedIndex = function () { return this.selectedIndex_; }; MDCListFoundation.prototype.setSelectedIndex = function (index) { if (!this.isIndexValid_(index)) { return; } if (this.isCheckboxList_) { this.setCheckboxAtIndex_(index); } else if (this.isRadioList_) { this.setRadioAtIndex_(index); } else { this.setSingleSelectionAtIndex_(index); } }; /** * Focus in handler for the list items. */ MDCListFoundation.prototype.handleFocusIn = function (_, listItemIndex) { if (listItemIndex >= 0) { this.adapter_.setTabIndexForListItemChildren(listItemIndex, '0'); } }; /** * Focus out handler for the list items. */ MDCListFoundation.prototype.handleFocusOut = function (_, listItemIndex) { var _this = this; if (listItemIndex >= 0) { this.adapter_.setTabIndexForListItemChildren(listItemIndex, '-1'); } /** * Between Focusout & Focusin some browsers do not have focus on any element. Setting a delay to wait till the focus * is moved to next element. */ setTimeout(function () { if (!_this.adapter_.isFocusInsideList()) { _this.setTabindexToFirstSelectedItem_(); } }, 0); }; /** * Key handler for the list. */ MDCListFoundation.prototype.handleKeydown = function (evt, isRootListItem, listItemIndex) { var isArrowLeft = evt.key === 'ArrowLeft' || evt.keyCode === 37; var isArrowUp = evt.key === 'ArrowUp' || evt.keyCode === 38; var isArrowRight = evt.key === 'ArrowRight' || evt.keyCode === 39; var isArrowDown = evt.key === 'ArrowDown' || evt.keyCode === 40; var isHome = evt.key === 'Home' || evt.keyCode === 36; var isEnd = evt.key === 'End' || evt.keyCode === 35; var isEnter = evt.key === 'Enter' || evt.keyCode === 13; var isSpace = evt.key === 'Space' || evt.keyCode === 32; if (this.adapter_.isRootFocused()) { if (isArrowUp || isEnd) { evt.preventDefault(); this.focusLastElement(); } else if (isArrowDown || isHome) { evt.preventDefault(); this.focusFirstElement(); } return; } var currentIndex = this.adapter_.getFocusedElementIndex(); if (currentIndex === -1) { currentIndex = listItemIndex; if (currentIndex < 0) { // If this event doesn't have a mdc-list-item ancestor from the // current list (not from a sublist), return early. return; } } var nextIndex; if (this.isVertical_ && isArrowDown || !this.isVertical_ && isArrowRight) { this.preventDefaultEvent_(evt); nextIndex = this.focusNextElement(currentIndex); } else if (this.isVertical_ && isArrowUp || !this.isVertical_ && isArrowLeft) { this.preventDefaultEvent_(evt); nextIndex = this.focusPrevElement(currentIndex); } else if (isHome) { this.preventDefaultEvent_(evt); nextIndex = this.focusFirstElement(); } else if (isEnd) { this.preventDefaultEvent_(evt); nextIndex = this.focusLastElement(); } else if (isEnter || isSpace) { if (isRootListItem) { // Return early if enter key is pressed on anchor element which triggers synthetic MouseEvent event. var target = evt.target; if (target && target.tagName === 'A' && isEnter) { return; } this.preventDefaultEvent_(evt); if (this.isSelectableList_()) { this.setSelectedIndexOnAction_(currentIndex); } this.adapter_.notifyAction(currentIndex); } } this.focusedItemIndex_ = currentIndex; if (nextIndex !== undefined) { this.setTabindexAtIndex_(nextIndex); this.focusedItemIndex_ = nextIndex; } }; /** * Click handler for the list. */ MDCListFoundation.prototype.handleClick = function (index, toggleCheckbox) { if (index === __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].UNSET_INDEX) { return; } if (this.isSelectableList_()) { this.setSelectedIndexOnAction_(index, toggleCheckbox); } this.adapter_.notifyAction(index); this.setTabindexAtIndex_(index); this.focusedItemIndex_ = index; }; /** * Focuses the next element on the list. */ MDCListFoundation.prototype.focusNextElement = function (index) { var count = this.adapter_.getListItemCount(); var nextIndex = index + 1; if (nextIndex >= count) { if (this.wrapFocus_) { nextIndex = 0; } else { // Return early because last item is already focused. return index; } } this.adapter_.focusItemAtIndex(nextIndex); return nextIndex; }; /** * Focuses the previous element on the list. */ MDCListFoundation.prototype.focusPrevElement = function (index) { var prevIndex = index - 1; if (prevIndex < 0) { if (this.wrapFocus_) { prevIndex = this.adapter_.getListItemCount() - 1; } else { // Return early because first item is already focused. return index; } } this.adapter_.focusItemAtIndex(prevIndex); return prevIndex; }; MDCListFoundation.prototype.focusFirstElement = function () { this.adapter_.focusItemAtIndex(0); return 0; }; MDCListFoundation.prototype.focusLastElement = function () { var lastIndex = this.adapter_.getListItemCount() - 1; this.adapter_.focusItemAtIndex(lastIndex); return lastIndex; }; /** * @param itemIndex Index of the list item * @param isEnabled Sets the list item to enabled or disabled. */ MDCListFoundation.prototype.setEnabled = function (itemIndex, isEnabled) { if (!this.isIndexValid_(itemIndex)) { return; } if (isEnabled) { this.adapter_.removeClassForElementIndex(itemIndex, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LIST_ITEM_DISABLED_CLASS); this.adapter_.setAttributeForElementIndex(itemIndex, __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].ARIA_DISABLED, 'false'); } else { this.adapter_.addClassForElementIndex(itemIndex, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LIST_ITEM_DISABLED_CLASS); this.adapter_.setAttributeForElementIndex(itemIndex, __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].ARIA_DISABLED, 'true'); } }; /** * Ensures that preventDefault is only called if the containing element doesn't * consume the event, and it will cause an unintended scroll. */ MDCListFoundation.prototype.preventDefaultEvent_ = function (evt) { var target = evt.target; var tagName = ("" + target.tagName).toLowerCase(); if (ELEMENTS_KEY_ALLOWED_IN.indexOf(tagName) === -1) { evt.preventDefault(); } }; MDCListFoundation.prototype.setSingleSelectionAtIndex_ = function (index) { if (this.selectedIndex_ === index) { return; } var selectedClassName = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LIST_ITEM_SELECTED_CLASS; if (this.useActivatedClass_) { selectedClassName = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LIST_ITEM_ACTIVATED_CLASS; } if (this.selectedIndex_ !== __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].UNSET_INDEX) { this.adapter_.removeClassForElementIndex(this.selectedIndex_, selectedClassName); } this.adapter_.addClassForElementIndex(index, selectedClassName); this.setAriaForSingleSelectionAtIndex_(index); this.selectedIndex_ = index; }; /** * Sets aria attribute for single selection at given index. */ MDCListFoundation.prototype.setAriaForSingleSelectionAtIndex_ = function (index) { // Detect the presence of aria-current and get the value only during list initialization when it is in unset state. if (this.selectedIndex_ === __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].UNSET_INDEX) { this.ariaCurrentAttrValue_ = this.adapter_.getAttributeForElementIndex(index, __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].ARIA_CURRENT); } var isAriaCurrent = this.ariaCurrentAttrValue_ !== null; var ariaAttribute = isAriaCurrent ? __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].ARIA_CURRENT : __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].ARIA_SELECTED; if (this.selectedIndex_ !== __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].UNSET_INDEX) { this.adapter_.setAttributeForElementIndex(this.selectedIndex_, ariaAttribute, 'false'); } var ariaAttributeValue = isAriaCurrent ? this.ariaCurrentAttrValue_ : 'true'; this.adapter_.setAttributeForElementIndex(index, ariaAttribute, ariaAttributeValue); }; /** * Toggles radio at give index. Radio doesn't change the checked state if it is already checked. */ MDCListFoundation.prototype.setRadioAtIndex_ = function (index) { this.adapter_.setCheckedCheckboxOrRadioAtIndex(index, true); if (this.selectedIndex_ !== __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].UNSET_INDEX) { this.adapter_.setAttributeForElementIndex(this.selectedIndex_, __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].ARIA_CHECKED, 'false'); } this.adapter_.setAttributeForElementIndex(index, __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].ARIA_CHECKED, 'true'); this.selectedIndex_ = index; }; MDCListFoundation.prototype.setCheckboxAtIndex_ = function (index) { for (var i = 0; i < this.adapter_.getListItemCount(); i++) { var isChecked = false; if (index.indexOf(i) >= 0) { isChecked = true; } this.adapter_.setCheckedCheckboxOrRadioAtIndex(i, isChecked); this.adapter_.setAttributeForElementIndex(i, __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].ARIA_CHECKED, isChecked ? 'true' : 'false'); } this.selectedIndex_ = index; }; MDCListFoundation.prototype.setTabindexAtIndex_ = function (index) { if (this.focusedItemIndex_ === __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].UNSET_INDEX && index !== 0) { // If no list item was selected set first list item's tabindex to -1. // Generally, tabindex is set to 0 on first list item of list that has no preselected items. this.adapter_.setAttributeForElementIndex(0, 'tabindex', '-1'); } else if (this.focusedItemIndex_ >= 0 && this.focusedItemIndex_ !== index) { this.adapter_.setAttributeForElementIndex(this.focusedItemIndex_, 'tabindex', '-1'); } this.adapter_.setAttributeForElementIndex(index, 'tabindex', '0'); }; /** * @return Return true if it is single selectin list, checkbox list or radio list. */ MDCListFoundation.prototype.isSelectableList_ = function () { return this.isSingleSelectionList_ || this.isCheckboxList_ || this.isRadioList_; }; MDCListFoundation.prototype.setTabindexToFirstSelectedItem_ = function () { var targetIndex = 0; if (this.isSelectableList_()) { if (typeof this.selectedIndex_ === 'number' && this.selectedIndex_ !== __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].UNSET_INDEX) { targetIndex = this.selectedIndex_; } else if (isNumberArray(this.selectedIndex_) && this.selectedIndex_.length > 0) { targetIndex = this.selectedIndex_.reduce(function (currentIndex, minIndex) { return Math.min(currentIndex, minIndex); }); } } this.setTabindexAtIndex_(targetIndex); }; MDCListFoundation.prototype.isIndexValid_ = function (index) { var _this = this; if (index instanceof Array) { if (!this.isCheckboxList_) { throw new Error('MDCListFoundation: Array of index is only supported for checkbox based list'); } if (index.length === 0) { return true; } else { return index.some(function (i) { return _this.isIndexInRange_(i); }); } } else if (typeof index === 'number') { if (this.isCheckboxList_) { throw new Error('MDCListFoundation: Expected array of index for checkbox based list but got number: ' + index); } return this.isIndexInRange_(index); } else { return false; } }; MDCListFoundation.prototype.isIndexInRange_ = function (index) { var listSize = this.adapter_.getListItemCount(); return index >= 0 && index < listSize; }; MDCListFoundation.prototype.setSelectedIndexOnAction_ = function (index, toggleCheckbox) { if (toggleCheckbox === void 0) { toggleCheckbox = true; } if (this.isCheckboxList_) { this.toggleCheckboxAtIndex_(index, toggleCheckbox); } else { this.setSelectedIndex(index); } }; MDCListFoundation.prototype.toggleCheckboxAtIndex_ = function (index, toggleCheckbox) { var isChecked = this.adapter_.isCheckboxCheckedAtIndex(index); if (toggleCheckbox) { isChecked = !isChecked; this.adapter_.setCheckedCheckboxOrRadioAtIndex(index, isChecked); } this.adapter_.setAttributeForElementIndex(index, __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].ARIA_CHECKED, isChecked ? 'true' : 'false'); // If none of the checkbox items are selected and selectedIndex is not initialized then provide a default value. var selectedIndexes = this.selectedIndex_ === __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].UNSET_INDEX ? [] : this.selectedIndex_.slice(); if (isChecked) { selectedIndexes.push(index); } else { selectedIndexes = selectedIndexes.filter(function (i) { return i !== index; }); } this.selectedIndex_ = selectedIndexes; }; return MDCListFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCListFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 48 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCMenuSurfaceFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(25); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCMenuSurfaceFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCMenuSurfaceFoundation, _super); function MDCMenuSurfaceFoundation(adapter) { var _this = _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCMenuSurfaceFoundation.defaultAdapter, adapter)) || this; _this.isOpen_ = false; _this.isQuickOpen_ = false; _this.isHoistedElement_ = false; _this.isFixedPosition_ = false; _this.openAnimationEndTimerId_ = 0; _this.closeAnimationEndTimerId_ = 0; _this.animationRequestId_ = 0; _this.anchorCorner_ = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* Corner */].TOP_START; _this.anchorMargin_ = { top: 0, right: 0, bottom: 0, left: 0 }; _this.position_ = { x: 0, y: 0 }; return _this; } Object.defineProperty(MDCMenuSurfaceFoundation, "cssClasses", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCMenuSurfaceFoundation, "strings", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["e" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCMenuSurfaceFoundation, "numbers", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["d" /* numbers */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCMenuSurfaceFoundation, "Corner", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* Corner */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCMenuSurfaceFoundation, "defaultAdapter", { /** * @see {@link MDCMenuSurfaceAdapter} for typing information on parameters and return types. */ get: function get() { // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { addClass: function addClass() { return undefined; }, removeClass: function removeClass() { return undefined; }, hasClass: function hasClass() { return false; }, hasAnchor: function hasAnchor() { return false; }, isElementInContainer: function isElementInContainer() { return false; }, isFocused: function isFocused() { return false; }, isRtl: function isRtl() { return false; }, getInnerDimensions: function getInnerDimensions() { return { height: 0, width: 0 }; }, getAnchorDimensions: function getAnchorDimensions() { return null; }, getWindowDimensions: function getWindowDimensions() { return { height: 0, width: 0 }; }, getBodyDimensions: function getBodyDimensions() { return { height: 0, width: 0 }; }, getWindowScroll: function getWindowScroll() { return { x: 0, y: 0 }; }, setPosition: function setPosition() { return undefined; }, setMaxHeight: function setMaxHeight() { return undefined; }, setTransformOrigin: function setTransformOrigin() { return undefined; }, saveFocus: function saveFocus() { return undefined; }, restoreFocus: function restoreFocus() { return undefined; }, notifyClose: function notifyClose() { return undefined; }, notifyOpen: function notifyOpen() { return undefined; } }; // tslint:enable:object-literal-sort-keys }, enumerable: true, configurable: true }); MDCMenuSurfaceFoundation.prototype.init = function () { var _a = MDCMenuSurfaceFoundation.cssClasses, ROOT = _a.ROOT, OPEN = _a.OPEN; if (!this.adapter_.hasClass(ROOT)) { throw new Error(ROOT + " class required in root element."); } if (this.adapter_.hasClass(OPEN)) { this.isOpen_ = true; } }; MDCMenuSurfaceFoundation.prototype.destroy = function () { clearTimeout(this.openAnimationEndTimerId_); clearTimeout(this.closeAnimationEndTimerId_); // Cancel any currently running animations. cancelAnimationFrame(this.animationRequestId_); }; /** * @param corner Default anchor corner alignment of top-left menu surface corner. */ MDCMenuSurfaceFoundation.prototype.setAnchorCorner = function (corner) { this.anchorCorner_ = corner; }; /** * @param margin Set of margin values from anchor. */ MDCMenuSurfaceFoundation.prototype.setAnchorMargin = function (margin) { this.anchorMargin_.top = margin.top || 0; this.anchorMargin_.right = margin.right || 0; this.anchorMargin_.bottom = margin.bottom || 0; this.anchorMargin_.left = margin.left || 0; }; /** Used to indicate if the menu-surface is hoisted to the body. */ MDCMenuSurfaceFoundation.prototype.setIsHoisted = function (isHoisted) { this.isHoistedElement_ = isHoisted; }; /** Used to set the menu-surface calculations based on a fixed position menu. */ MDCMenuSurfaceFoundation.prototype.setFixedPosition = function (isFixedPosition) { this.isFixedPosition_ = isFixedPosition; }; /** Sets the menu-surface position on the page. */ MDCMenuSurfaceFoundation.prototype.setAbsolutePosition = function (x, y) { this.position_.x = this.isFinite_(x) ? x : 0; this.position_.y = this.isFinite_(y) ? y : 0; }; MDCMenuSurfaceFoundation.prototype.setQuickOpen = function (quickOpen) { this.isQuickOpen_ = quickOpen; }; MDCMenuSurfaceFoundation.prototype.isOpen = function () { return this.isOpen_; }; /** * Open the menu surface. */ MDCMenuSurfaceFoundation.prototype.open = function () { var _this = this; this.adapter_.saveFocus(); if (!this.isQuickOpen_) { this.adapter_.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN); } this.animationRequestId_ = requestAnimationFrame(function () { _this.adapter_.addClass(MDCMenuSurfaceFoundation.cssClasses.OPEN); _this.dimensions_ = _this.adapter_.getInnerDimensions(); _this.autoPosition_(); if (_this.isQuickOpen_) { _this.adapter_.notifyOpen(); } else { _this.openAnimationEndTimerId_ = setTimeout(function () { _this.openAnimationEndTimerId_ = 0; _this.adapter_.removeClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN); _this.adapter_.notifyOpen(); }, __WEBPACK_IMPORTED_MODULE_2__constants__["d" /* numbers */].TRANSITION_OPEN_DURATION); } }); this.isOpen_ = true; }; /** * Closes the menu surface. */ MDCMenuSurfaceFoundation.prototype.close = function (skipRestoreFocus) { var _this = this; if (skipRestoreFocus === void 0) { skipRestoreFocus = false; } if (!this.isQuickOpen_) { this.adapter_.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_CLOSED); } requestAnimationFrame(function () { _this.adapter_.removeClass(MDCMenuSurfaceFoundation.cssClasses.OPEN); if (_this.isQuickOpen_) { _this.adapter_.notifyClose(); } else { _this.closeAnimationEndTimerId_ = setTimeout(function () { _this.closeAnimationEndTimerId_ = 0; _this.adapter_.removeClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_CLOSED); _this.adapter_.notifyClose(); }, __WEBPACK_IMPORTED_MODULE_2__constants__["d" /* numbers */].TRANSITION_CLOSE_DURATION); } }); this.isOpen_ = false; if (!skipRestoreFocus) { this.maybeRestoreFocus_(); } }; /** Handle clicks and close if not within menu-surface element. */ MDCMenuSurfaceFoundation.prototype.handleBodyClick = function (evt) { var el = evt.target; if (this.adapter_.isElementInContainer(el)) { return; } this.close(); }; /** Handle keys that close the surface. */ MDCMenuSurfaceFoundation.prototype.handleKeydown = function (evt) { var keyCode = evt.keyCode, key = evt.key; var isEscape = key === 'Escape' || keyCode === 27; if (isEscape) { this.close(); } }; MDCMenuSurfaceFoundation.prototype.autoPosition_ = function () { var _a; // Compute measurements for autoposition methods reuse. this.measurements_ = this.getAutoLayoutMeasurements_(); var corner = this.getOriginCorner_(); var maxMenuSurfaceHeight = this.getMenuSurfaceMaxHeight_(corner); var verticalAlignment = this.hasBit_(corner, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM) ? 'bottom' : 'top'; var horizontalAlignment = this.hasBit_(corner, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].RIGHT) ? 'right' : 'left'; var horizontalOffset = this.getHorizontalOriginOffset_(corner); var verticalOffset = this.getVerticalOriginOffset_(corner); var _b = this.measurements_, anchorSize = _b.anchorSize, surfaceSize = _b.surfaceSize; var position = (_a = {}, _a[horizontalAlignment] = horizontalOffset, _a[verticalAlignment] = verticalOffset, _a); // Center align when anchor width is comparable or greater than menu surface, otherwise keep corner. if (anchorSize.width / surfaceSize.width > __WEBPACK_IMPORTED_MODULE_2__constants__["d" /* numbers */].ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO) { horizontalAlignment = 'center'; } // If the menu-surface has been hoisted to the body, it's no longer relative to the anchor element if (this.isHoistedElement_ || this.isFixedPosition_) { this.adjustPositionForHoistedElement_(position); } this.adapter_.setTransformOrigin(horizontalAlignment + " " + verticalAlignment); this.adapter_.setPosition(position); this.adapter_.setMaxHeight(maxMenuSurfaceHeight ? maxMenuSurfaceHeight + 'px' : ''); }; /** * @return Measurements used to position menu surface popup. */ MDCMenuSurfaceFoundation.prototype.getAutoLayoutMeasurements_ = function () { var anchorRect = this.adapter_.getAnchorDimensions(); var bodySize = this.adapter_.getBodyDimensions(); var viewportSize = this.adapter_.getWindowDimensions(); var windowScroll = this.adapter_.getWindowScroll(); if (!anchorRect) { // tslint:disable:object-literal-sort-keys Positional properties are more readable when they're grouped together anchorRect = { top: this.position_.y, right: this.position_.x, bottom: this.position_.y, left: this.position_.x, width: 0, height: 0 }; // tslint:enable:object-literal-sort-keys } return { anchorSize: anchorRect, bodySize: bodySize, surfaceSize: this.dimensions_, viewportDistance: { // tslint:disable:object-literal-sort-keys Positional properties are more readable when they're grouped together top: anchorRect.top, right: viewportSize.width - anchorRect.right, bottom: viewportSize.height - anchorRect.bottom, left: anchorRect.left }, viewportSize: viewportSize, windowScroll: windowScroll }; }; /** * Computes the corner of the anchor from which to animate and position the menu surface. */ MDCMenuSurfaceFoundation.prototype.getOriginCorner_ = function () { // Defaults: open from the top left. var corner = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* Corner */].TOP_LEFT; var _a = this.measurements_, viewportDistance = _a.viewportDistance, anchorSize = _a.anchorSize, surfaceSize = _a.surfaceSize; var isBottomAligned = this.hasBit_(this.anchorCorner_, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM); var availableTop = isBottomAligned ? viewportDistance.top + anchorSize.height + this.anchorMargin_.bottom : viewportDistance.top + this.anchorMargin_.top; var availableBottom = isBottomAligned ? viewportDistance.bottom - this.anchorMargin_.bottom : viewportDistance.bottom + anchorSize.height - this.anchorMargin_.top; var topOverflow = surfaceSize.height - availableTop; var bottomOverflow = surfaceSize.height - availableBottom; if (bottomOverflow > 0 && topOverflow < bottomOverflow) { corner = this.setBit_(corner, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM); } var isRtl = this.adapter_.isRtl(); var isFlipRtl = this.hasBit_(this.anchorCorner_, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].FLIP_RTL); var avoidHorizontalOverlap = this.hasBit_(this.anchorCorner_, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].RIGHT); var isAlignedRight = avoidHorizontalOverlap && !isRtl || !avoidHorizontalOverlap && isFlipRtl && isRtl; var availableLeft = isAlignedRight ? viewportDistance.left + anchorSize.width + this.anchorMargin_.right : viewportDistance.left + this.anchorMargin_.left; var availableRight = isAlignedRight ? viewportDistance.right - this.anchorMargin_.right : viewportDistance.right + anchorSize.width - this.anchorMargin_.left; var leftOverflow = surfaceSize.width - availableLeft; var rightOverflow = surfaceSize.width - availableRight; if (leftOverflow < 0 && isAlignedRight && isRtl || avoidHorizontalOverlap && !isAlignedRight && leftOverflow < 0 || rightOverflow > 0 && leftOverflow < rightOverflow) { corner = this.setBit_(corner, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].RIGHT); } return corner; }; /** * @param corner Origin corner of the menu surface. * @return Maximum height of the menu surface, based on available space. 0 indicates should not be set. */ MDCMenuSurfaceFoundation.prototype.getMenuSurfaceMaxHeight_ = function (corner) { var viewportDistance = this.measurements_.viewportDistance; var maxHeight = 0; var isBottomAligned = this.hasBit_(corner, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM); var isBottomAnchored = this.hasBit_(this.anchorCorner_, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM); var MARGIN_TO_EDGE = MDCMenuSurfaceFoundation.numbers.MARGIN_TO_EDGE; // When maximum height is not specified, it is handled from CSS. if (isBottomAligned) { maxHeight = viewportDistance.top + this.anchorMargin_.top - MARGIN_TO_EDGE; if (!isBottomAnchored) { maxHeight += this.measurements_.anchorSize.height; } } else { maxHeight = viewportDistance.bottom - this.anchorMargin_.bottom + this.measurements_.anchorSize.height - MARGIN_TO_EDGE; if (isBottomAnchored) { maxHeight -= this.measurements_.anchorSize.height; } } return maxHeight; }; /** * @param corner Origin corner of the menu surface. * @return Horizontal offset of menu surface origin corner from corresponding anchor corner. */ MDCMenuSurfaceFoundation.prototype.getHorizontalOriginOffset_ = function (corner) { var anchorSize = this.measurements_.anchorSize; // isRightAligned corresponds to using the 'right' property on the surface. var isRightAligned = this.hasBit_(corner, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].RIGHT); var avoidHorizontalOverlap = this.hasBit_(this.anchorCorner_, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].RIGHT); if (isRightAligned) { var rightOffset = avoidHorizontalOverlap ? anchorSize.width - this.anchorMargin_.left : this.anchorMargin_.right; // For hoisted or fixed elements, adjust the offset by the difference between viewport width and body width so // when we calculate the right value (`adjustPositionForHoistedElement_`) based on the element position, // the right property is correct. if (this.isHoistedElement_ || this.isFixedPosition_) { return rightOffset - (this.measurements_.viewportSize.width - this.measurements_.bodySize.width); } return rightOffset; } return avoidHorizontalOverlap ? anchorSize.width - this.anchorMargin_.right : this.anchorMargin_.left; }; /** * @param corner Origin corner of the menu surface. * @return Vertical offset of menu surface origin corner from corresponding anchor corner. */ MDCMenuSurfaceFoundation.prototype.getVerticalOriginOffset_ = function (corner) { var anchorSize = this.measurements_.anchorSize; var isBottomAligned = this.hasBit_(corner, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM); var avoidVerticalOverlap = this.hasBit_(this.anchorCorner_, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM); var y = 0; if (isBottomAligned) { y = avoidVerticalOverlap ? anchorSize.height - this.anchorMargin_.top : -this.anchorMargin_.bottom; } else { y = avoidVerticalOverlap ? anchorSize.height + this.anchorMargin_.bottom : this.anchorMargin_.top; } return y; }; /** Calculates the offsets for positioning the menu-surface when the menu-surface has been hoisted to the body. */ MDCMenuSurfaceFoundation.prototype.adjustPositionForHoistedElement_ = function (position) { var e_1, _a; var _b = this.measurements_, windowScroll = _b.windowScroll, viewportDistance = _b.viewportDistance; var props = Object.keys(position); try { for (var props_1 = __WEBPACK_IMPORTED_MODULE_0_tslib__["e" /* __values */](props), props_1_1 = props_1.next(); !props_1_1.done; props_1_1 = props_1.next()) { var prop = props_1_1.value; var value = position[prop] || 0; // Hoisted surfaces need to have the anchor elements location on the page added to the // position properties for proper alignment on the body. value += viewportDistance[prop]; // Surfaces that are absolutely positioned need to have additional calculations for scroll // and bottom positioning. if (!this.isFixedPosition_) { if (prop === 'top') { value += windowScroll.y; } else if (prop === 'bottom') { value -= windowScroll.y; } else if (prop === 'left') { value += windowScroll.x; } else { // prop === 'right' value -= windowScroll.x; } } position[prop] = value; } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (props_1_1 && !props_1_1.done && (_a = props_1.return)) _a.call(props_1); } finally { if (e_1) throw e_1.error; } } }; /** * The last focused element when the menu surface was opened should regain focus, if the user is * focused on or within the menu surface when it is closed. */ MDCMenuSurfaceFoundation.prototype.maybeRestoreFocus_ = function () { var isRootFocused = this.adapter_.isFocused(); var childHasFocus = document.activeElement && this.adapter_.isElementInContainer(document.activeElement); if (isRootFocused || childHasFocus) { this.adapter_.restoreFocus(); } }; MDCMenuSurfaceFoundation.prototype.hasBit_ = function (corner, bit) { return Boolean(corner & bit); // tslint:disable-line:no-bitwise }; MDCMenuSurfaceFoundation.prototype.setBit_ = function (corner, bit) { return corner | bit; // tslint:disable-line:no-bitwise }; /** * isFinite that doesn't force conversion to number type. * Equivalent to Number.isFinite in ES2015, which is not supported in IE. */ MDCMenuSurfaceFoundation.prototype.isFinite_ = function (num) { return typeof num === 'number' && isFinite(num); }; return MDCMenuSurfaceFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCMenuSurfaceFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 49 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCDismissibleDrawerFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(110); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCDismissibleDrawerFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCDismissibleDrawerFoundation, _super); function MDCDismissibleDrawerFoundation(adapter) { var _this = _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCDismissibleDrawerFoundation.defaultAdapter, adapter)) || this; _this.animationFrame_ = 0; _this.animationTimer_ = 0; return _this; } Object.defineProperty(MDCDismissibleDrawerFoundation, "strings", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCDismissibleDrawerFoundation, "cssClasses", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCDismissibleDrawerFoundation, "defaultAdapter", { get: function get() { // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { addClass: function addClass() { return undefined; }, removeClass: function removeClass() { return undefined; }, hasClass: function hasClass() { return false; }, elementHasClass: function elementHasClass() { return false; }, notifyClose: function notifyClose() { return undefined; }, notifyOpen: function notifyOpen() { return undefined; }, saveFocus: function saveFocus() { return undefined; }, restoreFocus: function restoreFocus() { return undefined; }, focusActiveNavigationItem: function focusActiveNavigationItem() { return undefined; }, trapFocus: function trapFocus() { return undefined; }, releaseFocus: function releaseFocus() { return undefined; } }; // tslint:enable:object-literal-sort-keys }, enumerable: true, configurable: true }); MDCDismissibleDrawerFoundation.prototype.destroy = function () { if (this.animationFrame_) { cancelAnimationFrame(this.animationFrame_); } if (this.animationTimer_) { clearTimeout(this.animationTimer_); } }; /** * Opens the drawer from the closed state. */ MDCDismissibleDrawerFoundation.prototype.open = function () { var _this = this; if (this.isOpen() || this.isOpening() || this.isClosing()) { return; } this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPEN); this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ANIMATE); // Wait a frame once display is no longer "none", to establish basis for animation this.runNextAnimationFrame_(function () { _this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPENING); }); this.adapter_.saveFocus(); }; /** * Closes the drawer from the open state. */ MDCDismissibleDrawerFoundation.prototype.close = function () { if (!this.isOpen() || this.isOpening() || this.isClosing()) { return; } this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSING); }; /** * Returns true if the drawer is in the open position. * @return true if drawer is in open state. */ MDCDismissibleDrawerFoundation.prototype.isOpen = function () { return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPEN); }; /** * Returns true if the drawer is animating open. * @return true if drawer is animating open. */ MDCDismissibleDrawerFoundation.prototype.isOpening = function () { return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPENING) || this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ANIMATE); }; /** * Returns true if the drawer is animating closed. * @return true if drawer is animating closed. */ MDCDismissibleDrawerFoundation.prototype.isClosing = function () { return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSING); }; /** * Keydown handler to close drawer when key is escape. */ MDCDismissibleDrawerFoundation.prototype.handleKeydown = function (evt) { var keyCode = evt.keyCode, key = evt.key; var isEscape = key === 'Escape' || keyCode === 27; if (isEscape) { this.close(); } }; /** * Handles the `transitionend` event when the drawer finishes opening/closing. */ MDCDismissibleDrawerFoundation.prototype.handleTransitionEnd = function (evt) { var OPENING = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPENING, CLOSING = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSING, OPEN = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPEN, ANIMATE = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ANIMATE, ROOT = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ROOT; // In Edge, transitionend on ripple pseudo-elements yields a target without classList, so check for Element first. var isRootElement = this.isElement_(evt.target) && this.adapter_.elementHasClass(evt.target, ROOT); if (!isRootElement) { return; } if (this.isClosing()) { this.adapter_.removeClass(OPEN); this.closed_(); this.adapter_.restoreFocus(); this.adapter_.notifyClose(); } else { this.adapter_.focusActiveNavigationItem(); this.opened_(); this.adapter_.notifyOpen(); } this.adapter_.removeClass(ANIMATE); this.adapter_.removeClass(OPENING); this.adapter_.removeClass(CLOSING); }; /** * Extension point for when drawer finishes open animation. */ MDCDismissibleDrawerFoundation.prototype.opened_ = function () {}; // tslint:disable-line:no-empty /** * Extension point for when drawer finishes close animation. */ MDCDismissibleDrawerFoundation.prototype.closed_ = function () {}; // tslint:disable-line:no-empty /** * Runs the given logic on the next animation frame, using setTimeout to factor in Firefox reflow behavior. */ MDCDismissibleDrawerFoundation.prototype.runNextAnimationFrame_ = function (callback) { var _this = this; cancelAnimationFrame(this.animationFrame_); this.animationFrame_ = requestAnimationFrame(function () { _this.animationFrame_ = 0; clearTimeout(_this.animationTimer_); _this.animationTimer_ = setTimeout(callback, 0); }); }; MDCDismissibleDrawerFoundation.prototype.isElement_ = function (element) { // In Edge, transitionend on ripple pseudo-elements yields a target without classList. return Boolean(element.classList); }; return MDCDismissibleDrawerFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCDismissibleDrawerFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 50 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTopAppBarFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(13); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(51); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var INITIAL_VALUE = 0; var MDCTopAppBarFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCTopAppBarFoundation, _super); /* istanbul ignore next: optional argument is not a branch statement */ function MDCTopAppBarFoundation(adapter) { var _this = _super.call(this, adapter) || this; /** * Indicates if the top app bar was docked in the previous scroll handler iteration. */ _this.wasDocked_ = true; /** * Indicates if the top app bar is docked in the fully shown position. */ _this.isDockedShowing_ = true; /** * Variable for current scroll position of the top app bar */ _this.currentAppBarOffsetTop_ = 0; /** * Used to prevent the top app bar from being scrolled out of view during resize events */ _this.isCurrentlyBeingResized_ = false; /** * The timeout that's used to throttle the resize events */ _this.resizeThrottleId_ = INITIAL_VALUE; /** * The timeout that's used to debounce toggling the isCurrentlyBeingResized_ variable after a resize */ _this.resizeDebounceId_ = INITIAL_VALUE; _this.lastScrollPosition_ = _this.adapter_.getViewportScrollY(); _this.topAppBarHeight_ = _this.adapter_.getTopAppBarHeight(); return _this; } MDCTopAppBarFoundation.prototype.destroy = function () { _super.prototype.destroy.call(this); this.adapter_.setStyle('top', ''); }; /** * Scroll handler for the default scroll behavior of the top app bar. * @override */ MDCTopAppBarFoundation.prototype.handleTargetScroll = function () { var currentScrollPosition = Math.max(this.adapter_.getViewportScrollY(), 0); var diff = currentScrollPosition - this.lastScrollPosition_; this.lastScrollPosition_ = currentScrollPosition; // If the window is being resized the lastScrollPosition_ needs to be updated but the // current scroll of the top app bar should stay in the same position. if (!this.isCurrentlyBeingResized_) { this.currentAppBarOffsetTop_ -= diff; if (this.currentAppBarOffsetTop_ > 0) { this.currentAppBarOffsetTop_ = 0; } else if (Math.abs(this.currentAppBarOffsetTop_) > this.topAppBarHeight_) { this.currentAppBarOffsetTop_ = -this.topAppBarHeight_; } this.moveTopAppBar_(); } }; /** * Top app bar resize handler that throttle/debounce functions that execute updates. * @override */ MDCTopAppBarFoundation.prototype.handleWindowResize = function () { var _this = this; // Throttle resize events 10 p/s if (!this.resizeThrottleId_) { this.resizeThrottleId_ = setTimeout(function () { _this.resizeThrottleId_ = INITIAL_VALUE; _this.throttledResizeHandler_(); }, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */].DEBOUNCE_THROTTLE_RESIZE_TIME_MS); } this.isCurrentlyBeingResized_ = true; if (this.resizeDebounceId_) { clearTimeout(this.resizeDebounceId_); } this.resizeDebounceId_ = setTimeout(function () { _this.handleTargetScroll(); _this.isCurrentlyBeingResized_ = false; _this.resizeDebounceId_ = INITIAL_VALUE; }, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */].DEBOUNCE_THROTTLE_RESIZE_TIME_MS); }; /** * Function to determine if the DOM needs to update. */ MDCTopAppBarFoundation.prototype.checkForUpdate_ = function () { var offscreenBoundaryTop = -this.topAppBarHeight_; var hasAnyPixelsOffscreen = this.currentAppBarOffsetTop_ < 0; var hasAnyPixelsOnscreen = this.currentAppBarOffsetTop_ > offscreenBoundaryTop; var partiallyShowing = hasAnyPixelsOffscreen && hasAnyPixelsOnscreen; // If it's partially showing, it can't be docked. if (partiallyShowing) { this.wasDocked_ = false; } else { // Not previously docked and not partially showing, it's now docked. if (!this.wasDocked_) { this.wasDocked_ = true; return true; } else if (this.isDockedShowing_ !== hasAnyPixelsOnscreen) { this.isDockedShowing_ = hasAnyPixelsOnscreen; return true; } } return partiallyShowing; }; /** * Function to move the top app bar if needed. */ MDCTopAppBarFoundation.prototype.moveTopAppBar_ = function () { if (this.checkForUpdate_()) { // Once the top app bar is fully hidden we use the max potential top app bar height as our offset // so the top app bar doesn't show if the window resizes and the new height > the old height. var offset = this.currentAppBarOffsetTop_; if (Math.abs(offset) >= this.topAppBarHeight_) { offset = -__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */].MAX_TOP_APP_BAR_HEIGHT; } this.adapter_.setStyle('top', offset + 'px'); } }; /** * Throttled function that updates the top app bar scrolled values if the * top app bar height changes. */ MDCTopAppBarFoundation.prototype.throttledResizeHandler_ = function () { var currentHeight = this.adapter_.getTopAppBarHeight(); if (this.topAppBarHeight_ !== currentHeight) { this.wasDocked_ = false; // Since the top app bar has a different height depending on the screen width, this // will ensure that the top app bar remains in the correct location if // completely hidden and a resize makes the top app bar a different height. this.currentAppBarOffsetTop_ -= this.topAppBarHeight_ - currentHeight; this.topAppBarHeight_ = currentHeight; } this.handleTargetScroll(); }; return MDCTopAppBarFoundation; }(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* MDCTopAppBarBaseFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTopAppBarFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 51 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTopAppBarBaseFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(13); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCTopAppBarBaseFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCTopAppBarBaseFoundation, _super); /* istanbul ignore next: optional argument is not a branch statement */ function MDCTopAppBarBaseFoundation(adapter) { return _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCTopAppBarBaseFoundation.defaultAdapter, adapter)) || this; } Object.defineProperty(MDCTopAppBarBaseFoundation, "strings", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCTopAppBarBaseFoundation, "cssClasses", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCTopAppBarBaseFoundation, "numbers", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCTopAppBarBaseFoundation, "defaultAdapter", { /** * See {@link MDCTopAppBarAdapter} for typing information on parameters and return types. */ get: function get() { // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { addClass: function addClass() { return undefined; }, removeClass: function removeClass() { return undefined; }, hasClass: function hasClass() { return false; }, setStyle: function setStyle() { return undefined; }, getTopAppBarHeight: function getTopAppBarHeight() { return 0; }, notifyNavigationIconClicked: function notifyNavigationIconClicked() { return undefined; }, getViewportScrollY: function getViewportScrollY() { return 0; }, getTotalActionItems: function getTotalActionItems() { return 0; } }; // tslint:enable:object-literal-sort-keys }, enumerable: true, configurable: true }); /** Other variants of TopAppBar foundation overrides this method */ MDCTopAppBarBaseFoundation.prototype.handleTargetScroll = function () {}; // tslint:disable-line:no-empty /** Other variants of TopAppBar foundation overrides this method */ MDCTopAppBarBaseFoundation.prototype.handleWindowResize = function () {}; // tslint:disable-line:no-empty MDCTopAppBarBaseFoundation.prototype.handleNavigationClick = function () { this.adapter_.notifyNavigationIconClicked(); }; return MDCTopAppBarBaseFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTopAppBarBaseFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 52 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; }); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var cssClasses = { ACTIVATED: 'mdc-select--activated', DISABLED: 'mdc-select--disabled', FOCUSED: 'mdc-select--focused', INVALID: 'mdc-select--invalid', OUTLINED: 'mdc-select--outlined', REQUIRED: 'mdc-select--required', ROOT: 'mdc-select', SELECTED_ITEM_CLASS: 'mdc-list-item--selected', WITH_LEADING_ICON: 'mdc-select--with-leading-icon' }; var strings = { ARIA_CONTROLS: 'aria-controls', ARIA_SELECTED_ATTR: 'aria-selected', CHANGE_EVENT: 'MDCSelect:change', ENHANCED_VALUE_ATTR: 'data-value', HIDDEN_INPUT_SELECTOR: 'input[type="hidden"]', LABEL_SELECTOR: '.mdc-floating-label', LEADING_ICON_SELECTOR: '.mdc-select__icon', LINE_RIPPLE_SELECTOR: '.mdc-line-ripple', MENU_SELECTOR: '.mdc-select__menu', NATIVE_CONTROL_SELECTOR: '.mdc-select__native-control', OUTLINE_SELECTOR: '.mdc-notched-outline', SELECTED_ITEM_SELECTOR: "." + cssClasses.SELECTED_ITEM_CLASS, SELECTED_TEXT_SELECTOR: '.mdc-select__selected-text' }; var numbers = { LABEL_SCALE: 0.75 }; //# sourceMappingURL=constants.js.map /***/ }), /* 53 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; }); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var strings = { ARIA_CHECKED: 'aria-checked', CHECKMARK_SELECTOR: '.mdc-chip__checkmark', ENTRY_ANIMATION_NAME: 'mdc-chip-entry', INTERACTION_EVENT: 'MDCChip:interaction', LEADING_ICON_SELECTOR: '.mdc-chip__icon--leading', REMOVAL_EVENT: 'MDCChip:removal', SELECTION_EVENT: 'MDCChip:selection', TRAILING_ICON_INTERACTION_EVENT: 'MDCChip:trailingIconInteraction', TRAILING_ICON_SELECTOR: '.mdc-chip__icon--trailing' }; var cssClasses = { CHECKMARK: 'mdc-chip__checkmark', CHIP_EXIT: 'mdc-chip--exit', HIDDEN_LEADING_ICON: 'mdc-chip__icon--leading-hidden', LEADING_ICON: 'mdc-chip__icon--leading', SELECTED: 'mdc-chip--selected', TRAILING_ICON: 'mdc-chip__icon--trailing' }; //# sourceMappingURL=constants.js.map /***/ }), /* 54 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCChipFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(53); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var emptyClientRect = { bottom: 0, height: 0, left: 0, right: 0, top: 0, width: 0 }; var MDCChipFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCChipFoundation, _super); function MDCChipFoundation(adapter) { var _this = _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCChipFoundation.defaultAdapter, adapter)) || this; /** * Whether a trailing icon click should immediately trigger exit/removal of the chip. */ _this.shouldRemoveOnTrailingIconClick_ = true; return _this; } Object.defineProperty(MDCChipFoundation, "strings", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCChipFoundation, "cssClasses", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCChipFoundation, "defaultAdapter", { get: function get() { return { addClass: function addClass() { return undefined; }, addClassToLeadingIcon: function addClassToLeadingIcon() { return undefined; }, eventTargetHasClass: function eventTargetHasClass() { return false; }, getCheckmarkBoundingClientRect: function getCheckmarkBoundingClientRect() { return emptyClientRect; }, getComputedStyleValue: function getComputedStyleValue() { return ''; }, getRootBoundingClientRect: function getRootBoundingClientRect() { return emptyClientRect; }, hasClass: function hasClass() { return false; }, hasLeadingIcon: function hasLeadingIcon() { return false; }, notifyInteraction: function notifyInteraction() { return undefined; }, notifyRemoval: function notifyRemoval() { return undefined; }, notifySelection: function notifySelection() { return undefined; }, notifyTrailingIconInteraction: function notifyTrailingIconInteraction() { return undefined; }, removeClass: function removeClass() { return undefined; }, removeClassFromLeadingIcon: function removeClassFromLeadingIcon() { return undefined; }, setAttr: function setAttr() { return undefined; }, setStyleProperty: function setStyleProperty() { return undefined; } }; }, enumerable: true, configurable: true }); MDCChipFoundation.prototype.isSelected = function () { return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SELECTED); }; MDCChipFoundation.prototype.setSelected = function (selected) { if (selected) { this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SELECTED); this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_CHECKED, 'true'); } else { this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SELECTED); this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_CHECKED, 'false'); } this.adapter_.notifySelection(selected); }; MDCChipFoundation.prototype.getShouldRemoveOnTrailingIconClick = function () { return this.shouldRemoveOnTrailingIconClick_; }; MDCChipFoundation.prototype.setShouldRemoveOnTrailingIconClick = function (shouldRemove) { this.shouldRemoveOnTrailingIconClick_ = shouldRemove; }; MDCChipFoundation.prototype.getDimensions = function () { var _this = this; var getRootRect = function getRootRect() { return _this.adapter_.getRootBoundingClientRect(); }; var getCheckmarkRect = function getCheckmarkRect() { return _this.adapter_.getCheckmarkBoundingClientRect(); }; // When a chip has a checkmark and not a leading icon, the bounding rect changes in size depending on the current // size of the checkmark. if (!this.adapter_.hasLeadingIcon()) { var checkmarkRect = getCheckmarkRect(); if (checkmarkRect) { var rootRect = getRootRect(); // Checkmark is a square, meaning the client rect's width and height are identical once the animation completes. // However, the checkbox is initially hidden by setting the width to 0. // To account for an initial width of 0, we use the checkbox's height instead (which equals the end-state width) // when adding it to the root client rect's width. return { bottom: rootRect.bottom, height: rootRect.height, left: rootRect.left, right: rootRect.right, top: rootRect.top, width: rootRect.width + checkmarkRect.height }; } } return getRootRect(); }; /** * Begins the exit animation which leads to removal of the chip. */ MDCChipFoundation.prototype.beginExit = function () { this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHIP_EXIT); }; /** * Handles an interaction event on the root element. */ MDCChipFoundation.prototype.handleInteraction = function (evt) { var isEnter = evt.key === 'Enter' || evt.keyCode === 13; if (evt.type === 'click' || isEnter) { this.adapter_.notifyInteraction(); } }; /** * Handles a transition end event on the root element. */ MDCChipFoundation.prototype.handleTransitionEnd = function (evt) { var _this = this; // Handle transition end event on the chip when it is about to be removed. if (this.adapter_.eventTargetHasClass(evt.target, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHIP_EXIT)) { if (evt.propertyName === 'width') { this.adapter_.notifyRemoval(); } else if (evt.propertyName === 'opacity') { // See: https://css-tricks.com/using-css-transitions-auto-dimensions/#article-header-id-5 var chipWidth_1 = this.adapter_.getComputedStyleValue('width'); // On the next frame (once we get the computed width), explicitly set the chip's width // to its current pixel width, so we aren't transitioning out of 'auto'. requestAnimationFrame(function () { _this.adapter_.setStyleProperty('width', chipWidth_1); // To mitigate jitter, start transitioning padding and margin before width. _this.adapter_.setStyleProperty('padding', '0'); _this.adapter_.setStyleProperty('margin', '0'); // On the next frame (once width is explicitly set), transition width to 0. requestAnimationFrame(function () { _this.adapter_.setStyleProperty('width', '0'); }); }); } return; } // Handle a transition end event on the leading icon or checkmark, since the transition end event bubbles. if (evt.propertyName !== 'opacity') { return; } if (this.adapter_.eventTargetHasClass(evt.target, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LEADING_ICON) && this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SELECTED)) { this.adapter_.addClassToLeadingIcon(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HIDDEN_LEADING_ICON); } else if (this.adapter_.eventTargetHasClass(evt.target, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHECKMARK) && !this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SELECTED)) { this.adapter_.removeClassFromLeadingIcon(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HIDDEN_LEADING_ICON); } }; /** * Handles an interaction event on the trailing icon element. This is used to * prevent the ripple from activating on interaction with the trailing icon. */ MDCChipFoundation.prototype.handleTrailingIconInteraction = function (evt) { var isEnter = evt.key === 'Enter' || evt.keyCode === 13; evt.stopPropagation(); if (evt.type === 'click' || isEnter) { this.adapter_.notifyTrailingIconInteraction(); if (this.shouldRemoveOnTrailingIconClick_) { this.beginExit(); } } }; return MDCChipFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCChipFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 55 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; }); /** * @license * Copyright 2017 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var cssClasses = { ACTIVE: 'mdc-slider--active', DISABLED: 'mdc-slider--disabled', DISCRETE: 'mdc-slider--discrete', FOCUS: 'mdc-slider--focus', HAS_TRACK_MARKER: 'mdc-slider--display-markers', IN_TRANSIT: 'mdc-slider--in-transit', IS_DISCRETE: 'mdc-slider--discrete' }; var strings = { ARIA_DISABLED: 'aria-disabled', ARIA_VALUEMAX: 'aria-valuemax', ARIA_VALUEMIN: 'aria-valuemin', ARIA_VALUENOW: 'aria-valuenow', CHANGE_EVENT: 'MDCSlider:change', INPUT_EVENT: 'MDCSlider:input', LAST_TRACK_MARKER_SELECTOR: '.mdc-slider__track-marker:last-child', PIN_VALUE_MARKER_SELECTOR: '.mdc-slider__pin-value-marker', STEP_DATA_ATTR: 'data-step', THUMB_CONTAINER_SELECTOR: '.mdc-slider__thumb-container', TRACK_MARKER_CONTAINER_SELECTOR: '.mdc-slider__track-marker-container', TRACK_SELECTOR: '.mdc-slider__track' }; var numbers = { PAGE_FACTOR: 4 }; //# sourceMappingURL=constants.js.map /***/ }), /* 56 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTabScrollerRTL; }); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCTabScrollerRTL = /** @class */function () { function MDCTabScrollerRTL(adapter) { this.adapter_ = adapter; } return MDCTabScrollerRTL; }(); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTabScrollerRTL); //# sourceMappingURL=rtl-scroller.js.map /***/ }), /* 57 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTabIndicatorFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(275); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCTabIndicatorFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCTabIndicatorFoundation, _super); function MDCTabIndicatorFoundation(adapter) { return _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCTabIndicatorFoundation.defaultAdapter, adapter)) || this; } Object.defineProperty(MDCTabIndicatorFoundation, "cssClasses", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCTabIndicatorFoundation, "strings", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCTabIndicatorFoundation, "defaultAdapter", { get: function get() { // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { addClass: function addClass() { return undefined; }, removeClass: function removeClass() { return undefined; }, computeContentClientRect: function computeContentClientRect() { return { top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0 }; }, setContentStyleProperty: function setContentStyleProperty() { return undefined; } }; // tslint:enable:object-literal-sort-keys }, enumerable: true, configurable: true }); MDCTabIndicatorFoundation.prototype.computeContentClientRect = function () { return this.adapter_.computeContentClientRect(); }; return MDCTabIndicatorFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTabIndicatorFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 58 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return events; }); /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var cssClasses = { CELL: 'mdc-data-table__cell', CELL_NUMERIC: 'mdc-data-table__cell--numeric', CONTENT: 'mdc-data-table__content', HEADER_ROW: 'mdc-data-table__header-row', HEADER_ROW_CHECKBOX: 'mdc-data-table__header-row-checkbox', ROOT: 'mdc-data-table', ROW: 'mdc-data-table__row', ROW_CHECKBOX: 'mdc-data-table__row-checkbox', ROW_SELECTED: 'mdc-data-table__row--selected' }; var strings = { ARIA_SELECTED: 'aria-selected', DATA_ROW_ID_ATTR: 'data-row-id', HEADER_ROW_CHECKBOX_SELECTOR: "." + cssClasses.HEADER_ROW_CHECKBOX, ROW_CHECKBOX_SELECTOR: "." + cssClasses.ROW_CHECKBOX, ROW_SELECTED_SELECTOR: "." + cssClasses.ROW_SELECTED, ROW_SELECTOR: "." + cssClasses.ROW }; var events = { ROW_SELECTION_CHANGED: 'MDCDataTable:rowSelectionChanged', SELECTED_ALL: 'MDCDataTable:selectedAll', UNSELECTED_ALL: 'MDCDataTable:unselectedAll' }; //# sourceMappingURL=constants.js.map /***/ }), /* 59 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initialize; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__button__ = __webpack_require__(150); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__dialogs__ = __webpack_require__(175); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__datetime__ = __webpack_require__(180); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__text_fields__ = __webpack_require__(100); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__events__ = __webpack_require__(45); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__lists__ = __webpack_require__(216); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__drawer__ = __webpack_require__(217); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__header__ = __webpack_require__(220); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__icon_toggles__ = __webpack_require__(223); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__menus__ = __webpack_require__(103); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__selects__ = __webpack_require__(226); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__chips__ = __webpack_require__(231); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__cards__ = __webpack_require__(235); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__forms__ = __webpack_require__(236); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__snackbar__ = __webpack_require__(237); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__checkboxes__ = __webpack_require__(240); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__switches__ = __webpack_require__(243); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__rich_text_area__ = __webpack_require__(246); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__steppers__ = __webpack_require__(253); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__radios__ = __webpack_require__(254); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__sliders__ = __webpack_require__(257); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__hidden_fields__ = __webpack_require__(260); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__content__ = __webpack_require__(261); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__grid__ = __webpack_require__(262); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__tab_bars__ = __webpack_require__(263); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__data_tables__ = __webpack_require__(278); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__file_inputs__ = __webpack_require__(286); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__form_fields__ = __webpack_require__(287); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__images__ = __webpack_require__(290); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__typography__ = __webpack_require__(291); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__tooltip__ = __webpack_require__(292); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__plugins__ = __webpack_require__(293); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_32__progress__ = __webpack_require__(294); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_33__drag_n_drop__ = __webpack_require__(108); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_34__multi_select__ = __webpack_require__(297); function initialize(root, setRoot) { console.debug('Initializing components'); var start = performance.now(); Object(__WEBPACK_IMPORTED_MODULE_0__button__["a" /* initButtons */])(root); Object(__WEBPACK_IMPORTED_MODULE_1__dialogs__["a" /* initDialogs */])(root); Object(__WEBPACK_IMPORTED_MODULE_2__datetime__["a" /* initDateTime */])(root); // MUST BE BEFORE initTextFields Object(__WEBPACK_IMPORTED_MODULE_3__text_fields__["b" /* initTextFields */])(root); Object(__WEBPACK_IMPORTED_MODULE_5__lists__["a" /* initLists */])(root); Object(__WEBPACK_IMPORTED_MODULE_6__drawer__["a" /* initDrawer */])(root); Object(__WEBPACK_IMPORTED_MODULE_7__header__["a" /* initHeader */])(root); Object(__WEBPACK_IMPORTED_MODULE_8__icon_toggles__["a" /* initIconToggles */])(root); Object(__WEBPACK_IMPORTED_MODULE_9__menus__["a" /* initMenus */])(root); Object(__WEBPACK_IMPORTED_MODULE_10__selects__["a" /* initSelects */])(root); Object(__WEBPACK_IMPORTED_MODULE_11__chips__["a" /* initChips */])(root); Object(__WEBPACK_IMPORTED_MODULE_12__cards__["a" /* initCards */])(root); Object(__WEBPACK_IMPORTED_MODULE_13__forms__["a" /* initForms */])(root); Object(__WEBPACK_IMPORTED_MODULE_14__snackbar__["a" /* initSnackbar */])(root); Object(__WEBPACK_IMPORTED_MODULE_15__checkboxes__["a" /* initCheckboxes */])(root); Object(__WEBPACK_IMPORTED_MODULE_16__switches__["a" /* initSwitches */])(root); Object(__WEBPACK_IMPORTED_MODULE_17__rich_text_area__["a" /* initRichTextArea */])(root); Object(__WEBPACK_IMPORTED_MODULE_18__steppers__["a" /* initSteppers */])(root); Object(__WEBPACK_IMPORTED_MODULE_19__radios__["a" /* initRadios */])(root); Object(__WEBPACK_IMPORTED_MODULE_20__sliders__["a" /* initSliders */])(root); Object(__WEBPACK_IMPORTED_MODULE_21__hidden_fields__["a" /* initHiddenFields */])(root); Object(__WEBPACK_IMPORTED_MODULE_22__content__["a" /* initContent */])(root); Object(__WEBPACK_IMPORTED_MODULE_23__grid__["a" /* initGrid */])(root); Object(__WEBPACK_IMPORTED_MODULE_24__tab_bars__["a" /* initTabBars */])(root); Object(__WEBPACK_IMPORTED_MODULE_25__data_tables__["a" /* initTables */])(root); Object(__WEBPACK_IMPORTED_MODULE_26__file_inputs__["a" /* initFileInputs */])(root); Object(__WEBPACK_IMPORTED_MODULE_27__form_fields__["a" /* initFormFields */])(root); Object(__WEBPACK_IMPORTED_MODULE_28__images__["a" /* initImages */])(root); Object(__WEBPACK_IMPORTED_MODULE_29__typography__["a" /* initTypography */])(root); Object(__WEBPACK_IMPORTED_MODULE_32__progress__["a" /* initProgress */])(root); Object(__WEBPACK_IMPORTED_MODULE_30__tooltip__["a" /* initTooltips */])(root); Object(__WEBPACK_IMPORTED_MODULE_31__plugins__["a" /* initPlugins */])(root); Object(__WEBPACK_IMPORTED_MODULE_33__drag_n_drop__["c" /* initDragAndDrop */])(root); Object(__WEBPACK_IMPORTED_MODULE_34__multi_select__["a" /* initMultiSelects */])(root); // This needs to be last, because it relies on the components installed above. Object(__WEBPACK_IMPORTED_MODULE_4__events__["b" /* initEvents */])(root); var end = performance.now(); console.debug('Done in %s ms', (end - start).toFixed(2)); } /***/ }), /* 60 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; }); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var cssClasses = { // Ripple is a special case where the "root" component is really a "mixin" of sorts, // given that it's an 'upgrade' to an existing component. That being said it is the root // CSS class that all other CSS classes derive from. BG_FOCUSED: 'mdc-ripple-upgraded--background-focused', FG_ACTIVATION: 'mdc-ripple-upgraded--foreground-activation', FG_DEACTIVATION: 'mdc-ripple-upgraded--foreground-deactivation', ROOT: 'mdc-ripple-upgraded', UNBOUNDED: 'mdc-ripple-upgraded--unbounded' }; var strings = { VAR_FG_SCALE: '--mdc-ripple-fg-scale', VAR_FG_SIZE: '--mdc-ripple-fg-size', VAR_FG_TRANSLATE_END: '--mdc-ripple-fg-translate-end', VAR_FG_TRANSLATE_START: '--mdc-ripple-fg-translate-start', VAR_LEFT: '--mdc-ripple-left', VAR_TOP: '--mdc-ripple-top' }; var numbers = { DEACTIVATION_TIMEOUT_MS: 225, FG_DEACTIVATION_MS: 150, INITIAL_ORIGIN_SCALE: 0.6, PADDING: 10, TAP_DELAY_MS: 300 }; //# sourceMappingURL=constants.js.map /***/ }), /* 61 */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(152); /***/ }), /* 62 */ /***/ (function(module, exports, __webpack_require__) { var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var global = __webpack_require__(7); var getOwnPropertyDescriptor = __webpack_require__(63).f; var createNonEnumerableProperty = __webpack_require__(20); var redefine = __webpack_require__(156); var setGlobal = __webpack_require__(34); var copyConstructorProperties = __webpack_require__(161); var isForced = __webpack_require__(168); /* options.target - name of the target object options.global - target is the global object options.stat - export as static methods of target options.proto - export as prototype methods of target options.real - real prototype method for the `pure` version options.forced - export even if the native feature is available options.bind - bind methods to the target, required for the `pure` version options.wrap - wrap constructors to preventing global pollution, required for the `pure` version options.unsafe - use the simple assignment of property instead of delete + defineProperty options.sham - add a flag to not completely full polyfills options.enumerable - export as enumerable property options.noTargetGet - prevent calling a getter on target */ module.exports = function (options, source) { var TARGET = options.target; var GLOBAL = options.global; var STATIC = options.stat; var FORCED, target, key, targetProperty, sourceProperty, descriptor; if (GLOBAL) { target = global; } else if (STATIC) { target = global[TARGET] || setGlobal(TARGET, {}); } else { target = (global[TARGET] || {}).prototype; } if (target) for (key in source) { sourceProperty = source[key]; if (options.noTargetGet) { descriptor = getOwnPropertyDescriptor(target, key); targetProperty = descriptor && descriptor.value; } else targetProperty = target[key]; FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); // contained in target if (!FORCED && targetProperty !== undefined) { if ((typeof sourceProperty === 'undefined' ? 'undefined' : _typeof(sourceProperty)) === (typeof targetProperty === 'undefined' ? 'undefined' : _typeof(targetProperty))) continue; copyConstructorProperties(sourceProperty, targetProperty); } // add a flag to not completely full polyfills if (options.sham || targetProperty && targetProperty.sham) { createNonEnumerableProperty(sourceProperty, 'sham', true); } // extend global redefine(target, key, sourceProperty, options); } }; /***/ }), /* 63 */ /***/ (function(module, exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__(16); var propertyIsEnumerableModule = __webpack_require__(154); var createPropertyDescriptor = __webpack_require__(64); var toIndexedObject = __webpack_require__(32); var toPrimitive = __webpack_require__(67); var has = __webpack_require__(19); var IE8_DOM_DEFINE = __webpack_require__(68); var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor exports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { O = toIndexedObject(O); P = toPrimitive(P, true); if (IE8_DOM_DEFINE) try { return nativeGetOwnPropertyDescriptor(O, P); } catch (error) {/* empty */} if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]); }; /***/ }), /* 64 */ /***/ (function(module, exports) { module.exports = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; /***/ }), /* 65 */ /***/ (function(module, exports) { var toString = {}.toString; module.exports = function (it) { return toString.call(it).slice(8, -1); }; /***/ }), /* 66 */ /***/ (function(module, exports) { // `RequireObjectCoercible` abstract operation // https://tc39.github.io/ecma262/#sec-requireobjectcoercible module.exports = function (it) { if (it == undefined) throw TypeError("Can't call method on " + it); return it; }; /***/ }), /* 67 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(18); // `ToPrimitive` abstract operation // https://tc39.github.io/ecma262/#sec-toprimitive // instead of the ES6 spec version, we didn't implement @@toPrimitive case // and the second argument - flag - preferred type is a string module.exports = function (input, PREFERRED_STRING) { if (!isObject(input)) return input; var fn, val; if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val; if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; throw TypeError("Can't convert object to primitive value"); }; /***/ }), /* 68 */ /***/ (function(module, exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__(16); var fails = __webpack_require__(17); var createElement = __webpack_require__(69); // Thank's IE8 for his funny defineProperty module.exports = !DESCRIPTORS && !fails(function () { return Object.defineProperty(createElement('div'), 'a', { get: function get() { return 7; } }).a != 7; }); /***/ }), /* 69 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(7); var isObject = __webpack_require__(18); var document = global.document; // typeof document.createElement is 'object' in old IE var EXISTS = isObject(document) && isObject(document.createElement); module.exports = function (it) { return EXISTS ? document.createElement(it) : {}; }; /***/ }), /* 70 */ /***/ (function(module, exports, __webpack_require__) { var shared = __webpack_require__(22); module.exports = shared('native-function-to-string', Function.toString); /***/ }), /* 71 */ /***/ (function(module, exports, __webpack_require__) { var shared = __webpack_require__(22); var uid = __webpack_require__(72); var keys = shared('keys'); module.exports = function (key) { return keys[key] || (keys[key] = uid(key)); }; /***/ }), /* 72 */ /***/ (function(module, exports) { var id = 0; var postfix = Math.random(); module.exports = function (key) { return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36); }; /***/ }), /* 73 */ /***/ (function(module, exports, __webpack_require__) { var path = __webpack_require__(163); var global = __webpack_require__(7); var aFunction = function aFunction(variable) { return typeof variable == 'function' ? variable : undefined; }; module.exports = function (namespace, method) { return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace]) : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method]; }; /***/ }), /* 74 */ /***/ (function(module, exports, __webpack_require__) { var has = __webpack_require__(19); var toIndexedObject = __webpack_require__(32); var indexOf = __webpack_require__(165).indexOf; var hiddenKeys = __webpack_require__(35); module.exports = function (object, names) { var O = toIndexedObject(object); var i = 0; var result = []; var key; for (key in O) { !has(hiddenKeys, key) && has(O, key) && result.push(key); } // Don't enum bug & hidden keys while (names.length > i) { if (has(O, key = names[i++])) { ~indexOf(result, key) || result.push(key); } }return result; }; /***/ }), /* 75 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isArray = __webpack_require__(76); var toLength = __webpack_require__(23); var bind = __webpack_require__(77); // `FlattenIntoArray` abstract operation // https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray var flattenIntoArray = function flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) { var targetIndex = start; var sourceIndex = 0; var mapFn = mapper ? bind(mapper, thisArg, 3) : false; var element; while (sourceIndex < sourceLen) { if (sourceIndex in source) { element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex]; if (depth > 0 && isArray(element)) { targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1; } else { if (targetIndex >= 0x1FFFFFFFFFFFFF) throw TypeError('Exceed the acceptable array length'); target[targetIndex] = element; } targetIndex++; } sourceIndex++; } return targetIndex; }; module.exports = flattenIntoArray; /***/ }), /* 76 */ /***/ (function(module, exports, __webpack_require__) { var classof = __webpack_require__(65); // `IsArray` abstract operation // https://tc39.github.io/ecma262/#sec-isarray module.exports = Array.isArray || function isArray(arg) { return classof(arg) == 'Array'; }; /***/ }), /* 77 */ /***/ (function(module, exports, __webpack_require__) { var aFunction = __webpack_require__(78); // optional / simple context binding module.exports = function (fn, that, length) { aFunction(fn); if (that === undefined) return fn; switch (length) { case 0: return function () { return fn.call(that); }; case 1: return function (a) { return fn.call(that, a); }; case 2: return function (a, b) { return fn.call(that, a, b); }; case 3: return function (a, b, c) { return fn.call(that, a, b, c); }; } return function () /* ...args */{ return fn.apply(that, arguments); }; }; /***/ }), /* 78 */ /***/ (function(module, exports) { module.exports = function (it) { if (typeof it != 'function') { throw TypeError(String(it) + ' is not a function'); }return it; }; /***/ }), /* 79 */ /***/ (function(module, exports, __webpack_require__) { var requireObjectCoercible = __webpack_require__(66); // `ToObject` abstract operation // https://tc39.github.io/ecma262/#sec-toobject module.exports = function (argument) { return Object(requireObjectCoercible(argument)); }; /***/ }), /* 80 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(18); var isArray = __webpack_require__(76); var wellKnownSymbol = __webpack_require__(81); var SPECIES = wellKnownSymbol('species'); // `ArraySpeciesCreate` abstract operation // https://tc39.github.io/ecma262/#sec-arrayspeciescreate module.exports = function (originalArray, length) { var C; if (isArray(originalArray)) { C = originalArray.constructor; // cross-realm fallback if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;else if (isObject(C)) { C = C[SPECIES]; if (C === null) C = undefined; } }return new (C === undefined ? Array : C)(length === 0 ? 0 : length); }; /***/ }), /* 81 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(7); var shared = __webpack_require__(22); var uid = __webpack_require__(72); var NATIVE_SYMBOL = __webpack_require__(169); var _Symbol = global.Symbol; var store = shared('wks'); module.exports = function (name) { return store[name] || (store[name] = NATIVE_SYMBOL && _Symbol[name] || (NATIVE_SYMBOL ? _Symbol : uid)('Symbol.' + name)); }; /***/ }), /* 82 */ /***/ (function(module, exports, __webpack_require__) { var wellKnownSymbol = __webpack_require__(81); var create = __webpack_require__(171); var createNonEnumerableProperty = __webpack_require__(20); var UNSCOPABLES = wellKnownSymbol('unscopables'); var ArrayPrototype = Array.prototype; // Array.prototype[@@unscopables] // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables if (ArrayPrototype[UNSCOPABLES] == undefined) { createNonEnumerableProperty(ArrayPrototype, UNSCOPABLES, create(null)); } // add a key to Array.prototype[@@unscopables] module.exports = function (key) { ArrayPrototype[UNSCOPABLES][key] = true; }; /***/ }), /* 83 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(7); var bind = __webpack_require__(77); var call = Function.call; module.exports = function (CONSTRUCTOR, METHOD, length) { return bind(call, global[CONSTRUCTOR].prototype[METHOD], length); }; /***/ }), /* 84 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["b"] = createFocusTrapInstance; /* harmony export (immutable) */ __webpack_exports__["c"] = isScrollable; /* harmony export (immutable) */ __webpack_exports__["a"] = areTopsMisaligned; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_focus_trap__ = __webpack_require__(38); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_focus_trap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_focus_trap__); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ function createFocusTrapInstance(surfaceEl, focusTrapFactory, initialFocusEl) { if (focusTrapFactory === void 0) { focusTrapFactory = __WEBPACK_IMPORTED_MODULE_0_focus_trap___default.a; } return focusTrapFactory(surfaceEl, { clickOutsideDeactivates: true, escapeDeactivates: false, initialFocus: initialFocusEl }); } function isScrollable(el) { return el ? el.scrollHeight > el.offsetHeight : false; } function areTopsMisaligned(els) { var tops = new Set(); [].forEach.call(els, function (el) { return tops.add(el.offsetTop); }); return tops.size > 1; } //# sourceMappingURL=util.js.map /***/ }), /* 85 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCDialogFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(86); /** * @license * Copyright 2017 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCDialogFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCDialogFoundation, _super); function MDCDialogFoundation(adapter) { var _this = _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCDialogFoundation.defaultAdapter, adapter)) || this; _this.isOpen_ = false; _this.animationFrame_ = 0; _this.animationTimer_ = 0; _this.layoutFrame_ = 0; _this.escapeKeyAction_ = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].CLOSE_ACTION; _this.scrimClickAction_ = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].CLOSE_ACTION; _this.autoStackButtons_ = true; _this.areButtonsStacked_ = false; return _this; } Object.defineProperty(MDCDialogFoundation, "cssClasses", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCDialogFoundation, "strings", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCDialogFoundation, "numbers", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCDialogFoundation, "defaultAdapter", { get: function get() { return { addBodyClass: function addBodyClass() { return undefined; }, addClass: function addClass() { return undefined; }, areButtonsStacked: function areButtonsStacked() { return false; }, clickDefaultButton: function clickDefaultButton() { return undefined; }, eventTargetMatches: function eventTargetMatches() { return false; }, getActionFromEvent: function getActionFromEvent() { return ''; }, getInitialFocusEl: function getInitialFocusEl() { return null; }, hasClass: function hasClass() { return false; }, isContentScrollable: function isContentScrollable() { return false; }, notifyClosed: function notifyClosed() { return undefined; }, notifyClosing: function notifyClosing() { return undefined; }, notifyOpened: function notifyOpened() { return undefined; }, notifyOpening: function notifyOpening() { return undefined; }, releaseFocus: function releaseFocus() { return undefined; }, removeBodyClass: function removeBodyClass() { return undefined; }, removeClass: function removeClass() { return undefined; }, reverseButtons: function reverseButtons() { return undefined; }, trapFocus: function trapFocus() { return undefined; } }; }, enumerable: true, configurable: true }); MDCDialogFoundation.prototype.init = function () { if (this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].STACKED)) { this.setAutoStackButtons(false); } }; MDCDialogFoundation.prototype.destroy = function () { if (this.isOpen_) { this.close(__WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].DESTROY_ACTION); } if (this.animationTimer_) { clearTimeout(this.animationTimer_); this.handleAnimationTimerEnd_(); } if (this.layoutFrame_) { cancelAnimationFrame(this.layoutFrame_); this.layoutFrame_ = 0; } }; MDCDialogFoundation.prototype.open = function () { var _this = this; this.isOpen_ = true; this.adapter_.notifyOpening(); this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPENING); // Wait a frame once display is no longer "none", to establish basis for animation this.runNextAnimationFrame_(function () { _this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPEN); _this.adapter_.addBodyClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SCROLL_LOCK); _this.layout(); _this.animationTimer_ = setTimeout(function () { _this.handleAnimationTimerEnd_(); _this.adapter_.trapFocus(_this.adapter_.getInitialFocusEl()); _this.adapter_.notifyOpened(); }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].DIALOG_ANIMATION_OPEN_TIME_MS); }); }; MDCDialogFoundation.prototype.close = function (action) { var _this = this; if (action === void 0) { action = ''; } if (!this.isOpen_) { // Avoid redundant close calls (and events), e.g. from keydown on elements that inherently emit click return; } this.isOpen_ = false; this.adapter_.notifyClosing(action); this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSING); this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPEN); this.adapter_.removeBodyClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SCROLL_LOCK); cancelAnimationFrame(this.animationFrame_); this.animationFrame_ = 0; clearTimeout(this.animationTimer_); this.animationTimer_ = setTimeout(function () { _this.adapter_.releaseFocus(); _this.handleAnimationTimerEnd_(); _this.adapter_.notifyClosed(action); }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].DIALOG_ANIMATION_CLOSE_TIME_MS); }; MDCDialogFoundation.prototype.isOpen = function () { return this.isOpen_; }; MDCDialogFoundation.prototype.getEscapeKeyAction = function () { return this.escapeKeyAction_; }; MDCDialogFoundation.prototype.setEscapeKeyAction = function (action) { this.escapeKeyAction_ = action; }; MDCDialogFoundation.prototype.getScrimClickAction = function () { return this.scrimClickAction_; }; MDCDialogFoundation.prototype.setScrimClickAction = function (action) { this.scrimClickAction_ = action; }; MDCDialogFoundation.prototype.getAutoStackButtons = function () { return this.autoStackButtons_; }; MDCDialogFoundation.prototype.setAutoStackButtons = function (autoStack) { this.autoStackButtons_ = autoStack; }; MDCDialogFoundation.prototype.layout = function () { var _this = this; if (this.layoutFrame_) { cancelAnimationFrame(this.layoutFrame_); } this.layoutFrame_ = requestAnimationFrame(function () { _this.layoutInternal_(); _this.layoutFrame_ = 0; }); }; /** Handles click on the dialog root element. */ MDCDialogFoundation.prototype.handleClick = function (evt) { var isScrim = this.adapter_.eventTargetMatches(evt.target, __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].SCRIM_SELECTOR); // Check for scrim click first since it doesn't require querying ancestors. if (isScrim && this.scrimClickAction_ !== '') { this.close(this.scrimClickAction_); } else { var action = this.adapter_.getActionFromEvent(evt); if (action) { this.close(action); } } }; /** Handles keydown on the dialog root element. */ MDCDialogFoundation.prototype.handleKeydown = function (evt) { var isEnter = evt.key === 'Enter' || evt.keyCode === 13; if (!isEnter) { return; } var action = this.adapter_.getActionFromEvent(evt); if (action) { // Action button callback is handled in `handleClick`, // since space/enter keydowns on buttons trigger click events. return; } var isDefault = !this.adapter_.eventTargetMatches(evt.target, __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].SUPPRESS_DEFAULT_PRESS_SELECTOR); if (isEnter && isDefault) { this.adapter_.clickDefaultButton(); } }; /** Handles keydown on the document. */ MDCDialogFoundation.prototype.handleDocumentKeydown = function (evt) { var isEscape = evt.key === 'Escape' || evt.keyCode === 27; if (isEscape && this.escapeKeyAction_ !== '') { this.close(this.escapeKeyAction_); } }; MDCDialogFoundation.prototype.layoutInternal_ = function () { if (this.autoStackButtons_) { this.detectStackedButtons_(); } this.detectScrollableContent_(); }; MDCDialogFoundation.prototype.handleAnimationTimerEnd_ = function () { this.animationTimer_ = 0; this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPENING); this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSING); }; /** * Runs the given logic on the next animation frame, using setTimeout to factor in Firefox reflow behavior. */ MDCDialogFoundation.prototype.runNextAnimationFrame_ = function (callback) { var _this = this; cancelAnimationFrame(this.animationFrame_); this.animationFrame_ = requestAnimationFrame(function () { _this.animationFrame_ = 0; clearTimeout(_this.animationTimer_); _this.animationTimer_ = setTimeout(callback, 0); }); }; MDCDialogFoundation.prototype.detectStackedButtons_ = function () { // Remove the class first to let us measure the buttons' natural positions. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].STACKED); var areButtonsStacked = this.adapter_.areButtonsStacked(); if (areButtonsStacked) { this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].STACKED); } if (areButtonsStacked !== this.areButtonsStacked_) { this.adapter_.reverseButtons(); this.areButtonsStacked_ = areButtonsStacked; } }; MDCDialogFoundation.prototype.detectScrollableContent_ = function () { // Remove the class first to let us measure the natural height of the content. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SCROLLABLE); if (this.adapter_.isContentScrollable()) { this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SCROLLABLE); } }; return MDCDialogFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCDialogFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 86 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; }); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var cssClasses = { CLOSING: 'mdc-dialog--closing', OPEN: 'mdc-dialog--open', OPENING: 'mdc-dialog--opening', SCROLLABLE: 'mdc-dialog--scrollable', SCROLL_LOCK: 'mdc-dialog-scroll-lock', STACKED: 'mdc-dialog--stacked' }; var strings = { ACTION_ATTRIBUTE: 'data-mdc-dialog-action', BUTTON_DEFAULT_ATTRIBUTE: 'data-mdc-dialog-button-default', BUTTON_SELECTOR: '.mdc-dialog__button', CLOSED_EVENT: 'MDCDialog:closed', CLOSE_ACTION: 'close', CLOSING_EVENT: 'MDCDialog:closing', CONTAINER_SELECTOR: '.mdc-dialog__container', CONTENT_SELECTOR: '.mdc-dialog__content', DESTROY_ACTION: 'destroy', INITIAL_FOCUS_ATTRIBUTE: 'data-mdc-dialog-initial-focus', OPENED_EVENT: 'MDCDialog:opened', OPENING_EVENT: 'MDCDialog:opening', SCRIM_SELECTOR: '.mdc-dialog__scrim', SUPPRESS_DEFAULT_PRESS_SELECTOR: ['textarea', '.mdc-menu .mdc-list-item'].join(', '), SURFACE_SELECTOR: '.mdc-dialog__surface' }; var numbers = { DIALOG_ANIMATION_CLOSE_TIME_MS: 75, DIALOG_ANIMATION_OPEN_TIME_MS: 150 }; //# sourceMappingURL=constants.js.map /***/ }), /* 87 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__component__ = __webpack_require__(182); /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__component__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(42); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(94); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__character_counter_index__ = __webpack_require__(186); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__helper_text_index__ = __webpack_require__(187); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__icon_index__ = __webpack_require__(188); /* unused harmony namespace reexport */ /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ //# sourceMappingURL=index.js.map /***/ }), /* 88 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCFloatingLabel; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(89); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCFloatingLabel = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCFloatingLabel, _super); function MDCFloatingLabel() { return _super !== null && _super.apply(this, arguments) || this; } MDCFloatingLabel.attachTo = function (root) { return new MDCFloatingLabel(root); }; /** * Styles the label to produce the label shake for errors. * @param shouldShake If true, shakes the label by adding a CSS class; otherwise, stops shaking by removing the class. */ MDCFloatingLabel.prototype.shake = function (shouldShake) { this.foundation_.shake(shouldShake); }; /** * Styles the label to float/dock. * @param shouldFloat If true, floats the label by adding a CSS class; otherwise, docks it by removing the class. */ MDCFloatingLabel.prototype.float = function (shouldFloat) { this.foundation_.float(shouldFloat); }; MDCFloatingLabel.prototype.getWidth = function () { return this.foundation_.getWidth(); }; MDCFloatingLabel.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. var adapter = { addClass: function addClass(className) { return _this.root_.classList.add(className); }, removeClass: function removeClass(className) { return _this.root_.classList.remove(className); }, getWidth: function getWidth() { return _this.root_.scrollWidth; }, registerInteractionHandler: function registerInteractionHandler(evtType, handler) { return _this.listen(evtType, handler); }, deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) { return _this.unlisten(evtType, handler); } }; // tslint:enable:object-literal-sort-keys return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* MDCFloatingLabelFoundation */](adapter); }; return MDCFloatingLabel; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 89 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCFloatingLabelFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(183); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCFloatingLabelFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCFloatingLabelFoundation, _super); function MDCFloatingLabelFoundation(adapter) { var _this = _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCFloatingLabelFoundation.defaultAdapter, adapter)) || this; _this.shakeAnimationEndHandler_ = function () { return _this.handleShakeAnimationEnd_(); }; return _this; } Object.defineProperty(MDCFloatingLabelFoundation, "cssClasses", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCFloatingLabelFoundation, "defaultAdapter", { /** * See {@link MDCFloatingLabelAdapter} for typing information on parameters and return types. */ get: function get() { // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { addClass: function addClass() { return undefined; }, removeClass: function removeClass() { return undefined; }, getWidth: function getWidth() { return 0; }, registerInteractionHandler: function registerInteractionHandler() { return undefined; }, deregisterInteractionHandler: function deregisterInteractionHandler() { return undefined; } }; // tslint:enable:object-literal-sort-keys }, enumerable: true, configurable: true }); MDCFloatingLabelFoundation.prototype.init = function () { this.adapter_.registerInteractionHandler('animationend', this.shakeAnimationEndHandler_); }; MDCFloatingLabelFoundation.prototype.destroy = function () { this.adapter_.deregisterInteractionHandler('animationend', this.shakeAnimationEndHandler_); }; /** * Returns the width of the label element. */ MDCFloatingLabelFoundation.prototype.getWidth = function () { return this.adapter_.getWidth(); }; /** * Styles the label to produce a shake animation to indicate an error. * @param shouldShake If true, adds the shake CSS class; otherwise, removes shake class. */ MDCFloatingLabelFoundation.prototype.shake = function (shouldShake) { var LABEL_SHAKE = MDCFloatingLabelFoundation.cssClasses.LABEL_SHAKE; if (shouldShake) { this.adapter_.addClass(LABEL_SHAKE); } else { this.adapter_.removeClass(LABEL_SHAKE); } }; /** * Styles the label to float or dock. * @param shouldFloat If true, adds the float CSS class; otherwise, removes float and shake classes to dock the label. */ MDCFloatingLabelFoundation.prototype.float = function (shouldFloat) { var _a = MDCFloatingLabelFoundation.cssClasses, LABEL_FLOAT_ABOVE = _a.LABEL_FLOAT_ABOVE, LABEL_SHAKE = _a.LABEL_SHAKE; if (shouldFloat) { this.adapter_.addClass(LABEL_FLOAT_ABOVE); } else { this.adapter_.removeClass(LABEL_FLOAT_ABOVE); this.adapter_.removeClass(LABEL_SHAKE); } }; MDCFloatingLabelFoundation.prototype.handleShakeAnimationEnd_ = function () { var LABEL_SHAKE = MDCFloatingLabelFoundation.cssClasses.LABEL_SHAKE; this.adapter_.removeClass(LABEL_SHAKE); }; return MDCFloatingLabelFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCFloatingLabelFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 90 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCLineRipple; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(184); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCLineRipple = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCLineRipple, _super); function MDCLineRipple() { return _super !== null && _super.apply(this, arguments) || this; } MDCLineRipple.attachTo = function (root) { return new MDCLineRipple(root); }; /** * Activates the line ripple */ MDCLineRipple.prototype.activate = function () { this.foundation_.activate(); }; /** * Deactivates the line ripple */ MDCLineRipple.prototype.deactivate = function () { this.foundation_.deactivate(); }; /** * Sets the transform origin given a user's click location. * The `rippleCenter` is the x-coordinate of the middle of the ripple. */ MDCLineRipple.prototype.setRippleCenter = function (xCoordinate) { this.foundation_.setRippleCenter(xCoordinate); }; MDCLineRipple.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. var adapter = { addClass: function addClass(className) { return _this.root_.classList.add(className); }, removeClass: function removeClass(className) { return _this.root_.classList.remove(className); }, hasClass: function hasClass(className) { return _this.root_.classList.contains(className); }, setStyle: function setStyle(propertyName, value) { return _this.root_.style.setProperty(propertyName, value); }, registerEventHandler: function registerEventHandler(evtType, handler) { return _this.listen(evtType, handler); }, deregisterEventHandler: function deregisterEventHandler(evtType, handler) { return _this.unlisten(evtType, handler); } }; // tslint:enable:object-literal-sort-keys return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* MDCLineRippleFoundation */](adapter); }; return MDCLineRipple; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 91 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCNotchedOutlineFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(40); /** * @license * Copyright 2017 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCNotchedOutlineFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCNotchedOutlineFoundation, _super); function MDCNotchedOutlineFoundation(adapter) { return _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCNotchedOutlineFoundation.defaultAdapter, adapter)) || this; } Object.defineProperty(MDCNotchedOutlineFoundation, "strings", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCNotchedOutlineFoundation, "cssClasses", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCNotchedOutlineFoundation, "numbers", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCNotchedOutlineFoundation, "defaultAdapter", { /** * See {@link MDCNotchedOutlineAdapter} for typing information on parameters and return types. */ get: function get() { // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { addClass: function addClass() { return undefined; }, removeClass: function removeClass() { return undefined; }, setNotchWidthProperty: function setNotchWidthProperty() { return undefined; }, removeNotchWidthProperty: function removeNotchWidthProperty() { return undefined; } }; // tslint:enable:object-literal-sort-keys }, enumerable: true, configurable: true }); /** * Adds the outline notched selector and updates the notch width calculated based off of notchWidth. */ MDCNotchedOutlineFoundation.prototype.notch = function (notchWidth) { var OUTLINE_NOTCHED = MDCNotchedOutlineFoundation.cssClasses.OUTLINE_NOTCHED; if (notchWidth > 0) { notchWidth += __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].NOTCH_ELEMENT_PADDING; // Add padding from left/right. } this.adapter_.setNotchWidthProperty(notchWidth); this.adapter_.addClass(OUTLINE_NOTCHED); }; /** * Removes notched outline selector to close the notch in the outline. */ MDCNotchedOutlineFoundation.prototype.closeNotch = function () { var OUTLINE_NOTCHED = MDCNotchedOutlineFoundation.cssClasses.OUTLINE_NOTCHED; this.adapter_.removeClass(OUTLINE_NOTCHED); this.adapter_.removeNotchWidthProperty(); }; return MDCNotchedOutlineFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCNotchedOutlineFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 92 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTextFieldCharacterCounter; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(41); /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCTextFieldCharacterCounter = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCTextFieldCharacterCounter, _super); function MDCTextFieldCharacterCounter() { return _super !== null && _super.apply(this, arguments) || this; } MDCTextFieldCharacterCounter.attachTo = function (root) { return new MDCTextFieldCharacterCounter(root); }; Object.defineProperty(MDCTextFieldCharacterCounter.prototype, "foundation", { get: function get() { return this.foundation_; }, enumerable: true, configurable: true }); MDCTextFieldCharacterCounter.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. var adapter = { setContent: function setContent(content) { _this.root_.textContent = content; } }; return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* MDCTextFieldCharacterCounterFoundation */](adapter); }; return MDCTextFieldCharacterCounter; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 93 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; }); /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var cssClasses = { ROOT: 'mdc-text-field-character-counter' }; var strings = { ROOT_SELECTOR: "." + cssClasses.ROOT }; //# sourceMappingURL=constants.js.map /***/ }), /* 94 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTextFieldFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(42); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var POINTERDOWN_EVENTS = ['mousedown', 'touchstart']; var INTERACTION_EVENTS = ['click', 'keydown']; var MDCTextFieldFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCTextFieldFoundation, _super); /** * @param adapter * @param foundationMap Map from subcomponent names to their subfoundations. */ function MDCTextFieldFoundation(adapter, foundationMap) { if (foundationMap === void 0) { foundationMap = {}; } var _this = _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCTextFieldFoundation.defaultAdapter, adapter)) || this; _this.isFocused_ = false; _this.receivedUserInput_ = false; _this.isValid_ = true; _this.useNativeValidation_ = true; _this.helperText_ = foundationMap.helperText; _this.characterCounter_ = foundationMap.characterCounter; _this.leadingIcon_ = foundationMap.leadingIcon; _this.trailingIcon_ = foundationMap.trailingIcon; _this.inputFocusHandler_ = function () { return _this.activateFocus(); }; _this.inputBlurHandler_ = function () { return _this.deactivateFocus(); }; _this.inputInputHandler_ = function () { return _this.handleInput(); }; _this.setPointerXOffset_ = function (evt) { return _this.setTransformOrigin(evt); }; _this.textFieldInteractionHandler_ = function () { return _this.handleTextFieldInteraction(); }; _this.validationAttributeChangeHandler_ = function (attributesList) { return _this.handleValidationAttributeChange(attributesList); }; return _this; } Object.defineProperty(MDCTextFieldFoundation, "cssClasses", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCTextFieldFoundation, "strings", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["e" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCTextFieldFoundation, "numbers", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["d" /* numbers */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCTextFieldFoundation.prototype, "shouldAlwaysFloat_", { get: function get() { var type = this.getNativeInput_().type; return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* ALWAYS_FLOAT_TYPES */].indexOf(type) >= 0; }, enumerable: true, configurable: true }); Object.defineProperty(MDCTextFieldFoundation.prototype, "shouldFloat", { get: function get() { return this.shouldAlwaysFloat_ || this.isFocused_ || Boolean(this.getValue()) || this.isBadInput_(); }, enumerable: true, configurable: true }); Object.defineProperty(MDCTextFieldFoundation.prototype, "shouldShake", { get: function get() { return !this.isFocused_ && !this.isValid() && Boolean(this.getValue()); }, enumerable: true, configurable: true }); Object.defineProperty(MDCTextFieldFoundation, "defaultAdapter", { /** * See {@link MDCTextFieldAdapter} for typing information on parameters and return types. */ get: function get() { // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { addClass: function addClass() { return undefined; }, removeClass: function removeClass() { return undefined; }, hasClass: function hasClass() { return true; }, registerTextFieldInteractionHandler: function registerTextFieldInteractionHandler() { return undefined; }, deregisterTextFieldInteractionHandler: function deregisterTextFieldInteractionHandler() { return undefined; }, registerInputInteractionHandler: function registerInputInteractionHandler() { return undefined; }, deregisterInputInteractionHandler: function deregisterInputInteractionHandler() { return undefined; }, registerValidationAttributeChangeHandler: function registerValidationAttributeChangeHandler() { return new MutationObserver(function () { return undefined; }); }, deregisterValidationAttributeChangeHandler: function deregisterValidationAttributeChangeHandler() { return undefined; }, getNativeInput: function getNativeInput() { return null; }, isFocused: function isFocused() { return false; }, activateLineRipple: function activateLineRipple() { return undefined; }, deactivateLineRipple: function deactivateLineRipple() { return undefined; }, setLineRippleTransformOrigin: function setLineRippleTransformOrigin() { return undefined; }, shakeLabel: function shakeLabel() { return undefined; }, floatLabel: function floatLabel() { return undefined; }, hasLabel: function hasLabel() { return false; }, getLabelWidth: function getLabelWidth() { return 0; }, hasOutline: function hasOutline() { return false; }, notchOutline: function notchOutline() { return undefined; }, closeOutline: function closeOutline() { return undefined; } }; // tslint:enable:object-literal-sort-keys }, enumerable: true, configurable: true }); MDCTextFieldFoundation.prototype.init = function () { var _this = this; if (this.adapter_.isFocused()) { this.inputFocusHandler_(); } else if (this.adapter_.hasLabel() && this.shouldFloat) { this.notchOutline(true); this.adapter_.floatLabel(true); } this.adapter_.registerInputInteractionHandler('focus', this.inputFocusHandler_); this.adapter_.registerInputInteractionHandler('blur', this.inputBlurHandler_); this.adapter_.registerInputInteractionHandler('input', this.inputInputHandler_); POINTERDOWN_EVENTS.forEach(function (evtType) { _this.adapter_.registerInputInteractionHandler(evtType, _this.setPointerXOffset_); }); INTERACTION_EVENTS.forEach(function (evtType) { _this.adapter_.registerTextFieldInteractionHandler(evtType, _this.textFieldInteractionHandler_); }); this.validationObserver_ = this.adapter_.registerValidationAttributeChangeHandler(this.validationAttributeChangeHandler_); this.setCharacterCounter_(this.getValue().length); }; MDCTextFieldFoundation.prototype.destroy = function () { var _this = this; this.adapter_.deregisterInputInteractionHandler('focus', this.inputFocusHandler_); this.adapter_.deregisterInputInteractionHandler('blur', this.inputBlurHandler_); this.adapter_.deregisterInputInteractionHandler('input', this.inputInputHandler_); POINTERDOWN_EVENTS.forEach(function (evtType) { _this.adapter_.deregisterInputInteractionHandler(evtType, _this.setPointerXOffset_); }); INTERACTION_EVENTS.forEach(function (evtType) { _this.adapter_.deregisterTextFieldInteractionHandler(evtType, _this.textFieldInteractionHandler_); }); this.adapter_.deregisterValidationAttributeChangeHandler(this.validationObserver_); }; /** * Handles user interactions with the Text Field. */ MDCTextFieldFoundation.prototype.handleTextFieldInteraction = function () { var nativeInput = this.adapter_.getNativeInput(); if (nativeInput && nativeInput.disabled) { return; } this.receivedUserInput_ = true; }; /** * Handles validation attribute changes */ MDCTextFieldFoundation.prototype.handleValidationAttributeChange = function (attributesList) { var _this = this; attributesList.some(function (attributeName) { if (__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* VALIDATION_ATTR_WHITELIST */].indexOf(attributeName) > -1) { _this.styleValidity_(true); return true; } return false; }); if (attributesList.indexOf('maxlength') > -1) { this.setCharacterCounter_(this.getValue().length); } }; /** * Opens/closes the notched outline. */ MDCTextFieldFoundation.prototype.notchOutline = function (openNotch) { if (!this.adapter_.hasOutline()) { return; } if (openNotch) { var isDense = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["c" /* cssClasses */].DENSE); var labelScale = isDense ? __WEBPACK_IMPORTED_MODULE_2__constants__["d" /* numbers */].DENSE_LABEL_SCALE : __WEBPACK_IMPORTED_MODULE_2__constants__["d" /* numbers */].LABEL_SCALE; var labelWidth = this.adapter_.getLabelWidth() * labelScale; this.adapter_.notchOutline(labelWidth); } else { this.adapter_.closeOutline(); } }; /** * Activates the text field focus state. */ MDCTextFieldFoundation.prototype.activateFocus = function () { this.isFocused_ = true; this.styleFocused_(this.isFocused_); this.adapter_.activateLineRipple(); if (this.adapter_.hasLabel()) { this.notchOutline(this.shouldFloat); this.adapter_.floatLabel(this.shouldFloat); this.adapter_.shakeLabel(this.shouldShake); } if (this.helperText_) { this.helperText_.showToScreenReader(); } }; /** * Sets the line ripple's transform origin, so that the line ripple activate * animation will animate out from the user's click location. */ MDCTextFieldFoundation.prototype.setTransformOrigin = function (evt) { var touches = evt.touches; var targetEvent = touches ? touches[0] : evt; var targetClientRect = targetEvent.target.getBoundingClientRect(); var normalizedX = targetEvent.clientX - targetClientRect.left; this.adapter_.setLineRippleTransformOrigin(normalizedX); }; /** * Handles input change of text input and text area. */ MDCTextFieldFoundation.prototype.handleInput = function () { this.autoCompleteFocus(); this.setCharacterCounter_(this.getValue().length); }; /** * Activates the Text Field's focus state in cases when the input value * changes without user input (e.g. programmatically). */ MDCTextFieldFoundation.prototype.autoCompleteFocus = function () { if (!this.receivedUserInput_) { this.activateFocus(); } }; /** * Deactivates the Text Field's focus state. */ MDCTextFieldFoundation.prototype.deactivateFocus = function () { this.isFocused_ = false; this.adapter_.deactivateLineRipple(); var isValid = this.isValid(); this.styleValidity_(isValid); this.styleFocused_(this.isFocused_); if (this.adapter_.hasLabel()) { this.notchOutline(this.shouldFloat); this.adapter_.floatLabel(this.shouldFloat); this.adapter_.shakeLabel(this.shouldShake); } if (!this.shouldFloat) { this.receivedUserInput_ = false; } }; MDCTextFieldFoundation.prototype.getValue = function () { return this.getNativeInput_().value; }; /** * @param value The value to set on the input Element. */ MDCTextFieldFoundation.prototype.setValue = function (value) { // Prevent Safari from moving the caret to the end of the input when the value has not changed. if (this.getValue() !== value) { this.getNativeInput_().value = value; } this.setCharacterCounter_(value.length); var isValid = this.isValid(); this.styleValidity_(isValid); if (this.adapter_.hasLabel()) { this.notchOutline(this.shouldFloat); this.adapter_.floatLabel(this.shouldFloat); this.adapter_.shakeLabel(this.shouldShake); } }; /** * @return The custom validity state, if set; otherwise, the result of a native validity check. */ MDCTextFieldFoundation.prototype.isValid = function () { return this.useNativeValidation_ ? this.isNativeInputValid_() : this.isValid_; }; /** * @param isValid Sets the custom validity state of the Text Field. */ MDCTextFieldFoundation.prototype.setValid = function (isValid) { this.isValid_ = isValid; this.styleValidity_(isValid); var shouldShake = !isValid && !this.isFocused_; if (this.adapter_.hasLabel()) { this.adapter_.shakeLabel(shouldShake); } }; /** * Enables or disables the use of native validation. Use this for custom validation. * @param useNativeValidation Set this to false to ignore native input validation. */ MDCTextFieldFoundation.prototype.setUseNativeValidation = function (useNativeValidation) { this.useNativeValidation_ = useNativeValidation; }; MDCTextFieldFoundation.prototype.isDisabled = function () { return this.getNativeInput_().disabled; }; /** * @param disabled Sets the text-field disabled or enabled. */ MDCTextFieldFoundation.prototype.setDisabled = function (disabled) { this.getNativeInput_().disabled = disabled; this.styleDisabled_(disabled); }; /** * @param content Sets the content of the helper text. */ MDCTextFieldFoundation.prototype.setHelperTextContent = function (content) { if (this.helperText_) { this.helperText_.setContent(content); } }; /** * Sets the aria label of the leading icon. */ MDCTextFieldFoundation.prototype.setLeadingIconAriaLabel = function (label) { if (this.leadingIcon_) { this.leadingIcon_.setAriaLabel(label); } }; /** * Sets the text content of the leading icon. */ MDCTextFieldFoundation.prototype.setLeadingIconContent = function (content) { if (this.leadingIcon_) { this.leadingIcon_.setContent(content); } }; /** * Sets the aria label of the trailing icon. */ MDCTextFieldFoundation.prototype.setTrailingIconAriaLabel = function (label) { if (this.trailingIcon_) { this.trailingIcon_.setAriaLabel(label); } }; /** * Sets the text content of the trailing icon. */ MDCTextFieldFoundation.prototype.setTrailingIconContent = function (content) { if (this.trailingIcon_) { this.trailingIcon_.setContent(content); } }; /** * Sets character counter values that shows characters used and the total character limit. */ MDCTextFieldFoundation.prototype.setCharacterCounter_ = function (currentLength) { if (!this.characterCounter_) { return; } var maxLength = this.getNativeInput_().maxLength; if (maxLength === -1) { throw new Error('MDCTextFieldFoundation: Expected maxlength html property on text input or textarea.'); } this.characterCounter_.setCounterValue(currentLength, maxLength); }; /** * @return True if the Text Field input fails in converting the user-supplied value. */ MDCTextFieldFoundation.prototype.isBadInput_ = function () { // The badInput property is not supported in IE 11 💩. return this.getNativeInput_().validity.badInput || false; }; /** * @return The result of native validity checking (ValidityState.valid). */ MDCTextFieldFoundation.prototype.isNativeInputValid_ = function () { return this.getNativeInput_().validity.valid; }; /** * Styles the component based on the validity state. */ MDCTextFieldFoundation.prototype.styleValidity_ = function (isValid) { var INVALID = MDCTextFieldFoundation.cssClasses.INVALID; if (isValid) { this.adapter_.removeClass(INVALID); } else { this.adapter_.addClass(INVALID); } if (this.helperText_) { this.helperText_.setValidity(isValid); } }; /** * Styles the component based on the focused state. */ MDCTextFieldFoundation.prototype.styleFocused_ = function (isFocused) { var FOCUSED = MDCTextFieldFoundation.cssClasses.FOCUSED; if (isFocused) { this.adapter_.addClass(FOCUSED); } else { this.adapter_.removeClass(FOCUSED); } }; /** * Styles the component based on the disabled state. */ MDCTextFieldFoundation.prototype.styleDisabled_ = function (isDisabled) { var _a = MDCTextFieldFoundation.cssClasses, DISABLED = _a.DISABLED, INVALID = _a.INVALID; if (isDisabled) { this.adapter_.addClass(DISABLED); this.adapter_.removeClass(INVALID); } else { this.adapter_.removeClass(DISABLED); } if (this.leadingIcon_) { this.leadingIcon_.setDisabled(isDisabled); } if (this.trailingIcon_) { this.trailingIcon_.setDisabled(isDisabled); } }; /** * @return The native text input element from the host environment, or an object with the same shape for unit tests. */ MDCTextFieldFoundation.prototype.getNativeInput_ = function () { // this.adapter_ may be undefined in foundation unit tests. This happens when testdouble is creating a mock object // and invokes the shouldShake/shouldFloat getters (which in turn call getValue(), which calls this method) before // init() has been called from the MDCTextField constructor. To work around that issue, we return a dummy object. var nativeInput = this.adapter_ ? this.adapter_.getNativeInput() : null; return nativeInput || { disabled: false, maxLength: -1, type: 'input', validity: { badInput: false, valid: true }, value: '' }; }; return MDCTextFieldFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTextFieldFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 95 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTextFieldHelperText; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(43); /** * @license * Copyright 2017 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCTextFieldHelperText = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCTextFieldHelperText, _super); function MDCTextFieldHelperText() { return _super !== null && _super.apply(this, arguments) || this; } MDCTextFieldHelperText.attachTo = function (root) { return new MDCTextFieldHelperText(root); }; Object.defineProperty(MDCTextFieldHelperText.prototype, "foundation", { get: function get() { return this.foundation_; }, enumerable: true, configurable: true }); MDCTextFieldHelperText.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. var adapter = { addClass: function addClass(className) { return _this.root_.classList.add(className); }, removeClass: function removeClass(className) { return _this.root_.classList.remove(className); }, hasClass: function hasClass(className) { return _this.root_.classList.contains(className); }, setAttr: function setAttr(attr, value) { return _this.root_.setAttribute(attr, value); }, removeAttr: function removeAttr(attr) { return _this.root_.removeAttribute(attr); }, setContent: function setContent(content) { _this.root_.textContent = content; } }; // tslint:enable:object-literal-sort-keys return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* MDCTextFieldHelperTextFoundation */](adapter); }; return MDCTextFieldHelperText; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 96 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; }); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var cssClasses = { HELPER_TEXT_PERSISTENT: 'mdc-text-field-helper-text--persistent', HELPER_TEXT_VALIDATION_MSG: 'mdc-text-field-helper-text--validation-msg', ROOT: 'mdc-text-field-helper-text' }; var strings = { ARIA_HIDDEN: 'aria-hidden', ROLE: 'role', ROOT_SELECTOR: "." + cssClasses.ROOT }; //# sourceMappingURL=constants.js.map /***/ }), /* 97 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTextFieldIcon; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(98); /** * @license * Copyright 2017 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCTextFieldIcon = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCTextFieldIcon, _super); function MDCTextFieldIcon() { return _super !== null && _super.apply(this, arguments) || this; } MDCTextFieldIcon.attachTo = function (root) { return new MDCTextFieldIcon(root); }; Object.defineProperty(MDCTextFieldIcon.prototype, "foundation", { get: function get() { return this.foundation_; }, enumerable: true, configurable: true }); MDCTextFieldIcon.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. var adapter = { getAttr: function getAttr(attr) { return _this.root_.getAttribute(attr); }, setAttr: function setAttr(attr, value) { return _this.root_.setAttribute(attr, value); }, removeAttr: function removeAttr(attr) { return _this.root_.removeAttribute(attr); }, setContent: function setContent(content) { _this.root_.textContent = content; }, registerInteractionHandler: function registerInteractionHandler(evtType, handler) { return _this.listen(evtType, handler); }, deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) { return _this.unlisten(evtType, handler); }, notifyIconAction: function notifyIconAction() { return _this.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* MDCTextFieldIconFoundation */].strings.ICON_EVENT, {} /* evtData */, true /* shouldBubble */); } }; // tslint:enable:object-literal-sort-keys return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* MDCTextFieldIconFoundation */](adapter); }; return MDCTextFieldIcon; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 98 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTextFieldIconFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(99); /** * @license * Copyright 2017 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var INTERACTION_EVENTS = ['click', 'keydown']; var MDCTextFieldIconFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCTextFieldIconFoundation, _super); function MDCTextFieldIconFoundation(adapter) { var _this = _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCTextFieldIconFoundation.defaultAdapter, adapter)) || this; _this.savedTabIndex_ = null; _this.interactionHandler_ = function (evt) { return _this.handleInteraction(evt); }; return _this; } Object.defineProperty(MDCTextFieldIconFoundation, "strings", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCTextFieldIconFoundation, "cssClasses", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCTextFieldIconFoundation, "defaultAdapter", { /** * See {@link MDCTextFieldIconAdapter} for typing information on parameters and return types. */ get: function get() { // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { getAttr: function getAttr() { return null; }, setAttr: function setAttr() { return undefined; }, removeAttr: function removeAttr() { return undefined; }, setContent: function setContent() { return undefined; }, registerInteractionHandler: function registerInteractionHandler() { return undefined; }, deregisterInteractionHandler: function deregisterInteractionHandler() { return undefined; }, notifyIconAction: function notifyIconAction() { return undefined; } }; // tslint:enable:object-literal-sort-keys }, enumerable: true, configurable: true }); MDCTextFieldIconFoundation.prototype.init = function () { var _this = this; this.savedTabIndex_ = this.adapter_.getAttr('tabindex'); INTERACTION_EVENTS.forEach(function (evtType) { _this.adapter_.registerInteractionHandler(evtType, _this.interactionHandler_); }); }; MDCTextFieldIconFoundation.prototype.destroy = function () { var _this = this; INTERACTION_EVENTS.forEach(function (evtType) { _this.adapter_.deregisterInteractionHandler(evtType, _this.interactionHandler_); }); }; MDCTextFieldIconFoundation.prototype.setDisabled = function (disabled) { if (!this.savedTabIndex_) { return; } if (disabled) { this.adapter_.setAttr('tabindex', '-1'); this.adapter_.removeAttr('role'); } else { this.adapter_.setAttr('tabindex', this.savedTabIndex_); this.adapter_.setAttr('role', __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ICON_ROLE); } }; MDCTextFieldIconFoundation.prototype.setAriaLabel = function (label) { this.adapter_.setAttr('aria-label', label); }; MDCTextFieldIconFoundation.prototype.setContent = function (content) { this.adapter_.setContent(content); }; MDCTextFieldIconFoundation.prototype.handleInteraction = function (evt) { var isEnterKey = evt.key === 'Enter' || evt.keyCode === 13; if (evt.type === 'click' || isEnterKey) { this.adapter_.notifyIconAction(); } }; return MDCTextFieldIconFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTextFieldIconFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 99 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; }); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var strings = { ICON_EVENT: 'MDCTextField:icon', ICON_ROLE: 'button' }; var cssClasses = { ROOT: 'mdc-text-field__icon' }; //# sourceMappingURL=constants.js.map /***/ }), /* 100 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["b"] = initTextFields; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VTextField; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_textfield__ = __webpack_require__(87); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__base_component__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__mixins_event_handler__ = __webpack_require__(4); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__mixins_visibility_observer__ = __webpack_require__(44); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__mixins_dirtyable__ = __webpack_require__(11); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var AFTER_INPUT_EVENT = 'after_input'; var AFTER_INPUT_TIMEOUT = 500; // ms function initTextFields(e) { console.debug('\tTextFields'); Object(__WEBPACK_IMPORTED_MODULE_1__base_component__["c" /* hookupComponents */])(e, '.v-text-field', VTextField, __WEBPACK_IMPORTED_MODULE_0__material_textfield__["a" /* MDCTextField */]); } var VTextField = function (_dirtyableMixin) { _inherits(VTextField, _dirtyableMixin); function VTextField(element, mdcComponent) { _classCallCheck(this, VTextField); var _this = _possibleConstructorReturn(this, (VTextField.__proto__ || Object.getPrototypeOf(VTextField)).call(this, element, mdcComponent)); _this.input = element.querySelector('input,textarea'); _this.input.vComponent = _this; _this.afterInputTimeout = null; _this.helperDisplay = _this.root.getElementById(element.id + '-input-helper-text'); _this.origHelperText = _this.helperDisplay.innerHTML.trim(); _this.recalcWhenVisible(_this); _this.input.addEventListener('input', function (event) { clearTimeout(_this.afterInputTimeout); _this.afterInputTimeout = setTimeout(function () { _this.element.dispatchEvent(new Event(AFTER_INPUT_EVENT, { composed: true })); }, AFTER_INPUT_TIMEOUT); }); var caseType = element.dataset.case_type; if (caseType !== 'mixed') { _this.input.addEventListener('keyup', function (e) { _this.forceCase(caseType); }); } _this.originalValue = _this.value(); return _this; } // Called whenever a form is about to be submitted. // returns true on success // returns on failure return an error object that can be processed by VErrors: // { email: ["email must be filled", "email must be from your domain"] } // { :page: ["must be filled"] } _createClass(VTextField, [{ key: 'validate', value: function validate(formData) { console.debug('TextField validate', formData); var isValid = this.input.checkValidity(); if (isValid) { if (this.origHelperText !== '') { this.helperDisplay.innerHTML = this.origHelperText; this.helperDisplay.classList.remove('v-hidden', 'mdc-text-field-helper-text--validation-msg'); this.element.classList.remove('mdc-text-field--invalid'); } else { this.helperDisplay.classList.add('v-hidden'); } return true; } var message = this.helperDisplay.dataset.validationError ? this.helperDisplay.dataset.validationError : this.input.validationMessage; var errorMessage = {}; errorMessage[this.element.id] = [message]; return errorMessage; } // Called to collect data for submission }, { key: 'prepareSubmit', value: function prepareSubmit(params) { var optionSelected = this.optionSelected(); if (optionSelected) { var key = optionSelected.dataset.key; if (key) { var name = this.name(); var id = name + '_id'; params.push([id, key]); console.debug('TextField prepareSubmit added:' + id + '=' + key); } } params.push([this.name(), this.value()]); } }, { key: 'optionSelected', value: function optionSelected() { var dataList = this.element.querySelector('datalist'); if (dataList) { var parentElement = this.input; // If we find the input inside our list, we submit the form var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = dataList.children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var element = _step.value; if (element.value === parentElement.value) { return element; } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } } return null; } }, { key: 'name', value: function name() { return this.input.name; } }, { key: 'value', value: function value() { return this.input.value; } }, { key: 'clear', value: function clear() { if (this.value() !== '') { this.setValue(null); } } }, { key: 'reset', value: function reset() { this.input.value = this.originalValue; } }, { key: 'setValue', value: function setValue(value) { this.input.value = value; } }, { key: 'isDirty', value: function isDirty() { return this.dirtyable && this.value().localeCompare(this.originalValue) !== 0; } }, { key: 'onShow', value: function onShow() { this.mdcComponent.layout(); } }, { key: 'preview', value: function preview(result, acceptsMimeTypes) { this.setValue(result); } // Return true if focus is able to be set, false otherwise }, { key: 'focus', value: function focus() { if (this.isHidden() || this.input.disabled) return false; this.input.focus(); return true; } }, { key: 'isHidden', value: function isHidden() { var style = window.getComputedStyle(this.element); return style.display === 'none'; } }, { key: 'forceCase', value: function forceCase(caseType) { if (caseType === 'upper') { this.input.value = this.input.value.toUpperCase(); } else if (caseType === 'lower') { this.input.value = this.input.value.toLowerCase(); } } }]); return VTextField; }(Object(__WEBPACK_IMPORTED_MODULE_4__mixins_dirtyable__["a" /* dirtyableMixin */])(Object(__WEBPACK_IMPORTED_MODULE_3__mixins_visibility_observer__["a" /* visibilityObserverMixin */])(Object(__WEBPACK_IMPORTED_MODULE_2__mixins_event_handler__["a" /* eventHandlerMixin */])(__WEBPACK_IMPORTED_MODULE_1__base_component__["a" /* VBaseComponent */])))); /***/ }), /* 101 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_config__ = __webpack_require__(189); /* harmony default export */ __webpack_exports__["a"] = (new __WEBPACK_IMPORTED_MODULE_0__utils_config__["a" /* default */]({ component: { datetime: { flatpickr: { altInput: true, disableMobile: true, clickOpens: false, defaultHour: 0 } } }, request: { headers: { POST: { Accept: 'application/json,text/html;q=0.9' } } }, compatibility: { errorMessage: 'Your browser is not supported! Please use a different browser to continue.', incompatibleBrowsers: ['ie'] } })); /***/ }), /* 102 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = getEventTarget; function getEventTarget(event) { if (typeof event.composedPath === 'function') { var compTarget = event.composedPath()[0]; if (compTarget) { return compTarget; } if (event.path && event.path[0]) { return event.path[0]; } } return event.target; } /***/ }), /* 103 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["b"] = uninitMenus; /* harmony export (immutable) */ __webpack_exports__["a"] = initMenus; /* unused harmony export VMenu */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_menu__ = __webpack_require__(200); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__base_component__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__mixins_event_handler__ = __webpack_require__(4); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__events__ = __webpack_require__(45); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function createMenuHandler(menu, element) { return function (event) { var offset = parseInt(element.dataset.rightOffset); var placement = element.dataset.placement === 'contextual' ? __WEBPACK_IMPORTED_MODULE_0__material_menu__["a" /* Corner */].TOP_LEFT : __WEBPACK_IMPORTED_MODULE_0__material_menu__["a" /* Corner */].BOTTOM_LEFT; menu.setAbsolutePosition(event.clientX, event.clientY); menu.setAnchorMargin({ left: offset }); menu.setAnchorCorner(placement); menu.open = !menu.open; event.stopPropagation(); }; } function createSurfaceClickHandler(mdcMenu) { return function (event) { if (mdcMenu.open) { if (event.target.classList.contains('v-menu-link')) { mdcMenu.open = false; } } }; } function uninitMenus(root) { console.debug('\tUninit Menus'); Object(__WEBPACK_IMPORTED_MODULE_1__base_component__["e" /* unhookupComponents */])(root, '.v-menu'); } function initMenus(root) { console.debug('\tMenus'); Object(__WEBPACK_IMPORTED_MODULE_1__base_component__["c" /* hookupComponents */])(root, '.v-menu', VMenu, null); } var VMenu = function (_eventHandlerMixin) { _inherits(VMenu, _eventHandlerMixin); function VMenu(element) { _classCallCheck(this, VMenu); var _this = _possibleConstructorReturn(this, (VMenu.__proto__ || Object.getPrototypeOf(VMenu)).call(this, element)); _this.hoistedMenuElement = element.querySelector('.mdc-menu'); _this.mdcComponent = new __WEBPACK_IMPORTED_MODULE_0__material_menu__["b" /* MDCMenu */](_this.hoistedMenuElement); Object(__WEBPACK_IMPORTED_MODULE_3__events__["b" /* initEvents */])(_this.hoistedMenuElement); // Ensure that the menu surface closes when an item is clicked _this.hoistedMenuElement.addEventListener('click', createSurfaceClickHandler(_this.mdcComponent), { capture: true }); var link = _this.menulink(); if (link) { link.addEventListener('click', createMenuHandler(_this.mdcComponent, element)); } if (_this.hoistedMenuElement.getAttribute('data-hoist') != 'false') { _this.mdcComponent.hoistMenuToBody(); } return _this; } _createClass(VMenu, [{ key: "destroy", value: function destroy() { _get(VMenu.prototype.__proto__ || Object.getPrototypeOf(VMenu.prototype), "destroy", this).call(this); Object(__WEBPACK_IMPORTED_MODULE_3__events__["c" /* removeEvents */])(this.hoistedMenuElement); var link = this.menulink(); if (link) { link.removeEventListener('click', createMenuHandler(this.mdcComponent, this.element)); } this.hoistedMenuElement.removeEventListener('click', createSurfaceClickHandler(), { capture: true }); this.hoistedMenuElement.parentNode.removeChild(this.hoistedMenuElement); } }, { key: "menulink", value: function menulink() { var anchor = this.element.closest('.mdc-menu-anchor'); var link = null; if (anchor) { link = anchor.querySelector('.v-menu-click'); } return link; } }]); return VMenu; }(Object(__WEBPACK_IMPORTED_MODULE_2__mixins_event_handler__["a" /* eventHandlerMixin */])(__WEBPACK_IMPORTED_MODULE_1__base_component__["a" /* VBaseComponent */])); /***/ }), /* 104 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCMenu; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_dom_ponyfill__ = __webpack_require__(5); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_list_component__ = __webpack_require__(105); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_list_foundation__ = __webpack_require__(47); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__material_menu_surface_component__ = __webpack_require__(201); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__material_menu_surface_foundation__ = __webpack_require__(48); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__constants__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__foundation__ = __webpack_require__(106); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCMenu = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCMenu, _super); function MDCMenu() { return _super !== null && _super.apply(this, arguments) || this; } MDCMenu.attachTo = function (root) { return new MDCMenu(root); }; MDCMenu.prototype.initialize = function (menuSurfaceFactory, listFactory) { if (menuSurfaceFactory === void 0) { menuSurfaceFactory = function menuSurfaceFactory(el) { return new __WEBPACK_IMPORTED_MODULE_5__material_menu_surface_component__["a" /* MDCMenuSurface */](el); }; } if (listFactory === void 0) { listFactory = function listFactory(el) { return new __WEBPACK_IMPORTED_MODULE_3__material_list_component__["a" /* MDCList */](el); }; } this.menuSurfaceFactory_ = menuSurfaceFactory; this.listFactory_ = listFactory; }; MDCMenu.prototype.initialSyncWithDOM = function () { var _this = this; this.menuSurface_ = this.menuSurfaceFactory_(this.root_); var list = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["d" /* strings */].LIST_SELECTOR); if (list) { this.list_ = this.listFactory_(list); this.list_.wrapFocus = true; } else { this.list_ = null; } this.handleKeydown_ = function (evt) { return _this.foundation_.handleKeydown(evt); }; this.handleItemAction_ = function (evt) { return _this.foundation_.handleItemAction(_this.items[evt.detail.index]); }; this.handleMenuSurfaceOpened_ = function () { return _this.foundation_.handleMenuSurfaceOpened(); }; this.menuSurface_.listen(__WEBPACK_IMPORTED_MODULE_6__material_menu_surface_foundation__["a" /* MDCMenuSurfaceFoundation */].strings.OPENED_EVENT, this.handleMenuSurfaceOpened_); this.listen('keydown', this.handleKeydown_); this.listen(__WEBPACK_IMPORTED_MODULE_4__material_list_foundation__["a" /* MDCListFoundation */].strings.ACTION_EVENT, this.handleItemAction_); }; MDCMenu.prototype.destroy = function () { if (this.list_) { this.list_.destroy(); } this.menuSurface_.destroy(); this.menuSurface_.unlisten(__WEBPACK_IMPORTED_MODULE_6__material_menu_surface_foundation__["a" /* MDCMenuSurfaceFoundation */].strings.OPENED_EVENT, this.handleMenuSurfaceOpened_); this.unlisten('keydown', this.handleKeydown_); this.unlisten(__WEBPACK_IMPORTED_MODULE_4__material_list_foundation__["a" /* MDCListFoundation */].strings.ACTION_EVENT, this.handleItemAction_); _super.prototype.destroy.call(this); }; Object.defineProperty(MDCMenu.prototype, "open", { get: function get() { return this.menuSurface_.isOpen(); }, set: function set(value) { if (value) { this.menuSurface_.open(); } else { this.menuSurface_.close(); } }, enumerable: true, configurable: true }); Object.defineProperty(MDCMenu.prototype, "wrapFocus", { get: function get() { return this.list_ ? this.list_.wrapFocus : false; }, set: function set(value) { if (this.list_) { this.list_.wrapFocus = value; } }, enumerable: true, configurable: true }); Object.defineProperty(MDCMenu.prototype, "items", { /** * Return the items within the menu. Note that this only contains the set of elements within * the items container that are proper list items, and not supplemental / presentational DOM * elements. */ get: function get() { return this.list_ ? this.list_.listElements : []; }, enumerable: true, configurable: true }); Object.defineProperty(MDCMenu.prototype, "quickOpen", { set: function set(quickOpen) { this.menuSurface_.quickOpen = quickOpen; }, enumerable: true, configurable: true }); /** * Sets default focus state where the menu should focus every time when menu * is opened. Focuses the list root (`DefaultFocusState.LIST_ROOT`) element by * default. * @param focusState Default focus state. */ MDCMenu.prototype.setDefaultFocusState = function (focusState) { this.foundation_.setDefaultFocusState(focusState); }; /** * @param corner Default anchor corner alignment of top-left menu corner. */ MDCMenu.prototype.setAnchorCorner = function (corner) { this.menuSurface_.setAnchorCorner(corner); }; MDCMenu.prototype.setAnchorMargin = function (margin) { this.menuSurface_.setAnchorMargin(margin); }; /** * Sets the list item as the selected row at the specified index. * @param index Index of list item within menu. */ MDCMenu.prototype.setSelectedIndex = function (index) { this.foundation_.setSelectedIndex(index); }; /** * Sets the enabled state to isEnabled for the menu item at the given index. * @param index Index of the menu item * @param isEnabled The desired enabled state of the menu item. */ MDCMenu.prototype.setEnabled = function (index, isEnabled) { this.foundation_.setEnabled(index, isEnabled); }; /** * @return The item within the menu at the index specified. */ MDCMenu.prototype.getOptionByIndex = function (index) { var items = this.items; if (index < items.length) { return this.items[index]; } else { return null; } }; MDCMenu.prototype.setFixedPosition = function (isFixed) { this.menuSurface_.setFixedPosition(isFixed); }; MDCMenu.prototype.hoistMenuToBody = function () { this.menuSurface_.hoistMenuToBody(); }; MDCMenu.prototype.setIsHoisted = function (isHoisted) { this.menuSurface_.setIsHoisted(isHoisted); }; MDCMenu.prototype.setAbsolutePosition = function (x, y) { this.menuSurface_.setAbsolutePosition(x, y); }; /** * Sets the element that the menu-surface is anchored to. */ MDCMenu.prototype.setAnchorElement = function (element) { this.menuSurface_.anchorElement = element; }; MDCMenu.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. var adapter = { addClassToElementAtIndex: function addClassToElementAtIndex(index, className) { var list = _this.items; list[index].classList.add(className); }, removeClassFromElementAtIndex: function removeClassFromElementAtIndex(index, className) { var list = _this.items; list[index].classList.remove(className); }, addAttributeToElementAtIndex: function addAttributeToElementAtIndex(index, attr, value) { var list = _this.items; list[index].setAttribute(attr, value); }, removeAttributeFromElementAtIndex: function removeAttributeFromElementAtIndex(index, attr) { var list = _this.items; list[index].removeAttribute(attr); }, elementContainsClass: function elementContainsClass(element, className) { return element.classList.contains(className); }, closeSurface: function closeSurface(skipRestoreFocus) { return _this.menuSurface_.close(skipRestoreFocus); }, getElementIndex: function getElementIndex(element) { return _this.items.indexOf(element); }, notifySelected: function notifySelected(evtData) { return _this.emit(__WEBPACK_IMPORTED_MODULE_7__constants__["d" /* strings */].SELECTED_EVENT, { index: evtData.index, item: _this.items[evtData.index] }); }, getMenuItemCount: function getMenuItemCount() { return _this.items.length; }, focusItemAtIndex: function focusItemAtIndex(index) { return _this.items[index].focus(); }, focusListRoot: function focusListRoot() { return _this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["d" /* strings */].LIST_SELECTOR).focus(); }, isSelectableItemAtIndex: function isSelectableItemAtIndex(index) { return !!Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_ponyfill__["a" /* closest */])(_this.items[index], "." + __WEBPACK_IMPORTED_MODULE_7__constants__["b" /* cssClasses */].MENU_SELECTION_GROUP); }, getSelectedSiblingOfItemAtIndex: function getSelectedSiblingOfItemAtIndex(index) { var selectionGroupEl = Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_ponyfill__["a" /* closest */])(_this.items[index], "." + __WEBPACK_IMPORTED_MODULE_7__constants__["b" /* cssClasses */].MENU_SELECTION_GROUP); var selectedItemEl = selectionGroupEl.querySelector("." + __WEBPACK_IMPORTED_MODULE_7__constants__["b" /* cssClasses */].MENU_SELECTED_LIST_ITEM); return selectedItemEl ? _this.items.indexOf(selectedItemEl) : -1; } }; // tslint:enable:object-literal-sort-keys return new __WEBPACK_IMPORTED_MODULE_8__foundation__["a" /* MDCMenuFoundation */](adapter); }; return MDCMenu; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 105 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCList; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_dom_ponyfill__ = __webpack_require__(5); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(46); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation__ = __webpack_require__(47); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCList = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCList, _super); function MDCList() { return _super !== null && _super.apply(this, arguments) || this; } Object.defineProperty(MDCList.prototype, "vertical", { set: function set(value) { this.foundation_.setVerticalOrientation(value); }, enumerable: true, configurable: true }); Object.defineProperty(MDCList.prototype, "listElements", { get: function get() { return [].slice.call(this.root_.querySelectorAll("." + __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].LIST_ITEM_CLASS)); }, enumerable: true, configurable: true }); Object.defineProperty(MDCList.prototype, "wrapFocus", { set: function set(value) { this.foundation_.setWrapFocus(value); }, enumerable: true, configurable: true }); Object.defineProperty(MDCList.prototype, "singleSelection", { set: function set(isSingleSelectionList) { this.foundation_.setSingleSelection(isSingleSelectionList); }, enumerable: true, configurable: true }); Object.defineProperty(MDCList.prototype, "selectedIndex", { get: function get() { return this.foundation_.getSelectedIndex(); }, set: function set(index) { this.foundation_.setSelectedIndex(index); }, enumerable: true, configurable: true }); MDCList.attachTo = function (root) { return new MDCList(root); }; MDCList.prototype.initialSyncWithDOM = function () { this.handleClick_ = this.handleClickEvent_.bind(this); this.handleKeydown_ = this.handleKeydownEvent_.bind(this); this.focusInEventListener_ = this.handleFocusInEvent_.bind(this); this.focusOutEventListener_ = this.handleFocusOutEvent_.bind(this); this.listen('keydown', this.handleKeydown_); this.listen('click', this.handleClick_); this.listen('focusin', this.focusInEventListener_); this.listen('focusout', this.focusOutEventListener_); this.layout(); this.initializeListType(); }; MDCList.prototype.destroy = function () { this.unlisten('keydown', this.handleKeydown_); this.unlisten('click', this.handleClick_); this.unlisten('focusin', this.focusInEventListener_); this.unlisten('focusout', this.focusOutEventListener_); }; MDCList.prototype.layout = function () { var direction = this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ARIA_ORIENTATION); this.vertical = direction !== __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ARIA_ORIENTATION_HORIZONTAL; // List items need to have at least tabindex=-1 to be focusable. [].slice.call(this.root_.querySelectorAll('.mdc-list-item:not([tabindex])')).forEach(function (el) { el.setAttribute('tabindex', '-1'); }); // Child button/a elements are not tabbable until the list item is focused. [].slice.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].FOCUSABLE_CHILD_ELEMENTS)).forEach(function (el) { return el.setAttribute('tabindex', '-1'); }); this.foundation_.layout(); }; /** * Initialize selectedIndex value based on pre-selected checkbox list items, single selection or radio. */ MDCList.prototype.initializeListType = function () { var _this = this; var checkboxListItems = this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ARIA_ROLE_CHECKBOX_SELECTOR); var singleSelectedListItem = this.root_.querySelector("\n ." + __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].LIST_ITEM_ACTIVATED_CLASS + ",\n ." + __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].LIST_ITEM_SELECTED_CLASS + "\n "); var radioSelectedListItem = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ARIA_CHECKED_RADIO_SELECTOR); if (checkboxListItems.length) { var preselectedItems = this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ARIA_CHECKED_CHECKBOX_SELECTOR); this.selectedIndex = [].map.call(preselectedItems, function (listItem) { return _this.listElements.indexOf(listItem); }); } else if (singleSelectedListItem) { if (singleSelectedListItem.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].LIST_ITEM_ACTIVATED_CLASS)) { this.foundation_.setUseActivatedClass(true); } this.singleSelection = true; this.selectedIndex = this.listElements.indexOf(singleSelectedListItem); } else if (radioSelectedListItem) { this.selectedIndex = this.listElements.indexOf(radioSelectedListItem); } }; /** * Updates the list item at itemIndex to the desired isEnabled state. * @param itemIndex Index of the list item * @param isEnabled Sets the list item to enabled or disabled. */ MDCList.prototype.setEnabled = function (itemIndex, isEnabled) { this.foundation_.setEnabled(itemIndex, isEnabled); }; MDCList.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. var adapter = { addClassForElementIndex: function addClassForElementIndex(index, className) { var element = _this.listElements[index]; if (element) { element.classList.add(className); } }, focusItemAtIndex: function focusItemAtIndex(index) { var element = _this.listElements[index]; if (element) { element.focus(); } }, getAttributeForElementIndex: function getAttributeForElementIndex(index, attr) { return _this.listElements[index].getAttribute(attr); }, getFocusedElementIndex: function getFocusedElementIndex() { return _this.listElements.indexOf(document.activeElement); }, getListItemCount: function getListItemCount() { return _this.listElements.length; }, hasCheckboxAtIndex: function hasCheckboxAtIndex(index) { var listItem = _this.listElements[index]; return !!listItem.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].CHECKBOX_SELECTOR); }, hasRadioAtIndex: function hasRadioAtIndex(index) { var listItem = _this.listElements[index]; return !!listItem.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].RADIO_SELECTOR); }, isCheckboxCheckedAtIndex: function isCheckboxCheckedAtIndex(index) { var listItem = _this.listElements[index]; var toggleEl = listItem.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].CHECKBOX_SELECTOR); return toggleEl.checked; }, isFocusInsideList: function isFocusInsideList() { return _this.root_.contains(document.activeElement); }, isRootFocused: function isRootFocused() { return document.activeElement === _this.root_; }, notifyAction: function notifyAction(index) { _this.emit(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ACTION_EVENT, { index: index }, /** shouldBubble */true); }, removeClassForElementIndex: function removeClassForElementIndex(index, className) { var element = _this.listElements[index]; if (element) { element.classList.remove(className); } }, setAttributeForElementIndex: function setAttributeForElementIndex(index, attr, value) { var element = _this.listElements[index]; if (element) { element.setAttribute(attr, value); } }, setCheckedCheckboxOrRadioAtIndex: function setCheckedCheckboxOrRadioAtIndex(index, isChecked) { var listItem = _this.listElements[index]; var toggleEl = listItem.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].CHECKBOX_RADIO_SELECTOR); toggleEl.checked = isChecked; var event = document.createEvent('Event'); event.initEvent('change', true, true); toggleEl.dispatchEvent(event); }, setTabIndexForListItemChildren: function setTabIndexForListItemChildren(listItemIndex, tabIndexValue) { var element = _this.listElements[listItemIndex]; var listItemChildren = [].slice.call(element.querySelectorAll(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].CHILD_ELEMENTS_TO_TOGGLE_TABINDEX)); listItemChildren.forEach(function (el) { return el.setAttribute('tabindex', tabIndexValue); }); } }; return new __WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* MDCListFoundation */](adapter); }; /** * Used to figure out which list item this event is targetting. Or returns -1 if * there is no list item */ MDCList.prototype.getListItemIndex_ = function (evt) { var eventTarget = evt.target; var nearestParent = Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_ponyfill__["a" /* closest */])(eventTarget, "." + __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].LIST_ITEM_CLASS + ", ." + __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].ROOT); // Get the index of the element if it is a list item. if (nearestParent && Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_ponyfill__["b" /* matches */])(nearestParent, "." + __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].LIST_ITEM_CLASS)) { return this.listElements.indexOf(nearestParent); } return -1; }; /** * Used to figure out which element was clicked before sending the event to the foundation. */ MDCList.prototype.handleFocusInEvent_ = function (evt) { var index = this.getListItemIndex_(evt); this.foundation_.handleFocusIn(evt, index); }; /** * Used to figure out which element was clicked before sending the event to the foundation. */ MDCList.prototype.handleFocusOutEvent_ = function (evt) { var index = this.getListItemIndex_(evt); this.foundation_.handleFocusOut(evt, index); }; /** * Used to figure out which element was focused when keydown event occurred before sending the event to the * foundation. */ MDCList.prototype.handleKeydownEvent_ = function (evt) { var index = this.getListItemIndex_(evt); var target = evt.target; this.foundation_.handleKeydown(evt, target.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].LIST_ITEM_CLASS), index); }; /** * Used to figure out which element was clicked before sending the event to the foundation. */ MDCList.prototype.handleClickEvent_ = function (evt) { var index = this.getListItemIndex_(evt); var target = evt.target; // Toggle the checkbox only if it's not the target of the event, or the checkbox will have 2 change events. var toggleCheckbox = !Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_ponyfill__["b" /* matches */])(target, __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].CHECKBOX_RADIO_SELECTOR); this.foundation_.handleClick(index, toggleCheckbox); }; return MDCList; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 106 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCMenuFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_list_constants__ = __webpack_require__(46); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_menu_surface_foundation__ = __webpack_require__(48); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__(26); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCMenuFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCMenuFoundation, _super); function MDCMenuFoundation(adapter) { var _this = _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCMenuFoundation.defaultAdapter, adapter)) || this; _this.closeAnimationEndTimerId_ = 0; _this.defaultFocusState_ = __WEBPACK_IMPORTED_MODULE_4__constants__["a" /* DefaultFocusState */].LIST_ROOT; return _this; } Object.defineProperty(MDCMenuFoundation, "cssClasses", { get: function get() { return __WEBPACK_IMPORTED_MODULE_4__constants__["b" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCMenuFoundation, "strings", { get: function get() { return __WEBPACK_IMPORTED_MODULE_4__constants__["d" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCMenuFoundation, "numbers", { get: function get() { return __WEBPACK_IMPORTED_MODULE_4__constants__["c" /* numbers */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCMenuFoundation, "defaultAdapter", { /** * @see {@link MDCMenuAdapter} for typing information on parameters and return types. */ get: function get() { // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { addClassToElementAtIndex: function addClassToElementAtIndex() { return undefined; }, removeClassFromElementAtIndex: function removeClassFromElementAtIndex() { return undefined; }, addAttributeToElementAtIndex: function addAttributeToElementAtIndex() { return undefined; }, removeAttributeFromElementAtIndex: function removeAttributeFromElementAtIndex() { return undefined; }, elementContainsClass: function elementContainsClass() { return false; }, closeSurface: function closeSurface() { return undefined; }, getElementIndex: function getElementIndex() { return -1; }, notifySelected: function notifySelected() { return undefined; }, getMenuItemCount: function getMenuItemCount() { return 0; }, focusItemAtIndex: function focusItemAtIndex() { return undefined; }, focusListRoot: function focusListRoot() { return undefined; }, getSelectedSiblingOfItemAtIndex: function getSelectedSiblingOfItemAtIndex() { return -1; }, isSelectableItemAtIndex: function isSelectableItemAtIndex() { return false; } }; // tslint:enable:object-literal-sort-keys }, enumerable: true, configurable: true }); MDCMenuFoundation.prototype.destroy = function () { if (this.closeAnimationEndTimerId_) { clearTimeout(this.closeAnimationEndTimerId_); } this.adapter_.closeSurface(); }; MDCMenuFoundation.prototype.handleKeydown = function (evt) { var key = evt.key, keyCode = evt.keyCode; var isTab = key === 'Tab' || keyCode === 9; if (isTab) { this.adapter_.closeSurface( /** skipRestoreFocus */true); } }; MDCMenuFoundation.prototype.handleItemAction = function (listItem) { var _this = this; var index = this.adapter_.getElementIndex(listItem); if (index < 0) { return; } this.adapter_.notifySelected({ index: index }); this.adapter_.closeSurface(); // Wait for the menu to close before adding/removing classes that affect styles. this.closeAnimationEndTimerId_ = setTimeout(function () { // Recompute the index in case the menu contents have changed. var recomputedIndex = _this.adapter_.getElementIndex(listItem); if (_this.adapter_.isSelectableItemAtIndex(recomputedIndex)) { _this.setSelectedIndex(recomputedIndex); } }, __WEBPACK_IMPORTED_MODULE_3__material_menu_surface_foundation__["a" /* MDCMenuSurfaceFoundation */].numbers.TRANSITION_CLOSE_DURATION); }; MDCMenuFoundation.prototype.handleMenuSurfaceOpened = function () { switch (this.defaultFocusState_) { case __WEBPACK_IMPORTED_MODULE_4__constants__["a" /* DefaultFocusState */].FIRST_ITEM: this.adapter_.focusItemAtIndex(0); break; case __WEBPACK_IMPORTED_MODULE_4__constants__["a" /* DefaultFocusState */].LAST_ITEM: this.adapter_.focusItemAtIndex(this.adapter_.getMenuItemCount() - 1); break; case __WEBPACK_IMPORTED_MODULE_4__constants__["a" /* DefaultFocusState */].NONE: // Do nothing. break; default: this.adapter_.focusListRoot(); break; } }; /** * Sets default focus state where the menu should focus every time when menu * is opened. Focuses the list root (`DefaultFocusState.LIST_ROOT`) element by * default. */ MDCMenuFoundation.prototype.setDefaultFocusState = function (focusState) { this.defaultFocusState_ = focusState; }; /** * Selects the list item at `index` within the menu. * @param index Index of list item within the menu. */ MDCMenuFoundation.prototype.setSelectedIndex = function (index) { this.validatedIndex_(index); if (!this.adapter_.isSelectableItemAtIndex(index)) { throw new Error('MDCMenuFoundation: No selection group at specified index.'); } var prevSelectedIndex = this.adapter_.getSelectedSiblingOfItemAtIndex(index); if (prevSelectedIndex >= 0) { this.adapter_.removeAttributeFromElementAtIndex(prevSelectedIndex, __WEBPACK_IMPORTED_MODULE_4__constants__["d" /* strings */].ARIA_CHECKED_ATTR); this.adapter_.removeClassFromElementAtIndex(prevSelectedIndex, __WEBPACK_IMPORTED_MODULE_4__constants__["b" /* cssClasses */].MENU_SELECTED_LIST_ITEM); } this.adapter_.addClassToElementAtIndex(index, __WEBPACK_IMPORTED_MODULE_4__constants__["b" /* cssClasses */].MENU_SELECTED_LIST_ITEM); this.adapter_.addAttributeToElementAtIndex(index, __WEBPACK_IMPORTED_MODULE_4__constants__["d" /* strings */].ARIA_CHECKED_ATTR, 'true'); }; /** * Sets the enabled state to isEnabled for the menu item at the given index. * @param index Index of the menu item * @param isEnabled The desired enabled state of the menu item. */ MDCMenuFoundation.prototype.setEnabled = function (index, isEnabled) { this.validatedIndex_(index); if (isEnabled) { this.adapter_.removeClassFromElementAtIndex(index, __WEBPACK_IMPORTED_MODULE_2__material_list_constants__["a" /* cssClasses */].LIST_ITEM_DISABLED_CLASS); this.adapter_.addAttributeToElementAtIndex(index, __WEBPACK_IMPORTED_MODULE_4__constants__["d" /* strings */].ARIA_DISABLED_ATTR, 'false'); } else { this.adapter_.addClassToElementAtIndex(index, __WEBPACK_IMPORTED_MODULE_2__material_list_constants__["a" /* cssClasses */].LIST_ITEM_DISABLED_CLASS); this.adapter_.addAttributeToElementAtIndex(index, __WEBPACK_IMPORTED_MODULE_4__constants__["d" /* strings */].ARIA_DISABLED_ATTR, 'true'); } }; MDCMenuFoundation.prototype.validatedIndex_ = function (index) { var menuSize = this.adapter_.getMenuItemCount(); var isIndexInRange = index >= 0 && index < menuSize; if (!isIndexInRange) { throw new Error('MDCMenuFoundation: No list item at specified index.'); } }; return MDCMenuFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCMenuFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 107 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VDialog; }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var VDialog = function () { function VDialog(options, params, event, root) { _classCallCheck(this, VDialog); this.dialogId = options.target; this.params = params; this.event = event; this.root = root; } _createClass(VDialog, [{ key: 'call', value: function call(results) { var dialog = this.root.querySelector('#' + this.dialogId); if (!(dialog && dialog.vComponent)) { var err = new Error('Unable to find dialog ' + this.dialogId + '. ' + 'Did you forget to attach it?'); results.push({ action: 'dialog', contentType: 'v/errors', content: { exception: err.message } }); return new Promise(function (_, reject) { return reject(results); }); } return new Promise(function (resolve, reject) { var comp = dialog.vComponent.mdcComponent; comp.listen('MDCDialog:closed', function (event) { results.push({ action: 'dialog', statusCode: 200, dialogAction: event.detail.action }); resolve(results); }); dialog.vComponent.open(); }); } }]); return VDialog; }(); /***/ }), /* 108 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export EVENT_DROPPED */ /* harmony export (immutable) */ __webpack_exports__["c"] = initDragAndDrop; /* harmony export (immutable) */ __webpack_exports__["b"] = hasDragDropData; /* harmony export (immutable) */ __webpack_exports__["a"] = extractDragDropData; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__base_component__ = __webpack_require__(1); /* A drag data store (DragEvent.prototype.dataTransfer.items) can be in one of three modes: 1. read/write, during a `dragstart` event: items can be read and added 2. read-only, during a `drop` event: items can be read, but not added 3. protected, during all other types of DragEvent: items cannot be read or added. (see https://html.spec.whatwg.org/multipage/dnd.html#concept-dnd-rw) Thus, attempting to mutate the store during events other than `dragstart` fails silently: no error is raised, but items are not added. To read items in protected mode, serialize data as a string and store it as a key instead of as a value. This makes it accessible via `dataTransfer.types`: // in a dragstart handler: event.dataTransfer.setData(JSON.stringify(foo), ''); // in a later read-only or protected DragEvent handler: const json = event.dataTransfer.types[someIndex]; const foo = JSON.stringify(json); There is no workaround for attempting to mutate a drag data store not in read/write mode. */ var EVENT_DROPPED = 'dropped'; var DRAG_DATA_MIME_TYPE = 'application/x.voom-drag-data+json'; var ELEMENT_ID_MIME_TYPE = 'text/x.voom-element-id'; function createDragStartHandler(root, element) { return function (event) { var dragParamData = event.target.dataset.drag_params; if (dragParamData) { event.dataTransfer.setData(DRAG_DATA_MIME_TYPE, dragParamData); var zone = JSON.parse(dragParamData).zone; if (zone) { event.dataTransfer.setData(zone, ''); } event.dataTransfer.effectAllowed = 'move'; event.target.classList.remove('v-dnd-draggable'); event.target.classList.add('v-dnd-moving'); event.dataTransfer.setData(ELEMENT_ID_MIME_TYPE, element.id); } }; } function createDragOverHandler(root, element) { return function (event) { var dropZone = element.dataset.dropzone; if (dropZone == null || event.dataTransfer.types.includes(dropZone)) { if (event.preventDefault) { event.preventDefault(); } element.classList.add('v-dnd-over'); } else { element.classList.remove('v-dnd-over'); } }; } function createDragLeaveHandler(root, element) { return function (event) { element.classList.remove('v-dnd-over'); }; } function createDropHandler(root, element) { // When an element is upgraded to a Voom component after being replaced via // `replaces`, root may refer to the replaced element itself instead of the // element's root node. // Since a valid drop zone may exist anywhere on the page, it is not // guaranteed that root contains the element being dragged. // getRootNode will fetch `root`'s actual root node (document or shadow // DOM root). var trueRoot = Object(__WEBPACK_IMPORTED_MODULE_0__base_component__["b" /* getRootNode */])(root); return function (event) { event.stopPropagation(); event.preventDefault(); var id = event.dataTransfer.getData(ELEMENT_ID_MIME_TYPE); var draggedElement = id ? trueRoot.querySelector('#' + id) : null; var dragParams = {}; if (draggedElement) { dragParams = JSON.parse(draggedElement.dataset.drag_params); } element.classList.remove('v-dnd-over', 'v-dnd-moving'); element.classList.add('v-dnd-draggable'); // Emit a "dropped" event for the element being dragged: // The drag_params of the dragged element are merged with the // drop_params of the drop zone. var dropZoneParams = JSON.parse(element.dataset.drop_params); var params = Object.assign({}, dragParams, dropZoneParams); var droppedEvent = new CustomEvent(EVENT_DROPPED, { detail: params }); draggedElement.dispatchEvent(droppedEvent); return false; }; } function createDragEndHandler(root, element) { return function (event) { element.classList.remove('v-dnd-over', 'v-dnd-moving'); element.classList.add('v-dnd-draggable'); }; } var DRAGGABLE_SELECTOR = '[draggable=true]'; var DROP_ZONE_SELECTOR = '[data-dropzone]'; function initDragAndDrop(root) { var draggables = Array.from(root.querySelectorAll(DRAGGABLE_SELECTOR)); if (typeof root.matches === 'function' && root.matches(DRAGGABLE_SELECTOR)) { draggables.unshift(root); } var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = draggables[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var elem = _step.value; elem.addEventListener('dragstart', createDragStartHandler(root, elem)); elem.addEventListener('dragend', createDragEndHandler(root, elem)); } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } var dropZones = Array.from(root.querySelectorAll(DROP_ZONE_SELECTOR)); if (typeof root.matches === 'function' && root.matches(DROP_ZONE_SELECTOR)) { dropZones.unshift(root); } var _iteratorNormalCompletion2 = true; var _didIteratorError2 = false; var _iteratorError2 = undefined; try { for (var _iterator2 = dropZones[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { var _elem = _step2.value; _elem.addEventListener('dragover', createDragOverHandler(root, _elem)); _elem.addEventListener('drop', createDropHandler(root, _elem)); _elem.addEventListener('dragleave', createDragLeaveHandler(root, _elem)); } } catch (err) { _didIteratorError2 = true; _iteratorError2 = err; } finally { try { if (!_iteratorNormalCompletion2 && _iterator2.return) { _iterator2.return(); } } finally { if (_didIteratorError2) { throw _iteratorError2; } } } } /** * hasDragDropData determines whether the provided event has previously-set * drag-n-drop data available. * @param {Event} event * @return {Boolean} */ function hasDragDropData(event) { return event.type === 'drop' && event.dataTransfer || event.type === EVENT_DROPPED && event.detail; } /** * extractDragDropData attempts to extract a payload of drag-n-drop data from * the provided event previously set during a `dragstart` event. * @param {Event} event * @return {Object} */ function extractDragDropData(event) { if (event.type === 'drop' && event.dataTransfer) { return JSON.parse(event.dataTransfer.getData(DRAG_DATA_MIME_TYPE)); } else if (event.type === EVENT_DROPPED) { return event.detail; } return {}; } /***/ }), /* 109 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = createFocusTrapInstance; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_focus_trap__ = __webpack_require__(38); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_focus_trap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_focus_trap__); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ function createFocusTrapInstance(surfaceEl, focusTrapFactory) { if (focusTrapFactory === void 0) { focusTrapFactory = __WEBPACK_IMPORTED_MODULE_0_focus_trap___default.a; } return focusTrapFactory(surfaceEl, { clickOutsideDeactivates: true, escapeDeactivates: false, initialFocus: undefined, returnFocusOnDeactivate: false }); } //# sourceMappingURL=util.js.map /***/ }), /* 110 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; }); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var cssClasses = { ANIMATE: 'mdc-drawer--animate', CLOSING: 'mdc-drawer--closing', DISMISSIBLE: 'mdc-drawer--dismissible', MODAL: 'mdc-drawer--modal', OPEN: 'mdc-drawer--open', OPENING: 'mdc-drawer--opening', ROOT: 'mdc-drawer' }; var strings = { APP_CONTENT_SELECTOR: '.mdc-drawer-app-content', CLOSE_EVENT: 'MDCDrawer:closed', OPEN_EVENT: 'MDCDrawer:opened', SCRIM_SELECTOR: '.mdc-drawer-scrim' }; //# sourceMappingURL=constants.js.map /***/ }), /* 111 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCModalDrawerFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__ = __webpack_require__(49); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ /* istanbul ignore next: subclass is not a branch statement */ var MDCModalDrawerFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCModalDrawerFoundation, _super); function MDCModalDrawerFoundation() { return _super !== null && _super.apply(this, arguments) || this; } /** * Handles click event on scrim. */ MDCModalDrawerFoundation.prototype.handleScrimClick = function () { this.close(); }; /** * Called when drawer finishes open animation. */ MDCModalDrawerFoundation.prototype.opened_ = function () { this.adapter_.trapFocus(); }; /** * Called when drawer finishes close animation. */ MDCModalDrawerFoundation.prototype.closed_ = function () { this.adapter_.releaseFocus(); }; return MDCModalDrawerFoundation; }(__WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__["a" /* MDCDismissibleDrawerFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCModalDrawerFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 112 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCFixedTopAppBarFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(13); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__standard_foundation__ = __webpack_require__(50); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCFixedTopAppBarFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCFixedTopAppBarFoundation, _super); function MDCFixedTopAppBarFoundation() { var _this = _super !== null && _super.apply(this, arguments) || this; /** * State variable for the previous scroll iteration top app bar state */ _this.wasScrolled_ = false; return _this; } /** * Scroll handler for applying/removing the modifier class on the fixed top app bar. * @override */ MDCFixedTopAppBarFoundation.prototype.handleTargetScroll = function () { var currentScroll = this.adapter_.getViewportScrollY(); if (currentScroll <= 0) { if (this.wasScrolled_) { this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].FIXED_SCROLLED_CLASS); this.wasScrolled_ = false; } } else { if (!this.wasScrolled_) { this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].FIXED_SCROLLED_CLASS); this.wasScrolled_ = true; } } }; return MDCFixedTopAppBarFoundation; }(__WEBPACK_IMPORTED_MODULE_2__standard_foundation__["a" /* MDCTopAppBarFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCFixedTopAppBarFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 113 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCShortTopAppBarFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(13); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(51); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCShortTopAppBarFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCShortTopAppBarFoundation, _super); /* istanbul ignore next: optional argument is not a branch statement */ function MDCShortTopAppBarFoundation(adapter) { var _this = _super.call(this, adapter) || this; _this.isCollapsed_ = false; _this.isAlwaysCollapsed_ = false; return _this; } Object.defineProperty(MDCShortTopAppBarFoundation.prototype, "isCollapsed", { // Public visibility for backward compatibility. get: function get() { return this.isCollapsed_; }, enumerable: true, configurable: true }); MDCShortTopAppBarFoundation.prototype.init = function () { _super.prototype.init.call(this); if (this.adapter_.getTotalActionItems() > 0) { this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].SHORT_HAS_ACTION_ITEM_CLASS); } // If initialized with SHORT_COLLAPSED_CLASS, the bar should always be collapsed this.setAlwaysCollapsed(this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].SHORT_COLLAPSED_CLASS)); }; /** * Set if the short top app bar should always be collapsed. * * @param value When `true`, bar will always be collapsed. When `false`, bar may collapse or expand based on scroll. */ MDCShortTopAppBarFoundation.prototype.setAlwaysCollapsed = function (value) { this.isAlwaysCollapsed_ = !!value; if (this.isAlwaysCollapsed_) { this.collapse_(); } else { // let maybeCollapseBar_ determine if the bar should be collapsed this.maybeCollapseBar_(); } }; MDCShortTopAppBarFoundation.prototype.getAlwaysCollapsed = function () { return this.isAlwaysCollapsed_; }; /** * Scroll handler for applying/removing the collapsed modifier class on the short top app bar. * @override */ MDCShortTopAppBarFoundation.prototype.handleTargetScroll = function () { this.maybeCollapseBar_(); }; MDCShortTopAppBarFoundation.prototype.maybeCollapseBar_ = function () { if (this.isAlwaysCollapsed_) { return; } var currentScroll = this.adapter_.getViewportScrollY(); if (currentScroll <= 0) { if (this.isCollapsed_) { this.uncollapse_(); } } else { if (!this.isCollapsed_) { this.collapse_(); } } }; MDCShortTopAppBarFoundation.prototype.uncollapse_ = function () { this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].SHORT_COLLAPSED_CLASS); this.isCollapsed_ = false; }; MDCShortTopAppBarFoundation.prototype.collapse_ = function () { this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].SHORT_COLLAPSED_CLASS); this.isCollapsed_ = true; }; return MDCShortTopAppBarFoundation; }(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* MDCTopAppBarBaseFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCShortTopAppBarFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 114 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCIconButtonToggleFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(115); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCIconButtonToggleFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCIconButtonToggleFoundation, _super); function MDCIconButtonToggleFoundation(adapter) { return _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCIconButtonToggleFoundation.defaultAdapter, adapter)) || this; } Object.defineProperty(MDCIconButtonToggleFoundation, "cssClasses", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCIconButtonToggleFoundation, "strings", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCIconButtonToggleFoundation, "defaultAdapter", { get: function get() { return { addClass: function addClass() { return undefined; }, hasClass: function hasClass() { return false; }, notifyChange: function notifyChange() { return undefined; }, removeClass: function removeClass() { return undefined; }, setAttr: function setAttr() { return undefined; } }; }, enumerable: true, configurable: true }); MDCIconButtonToggleFoundation.prototype.init = function () { this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_PRESSED, "" + this.isOn()); }; MDCIconButtonToggleFoundation.prototype.handleClick = function () { this.toggle(); this.adapter_.notifyChange({ isOn: this.isOn() }); }; MDCIconButtonToggleFoundation.prototype.isOn = function () { return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ICON_BUTTON_ON); }; MDCIconButtonToggleFoundation.prototype.toggle = function (isOn) { if (isOn === void 0) { isOn = !this.isOn(); } if (isOn) { this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ICON_BUTTON_ON); } else { this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ICON_BUTTON_ON); } this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_PRESSED, "" + isOn); }; return MDCIconButtonToggleFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCIconButtonToggleFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 115 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; }); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var cssClasses = { ICON_BUTTON_ON: 'mdc-icon-button--on', ROOT: 'mdc-icon-button' }; var strings = { ARIA_PRESSED: 'aria-pressed', CHANGE_EVENT: 'MDCIconButtonToggle:change' }; //# sourceMappingURL=constants.js.map /***/ }), /* 116 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCSelectFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(52); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCSelectFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCSelectFoundation, _super); /* istanbul ignore next: optional argument is not a branch statement */ /** * @param adapter * @param foundationMap Map from subcomponent names to their subfoundations. */ function MDCSelectFoundation(adapter, foundationMap) { if (foundationMap === void 0) { foundationMap = {}; } var _this = _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCSelectFoundation.defaultAdapter, adapter)) || this; _this.leadingIcon_ = foundationMap.leadingIcon; _this.helperText_ = foundationMap.helperText; return _this; } Object.defineProperty(MDCSelectFoundation, "cssClasses", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCSelectFoundation, "numbers", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCSelectFoundation, "strings", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCSelectFoundation, "defaultAdapter", { /** * See {@link MDCSelectAdapter} for typing information on parameters and return types. */ get: function get() { // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { addClass: function addClass() { return undefined; }, removeClass: function removeClass() { return undefined; }, hasClass: function hasClass() { return false; }, activateBottomLine: function activateBottomLine() { return undefined; }, deactivateBottomLine: function deactivateBottomLine() { return undefined; }, setValue: function setValue() { return undefined; }, getValue: function getValue() { return ''; }, floatLabel: function floatLabel() { return undefined; }, getLabelWidth: function getLabelWidth() { return 0; }, hasOutline: function hasOutline() { return false; }, notchOutline: function notchOutline() { return undefined; }, closeOutline: function closeOutline() { return undefined; }, openMenu: function openMenu() { return undefined; }, closeMenu: function closeMenu() { return undefined; }, isMenuOpen: function isMenuOpen() { return false; }, setSelectedIndex: function setSelectedIndex() { return undefined; }, setDisabled: function setDisabled() { return undefined; }, setRippleCenter: function setRippleCenter() { return undefined; }, notifyChange: function notifyChange() { return undefined; }, checkValidity: function checkValidity() { return false; }, setValid: function setValid() { return undefined; } }; // tslint:enable:object-literal-sort-keys }, enumerable: true, configurable: true }); MDCSelectFoundation.prototype.setSelectedIndex = function (index) { this.adapter_.setSelectedIndex(index); this.adapter_.closeMenu(); var didChange = true; this.handleChange(didChange); }; MDCSelectFoundation.prototype.setValue = function (value) { this.adapter_.setValue(value); var didChange = true; this.handleChange(didChange); }; MDCSelectFoundation.prototype.getValue = function () { return this.adapter_.getValue(); }; MDCSelectFoundation.prototype.setDisabled = function (isDisabled) { if (isDisabled) { this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].DISABLED); } else { this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].DISABLED); } this.adapter_.setDisabled(isDisabled); this.adapter_.closeMenu(); if (this.leadingIcon_) { this.leadingIcon_.setDisabled(isDisabled); } }; /** * @param content Sets the content of the helper text. */ MDCSelectFoundation.prototype.setHelperTextContent = function (content) { if (this.helperText_) { this.helperText_.setContent(content); } }; MDCSelectFoundation.prototype.layout = function () { var openNotch = this.getValue().length > 0; this.notchOutline(openNotch); }; MDCSelectFoundation.prototype.handleMenuOpened = function () { this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ACTIVATED); }; MDCSelectFoundation.prototype.handleMenuClosed = function () { this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ACTIVATED); }; /** * Handles value changes, via change event or programmatic updates. */ MDCSelectFoundation.prototype.handleChange = function (didChange) { if (didChange === void 0) { didChange = true; } var value = this.getValue(); var optionHasValue = value.length > 0; var isRequired = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].REQUIRED); this.notchOutline(optionHasValue); if (!this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].FOCUSED)) { this.adapter_.floatLabel(optionHasValue); } if (didChange) { this.adapter_.notifyChange(value); if (isRequired) { this.setValid(this.isValid()); if (this.helperText_) { this.helperText_.setValidity(this.isValid()); } } } }; /** * Handles focus events from select element. */ MDCSelectFoundation.prototype.handleFocus = function () { this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].FOCUSED); this.adapter_.floatLabel(true); this.notchOutline(true); this.adapter_.activateBottomLine(); if (this.helperText_) { this.helperText_.showToScreenReader(); } }; /** * Handles blur events from select element. */ MDCSelectFoundation.prototype.handleBlur = function () { if (this.adapter_.isMenuOpen()) { return; } this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].FOCUSED); this.handleChange(false); this.adapter_.deactivateBottomLine(); var isRequired = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].REQUIRED); if (isRequired) { this.setValid(this.isValid()); if (this.helperText_) { this.helperText_.setValidity(this.isValid()); } } }; MDCSelectFoundation.prototype.handleClick = function (normalizedX) { if (this.adapter_.isMenuOpen()) { return; } this.adapter_.setRippleCenter(normalizedX); this.adapter_.openMenu(); }; MDCSelectFoundation.prototype.handleKeydown = function (event) { if (this.adapter_.isMenuOpen()) { return; } var isEnter = event.key === 'Enter' || event.keyCode === 13; var isSpace = event.key === 'Space' || event.keyCode === 32; var arrowUp = event.key === 'ArrowUp' || event.keyCode === 38; var arrowDown = event.key === 'ArrowDown' || event.keyCode === 40; if (this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].FOCUSED) && (isEnter || isSpace || arrowUp || arrowDown)) { this.adapter_.openMenu(); event.preventDefault(); } }; /** * Opens/closes the notched outline. */ MDCSelectFoundation.prototype.notchOutline = function (openNotch) { if (!this.adapter_.hasOutline()) { return; } var isFocused = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].FOCUSED); if (openNotch) { var labelScale = __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].LABEL_SCALE; var labelWidth = this.adapter_.getLabelWidth() * labelScale; this.adapter_.notchOutline(labelWidth); } else if (!isFocused) { this.adapter_.closeOutline(); } }; /** * Sets the aria label of the leading icon. */ MDCSelectFoundation.prototype.setLeadingIconAriaLabel = function (label) { if (this.leadingIcon_) { this.leadingIcon_.setAriaLabel(label); } }; /** * Sets the text content of the leading icon. */ MDCSelectFoundation.prototype.setLeadingIconContent = function (content) { if (this.leadingIcon_) { this.leadingIcon_.setContent(content); } }; MDCSelectFoundation.prototype.setValid = function (isValid) { this.adapter_.setValid(isValid); }; MDCSelectFoundation.prototype.isValid = function () { return this.adapter_.checkValidity(); }; return MDCSelectFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCSelectFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 117 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCSelectHelperText; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(118); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCSelectHelperText = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCSelectHelperText, _super); function MDCSelectHelperText() { return _super !== null && _super.apply(this, arguments) || this; } MDCSelectHelperText.attachTo = function (root) { return new MDCSelectHelperText(root); }; Object.defineProperty(MDCSelectHelperText.prototype, "foundation", { get: function get() { return this.foundation_; }, enumerable: true, configurable: true }); MDCSelectHelperText.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. var adapter = { addClass: function addClass(className) { return _this.root_.classList.add(className); }, removeClass: function removeClass(className) { return _this.root_.classList.remove(className); }, hasClass: function hasClass(className) { return _this.root_.classList.contains(className); }, setAttr: function setAttr(attr, value) { return _this.root_.setAttribute(attr, value); }, removeAttr: function removeAttr(attr) { return _this.root_.removeAttribute(attr); }, setContent: function setContent(content) { _this.root_.textContent = content; } }; // tslint:enable:object-literal-sort-keys return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* MDCSelectHelperTextFoundation */](adapter); }; return MDCSelectHelperText; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 118 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCSelectHelperTextFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(119); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCSelectHelperTextFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCSelectHelperTextFoundation, _super); function MDCSelectHelperTextFoundation(adapter) { return _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCSelectHelperTextFoundation.defaultAdapter, adapter)) || this; } Object.defineProperty(MDCSelectHelperTextFoundation, "cssClasses", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCSelectHelperTextFoundation, "strings", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCSelectHelperTextFoundation, "defaultAdapter", { /** * See {@link MDCSelectHelperTextAdapter} for typing information on parameters and return types. */ get: function get() { // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { addClass: function addClass() { return undefined; }, removeClass: function removeClass() { return undefined; }, hasClass: function hasClass() { return false; }, setAttr: function setAttr() { return undefined; }, removeAttr: function removeAttr() { return undefined; }, setContent: function setContent() { return undefined; } }; // tslint:enable:object-literal-sort-keys }, enumerable: true, configurable: true }); /** * Sets the content of the helper text field. */ MDCSelectHelperTextFoundation.prototype.setContent = function (content) { this.adapter_.setContent(content); }; /** * Sets the persistency of the helper text. */ MDCSelectHelperTextFoundation.prototype.setPersistent = function (isPersistent) { if (isPersistent) { this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT); } else { this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT); } }; /** * @param isValidation True to make the helper text act as an error validation message. */ MDCSelectHelperTextFoundation.prototype.setValidation = function (isValidation) { if (isValidation) { this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG); } else { this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG); } }; /** * Makes the helper text visible to screen readers. */ MDCSelectHelperTextFoundation.prototype.showToScreenReader = function () { this.adapter_.removeAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_HIDDEN); }; /** * Sets the validity of the helper text based on the select validity. */ MDCSelectHelperTextFoundation.prototype.setValidity = function (selectIsValid) { var helperTextIsPersistent = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT); var helperTextIsValidationMsg = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG); var validationMsgNeedsDisplay = helperTextIsValidationMsg && !selectIsValid; if (validationMsgNeedsDisplay) { this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ROLE, 'alert'); } else { this.adapter_.removeAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ROLE); } if (!helperTextIsPersistent && !validationMsgNeedsDisplay) { this.hide_(); } }; /** * Hides the help text from screen readers. */ MDCSelectHelperTextFoundation.prototype.hide_ = function () { this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_HIDDEN, 'true'); }; return MDCSelectHelperTextFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCSelectHelperTextFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 119 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; }); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var strings = { ARIA_HIDDEN: 'aria-hidden', ROLE: 'role' }; var cssClasses = { HELPER_TEXT_PERSISTENT: 'mdc-select-helper-text--persistent', HELPER_TEXT_VALIDATION_MSG: 'mdc-select-helper-text--validation-msg' }; //# sourceMappingURL=constants.js.map /***/ }), /* 120 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCSelectIcon; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(121); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCSelectIcon = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCSelectIcon, _super); function MDCSelectIcon() { return _super !== null && _super.apply(this, arguments) || this; } MDCSelectIcon.attachTo = function (root) { return new MDCSelectIcon(root); }; Object.defineProperty(MDCSelectIcon.prototype, "foundation", { get: function get() { return this.foundation_; }, enumerable: true, configurable: true }); MDCSelectIcon.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. var adapter = { getAttr: function getAttr(attr) { return _this.root_.getAttribute(attr); }, setAttr: function setAttr(attr, value) { return _this.root_.setAttribute(attr, value); }, removeAttr: function removeAttr(attr) { return _this.root_.removeAttribute(attr); }, setContent: function setContent(content) { _this.root_.textContent = content; }, registerInteractionHandler: function registerInteractionHandler(evtType, handler) { return _this.listen(evtType, handler); }, deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) { return _this.unlisten(evtType, handler); }, notifyIconAction: function notifyIconAction() { return _this.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* MDCSelectIconFoundation */].strings.ICON_EVENT, {} /* evtData */, true /* shouldBubble */); } }; // tslint:enable:object-literal-sort-keys return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* MDCSelectIconFoundation */](adapter); }; return MDCSelectIcon; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 121 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCSelectIconFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(122); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var INTERACTION_EVENTS = ['click', 'keydown']; var MDCSelectIconFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCSelectIconFoundation, _super); function MDCSelectIconFoundation(adapter) { var _this = _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCSelectIconFoundation.defaultAdapter, adapter)) || this; _this.savedTabIndex_ = null; _this.interactionHandler_ = function (evt) { return _this.handleInteraction(evt); }; return _this; } Object.defineProperty(MDCSelectIconFoundation, "strings", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCSelectIconFoundation, "defaultAdapter", { /** * See {@link MDCSelectIconAdapter} for typing information on parameters and return types. */ get: function get() { // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { getAttr: function getAttr() { return null; }, setAttr: function setAttr() { return undefined; }, removeAttr: function removeAttr() { return undefined; }, setContent: function setContent() { return undefined; }, registerInteractionHandler: function registerInteractionHandler() { return undefined; }, deregisterInteractionHandler: function deregisterInteractionHandler() { return undefined; }, notifyIconAction: function notifyIconAction() { return undefined; } }; // tslint:enable:object-literal-sort-keys }, enumerable: true, configurable: true }); MDCSelectIconFoundation.prototype.init = function () { var _this = this; this.savedTabIndex_ = this.adapter_.getAttr('tabindex'); INTERACTION_EVENTS.forEach(function (evtType) { _this.adapter_.registerInteractionHandler(evtType, _this.interactionHandler_); }); }; MDCSelectIconFoundation.prototype.destroy = function () { var _this = this; INTERACTION_EVENTS.forEach(function (evtType) { _this.adapter_.deregisterInteractionHandler(evtType, _this.interactionHandler_); }); }; MDCSelectIconFoundation.prototype.setDisabled = function (disabled) { if (!this.savedTabIndex_) { return; } if (disabled) { this.adapter_.setAttr('tabindex', '-1'); this.adapter_.removeAttr('role'); } else { this.adapter_.setAttr('tabindex', this.savedTabIndex_); this.adapter_.setAttr('role', __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* strings */].ICON_ROLE); } }; MDCSelectIconFoundation.prototype.setAriaLabel = function (label) { this.adapter_.setAttr('aria-label', label); }; MDCSelectIconFoundation.prototype.setContent = function (content) { this.adapter_.setContent(content); }; MDCSelectIconFoundation.prototype.handleInteraction = function (evt) { var isEnterKey = evt.key === 'Enter' || evt.keyCode === 13; if (evt.type === 'click' || isEnterKey) { this.adapter_.notifyIconAction(); } }; return MDCSelectIconFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCSelectIconFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 122 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return strings; }); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var strings = { ICON_EVENT: 'MDCSelect:icon', ICON_ROLE: 'button' }; //# sourceMappingURL=constants.js.map /***/ }), /* 123 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__chip_index__ = __webpack_require__(232); /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__chip_index__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__chip_set_index__ = __webpack_require__(233); /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_1__chip_set_index__["a"]; }); /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ //# sourceMappingURL=index.js.map /***/ }), /* 124 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCChip; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_ripple_component__ = __webpack_require__(6); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_ripple_foundation__ = __webpack_require__(9); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__(53); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation__ = __webpack_require__(54); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var INTERACTION_EVENTS = ['click', 'keydown']; var MDCChip = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCChip, _super); function MDCChip() { return _super !== null && _super.apply(this, arguments) || this; } Object.defineProperty(MDCChip.prototype, "selected", { /** * @return Whether the chip is selected. */ get: function get() { return this.foundation_.isSelected(); }, /** * Sets selected state on the chip. */ set: function set(selected) { this.foundation_.setSelected(selected); }, enumerable: true, configurable: true }); Object.defineProperty(MDCChip.prototype, "shouldRemoveOnTrailingIconClick", { /** * @return Whether a trailing icon click should trigger exit/removal of the chip. */ get: function get() { return this.foundation_.getShouldRemoveOnTrailingIconClick(); }, /** * Sets whether a trailing icon click should trigger exit/removal of the chip. */ set: function set(shouldRemove) { this.foundation_.setShouldRemoveOnTrailingIconClick(shouldRemove); }, enumerable: true, configurable: true }); Object.defineProperty(MDCChip.prototype, "ripple", { get: function get() { return this.ripple_; }, enumerable: true, configurable: true }); Object.defineProperty(MDCChip.prototype, "id", { get: function get() { return this.root_.id; }, enumerable: true, configurable: true }); MDCChip.attachTo = function (root) { return new MDCChip(root); }; MDCChip.prototype.initialize = function (rippleFactory) { var _this = this; if (rippleFactory === void 0) { rippleFactory = function rippleFactory(el, foundation) { return new __WEBPACK_IMPORTED_MODULE_2__material_ripple_component__["a" /* MDCRipple */](el, foundation); }; } this.leadingIcon_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].LEADING_ICON_SELECTOR); this.trailingIcon_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].TRAILING_ICON_SELECTOR); this.checkmark_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].CHECKMARK_SELECTOR); // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. var rippleAdapter = __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, __WEBPACK_IMPORTED_MODULE_2__material_ripple_component__["a" /* MDCRipple */].createAdapter(this), { computeBoundingRect: function computeBoundingRect() { return _this.foundation_.getDimensions(); } }); this.ripple_ = rippleFactory(this.root_, new __WEBPACK_IMPORTED_MODULE_3__material_ripple_foundation__["a" /* MDCRippleFoundation */](rippleAdapter)); }; MDCChip.prototype.initialSyncWithDOM = function () { var _this = this; this.handleInteraction_ = function (evt) { return _this.foundation_.handleInteraction(evt); }; this.handleTransitionEnd_ = function (evt) { return _this.foundation_.handleTransitionEnd(evt); }; this.handleTrailingIconInteraction_ = function (evt) { return _this.foundation_.handleTrailingIconInteraction(evt); }; INTERACTION_EVENTS.forEach(function (evtType) { _this.listen(evtType, _this.handleInteraction_); }); this.listen('transitionend', this.handleTransitionEnd_); if (this.trailingIcon_) { INTERACTION_EVENTS.forEach(function (evtType) { _this.trailingIcon_.addEventListener(evtType, _this.handleTrailingIconInteraction_); }); } }; MDCChip.prototype.destroy = function () { var _this = this; this.ripple_.destroy(); INTERACTION_EVENTS.forEach(function (evtType) { _this.unlisten(evtType, _this.handleInteraction_); }); this.unlisten('transitionend', this.handleTransitionEnd_); if (this.trailingIcon_) { INTERACTION_EVENTS.forEach(function (evtType) { _this.trailingIcon_.removeEventListener(evtType, _this.handleTrailingIconInteraction_); }); } _super.prototype.destroy.call(this); }; /** * Begins the exit animation which leads to removal of the chip. */ MDCChip.prototype.beginExit = function () { this.foundation_.beginExit(); }; MDCChip.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. var adapter = { addClass: function addClass(className) { return _this.root_.classList.add(className); }, addClassToLeadingIcon: function addClassToLeadingIcon(className) { if (_this.leadingIcon_) { _this.leadingIcon_.classList.add(className); } }, eventTargetHasClass: function eventTargetHasClass(target, className) { return target ? target.classList.contains(className) : false; }, getCheckmarkBoundingClientRect: function getCheckmarkBoundingClientRect() { return _this.checkmark_ ? _this.checkmark_.getBoundingClientRect() : null; }, getComputedStyleValue: function getComputedStyleValue(propertyName) { return window.getComputedStyle(_this.root_).getPropertyValue(propertyName); }, getRootBoundingClientRect: function getRootBoundingClientRect() { return _this.root_.getBoundingClientRect(); }, hasClass: function hasClass(className) { return _this.root_.classList.contains(className); }, hasLeadingIcon: function hasLeadingIcon() { return !!_this.leadingIcon_; }, notifyInteraction: function notifyInteraction() { return _this.emit(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].INTERACTION_EVENT, { chipId: _this.id }, true /* shouldBubble */); }, notifyRemoval: function notifyRemoval() { return _this.emit(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].REMOVAL_EVENT, { chipId: _this.id, root: _this.root_ }, true /* shouldBubble */); }, notifySelection: function notifySelection(selected) { return _this.emit(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].SELECTION_EVENT, { chipId: _this.id, selected: selected }, true /* shouldBubble */); }, notifyTrailingIconInteraction: function notifyTrailingIconInteraction() { return _this.emit(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].TRAILING_ICON_INTERACTION_EVENT, { chipId: _this.id }, true /* shouldBubble */); }, removeClass: function removeClass(className) { return _this.root_.classList.remove(className); }, removeClassFromLeadingIcon: function removeClassFromLeadingIcon(className) { if (_this.leadingIcon_) { _this.leadingIcon_.classList.remove(className); } }, setAttr: function setAttr(attr, value) { return _this.root_.setAttribute(attr, value); }, setStyleProperty: function setStyleProperty(propertyName, value) { return _this.root_.style.setProperty(propertyName, value); } }; return new __WEBPACK_IMPORTED_MODULE_5__foundation__["a" /* MDCChipFoundation */](adapter); }; return MDCChip; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 125 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCChipSetFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(126); /** * @license * Copyright 2017 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCChipSetFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCChipSetFoundation, _super); function MDCChipSetFoundation(adapter) { var _this = _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCChipSetFoundation.defaultAdapter, adapter)) || this; /** * The ids of the selected chips in the set. Only used for choice chip set or filter chip set. */ _this.selectedChipIds_ = []; return _this; } Object.defineProperty(MDCChipSetFoundation, "strings", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCChipSetFoundation, "cssClasses", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCChipSetFoundation, "defaultAdapter", { get: function get() { return { hasClass: function hasClass() { return false; }, removeChip: function removeChip() { return undefined; }, setSelected: function setSelected() { return undefined; } }; }, enumerable: true, configurable: true }); /** * Returns an array of the IDs of all selected chips. */ MDCChipSetFoundation.prototype.getSelectedChipIds = function () { return this.selectedChipIds_.slice(); }; /** * Selects the chip with the given id. Deselects all other chips if the chip set is of the choice variant. */ MDCChipSetFoundation.prototype.select = function (chipId) { if (this.selectedChipIds_.indexOf(chipId) >= 0) { return; } if (this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHOICE) && this.selectedChipIds_.length > 0) { var previouslySelectedChip = this.selectedChipIds_[0]; this.selectedChipIds_.length = 0; this.adapter_.setSelected(previouslySelectedChip, false); } this.selectedChipIds_.push(chipId); this.adapter_.setSelected(chipId, true); }; /** * Handles a chip interaction event */ MDCChipSetFoundation.prototype.handleChipInteraction = function (chipId) { if (this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHOICE) || this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].FILTER)) { this.toggleSelect_(chipId); } }; /** * Handles a chip selection event, used to handle discrepancy when selection state is set directly on the Chip. */ MDCChipSetFoundation.prototype.handleChipSelection = function (chipId, selected) { var chipIsSelected = this.selectedChipIds_.indexOf(chipId) >= 0; if (selected && !chipIsSelected) { this.select(chipId); } else if (!selected && chipIsSelected) { this.deselect_(chipId); } }; /** * Handles the event when a chip is removed. */ MDCChipSetFoundation.prototype.handleChipRemoval = function (chipId) { this.deselect_(chipId); this.adapter_.removeChip(chipId); }; /** * Deselects the chip with the given id. */ MDCChipSetFoundation.prototype.deselect_ = function (chipId) { var index = this.selectedChipIds_.indexOf(chipId); if (index >= 0) { this.selectedChipIds_.splice(index, 1); this.adapter_.setSelected(chipId, false); } }; /** * Toggles selection of the chip with the given id. */ MDCChipSetFoundation.prototype.toggleSelect_ = function (chipId) { if (this.selectedChipIds_.indexOf(chipId) >= 0) { this.deselect_(chipId); } else { this.select(chipId); } }; return MDCChipSetFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCChipSetFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 126 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; }); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var strings = { CHIP_SELECTOR: '.mdc-chip' }; var cssClasses = { CHOICE: 'mdc-chip-set--choice', FILTER: 'mdc-chip-set--filter' }; //# sourceMappingURL=constants.js.map /***/ }), /* 127 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return announce; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(28); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var ARIA_LIVE_DELAY_MS = __WEBPACK_IMPORTED_MODULE_0__constants__["b" /* numbers */].ARIA_LIVE_DELAY_MS; var ARIA_LIVE_LABEL_TEXT_ATTR = __WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_LIVE_LABEL_TEXT_ATTR; function announce(ariaEl, labelEl) { if (labelEl === void 0) { labelEl = ariaEl; } var priority = ariaEl.getAttribute('aria-live'); // Trim text to ignore ` ` (see below). // textContent is only null if the node is a document, DOCTYPE, or notation. var labelText = labelEl.textContent.trim(); if (!labelText || !priority) { return; } // Temporarily disable `aria-live` to prevent JAWS+Firefox from announcing the message twice. ariaEl.setAttribute('aria-live', 'off'); // Temporarily clear `textContent` to force a DOM mutation event that will be detected by screen readers. // `aria-live` elements are only announced when the element's `textContent` *changes*, so snackbars // sent to the browser in the initial HTML response won't be read unless we clear the element's `textContent` first. // Similarly, displaying the same snackbar message twice in a row doesn't trigger a DOM mutation event, // so screen readers won't announce the second message unless we first clear `textContent`. // // We have to clear the label text two different ways to make it work in all browsers and screen readers: // // 1. `textContent = ''` is required for IE11 + JAWS // 2. `innerHTML = ' '` is required for Chrome + JAWS and NVDA // // All other browser/screen reader combinations support both methods. // // The wrapper `<span>` visually hides the space character so that it doesn't cause jank when added/removed. // N.B.: Setting `position: absolute`, `opacity: 0`, or `height: 0` prevents Chrome from detecting the DOM change. // // This technique has been tested in: // // * JAWS 2019: // - Chrome 70 // - Firefox 60 (ESR) // - IE 11 // * NVDA 2018: // - Chrome 70 // - Firefox 60 (ESR) // - IE 11 // * ChromeVox 53 labelEl.textContent = ''; labelEl.innerHTML = '<span style="display: inline-block; width: 0; height: 1px;"> </span>'; // Prevent visual jank by temporarily displaying the label text in the ::before pseudo-element. // CSS generated content is normally announced by screen readers // (except in IE 11; see https://tink.uk/accessibility-support-for-css-generated-content/); // however, `aria-live` is turned off, so this DOM update will be ignored by screen readers. labelEl.setAttribute(ARIA_LIVE_LABEL_TEXT_ATTR, labelText); setTimeout(function () { // Allow screen readers to announce changes to the DOM again. ariaEl.setAttribute('aria-live', priority); // Remove the message from the ::before pseudo-element. labelEl.removeAttribute(ARIA_LIVE_LABEL_TEXT_ATTR); // Restore the original label text, which will be announced by screen readers. labelEl.textContent = labelText; }, ARIA_LIVE_DELAY_MS); } //# sourceMappingURL=util.js.map /***/ }), /* 128 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCSnackbarFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(28); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var OPENING = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPENING, OPEN = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPEN, CLOSING = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSING; var REASON_ACTION = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].REASON_ACTION, REASON_DISMISS = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].REASON_DISMISS; var MDCSnackbarFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCSnackbarFoundation, _super); function MDCSnackbarFoundation(adapter) { var _this = _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCSnackbarFoundation.defaultAdapter, adapter)) || this; _this.isOpen_ = false; _this.animationFrame_ = 0; _this.animationTimer_ = 0; _this.autoDismissTimer_ = 0; _this.autoDismissTimeoutMs_ = __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].DEFAULT_AUTO_DISMISS_TIMEOUT_MS; _this.closeOnEscape_ = true; return _this; } Object.defineProperty(MDCSnackbarFoundation, "cssClasses", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCSnackbarFoundation, "strings", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCSnackbarFoundation, "numbers", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCSnackbarFoundation, "defaultAdapter", { get: function get() { return { addClass: function addClass() { return undefined; }, announce: function announce() { return undefined; }, notifyClosed: function notifyClosed() { return undefined; }, notifyClosing: function notifyClosing() { return undefined; }, notifyOpened: function notifyOpened() { return undefined; }, notifyOpening: function notifyOpening() { return undefined; }, removeClass: function removeClass() { return undefined; } }; }, enumerable: true, configurable: true }); MDCSnackbarFoundation.prototype.destroy = function () { this.clearAutoDismissTimer_(); cancelAnimationFrame(this.animationFrame_); this.animationFrame_ = 0; clearTimeout(this.animationTimer_); this.animationTimer_ = 0; this.adapter_.removeClass(OPENING); this.adapter_.removeClass(OPEN); this.adapter_.removeClass(CLOSING); }; MDCSnackbarFoundation.prototype.open = function () { var _this = this; this.clearAutoDismissTimer_(); this.isOpen_ = true; this.adapter_.notifyOpening(); this.adapter_.removeClass(CLOSING); this.adapter_.addClass(OPENING); this.adapter_.announce(); // Wait a frame once display is no longer "none", to establish basis for animation this.runNextAnimationFrame_(function () { _this.adapter_.addClass(OPEN); _this.animationTimer_ = setTimeout(function () { _this.handleAnimationTimerEnd_(); _this.adapter_.notifyOpened(); _this.autoDismissTimer_ = setTimeout(function () { _this.close(REASON_DISMISS); }, _this.getTimeoutMs()); }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].SNACKBAR_ANIMATION_OPEN_TIME_MS); }); }; /** * @param reason Why the snackbar was closed. Value will be passed to CLOSING_EVENT and CLOSED_EVENT via the * `event.detail.reason` property. Standard values are REASON_ACTION and REASON_DISMISS, but custom * client-specific values may also be used if desired. */ MDCSnackbarFoundation.prototype.close = function (reason) { var _this = this; if (reason === void 0) { reason = ''; } if (!this.isOpen_) { // Avoid redundant close calls (and events), e.g. repeated interactions as the snackbar is animating closed return; } cancelAnimationFrame(this.animationFrame_); this.animationFrame_ = 0; this.clearAutoDismissTimer_(); this.isOpen_ = false; this.adapter_.notifyClosing(reason); this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSING); this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPEN); this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPENING); clearTimeout(this.animationTimer_); this.animationTimer_ = setTimeout(function () { _this.handleAnimationTimerEnd_(); _this.adapter_.notifyClosed(reason); }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].SNACKBAR_ANIMATION_CLOSE_TIME_MS); }; MDCSnackbarFoundation.prototype.isOpen = function () { return this.isOpen_; }; MDCSnackbarFoundation.prototype.getTimeoutMs = function () { return this.autoDismissTimeoutMs_; }; MDCSnackbarFoundation.prototype.setTimeoutMs = function (timeoutMs) { // Use shorter variable names to make the code more readable var minValue = __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].MIN_AUTO_DISMISS_TIMEOUT_MS; var maxValue = __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].MAX_AUTO_DISMISS_TIMEOUT_MS; if (timeoutMs <= maxValue && timeoutMs >= minValue) { this.autoDismissTimeoutMs_ = timeoutMs; } else { throw new Error("timeoutMs must be an integer in the range " + minValue + '\u2013' + maxValue + ", but got '" + timeoutMs + "'"); } }; MDCSnackbarFoundation.prototype.getCloseOnEscape = function () { return this.closeOnEscape_; }; MDCSnackbarFoundation.prototype.setCloseOnEscape = function (closeOnEscape) { this.closeOnEscape_ = closeOnEscape; }; MDCSnackbarFoundation.prototype.handleKeyDown = function (evt) { var isEscapeKey = evt.key === 'Escape' || evt.keyCode === 27; if (isEscapeKey && this.getCloseOnEscape()) { this.close(REASON_DISMISS); } }; MDCSnackbarFoundation.prototype.handleActionButtonClick = function (_evt) { this.close(REASON_ACTION); }; MDCSnackbarFoundation.prototype.handleActionIconClick = function (_evt) { this.close(REASON_DISMISS); }; MDCSnackbarFoundation.prototype.clearAutoDismissTimer_ = function () { clearTimeout(this.autoDismissTimer_); this.autoDismissTimer_ = 0; }; MDCSnackbarFoundation.prototype.handleAnimationTimerEnd_ = function () { this.animationTimer_ = 0; this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPENING); this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSING); }; /** * Runs the given logic on the next animation frame, using setTimeout to factor in Firefox reflow behavior. */ MDCSnackbarFoundation.prototype.runNextAnimationFrame_ = function (callback) { var _this = this; cancelAnimationFrame(this.animationFrame_); this.animationFrame_ = requestAnimationFrame(function () { _this.animationFrame_ = 0; clearTimeout(_this.animationTimer_); _this.animationTimer_ = setTimeout(callback, 0); }); }; return MDCSnackbarFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCSnackbarFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 129 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCCheckboxFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(130); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCCheckboxFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCCheckboxFoundation, _super); function MDCCheckboxFoundation(adapter) { var _this = _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCCheckboxFoundation.defaultAdapter, adapter)) || this; _this.currentCheckState_ = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].TRANSITION_STATE_INIT; _this.currentAnimationClass_ = ''; _this.animEndLatchTimer_ = 0; _this.enableAnimationEndHandler_ = false; return _this; } Object.defineProperty(MDCCheckboxFoundation, "cssClasses", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCCheckboxFoundation, "strings", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCCheckboxFoundation, "numbers", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCCheckboxFoundation, "defaultAdapter", { get: function get() { return { addClass: function addClass() { return undefined; }, forceLayout: function forceLayout() { return undefined; }, hasNativeControl: function hasNativeControl() { return false; }, isAttachedToDOM: function isAttachedToDOM() { return false; }, isChecked: function isChecked() { return false; }, isIndeterminate: function isIndeterminate() { return false; }, removeClass: function removeClass() { return undefined; }, removeNativeControlAttr: function removeNativeControlAttr() { return undefined; }, setNativeControlAttr: function setNativeControlAttr() { return undefined; }, setNativeControlDisabled: function setNativeControlDisabled() { return undefined; } }; }, enumerable: true, configurable: true }); MDCCheckboxFoundation.prototype.init = function () { this.currentCheckState_ = this.determineCheckState_(); this.updateAriaChecked_(); this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].UPGRADED); }; MDCCheckboxFoundation.prototype.destroy = function () { clearTimeout(this.animEndLatchTimer_); }; MDCCheckboxFoundation.prototype.setDisabled = function (disabled) { this.adapter_.setNativeControlDisabled(disabled); if (disabled) { this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].DISABLED); } else { this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].DISABLED); } }; /** * Handles the animationend event for the checkbox */ MDCCheckboxFoundation.prototype.handleAnimationEnd = function () { var _this = this; if (!this.enableAnimationEndHandler_) { return; } clearTimeout(this.animEndLatchTimer_); this.animEndLatchTimer_ = setTimeout(function () { _this.adapter_.removeClass(_this.currentAnimationClass_); _this.enableAnimationEndHandler_ = false; }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].ANIM_END_LATCH_MS); }; /** * Handles the change event for the checkbox */ MDCCheckboxFoundation.prototype.handleChange = function () { this.transitionCheckState_(); }; MDCCheckboxFoundation.prototype.transitionCheckState_ = function () { if (!this.adapter_.hasNativeControl()) { return; } var oldState = this.currentCheckState_; var newState = this.determineCheckState_(); if (oldState === newState) { return; } this.updateAriaChecked_(); var TRANSITION_STATE_UNCHECKED = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].TRANSITION_STATE_UNCHECKED; var SELECTED = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SELECTED; if (newState === TRANSITION_STATE_UNCHECKED) { this.adapter_.removeClass(SELECTED); } else { this.adapter_.addClass(SELECTED); } // Check to ensure that there isn't a previously existing animation class, in case for example // the user interacted with the checkbox before the animation was finished. if (this.currentAnimationClass_.length > 0) { clearTimeout(this.animEndLatchTimer_); this.adapter_.forceLayout(); this.adapter_.removeClass(this.currentAnimationClass_); } this.currentAnimationClass_ = this.getTransitionAnimationClass_(oldState, newState); this.currentCheckState_ = newState; // Check for parentNode so that animations are only run when the element is attached // to the DOM. if (this.adapter_.isAttachedToDOM() && this.currentAnimationClass_.length > 0) { this.adapter_.addClass(this.currentAnimationClass_); this.enableAnimationEndHandler_ = true; } }; MDCCheckboxFoundation.prototype.determineCheckState_ = function () { var TRANSITION_STATE_INDETERMINATE = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].TRANSITION_STATE_INDETERMINATE, TRANSITION_STATE_CHECKED = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].TRANSITION_STATE_CHECKED, TRANSITION_STATE_UNCHECKED = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].TRANSITION_STATE_UNCHECKED; if (this.adapter_.isIndeterminate()) { return TRANSITION_STATE_INDETERMINATE; } return this.adapter_.isChecked() ? TRANSITION_STATE_CHECKED : TRANSITION_STATE_UNCHECKED; }; MDCCheckboxFoundation.prototype.getTransitionAnimationClass_ = function (oldState, newState) { var TRANSITION_STATE_INIT = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].TRANSITION_STATE_INIT, TRANSITION_STATE_CHECKED = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].TRANSITION_STATE_CHECKED, TRANSITION_STATE_UNCHECKED = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].TRANSITION_STATE_UNCHECKED; var _a = MDCCheckboxFoundation.cssClasses, ANIM_UNCHECKED_CHECKED = _a.ANIM_UNCHECKED_CHECKED, ANIM_UNCHECKED_INDETERMINATE = _a.ANIM_UNCHECKED_INDETERMINATE, ANIM_CHECKED_UNCHECKED = _a.ANIM_CHECKED_UNCHECKED, ANIM_CHECKED_INDETERMINATE = _a.ANIM_CHECKED_INDETERMINATE, ANIM_INDETERMINATE_CHECKED = _a.ANIM_INDETERMINATE_CHECKED, ANIM_INDETERMINATE_UNCHECKED = _a.ANIM_INDETERMINATE_UNCHECKED; switch (oldState) { case TRANSITION_STATE_INIT: if (newState === TRANSITION_STATE_UNCHECKED) { return ''; } return newState === TRANSITION_STATE_CHECKED ? ANIM_INDETERMINATE_CHECKED : ANIM_INDETERMINATE_UNCHECKED; case TRANSITION_STATE_UNCHECKED: return newState === TRANSITION_STATE_CHECKED ? ANIM_UNCHECKED_CHECKED : ANIM_UNCHECKED_INDETERMINATE; case TRANSITION_STATE_CHECKED: return newState === TRANSITION_STATE_UNCHECKED ? ANIM_CHECKED_UNCHECKED : ANIM_CHECKED_INDETERMINATE; default: // TRANSITION_STATE_INDETERMINATE return newState === TRANSITION_STATE_CHECKED ? ANIM_INDETERMINATE_CHECKED : ANIM_INDETERMINATE_UNCHECKED; } }; MDCCheckboxFoundation.prototype.updateAriaChecked_ = function () { // Ensure aria-checked is set to mixed if checkbox is in indeterminate state. if (this.adapter_.isIndeterminate()) { this.adapter_.setNativeControlAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].ARIA_CHECKED_ATTR, __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].ARIA_CHECKED_INDETERMINATE_VALUE); } else { // The on/off state does not need to keep track of aria-checked, since // the screenreader uses the checked property on the checkbox element. this.adapter_.removeNativeControlAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].ARIA_CHECKED_ATTR); } }; return MDCCheckboxFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCCheckboxFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 130 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; }); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var cssClasses = { ANIM_CHECKED_INDETERMINATE: 'mdc-checkbox--anim-checked-indeterminate', ANIM_CHECKED_UNCHECKED: 'mdc-checkbox--anim-checked-unchecked', ANIM_INDETERMINATE_CHECKED: 'mdc-checkbox--anim-indeterminate-checked', ANIM_INDETERMINATE_UNCHECKED: 'mdc-checkbox--anim-indeterminate-unchecked', ANIM_UNCHECKED_CHECKED: 'mdc-checkbox--anim-unchecked-checked', ANIM_UNCHECKED_INDETERMINATE: 'mdc-checkbox--anim-unchecked-indeterminate', BACKGROUND: 'mdc-checkbox__background', CHECKED: 'mdc-checkbox--checked', CHECKMARK: 'mdc-checkbox__checkmark', CHECKMARK_PATH: 'mdc-checkbox__checkmark-path', DISABLED: 'mdc-checkbox--disabled', INDETERMINATE: 'mdc-checkbox--indeterminate', MIXEDMARK: 'mdc-checkbox__mixedmark', NATIVE_CONTROL: 'mdc-checkbox__native-control', ROOT: 'mdc-checkbox', SELECTED: 'mdc-checkbox--selected', UPGRADED: 'mdc-checkbox--upgraded' }; var strings = { ARIA_CHECKED_ATTR: 'aria-checked', ARIA_CHECKED_INDETERMINATE_VALUE: 'mixed', NATIVE_CONTROL_SELECTOR: '.mdc-checkbox__native-control', TRANSITION_STATE_CHECKED: 'checked', TRANSITION_STATE_INDETERMINATE: 'indeterminate', TRANSITION_STATE_INIT: 'init', TRANSITION_STATE_UNCHECKED: 'unchecked' }; var numbers = { ANIM_END_LATCH_MS: 250 }; //# sourceMappingURL=constants.js.map /***/ }), /* 131 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCSwitchFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(132); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCSwitchFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCSwitchFoundation, _super); function MDCSwitchFoundation(adapter) { return _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCSwitchFoundation.defaultAdapter, adapter)) || this; } Object.defineProperty(MDCSwitchFoundation, "strings", { /** The string constants used by the switch. */ get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCSwitchFoundation, "cssClasses", { /** The CSS classes used by the switch. */ get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCSwitchFoundation, "defaultAdapter", { /** The default Adapter for the switch. */ get: function get() { return { addClass: function addClass() { return undefined; }, removeClass: function removeClass() { return undefined; }, setNativeControlChecked: function setNativeControlChecked() { return undefined; }, setNativeControlDisabled: function setNativeControlDisabled() { return undefined; } }; }, enumerable: true, configurable: true }); /** Sets the checked state of the switch. */ MDCSwitchFoundation.prototype.setChecked = function (checked) { this.adapter_.setNativeControlChecked(checked); this.updateCheckedStyling_(checked); }; /** Sets the disabled state of the switch. */ MDCSwitchFoundation.prototype.setDisabled = function (disabled) { this.adapter_.setNativeControlDisabled(disabled); if (disabled) { this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].DISABLED); } else { this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].DISABLED); } }; /** Handles the change event for the switch native control. */ MDCSwitchFoundation.prototype.handleChange = function (evt) { var nativeControl = evt.target; this.updateCheckedStyling_(nativeControl.checked); }; /** Updates the styling of the switch based on its checked state. */ MDCSwitchFoundation.prototype.updateCheckedStyling_ = function (checked) { if (checked) { this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHECKED); } else { this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHECKED); } }; return MDCSwitchFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCSwitchFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 132 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; }); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ /** CSS classes used by the switch. */ var cssClasses = { /** Class used for a switch that is in the "checked" (on) position. */ CHECKED: 'mdc-switch--checked', /** Class used for a switch that is disabled. */ DISABLED: 'mdc-switch--disabled' }; /** String constants used by the switch. */ var strings = { /** A CSS selector used to locate the native HTML control for the switch. */ NATIVE_CONTROL_SELECTOR: '.mdc-switch__native-control', /** A CSS selector used to locate the ripple surface element for the switch. */ RIPPLE_SURFACE_SELECTOR: '.mdc-switch__thumb-underlay' }; //# sourceMappingURL=constants.js.map /***/ }), /* 133 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(Buffer, module) {var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /*! * Quill Editor v1.3.7 * https://quilljs.com/ * Copyright (c) 2014, Jason Chen * Copyright (c) 2013, salesforce.com */ (function webpackUniversalModuleDefinition(root, factory) { if (( false ? 'undefined' : _typeof2(exports)) === 'object' && ( false ? 'undefined' : _typeof2(module)) === 'object') module.exports = factory();else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else if ((typeof exports === 'undefined' ? 'undefined' : _typeof2(exports)) === 'object') exports["Quill"] = factory();else root["Quill"] = factory(); })(typeof self !== 'undefined' ? self : this, function () { return (/******/function (modules) { // webpackBootstrap /******/ // The module cache /******/var installedModules = {}; /******/ /******/ // The require function /******/function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/if (installedModules[moduleId]) { /******/return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/var module = installedModules[moduleId] = { /******/i: moduleId, /******/l: false, /******/exports: {} /******/ }; /******/ /******/ // Execute the module function /******/modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/module.l = true; /******/ /******/ // Return the exports of the module /******/return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/__webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/__webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/__webpack_require__.d = function (exports, name, getter) { /******/if (!__webpack_require__.o(exports, name)) { /******/Object.defineProperty(exports, name, { /******/configurable: false, /******/enumerable: true, /******/get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/__webpack_require__.n = function (module) { /******/var getter = module && module.__esModule ? /******/function getDefault() { return module['default']; } : /******/function getModuleExports() { return module; }; /******/__webpack_require__.d(getter, 'a', getter); /******/return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/__webpack_require__.o = function (object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/__webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/return __webpack_require__(__webpack_require__.s = 109); /******/ }( /************************************************************************/ /******/[ /* 0 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var container_1 = __webpack_require__(17); var format_1 = __webpack_require__(18); var leaf_1 = __webpack_require__(19); var scroll_1 = __webpack_require__(45); var inline_1 = __webpack_require__(46); var block_1 = __webpack_require__(47); var embed_1 = __webpack_require__(48); var text_1 = __webpack_require__(49); var attributor_1 = __webpack_require__(12); var class_1 = __webpack_require__(32); var style_1 = __webpack_require__(33); var store_1 = __webpack_require__(31); var Registry = __webpack_require__(1); var Parchment = { Scope: Registry.Scope, create: Registry.create, find: Registry.find, query: Registry.query, register: Registry.register, Container: container_1.default, Format: format_1.default, Leaf: leaf_1.default, Embed: embed_1.default, Scroll: scroll_1.default, Block: block_1.default, Inline: inline_1.default, Text: text_1.default, Attributor: { Attribute: attributor_1.default, Class: class_1.default, Style: style_1.default, Store: store_1.default } }; exports.default = Parchment; /***/ }, /* 1 */ /***/function (module, exports, __webpack_require__) { "use strict"; var __extends = this && this.__extends || function () { var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) d[p] = b[p]; } }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); Object.defineProperty(exports, "__esModule", { value: true }); var ParchmentError = /** @class */function (_super) { __extends(ParchmentError, _super); function ParchmentError(message) { var _this = this; message = '[Parchment] ' + message; _this = _super.call(this, message) || this; _this.message = message; _this.name = _this.constructor.name; return _this; } return ParchmentError; }(Error); exports.ParchmentError = ParchmentError; var attributes = {}; var classes = {}; var tags = {}; var types = {}; exports.DATA_KEY = '__blot'; var Scope; (function (Scope) { Scope[Scope["TYPE"] = 3] = "TYPE"; Scope[Scope["LEVEL"] = 12] = "LEVEL"; Scope[Scope["ATTRIBUTE"] = 13] = "ATTRIBUTE"; Scope[Scope["BLOT"] = 14] = "BLOT"; Scope[Scope["INLINE"] = 7] = "INLINE"; Scope[Scope["BLOCK"] = 11] = "BLOCK"; Scope[Scope["BLOCK_BLOT"] = 10] = "BLOCK_BLOT"; Scope[Scope["INLINE_BLOT"] = 6] = "INLINE_BLOT"; Scope[Scope["BLOCK_ATTRIBUTE"] = 9] = "BLOCK_ATTRIBUTE"; Scope[Scope["INLINE_ATTRIBUTE"] = 5] = "INLINE_ATTRIBUTE"; Scope[Scope["ANY"] = 15] = "ANY"; })(Scope = exports.Scope || (exports.Scope = {})); function create(input, value) { var match = query(input); if (match == null) { throw new ParchmentError("Unable to create " + input + " blot"); } var BlotClass = match; var node = // @ts-ignore input instanceof Node || input['nodeType'] === Node.TEXT_NODE ? input : BlotClass.create(value); return new BlotClass(node, value); } exports.create = create; function find(node, bubble) { if (bubble === void 0) { bubble = false; } if (node == null) return null; // @ts-ignore if (node[exports.DATA_KEY] != null) return node[exports.DATA_KEY].blot; if (bubble) return find(node.parentNode, bubble); return null; } exports.find = find; function query(query, scope) { if (scope === void 0) { scope = Scope.ANY; } var match; if (typeof query === 'string') { match = types[query] || attributes[query]; // @ts-ignore } else if (query instanceof Text || query['nodeType'] === Node.TEXT_NODE) { match = types['text']; } else if (typeof query === 'number') { if (query & Scope.LEVEL & Scope.BLOCK) { match = types['block']; } else if (query & Scope.LEVEL & Scope.INLINE) { match = types['inline']; } } else if (query instanceof HTMLElement) { var names = (query.getAttribute('class') || '').split(/\s+/); for (var i in names) { match = classes[names[i]]; if (match) break; } match = match || tags[query.tagName]; } if (match == null) return null; // @ts-ignore if (scope & Scope.LEVEL & match.scope && scope & Scope.TYPE & match.scope) return match; return null; } exports.query = query; function register() { var Definitions = []; for (var _i = 0; _i < arguments.length; _i++) { Definitions[_i] = arguments[_i]; } if (Definitions.length > 1) { return Definitions.map(function (d) { return register(d); }); } var Definition = Definitions[0]; if (typeof Definition.blotName !== 'string' && typeof Definition.attrName !== 'string') { throw new ParchmentError('Invalid definition'); } else if (Definition.blotName === 'abstract') { throw new ParchmentError('Cannot register abstract class'); } types[Definition.blotName || Definition.attrName] = Definition; if (typeof Definition.keyName === 'string') { attributes[Definition.keyName] = Definition; } else { if (Definition.className != null) { classes[Definition.className] = Definition; } if (Definition.tagName != null) { if (Array.isArray(Definition.tagName)) { Definition.tagName = Definition.tagName.map(function (tagName) { return tagName.toUpperCase(); }); } else { Definition.tagName = Definition.tagName.toUpperCase(); } var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName]; tagNames.forEach(function (tag) { if (tags[tag] == null || Definition.className == null) { tags[tag] = Definition; } }); } } return Definition; } exports.register = register; /***/ }, /* 2 */ /***/function (module, exports, __webpack_require__) { var diff = __webpack_require__(51); var equal = __webpack_require__(11); var extend = __webpack_require__(3); var op = __webpack_require__(20); var NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff() var Delta = function Delta(ops) { // Assume we are given a well formed ops if (Array.isArray(ops)) { this.ops = ops; } else if (ops != null && Array.isArray(ops.ops)) { this.ops = ops.ops; } else { this.ops = []; } }; Delta.prototype.insert = function (text, attributes) { var newOp = {}; if (text.length === 0) return this; newOp.insert = text; if (attributes != null && (typeof attributes === 'undefined' ? 'undefined' : _typeof2(attributes)) === 'object' && Object.keys(attributes).length > 0) { newOp.attributes = attributes; } return this.push(newOp); }; Delta.prototype['delete'] = function (length) { if (length <= 0) return this; return this.push({ 'delete': length }); }; Delta.prototype.retain = function (length, attributes) { if (length <= 0) return this; var newOp = { retain: length }; if (attributes != null && (typeof attributes === 'undefined' ? 'undefined' : _typeof2(attributes)) === 'object' && Object.keys(attributes).length > 0) { newOp.attributes = attributes; } return this.push(newOp); }; Delta.prototype.push = function (newOp) { var index = this.ops.length; var lastOp = this.ops[index - 1]; newOp = extend(true, {}, newOp); if ((typeof lastOp === 'undefined' ? 'undefined' : _typeof2(lastOp)) === 'object') { if (typeof newOp['delete'] === 'number' && typeof lastOp['delete'] === 'number') { this.ops[index - 1] = { 'delete': lastOp['delete'] + newOp['delete'] }; return this; } // Since it does not matter if we insert before or after deleting at the same index, // always prefer to insert first if (typeof lastOp['delete'] === 'number' && newOp.insert != null) { index -= 1; lastOp = this.ops[index - 1]; if ((typeof lastOp === 'undefined' ? 'undefined' : _typeof2(lastOp)) !== 'object') { this.ops.unshift(newOp); return this; } } if (equal(newOp.attributes, lastOp.attributes)) { if (typeof newOp.insert === 'string' && typeof lastOp.insert === 'string') { this.ops[index - 1] = { insert: lastOp.insert + newOp.insert }; if (_typeof2(newOp.attributes) === 'object') this.ops[index - 1].attributes = newOp.attributes; return this; } else if (typeof newOp.retain === 'number' && typeof lastOp.retain === 'number') { this.ops[index - 1] = { retain: lastOp.retain + newOp.retain }; if (_typeof2(newOp.attributes) === 'object') this.ops[index - 1].attributes = newOp.attributes; return this; } } } if (index === this.ops.length) { this.ops.push(newOp); } else { this.ops.splice(index, 0, newOp); } return this; }; Delta.prototype.chop = function () { var lastOp = this.ops[this.ops.length - 1]; if (lastOp && lastOp.retain && !lastOp.attributes) { this.ops.pop(); } return this; }; Delta.prototype.filter = function (predicate) { return this.ops.filter(predicate); }; Delta.prototype.forEach = function (predicate) { this.ops.forEach(predicate); }; Delta.prototype.map = function (predicate) { return this.ops.map(predicate); }; Delta.prototype.partition = function (predicate) { var passed = [], failed = []; this.forEach(function (op) { var target = predicate(op) ? passed : failed; target.push(op); }); return [passed, failed]; }; Delta.prototype.reduce = function (predicate, initial) { return this.ops.reduce(predicate, initial); }; Delta.prototype.changeLength = function () { return this.reduce(function (length, elem) { if (elem.insert) { return length + op.length(elem); } else if (elem.delete) { return length - elem.delete; } return length; }, 0); }; Delta.prototype.length = function () { return this.reduce(function (length, elem) { return length + op.length(elem); }, 0); }; Delta.prototype.slice = function (start, end) { start = start || 0; if (typeof end !== 'number') end = Infinity; var ops = []; var iter = op.iterator(this.ops); var index = 0; while (index < end && iter.hasNext()) { var nextOp; if (index < start) { nextOp = iter.next(start - index); } else { nextOp = iter.next(end - index); ops.push(nextOp); } index += op.length(nextOp); } return new Delta(ops); }; Delta.prototype.compose = function (other) { var thisIter = op.iterator(this.ops); var otherIter = op.iterator(other.ops); var ops = []; var firstOther = otherIter.peek(); if (firstOther != null && typeof firstOther.retain === 'number' && firstOther.attributes == null) { var firstLeft = firstOther.retain; while (thisIter.peekType() === 'insert' && thisIter.peekLength() <= firstLeft) { firstLeft -= thisIter.peekLength(); ops.push(thisIter.next()); } if (firstOther.retain - firstLeft > 0) { otherIter.next(firstOther.retain - firstLeft); } } var delta = new Delta(ops); while (thisIter.hasNext() || otherIter.hasNext()) { if (otherIter.peekType() === 'insert') { delta.push(otherIter.next()); } else if (thisIter.peekType() === 'delete') { delta.push(thisIter.next()); } else { var length = Math.min(thisIter.peekLength(), otherIter.peekLength()); var thisOp = thisIter.next(length); var otherOp = otherIter.next(length); if (typeof otherOp.retain === 'number') { var newOp = {}; if (typeof thisOp.retain === 'number') { newOp.retain = length; } else { newOp.insert = thisOp.insert; } // Preserve null when composing with a retain, otherwise remove it for inserts var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number'); if (attributes) newOp.attributes = attributes; delta.push(newOp); // Optimization if rest of other is just retain if (!otherIter.hasNext() && equal(delta.ops[delta.ops.length - 1], newOp)) { var rest = new Delta(thisIter.rest()); return delta.concat(rest).chop(); } // Other op should be delete, we could be an insert or retain // Insert + delete cancels out } else if (typeof otherOp['delete'] === 'number' && typeof thisOp.retain === 'number') { delta.push(otherOp); } } } return delta.chop(); }; Delta.prototype.concat = function (other) { var delta = new Delta(this.ops.slice()); if (other.ops.length > 0) { delta.push(other.ops[0]); delta.ops = delta.ops.concat(other.ops.slice(1)); } return delta; }; Delta.prototype.diff = function (other, index) { if (this.ops === other.ops) { return new Delta(); } var strings = [this, other].map(function (delta) { return delta.map(function (op) { if (op.insert != null) { return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER; } var prep = delta === other ? 'on' : 'with'; throw new Error('diff() called ' + prep + ' non-document'); }).join(''); }); var delta = new Delta(); var diffResult = diff(strings[0], strings[1], index); var thisIter = op.iterator(this.ops); var otherIter = op.iterator(other.ops); diffResult.forEach(function (component) { var length = component[1].length; while (length > 0) { var opLength = 0; switch (component[0]) { case diff.INSERT: opLength = Math.min(otherIter.peekLength(), length); delta.push(otherIter.next(opLength)); break; case diff.DELETE: opLength = Math.min(length, thisIter.peekLength()); thisIter.next(opLength); delta['delete'](opLength); break; case diff.EQUAL: opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length); var thisOp = thisIter.next(opLength); var otherOp = otherIter.next(opLength); if (equal(thisOp.insert, otherOp.insert)) { delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes)); } else { delta.push(otherOp)['delete'](opLength); } break; } length -= opLength; } }); return delta.chop(); }; Delta.prototype.eachLine = function (predicate, newline) { newline = newline || '\n'; var iter = op.iterator(this.ops); var line = new Delta(); var i = 0; while (iter.hasNext()) { if (iter.peekType() !== 'insert') return; var thisOp = iter.peek(); var start = op.length(thisOp) - iter.peekLength(); var index = typeof thisOp.insert === 'string' ? thisOp.insert.indexOf(newline, start) - start : -1; if (index < 0) { line.push(iter.next()); } else if (index > 0) { line.push(iter.next(index)); } else { if (predicate(line, iter.next(1).attributes || {}, i) === false) { return; } i += 1; line = new Delta(); } } if (line.length() > 0) { predicate(line, {}, i); } }; Delta.prototype.transform = function (other, priority) { priority = !!priority; if (typeof other === 'number') { return this.transformPosition(other, priority); } var thisIter = op.iterator(this.ops); var otherIter = op.iterator(other.ops); var delta = new Delta(); while (thisIter.hasNext() || otherIter.hasNext()) { if (thisIter.peekType() === 'insert' && (priority || otherIter.peekType() !== 'insert')) { delta.retain(op.length(thisIter.next())); } else if (otherIter.peekType() === 'insert') { delta.push(otherIter.next()); } else { var length = Math.min(thisIter.peekLength(), otherIter.peekLength()); var thisOp = thisIter.next(length); var otherOp = otherIter.next(length); if (thisOp['delete']) { // Our delete either makes their delete redundant or removes their retain continue; } else if (otherOp['delete']) { delta.push(otherOp); } else { // We retain either their retain or insert delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority)); } } } return delta.chop(); }; Delta.prototype.transformPosition = function (index, priority) { priority = !!priority; var thisIter = op.iterator(this.ops); var offset = 0; while (thisIter.hasNext() && offset <= index) { var length = thisIter.peekLength(); var nextType = thisIter.peekType(); thisIter.next(); if (nextType === 'delete') { index -= Math.min(length, index - offset); continue; } else if (nextType === 'insert' && (offset < index || !priority)) { index += length; } offset += length; } return index; }; module.exports = Delta; /***/ }, /* 3 */ /***/function (module, exports) { 'use strict'; var hasOwn = Object.prototype.hasOwnProperty; var toStr = Object.prototype.toString; var defineProperty = Object.defineProperty; var gOPD = Object.getOwnPropertyDescriptor; var isArray = function isArray(arr) { if (typeof Array.isArray === 'function') { return Array.isArray(arr); } return toStr.call(arr) === '[object Array]'; }; var isPlainObject = function isPlainObject(obj) { if (!obj || toStr.call(obj) !== '[object Object]') { return false; } var hasOwnConstructor = hasOwn.call(obj, 'constructor'); var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); // Not own constructor property must be Object if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { return false; } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. var key; for (key in obj) {/**/} return typeof key === 'undefined' || hasOwn.call(obj, key); }; // If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target var setProperty = function setProperty(target, options) { if (defineProperty && options.name === '__proto__') { defineProperty(target, options.name, { enumerable: true, configurable: true, value: options.newValue, writable: true }); } else { target[options.name] = options.newValue; } }; // Return undefined instead of __proto__ if '__proto__' is not an own property var getProperty = function getProperty(obj, name) { if (name === '__proto__') { if (!hasOwn.call(obj, name)) { return void 0; } else if (gOPD) { // In early versions of node, obj['__proto__'] is buggy when obj has // __proto__ as an own property. Object.getOwnPropertyDescriptor() works. return gOPD(obj, name).value; } } return obj[name]; }; module.exports = function extend() { var options, name, src, copy, copyIsArray, clone; var target = arguments[0]; var i = 1; var length = arguments.length; var deep = false; // Handle a deep copy situation if (typeof target === 'boolean') { deep = target; target = arguments[1] || {}; // skip the boolean and the target i = 2; } if (target == null || (typeof target === 'undefined' ? 'undefined' : _typeof2(target)) !== 'object' && typeof target !== 'function') { target = {}; } for (; i < length; ++i) { options = arguments[i]; // Only deal with non-null/undefined values if (options != null) { // Extend the base object for (name in options) { src = getProperty(target, name); copy = getProperty(options, name); // Prevent never-ending loop if (target !== copy) { // Recurse if we're merging plain objects or arrays if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { if (copyIsArray) { copyIsArray = false; clone = src && isArray(src) ? src : []; } else { clone = src && isPlainObject(src) ? src : {}; } // Never move original objects, clone them setProperty(target, { name: name, newValue: extend(deep, clone, copy) }); // Don't bring in undefined values } else if (typeof copy !== 'undefined') { setProperty(target, { name: name, newValue: copy }); } } } } } // Return the modified object return target; }; /***/ }, /* 4 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.BlockEmbed = exports.bubbleFormats = undefined; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) { var parent = Object.getPrototypeOf(object);if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get;if (getter === undefined) { return undefined; }return getter.call(receiver); } }; var _extend = __webpack_require__(3); var _extend2 = _interopRequireDefault(_extend); var _quillDelta = __webpack_require__(2); var _quillDelta2 = _interopRequireDefault(_quillDelta); var _parchment = __webpack_require__(0); var _parchment2 = _interopRequireDefault(_parchment); var _break = __webpack_require__(16); var _break2 = _interopRequireDefault(_break); var _inline = __webpack_require__(6); var _inline2 = _interopRequireDefault(_inline); var _text = __webpack_require__(7); var _text2 = _interopRequireDefault(_text); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var NEWLINE_LENGTH = 1; var BlockEmbed = function (_Parchment$Embed) { _inherits(BlockEmbed, _Parchment$Embed); function BlockEmbed() { _classCallCheck(this, BlockEmbed); return _possibleConstructorReturn(this, (BlockEmbed.__proto__ || Object.getPrototypeOf(BlockEmbed)).apply(this, arguments)); } _createClass(BlockEmbed, [{ key: 'attach', value: function attach() { _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'attach', this).call(this); this.attributes = new _parchment2.default.Attributor.Store(this.domNode); } }, { key: 'delta', value: function delta() { return new _quillDelta2.default().insert(this.value(), (0, _extend2.default)(this.formats(), this.attributes.values())); } }, { key: 'format', value: function format(name, value) { var attribute = _parchment2.default.query(name, _parchment2.default.Scope.BLOCK_ATTRIBUTE); if (attribute != null) { this.attributes.attribute(attribute, value); } } }, { key: 'formatAt', value: function formatAt(index, length, name, value) { this.format(name, value); } }, { key: 'insertAt', value: function insertAt(index, value, def) { if (typeof value === 'string' && value.endsWith('\n')) { var block = _parchment2.default.create(Block.blotName); this.parent.insertBefore(block, index === 0 ? this : this.next); block.insertAt(0, value.slice(0, -1)); } else { _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'insertAt', this).call(this, index, value, def); } } }]); return BlockEmbed; }(_parchment2.default.Embed); BlockEmbed.scope = _parchment2.default.Scope.BLOCK_BLOT; // It is important for cursor behavior BlockEmbeds use tags that are block level elements var Block = function (_Parchment$Block) { _inherits(Block, _Parchment$Block); function Block(domNode) { _classCallCheck(this, Block); var _this2 = _possibleConstructorReturn(this, (Block.__proto__ || Object.getPrototypeOf(Block)).call(this, domNode)); _this2.cache = {}; return _this2; } _createClass(Block, [{ key: 'delta', value: function delta() { if (this.cache.delta == null) { this.cache.delta = this.descendants(_parchment2.default.Leaf).reduce(function (delta, leaf) { if (leaf.length() === 0) { return delta; } else { return delta.insert(leaf.value(), bubbleFormats(leaf)); } }, new _quillDelta2.default()).insert('\n', bubbleFormats(this)); } return this.cache.delta; } }, { key: 'deleteAt', value: function deleteAt(index, length) { _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'deleteAt', this).call(this, index, length); this.cache = {}; } }, { key: 'formatAt', value: function formatAt(index, length, name, value) { if (length <= 0) return; if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) { if (index + length === this.length()) { this.format(name, value); } } else { _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'formatAt', this).call(this, index, Math.min(length, this.length() - index - 1), name, value); } this.cache = {}; } }, { key: 'insertAt', value: function insertAt(index, value, def) { if (def != null) return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, index, value, def); if (value.length === 0) return; var lines = value.split('\n'); var text = lines.shift(); if (text.length > 0) { if (index < this.length() - 1 || this.children.tail == null) { _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, Math.min(index, this.length() - 1), text); } else { this.children.tail.insertAt(this.children.tail.length(), text); } this.cache = {}; } var block = this; lines.reduce(function (index, line) { block = block.split(index, true); block.insertAt(0, line); return line.length; }, index + text.length); } }, { key: 'insertBefore', value: function insertBefore(blot, ref) { var head = this.children.head; _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertBefore', this).call(this, blot, ref); if (head instanceof _break2.default) { head.remove(); } this.cache = {}; } }, { key: 'length', value: function length() { if (this.cache.length == null) { this.cache.length = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'length', this).call(this) + NEWLINE_LENGTH; } return this.cache.length; } }, { key: 'moveChildren', value: function moveChildren(target, ref) { _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'moveChildren', this).call(this, target, ref); this.cache = {}; } }, { key: 'optimize', value: function optimize(context) { _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'optimize', this).call(this, context); this.cache = {}; } }, { key: 'path', value: function path(index) { return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'path', this).call(this, index, true); } }, { key: 'removeChild', value: function removeChild(child) { _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'removeChild', this).call(this, child); this.cache = {}; } }, { key: 'split', value: function split(index) { var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) { var clone = this.clone(); if (index === 0) { this.parent.insertBefore(clone, this); return this; } else { this.parent.insertBefore(clone, this.next); return clone; } } else { var next = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'split', this).call(this, index, force); this.cache = {}; return next; } } }]); return Block; }(_parchment2.default.Block); Block.blotName = 'block'; Block.tagName = 'P'; Block.defaultChild = 'break'; Block.allowedChildren = [_inline2.default, _parchment2.default.Embed, _text2.default]; function bubbleFormats(blot) { var formats = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; if (blot == null) return formats; if (typeof blot.formats === 'function') { formats = (0, _extend2.default)(formats, blot.formats()); } if (blot.parent == null || blot.parent.blotName == 'scroll' || blot.parent.statics.scope !== blot.statics.scope) { return formats; } return bubbleFormats(blot.parent, formats); } exports.bubbleFormats = bubbleFormats; exports.BlockEmbed = BlockEmbed; exports.default = Block; /***/ }, /* 5 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.overload = exports.expandConfig = undefined; var _typeof = typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol" ? function (obj) { return typeof obj === 'undefined' ? 'undefined' : _typeof2(obj); } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === 'undefined' ? 'undefined' : _typeof2(obj); }; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [];var _n = true;var _d = false;var _e = undefined;try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value);if (i && _arr.length === i) break; } } catch (err) { _d = true;_e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } }return _arr; }return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); __webpack_require__(50); var _quillDelta = __webpack_require__(2); var _quillDelta2 = _interopRequireDefault(_quillDelta); var _editor = __webpack_require__(14); var _editor2 = _interopRequireDefault(_editor); var _emitter3 = __webpack_require__(8); var _emitter4 = _interopRequireDefault(_emitter3); var _module = __webpack_require__(9); var _module2 = _interopRequireDefault(_module); var _parchment = __webpack_require__(0); var _parchment2 = _interopRequireDefault(_parchment); var _selection = __webpack_require__(15); var _selection2 = _interopRequireDefault(_selection); var _extend = __webpack_require__(3); var _extend2 = _interopRequireDefault(_extend); var _logger = __webpack_require__(10); var _logger2 = _interopRequireDefault(_logger); var _theme = __webpack_require__(34); var _theme2 = _interopRequireDefault(_theme); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; }return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var debug = (0, _logger2.default)('quill'); var Quill = function () { _createClass(Quill, null, [{ key: 'debug', value: function debug(limit) { if (limit === true) { limit = 'log'; } _logger2.default.level(limit); } }, { key: 'find', value: function find(node) { return node.__quill || _parchment2.default.find(node); } }, { key: 'import', value: function _import(name) { if (this.imports[name] == null) { debug.error('Cannot import ' + name + '. Are you sure it was registered?'); } return this.imports[name]; } }, { key: 'register', value: function register(path, target) { var _this = this; var overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; if (typeof path !== 'string') { var name = path.attrName || path.blotName; if (typeof name === 'string') { // register(Blot | Attributor, overwrite) this.register('formats/' + name, path, target); } else { Object.keys(path).forEach(function (key) { _this.register(key, path[key], target); }); } } else { if (this.imports[path] != null && !overwrite) { debug.warn('Overwriting ' + path + ' with', target); } this.imports[path] = target; if ((path.startsWith('blots/') || path.startsWith('formats/')) && target.blotName !== 'abstract') { _parchment2.default.register(target); } else if (path.startsWith('modules') && typeof target.register === 'function') { target.register(); } } } }]); function Quill(container) { var _this2 = this; var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; _classCallCheck(this, Quill); this.options = expandConfig(container, options); this.container = this.options.container; if (this.container == null) { return debug.error('Invalid Quill container', container); } if (this.options.debug) { Quill.debug(this.options.debug); } var html = this.container.innerHTML.trim(); this.container.classList.add('ql-container'); this.container.innerHTML = ''; this.container.__quill = this; this.root = this.addContainer('ql-editor'); this.root.classList.add('ql-blank'); this.root.setAttribute('data-gramm', false); this.scrollingContainer = this.options.scrollingContainer || this.root; this.emitter = new _emitter4.default(); this.scroll = _parchment2.default.create(this.root, { emitter: this.emitter, whitelist: this.options.formats }); this.editor = new _editor2.default(this.scroll); this.selection = new _selection2.default(this.scroll, this.emitter); this.theme = new this.options.theme(this, this.options); this.keyboard = this.theme.addModule('keyboard'); this.clipboard = this.theme.addModule('clipboard'); this.history = this.theme.addModule('history'); this.theme.init(); this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type) { if (type === _emitter4.default.events.TEXT_CHANGE) { _this2.root.classList.toggle('ql-blank', _this2.editor.isBlank()); } }); this.emitter.on(_emitter4.default.events.SCROLL_UPDATE, function (source, mutations) { var range = _this2.selection.lastRange; var index = range && range.length === 0 ? range.index : undefined; modify.call(_this2, function () { return _this2.editor.update(null, mutations, index); }, source); }); var contents = this.clipboard.convert('<div class=\'ql-editor\' style="white-space: normal;">' + html + '<p><br></p></div>'); this.setContents(contents); this.history.clear(); if (this.options.placeholder) { this.root.setAttribute('data-placeholder', this.options.placeholder); } if (this.options.readOnly) { this.disable(); } } _createClass(Quill, [{ key: 'addContainer', value: function addContainer(container) { var refNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; if (typeof container === 'string') { var className = container; container = document.createElement('div'); container.classList.add(className); } this.container.insertBefore(container, refNode); return container; } }, { key: 'blur', value: function blur() { this.selection.setRange(null); } }, { key: 'deleteText', value: function deleteText(index, length, source) { var _this3 = this; var _overload = overload(index, length, source); var _overload2 = _slicedToArray(_overload, 4); index = _overload2[0]; length = _overload2[1]; source = _overload2[3]; return modify.call(this, function () { return _this3.editor.deleteText(index, length); }, source, index, -1 * length); } }, { key: 'disable', value: function disable() { this.enable(false); } }, { key: 'enable', value: function enable() { var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; this.scroll.enable(enabled); this.container.classList.toggle('ql-disabled', !enabled); } }, { key: 'focus', value: function focus() { var scrollTop = this.scrollingContainer.scrollTop; this.selection.focus(); this.scrollingContainer.scrollTop = scrollTop; this.scrollIntoView(); } }, { key: 'format', value: function format(name, value) { var _this4 = this; var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API; return modify.call(this, function () { var range = _this4.getSelection(true); var change = new _quillDelta2.default(); if (range == null) { return change; } else if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) { change = _this4.editor.formatLine(range.index, range.length, _defineProperty({}, name, value)); } else if (range.length === 0) { _this4.selection.format(name, value); return change; } else { change = _this4.editor.formatText(range.index, range.length, _defineProperty({}, name, value)); } _this4.setSelection(range, _emitter4.default.sources.SILENT); return change; }, source); } }, { key: 'formatLine', value: function formatLine(index, length, name, value, source) { var _this5 = this; var formats = void 0; var _overload3 = overload(index, length, name, value, source); var _overload4 = _slicedToArray(_overload3, 4); index = _overload4[0]; length = _overload4[1]; formats = _overload4[2]; source = _overload4[3]; return modify.call(this, function () { return _this5.editor.formatLine(index, length, formats); }, source, index, 0); } }, { key: 'formatText', value: function formatText(index, length, name, value, source) { var _this6 = this; var formats = void 0; var _overload5 = overload(index, length, name, value, source); var _overload6 = _slicedToArray(_overload5, 4); index = _overload6[0]; length = _overload6[1]; formats = _overload6[2]; source = _overload6[3]; return modify.call(this, function () { return _this6.editor.formatText(index, length, formats); }, source, index, 0); } }, { key: 'getBounds', value: function getBounds(index) { var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; var bounds = void 0; if (typeof index === 'number') { bounds = this.selection.getBounds(index, length); } else { bounds = this.selection.getBounds(index.index, index.length); } var containerBounds = this.container.getBoundingClientRect(); return { bottom: bounds.bottom - containerBounds.top, height: bounds.height, left: bounds.left - containerBounds.left, right: bounds.right - containerBounds.left, top: bounds.top - containerBounds.top, width: bounds.width }; } }, { key: 'getContents', value: function getContents() { var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index; var _overload7 = overload(index, length); var _overload8 = _slicedToArray(_overload7, 2); index = _overload8[0]; length = _overload8[1]; return this.editor.getContents(index, length); } }, { key: 'getFormat', value: function getFormat() { var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getSelection(true); var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; if (typeof index === 'number') { return this.editor.getFormat(index, length); } else { return this.editor.getFormat(index.index, index.length); } } }, { key: 'getIndex', value: function getIndex(blot) { return blot.offset(this.scroll); } }, { key: 'getLength', value: function getLength() { return this.scroll.length(); } }, { key: 'getLeaf', value: function getLeaf(index) { return this.scroll.leaf(index); } }, { key: 'getLine', value: function getLine(index) { return this.scroll.line(index); } }, { key: 'getLines', value: function getLines() { var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE; if (typeof index !== 'number') { return this.scroll.lines(index.index, index.length); } else { return this.scroll.lines(index, length); } } }, { key: 'getModule', value: function getModule(name) { return this.theme.modules[name]; } }, { key: 'getSelection', value: function getSelection() { var focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; if (focus) this.focus(); this.update(); // Make sure we access getRange with editor in consistent state return this.selection.getRange()[0]; } }, { key: 'getText', value: function getText() { var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index; var _overload9 = overload(index, length); var _overload10 = _slicedToArray(_overload9, 2); index = _overload10[0]; length = _overload10[1]; return this.editor.getText(index, length); } }, { key: 'hasFocus', value: function hasFocus() { return this.selection.hasFocus(); } }, { key: 'insertEmbed', value: function insertEmbed(index, embed, value) { var _this7 = this; var source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Quill.sources.API; return modify.call(this, function () { return _this7.editor.insertEmbed(index, embed, value); }, source, index); } }, { key: 'insertText', value: function insertText(index, text, name, value, source) { var _this8 = this; var formats = void 0; var _overload11 = overload(index, 0, name, value, source); var _overload12 = _slicedToArray(_overload11, 4); index = _overload12[0]; formats = _overload12[2]; source = _overload12[3]; return modify.call(this, function () { return _this8.editor.insertText(index, text, formats); }, source, index, text.length); } }, { key: 'isEnabled', value: function isEnabled() { return !this.container.classList.contains('ql-disabled'); } }, { key: 'off', value: function off() { return this.emitter.off.apply(this.emitter, arguments); } }, { key: 'on', value: function on() { return this.emitter.on.apply(this.emitter, arguments); } }, { key: 'once', value: function once() { return this.emitter.once.apply(this.emitter, arguments); } }, { key: 'pasteHTML', value: function pasteHTML(index, html, source) { this.clipboard.dangerouslyPasteHTML(index, html, source); } }, { key: 'removeFormat', value: function removeFormat(index, length, source) { var _this9 = this; var _overload13 = overload(index, length, source); var _overload14 = _slicedToArray(_overload13, 4); index = _overload14[0]; length = _overload14[1]; source = _overload14[3]; return modify.call(this, function () { return _this9.editor.removeFormat(index, length); }, source, index); } }, { key: 'scrollIntoView', value: function scrollIntoView() { this.selection.scrollIntoView(this.scrollingContainer); } }, { key: 'setContents', value: function setContents(delta) { var _this10 = this; var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; return modify.call(this, function () { delta = new _quillDelta2.default(delta); var length = _this10.getLength(); var deleted = _this10.editor.deleteText(0, length); var applied = _this10.editor.applyDelta(delta); var lastOp = applied.ops[applied.ops.length - 1]; if (lastOp != null && typeof lastOp.insert === 'string' && lastOp.insert[lastOp.insert.length - 1] === '\n') { _this10.editor.deleteText(_this10.getLength() - 1, 1); applied.delete(1); } var ret = deleted.compose(applied); return ret; }, source); } }, { key: 'setSelection', value: function setSelection(index, length, source) { if (index == null) { this.selection.setRange(null, length || Quill.sources.API); } else { var _overload15 = overload(index, length, source); var _overload16 = _slicedToArray(_overload15, 4); index = _overload16[0]; length = _overload16[1]; source = _overload16[3]; this.selection.setRange(new _selection.Range(index, length), source); if (source !== _emitter4.default.sources.SILENT) { this.selection.scrollIntoView(this.scrollingContainer); } } } }, { key: 'setText', value: function setText(text) { var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; var delta = new _quillDelta2.default().insert(text); return this.setContents(delta, source); } }, { key: 'update', value: function update() { var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER; var change = this.scroll.update(source); // Will update selection before selection.update() does if text changes this.selection.update(source); return change; } }, { key: 'updateContents', value: function updateContents(delta) { var _this11 = this; var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; return modify.call(this, function () { delta = new _quillDelta2.default(delta); return _this11.editor.applyDelta(delta, source); }, source, true); } }]); return Quill; }(); Quill.DEFAULTS = { bounds: null, formats: null, modules: {}, placeholder: '', readOnly: false, scrollingContainer: null, strict: true, theme: 'default' }; Quill.events = _emitter4.default.events; Quill.sources = _emitter4.default.sources; // eslint-disable-next-line no-undef Quill.version = false ? 'dev' : "1.3.7"; Quill.imports = { 'delta': _quillDelta2.default, 'parchment': _parchment2.default, 'core/module': _module2.default, 'core/theme': _theme2.default }; function expandConfig(container, userConfig) { userConfig = (0, _extend2.default)(true, { container: container, modules: { clipboard: true, keyboard: true, history: true } }, userConfig); if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) { userConfig.theme = _theme2.default; } else { userConfig.theme = Quill.import('themes/' + userConfig.theme); if (userConfig.theme == null) { throw new Error('Invalid theme ' + userConfig.theme + '. Did you register it?'); } } var themeConfig = (0, _extend2.default)(true, {}, userConfig.theme.DEFAULTS); [themeConfig, userConfig].forEach(function (config) { config.modules = config.modules || {}; Object.keys(config.modules).forEach(function (module) { if (config.modules[module] === true) { config.modules[module] = {}; } }); }); var moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules)); var moduleConfig = moduleNames.reduce(function (config, name) { var moduleClass = Quill.import('modules/' + name); if (moduleClass == null) { debug.error('Cannot load ' + name + ' module. Are you sure you registered it?'); } else { config[name] = moduleClass.DEFAULTS || {}; } return config; }, {}); // Special case toolbar shorthand if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) { userConfig.modules.toolbar = { container: userConfig.modules.toolbar }; } userConfig = (0, _extend2.default)(true, {}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig); ['bounds', 'container', 'scrollingContainer'].forEach(function (key) { if (typeof userConfig[key] === 'string') { userConfig[key] = document.querySelector(userConfig[key]); } }); userConfig.modules = Object.keys(userConfig.modules).reduce(function (config, name) { if (userConfig.modules[name]) { config[name] = userConfig.modules[name]; } return config; }, {}); return userConfig; } // Handle selection preservation and TEXT_CHANGE emission // common to modification APIs function modify(modifier, source, index, shift) { if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) { return new _quillDelta2.default(); } var range = index == null ? null : this.getSelection(); var oldDelta = this.editor.delta; var change = modifier(); if (range != null) { if (index === true) index = range.index; if (shift == null) { range = shiftRange(range, change, source); } else if (shift !== 0) { range = shiftRange(range, index, shift, source); } this.setSelection(range, _emitter4.default.sources.SILENT); } if (change.length() > 0) { var _emitter; var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source]; (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args)); if (source !== _emitter4.default.sources.SILENT) { var _emitter2; (_emitter2 = this.emitter).emit.apply(_emitter2, args); } } return change; } function overload(index, length, name, value, source) { var formats = {}; if (typeof index.index === 'number' && typeof index.length === 'number') { // Allow for throwaway end (used by insertText/insertEmbed) if (typeof length !== 'number') { source = value, value = name, name = length, length = index.length, index = index.index; } else { length = index.length, index = index.index; } } else if (typeof length !== 'number') { source = value, value = name, name = length, length = 0; } // Handle format being object, two format name/value strings or excluded if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') { formats = name; source = value; } else if (typeof name === 'string') { if (value != null) { formats[name] = value; } else { source = name; } } // Handle optional source source = source || _emitter4.default.sources.API; return [index, length, formats, source]; } function shiftRange(range, index, length, source) { if (range == null) return null; var start = void 0, end = void 0; if (index instanceof _quillDelta2.default) { var _map = [range.index, range.index + range.length].map(function (pos) { return index.transformPosition(pos, source !== _emitter4.default.sources.USER); }); var _map2 = _slicedToArray(_map, 2); start = _map2[0]; end = _map2[1]; } else { var _map3 = [range.index, range.index + range.length].map(function (pos) { if (pos < index || pos === index && source === _emitter4.default.sources.USER) return pos; if (length >= 0) { return pos + length; } else { return Math.max(index, pos + length); } }); var _map4 = _slicedToArray(_map3, 2); start = _map4[0]; end = _map4[1]; } return new _selection.Range(start, end - start); } exports.expandConfig = expandConfig; exports.overload = overload; exports.default = Quill; /***/ }, /* 6 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) { var parent = Object.getPrototypeOf(object);if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get;if (getter === undefined) { return undefined; }return getter.call(receiver); } }; var _text = __webpack_require__(7); var _text2 = _interopRequireDefault(_text); var _parchment = __webpack_require__(0); var _parchment2 = _interopRequireDefault(_parchment); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Inline = function (_Parchment$Inline) { _inherits(Inline, _Parchment$Inline); function Inline() { _classCallCheck(this, Inline); return _possibleConstructorReturn(this, (Inline.__proto__ || Object.getPrototypeOf(Inline)).apply(this, arguments)); } _createClass(Inline, [{ key: 'formatAt', value: function formatAt(index, length, name, value) { if (Inline.compare(this.statics.blotName, name) < 0 && _parchment2.default.query(name, _parchment2.default.Scope.BLOT)) { var blot = this.isolate(index, length); if (value) { blot.wrap(name, value); } } else { _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'formatAt', this).call(this, index, length, name, value); } } }, { key: 'optimize', value: function optimize(context) { _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'optimize', this).call(this, context); if (this.parent instanceof Inline && Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) { var parent = this.parent.isolate(this.offset(), this.length()); this.moveChildren(parent); parent.wrap(this); } } }], [{ key: 'compare', value: function compare(self, other) { var selfIndex = Inline.order.indexOf(self); var otherIndex = Inline.order.indexOf(other); if (selfIndex >= 0 || otherIndex >= 0) { return selfIndex - otherIndex; } else if (self === other) { return 0; } else if (self < other) { return -1; } else { return 1; } } }]); return Inline; }(_parchment2.default.Inline); Inline.allowedChildren = [Inline, _parchment2.default.Embed, _text2.default]; // Lower index means deeper in the DOM tree, since not found (-1) is for embeds Inline.order = ['cursor', 'inline', // Must be lower 'underline', 'strike', 'italic', 'bold', 'script', 'link', 'code' // Must be higher ]; exports.default = Inline; /***/ }, /* 7 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _parchment = __webpack_require__(0); var _parchment2 = _interopRequireDefault(_parchment); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var TextBlot = function (_Parchment$Text) { _inherits(TextBlot, _Parchment$Text); function TextBlot() { _classCallCheck(this, TextBlot); return _possibleConstructorReturn(this, (TextBlot.__proto__ || Object.getPrototypeOf(TextBlot)).apply(this, arguments)); } return TextBlot; }(_parchment2.default.Text); exports.default = TextBlot; /***/ }, /* 8 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) { var parent = Object.getPrototypeOf(object);if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get;if (getter === undefined) { return undefined; }return getter.call(receiver); } }; var _eventemitter = __webpack_require__(54); var _eventemitter2 = _interopRequireDefault(_eventemitter); var _logger = __webpack_require__(10); var _logger2 = _interopRequireDefault(_logger); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var debug = (0, _logger2.default)('quill:events'); var EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click']; EVENTS.forEach(function (eventName) { document.addEventListener(eventName, function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } [].slice.call(document.querySelectorAll('.ql-container')).forEach(function (node) { // TODO use WeakMap if (node.__quill && node.__quill.emitter) { var _node$__quill$emitter; (_node$__quill$emitter = node.__quill.emitter).handleDOM.apply(_node$__quill$emitter, args); } }); }); }); var Emitter = function (_EventEmitter) { _inherits(Emitter, _EventEmitter); function Emitter() { _classCallCheck(this, Emitter); var _this = _possibleConstructorReturn(this, (Emitter.__proto__ || Object.getPrototypeOf(Emitter)).call(this)); _this.listeners = {}; _this.on('error', debug.error); return _this; } _createClass(Emitter, [{ key: 'emit', value: function emit() { debug.log.apply(debug, arguments); _get(Emitter.prototype.__proto__ || Object.getPrototypeOf(Emitter.prototype), 'emit', this).apply(this, arguments); } }, { key: 'handleDOM', value: function handleDOM(event) { for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { args[_key2 - 1] = arguments[_key2]; } (this.listeners[event.type] || []).forEach(function (_ref) { var node = _ref.node, handler = _ref.handler; if (event.target === node || node.contains(event.target)) { handler.apply(undefined, [event].concat(args)); } }); } }, { key: 'listenDOM', value: function listenDOM(eventName, node, handler) { if (!this.listeners[eventName]) { this.listeners[eventName] = []; } this.listeners[eventName].push({ node: node, handler: handler }); } }]); return Emitter; }(_eventemitter2.default); Emitter.events = { EDITOR_CHANGE: 'editor-change', SCROLL_BEFORE_UPDATE: 'scroll-before-update', SCROLL_OPTIMIZE: 'scroll-optimize', SCROLL_UPDATE: 'scroll-update', SELECTION_CHANGE: 'selection-change', TEXT_CHANGE: 'text-change' }; Emitter.sources = { API: 'api', SILENT: 'silent', USER: 'user' }; exports.default = Emitter; /***/ }, /* 9 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Module = function Module(quill) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; _classCallCheck(this, Module); this.quill = quill; this.options = options; }; Module.DEFAULTS = {}; exports.default = Module; /***/ }, /* 10 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var levels = ['error', 'warn', 'log', 'info']; var level = 'warn'; function debug(method) { if (levels.indexOf(method) <= levels.indexOf(level)) { var _console; for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } (_console = console)[method].apply(_console, args); // eslint-disable-line no-console } } function namespace(ns) { return levels.reduce(function (logger, method) { logger[method] = debug.bind(console, method, ns); return logger; }, {}); } debug.level = namespace.level = function (newLevel) { level = newLevel; }; exports.default = namespace; /***/ }, /* 11 */ /***/function (module, exports, __webpack_require__) { var pSlice = Array.prototype.slice; var objectKeys = __webpack_require__(52); var isArguments = __webpack_require__(53); var deepEqual = module.exports = function (actual, expected, opts) { if (!opts) opts = {}; // 7.1. All identical values are equivalent, as determined by ===. if (actual === expected) { return true; } else if (actual instanceof Date && expected instanceof Date) { return actual.getTime() === expected.getTime(); // 7.3. Other pairs that do not both pass typeof value == 'object', // equivalence is determined by ==. } else if (!actual || !expected || (typeof actual === 'undefined' ? 'undefined' : _typeof2(actual)) != 'object' && (typeof expected === 'undefined' ? 'undefined' : _typeof2(expected)) != 'object') { return opts.strict ? actual === expected : actual == expected; // 7.4. For all other Object pairs, including Array objects, equivalence is // determined by having the same number of owned properties (as verified // with Object.prototype.hasOwnProperty.call), the same set of keys // (although not necessarily the same order), equivalent values for every // corresponding key, and an identical 'prototype' property. Note: this // accounts for both named and indexed properties on Arrays. } else { return objEquiv(actual, expected, opts); } }; function isUndefinedOrNull(value) { return value === null || value === undefined; } function isBuffer(x) { if (!x || (typeof x === 'undefined' ? 'undefined' : _typeof2(x)) !== 'object' || typeof x.length !== 'number') return false; if (typeof x.copy !== 'function' || typeof x.slice !== 'function') { return false; } if (x.length > 0 && typeof x[0] !== 'number') return false; return true; } function objEquiv(a, b, opts) { var i, key; if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) return false; // an identical 'prototype' property. if (a.prototype !== b.prototype) return false; //~~~I've managed to break Object.keys through screwy arguments passing. // Converting to array solves the problem. if (isArguments(a)) { if (!isArguments(b)) { return false; } a = pSlice.call(a); b = pSlice.call(b); return deepEqual(a, b, opts); } if (isBuffer(a)) { if (!isBuffer(b)) { return false; } if (a.length !== b.length) return false; for (i = 0; i < a.length; i++) { if (a[i] !== b[i]) return false; } return true; } try { var ka = objectKeys(a), kb = objectKeys(b); } catch (e) { //happens when one is a string literal and the other isn't return false; } // having the same number of owned properties (keys incorporates // hasOwnProperty) if (ka.length != kb.length) return false; //the same set of keys (although not necessarily the same order), ka.sort(); kb.sort(); //~~~cheap key test for (i = ka.length - 1; i >= 0; i--) { if (ka[i] != kb[i]) return false; } //equivalent values for every corresponding key, and //~~~possibly expensive deep test for (i = ka.length - 1; i >= 0; i--) { key = ka[i]; if (!deepEqual(a[key], b[key], opts)) return false; } return (typeof a === 'undefined' ? 'undefined' : _typeof2(a)) === (typeof b === 'undefined' ? 'undefined' : _typeof2(b)); } /***/ }, /* 12 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Registry = __webpack_require__(1); var Attributor = /** @class */function () { function Attributor(attrName, keyName, options) { if (options === void 0) { options = {}; } this.attrName = attrName; this.keyName = keyName; var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE; if (options.scope != null) { // Ignore type bits, force attribute bit this.scope = options.scope & Registry.Scope.LEVEL | attributeBit; } else { this.scope = Registry.Scope.ATTRIBUTE; } if (options.whitelist != null) this.whitelist = options.whitelist; } Attributor.keys = function (node) { return [].map.call(node.attributes, function (item) { return item.name; }); }; Attributor.prototype.add = function (node, value) { if (!this.canAdd(node, value)) return false; node.setAttribute(this.keyName, value); return true; }; Attributor.prototype.canAdd = function (node, value) { var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE)); if (match == null) return false; if (this.whitelist == null) return true; if (typeof value === 'string') { return this.whitelist.indexOf(value.replace(/["']/g, '')) > -1; } else { return this.whitelist.indexOf(value) > -1; } }; Attributor.prototype.remove = function (node) { node.removeAttribute(this.keyName); }; Attributor.prototype.value = function (node) { var value = node.getAttribute(this.keyName); if (this.canAdd(node, value) && value) { return value; } return ''; }; return Attributor; }(); exports.default = Attributor; /***/ }, /* 13 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.Code = undefined; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [];var _n = true;var _d = false;var _e = undefined;try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value);if (i && _arr.length === i) break; } } catch (err) { _d = true;_e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } }return _arr; }return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) { var parent = Object.getPrototypeOf(object);if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get;if (getter === undefined) { return undefined; }return getter.call(receiver); } }; var _quillDelta = __webpack_require__(2); var _quillDelta2 = _interopRequireDefault(_quillDelta); var _parchment = __webpack_require__(0); var _parchment2 = _interopRequireDefault(_parchment); var _block = __webpack_require__(4); var _block2 = _interopRequireDefault(_block); var _inline = __webpack_require__(6); var _inline2 = _interopRequireDefault(_inline); var _text = __webpack_require__(7); var _text2 = _interopRequireDefault(_text); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Code = function (_Inline) { _inherits(Code, _Inline); function Code() { _classCallCheck(this, Code); return _possibleConstructorReturn(this, (Code.__proto__ || Object.getPrototypeOf(Code)).apply(this, arguments)); } return Code; }(_inline2.default); Code.blotName = 'code'; Code.tagName = 'CODE'; var CodeBlock = function (_Block) { _inherits(CodeBlock, _Block); function CodeBlock() { _classCallCheck(this, CodeBlock); return _possibleConstructorReturn(this, (CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock)).apply(this, arguments)); } _createClass(CodeBlock, [{ key: 'delta', value: function delta() { var _this3 = this; var text = this.domNode.textContent; if (text.endsWith('\n')) { // Should always be true text = text.slice(0, -1); } return text.split('\n').reduce(function (delta, frag) { return delta.insert(frag).insert('\n', _this3.formats()); }, new _quillDelta2.default()); } }, { key: 'format', value: function format(name, value) { if (name === this.statics.blotName && value) return; var _descendant = this.descendant(_text2.default, this.length() - 1), _descendant2 = _slicedToArray(_descendant, 1), text = _descendant2[0]; if (text != null) { text.deleteAt(text.length() - 1, 1); } _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'format', this).call(this, name, value); } }, { key: 'formatAt', value: function formatAt(index, length, name, value) { if (length === 0) return; if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK) == null || name === this.statics.blotName && value === this.statics.formats(this.domNode)) { return; } var nextNewline = this.newlineIndex(index); if (nextNewline < 0 || nextNewline >= index + length) return; var prevNewline = this.newlineIndex(index, true) + 1; var isolateLength = nextNewline - prevNewline + 1; var blot = this.isolate(prevNewline, isolateLength); var next = blot.next; blot.format(name, value); if (next instanceof CodeBlock) { next.formatAt(0, index - prevNewline + length - isolateLength, name, value); } } }, { key: 'insertAt', value: function insertAt(index, value, def) { if (def != null) return; var _descendant3 = this.descendant(_text2.default, index), _descendant4 = _slicedToArray(_descendant3, 2), text = _descendant4[0], offset = _descendant4[1]; text.insertAt(offset, value); } }, { key: 'length', value: function length() { var length = this.domNode.textContent.length; if (!this.domNode.textContent.endsWith('\n')) { return length + 1; } return length; } }, { key: 'newlineIndex', value: function newlineIndex(searchIndex) { var reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (!reverse) { var offset = this.domNode.textContent.slice(searchIndex).indexOf('\n'); return offset > -1 ? searchIndex + offset : -1; } else { return this.domNode.textContent.slice(0, searchIndex).lastIndexOf('\n'); } } }, { key: 'optimize', value: function optimize(context) { if (!this.domNode.textContent.endsWith('\n')) { this.appendChild(_parchment2.default.create('text', '\n')); } _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'optimize', this).call(this, context); var next = this.next; if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) { next.optimize(context); next.moveChildren(this); next.remove(); } } }, { key: 'replace', value: function replace(target) { _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'replace', this).call(this, target); [].slice.call(this.domNode.querySelectorAll('*')).forEach(function (node) { var blot = _parchment2.default.find(node); if (blot == null) { node.parentNode.removeChild(node); } else if (blot instanceof _parchment2.default.Embed) { blot.remove(); } else { blot.unwrap(); } }); } }], [{ key: 'create', value: function create(value) { var domNode = _get(CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock), 'create', this).call(this, value); domNode.setAttribute('spellcheck', false); return domNode; } }, { key: 'formats', value: function formats() { return true; } }]); return CodeBlock; }(_block2.default); CodeBlock.blotName = 'code-block'; CodeBlock.tagName = 'PRE'; CodeBlock.TAB = ' '; exports.Code = Code; exports.default = CodeBlock; /***/ }, /* 14 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _typeof = typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol" ? function (obj) { return typeof obj === 'undefined' ? 'undefined' : _typeof2(obj); } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === 'undefined' ? 'undefined' : _typeof2(obj); }; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [];var _n = true;var _d = false;var _e = undefined;try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value);if (i && _arr.length === i) break; } } catch (err) { _d = true;_e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } }return _arr; }return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _quillDelta = __webpack_require__(2); var _quillDelta2 = _interopRequireDefault(_quillDelta); var _op = __webpack_require__(20); var _op2 = _interopRequireDefault(_op); var _parchment = __webpack_require__(0); var _parchment2 = _interopRequireDefault(_parchment); var _code = __webpack_require__(13); var _code2 = _interopRequireDefault(_code); var _cursor = __webpack_require__(24); var _cursor2 = _interopRequireDefault(_cursor); var _block = __webpack_require__(4); var _block2 = _interopRequireDefault(_block); var _break = __webpack_require__(16); var _break2 = _interopRequireDefault(_break); var _clone = __webpack_require__(21); var _clone2 = _interopRequireDefault(_clone); var _deepEqual = __webpack_require__(11); var _deepEqual2 = _interopRequireDefault(_deepEqual); var _extend = __webpack_require__(3); var _extend2 = _interopRequireDefault(_extend); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; }return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var ASCII = /^[ -~]*$/; var Editor = function () { function Editor(scroll) { _classCallCheck(this, Editor); this.scroll = scroll; this.delta = this.getDelta(); } _createClass(Editor, [{ key: 'applyDelta', value: function applyDelta(delta) { var _this = this; var consumeNextNewline = false; this.scroll.update(); var scrollLength = this.scroll.length(); this.scroll.batchStart(); delta = normalizeDelta(delta); delta.reduce(function (index, op) { var length = op.retain || op.delete || op.insert.length || 1; var attributes = op.attributes || {}; if (op.insert != null) { if (typeof op.insert === 'string') { var text = op.insert; if (text.endsWith('\n') && consumeNextNewline) { consumeNextNewline = false; text = text.slice(0, -1); } if (index >= scrollLength && !text.endsWith('\n')) { consumeNextNewline = true; } _this.scroll.insertAt(index, text); var _scroll$line = _this.scroll.line(index), _scroll$line2 = _slicedToArray(_scroll$line, 2), line = _scroll$line2[0], offset = _scroll$line2[1]; var formats = (0, _extend2.default)({}, (0, _block.bubbleFormats)(line)); if (line instanceof _block2.default) { var _line$descendant = line.descendant(_parchment2.default.Leaf, offset), _line$descendant2 = _slicedToArray(_line$descendant, 1), leaf = _line$descendant2[0]; formats = (0, _extend2.default)(formats, (0, _block.bubbleFormats)(leaf)); } attributes = _op2.default.attributes.diff(formats, attributes) || {}; } else if (_typeof(op.insert) === 'object') { var key = Object.keys(op.insert)[0]; // There should only be one key if (key == null) return index; _this.scroll.insertAt(index, key, op.insert[key]); } scrollLength += length; } Object.keys(attributes).forEach(function (name) { _this.scroll.formatAt(index, length, name, attributes[name]); }); return index + length; }, 0); delta.reduce(function (index, op) { if (typeof op.delete === 'number') { _this.scroll.deleteAt(index, op.delete); return index; } return index + (op.retain || op.insert.length || 1); }, 0); this.scroll.batchEnd(); return this.update(delta); } }, { key: 'deleteText', value: function deleteText(index, length) { this.scroll.deleteAt(index, length); return this.update(new _quillDelta2.default().retain(index).delete(length)); } }, { key: 'formatLine', value: function formatLine(index, length) { var _this2 = this; var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; this.scroll.update(); Object.keys(formats).forEach(function (format) { if (_this2.scroll.whitelist != null && !_this2.scroll.whitelist[format]) return; var lines = _this2.scroll.lines(index, Math.max(length, 1)); var lengthRemaining = length; lines.forEach(function (line) { var lineLength = line.length(); if (!(line instanceof _code2.default)) { line.format(format, formats[format]); } else { var codeIndex = index - line.offset(_this2.scroll); var codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1; line.formatAt(codeIndex, codeLength, format, formats[format]); } lengthRemaining -= lineLength; }); }); this.scroll.optimize(); return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats))); } }, { key: 'formatText', value: function formatText(index, length) { var _this3 = this; var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; Object.keys(formats).forEach(function (format) { _this3.scroll.formatAt(index, length, format, formats[format]); }); return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats))); } }, { key: 'getContents', value: function getContents(index, length) { return this.delta.slice(index, index + length); } }, { key: 'getDelta', value: function getDelta() { return this.scroll.lines().reduce(function (delta, line) { return delta.concat(line.delta()); }, new _quillDelta2.default()); } }, { key: 'getFormat', value: function getFormat(index) { var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; var lines = [], leaves = []; if (length === 0) { this.scroll.path(index).forEach(function (path) { var _path = _slicedToArray(path, 1), blot = _path[0]; if (blot instanceof _block2.default) { lines.push(blot); } else if (blot instanceof _parchment2.default.Leaf) { leaves.push(blot); } }); } else { lines = this.scroll.lines(index, length); leaves = this.scroll.descendants(_parchment2.default.Leaf, index, length); } var formatsArr = [lines, leaves].map(function (blots) { if (blots.length === 0) return {}; var formats = (0, _block.bubbleFormats)(blots.shift()); while (Object.keys(formats).length > 0) { var blot = blots.shift(); if (blot == null) return formats; formats = combineFormats((0, _block.bubbleFormats)(blot), formats); } return formats; }); return _extend2.default.apply(_extend2.default, formatsArr); } }, { key: 'getText', value: function getText(index, length) { return this.getContents(index, length).filter(function (op) { return typeof op.insert === 'string'; }).map(function (op) { return op.insert; }).join(''); } }, { key: 'insertEmbed', value: function insertEmbed(index, embed, value) { this.scroll.insertAt(index, embed, value); return this.update(new _quillDelta2.default().retain(index).insert(_defineProperty({}, embed, value))); } }, { key: 'insertText', value: function insertText(index, text) { var _this4 = this; var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; text = text.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); this.scroll.insertAt(index, text); Object.keys(formats).forEach(function (format) { _this4.scroll.formatAt(index, text.length, format, formats[format]); }); return this.update(new _quillDelta2.default().retain(index).insert(text, (0, _clone2.default)(formats))); } }, { key: 'isBlank', value: function isBlank() { if (this.scroll.children.length == 0) return true; if (this.scroll.children.length > 1) return false; var block = this.scroll.children.head; if (block.statics.blotName !== _block2.default.blotName) return false; if (block.children.length > 1) return false; return block.children.head instanceof _break2.default; } }, { key: 'removeFormat', value: function removeFormat(index, length) { var text = this.getText(index, length); var _scroll$line3 = this.scroll.line(index + length), _scroll$line4 = _slicedToArray(_scroll$line3, 2), line = _scroll$line4[0], offset = _scroll$line4[1]; var suffixLength = 0, suffix = new _quillDelta2.default(); if (line != null) { if (!(line instanceof _code2.default)) { suffixLength = line.length() - offset; } else { suffixLength = line.newlineIndex(offset) - offset + 1; } suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\n'); } var contents = this.getContents(index, length + suffixLength); var diff = contents.diff(new _quillDelta2.default().insert(text).concat(suffix)); var delta = new _quillDelta2.default().retain(index).concat(diff); return this.applyDelta(delta); } }, { key: 'update', value: function update(change) { var mutations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; var cursorIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; var oldDelta = this.delta; if (mutations.length === 1 && mutations[0].type === 'characterData' && mutations[0].target.data.match(ASCII) && _parchment2.default.find(mutations[0].target)) { // Optimization for character changes var textBlot = _parchment2.default.find(mutations[0].target); var formats = (0, _block.bubbleFormats)(textBlot); var index = textBlot.offset(this.scroll); var oldValue = mutations[0].oldValue.replace(_cursor2.default.CONTENTS, ''); var oldText = new _quillDelta2.default().insert(oldValue); var newText = new _quillDelta2.default().insert(textBlot.value()); var diffDelta = new _quillDelta2.default().retain(index).concat(oldText.diff(newText, cursorIndex)); change = diffDelta.reduce(function (delta, op) { if (op.insert) { return delta.insert(op.insert, formats); } else { return delta.push(op); } }, new _quillDelta2.default()); this.delta = oldDelta.compose(change); } else { this.delta = this.getDelta(); if (!change || !(0, _deepEqual2.default)(oldDelta.compose(change), this.delta)) { change = oldDelta.diff(this.delta, cursorIndex); } } return change; } }]); return Editor; }(); function combineFormats(formats, combined) { return Object.keys(combined).reduce(function (merged, name) { if (formats[name] == null) return merged; if (combined[name] === formats[name]) { merged[name] = combined[name]; } else if (Array.isArray(combined[name])) { if (combined[name].indexOf(formats[name]) < 0) { merged[name] = combined[name].concat([formats[name]]); } } else { merged[name] = [combined[name], formats[name]]; } return merged; }, {}); } function normalizeDelta(delta) { return delta.reduce(function (delta, op) { if (op.insert === 1) { var attributes = (0, _clone2.default)(op.attributes); delete attributes['image']; return delta.insert({ image: op.attributes.image }, attributes); } if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) { op = (0, _clone2.default)(op); if (op.attributes.list) { op.attributes.list = 'ordered'; } else { op.attributes.list = 'bullet'; delete op.attributes.bullet; } } if (typeof op.insert === 'string') { var text = op.insert.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); return delta.insert(text, op.attributes); } return delta.push(op); }, new _quillDelta2.default()); } exports.default = Editor; /***/ }, /* 15 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.Range = undefined; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [];var _n = true;var _d = false;var _e = undefined;try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value);if (i && _arr.length === i) break; } } catch (err) { _d = true;_e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } }return _arr; }return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _parchment = __webpack_require__(0); var _parchment2 = _interopRequireDefault(_parchment); var _clone = __webpack_require__(21); var _clone2 = _interopRequireDefault(_clone); var _deepEqual = __webpack_require__(11); var _deepEqual2 = _interopRequireDefault(_deepEqual); var _emitter3 = __webpack_require__(8); var _emitter4 = _interopRequireDefault(_emitter3); var _logger = __webpack_require__(10); var _logger2 = _interopRequireDefault(_logger); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; }return arr2; } else { return Array.from(arr); } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var debug = (0, _logger2.default)('quill:selection'); var Range = function Range(index) { var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; _classCallCheck(this, Range); this.index = index; this.length = length; }; var Selection = function () { function Selection(scroll, emitter) { var _this = this; _classCallCheck(this, Selection); this.emitter = emitter; this.scroll = scroll; this.composing = false; this.mouseDown = false; this.root = this.scroll.domNode; this.cursor = _parchment2.default.create('cursor', this); // savedRange is last non-null range this.lastRange = this.savedRange = new Range(0, 0); this.handleComposition(); this.handleDragging(); this.emitter.listenDOM('selectionchange', document, function () { if (!_this.mouseDown) { setTimeout(_this.update.bind(_this, _emitter4.default.sources.USER), 1); } }); this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type, delta) { if (type === _emitter4.default.events.TEXT_CHANGE && delta.length() > 0) { _this.update(_emitter4.default.sources.SILENT); } }); this.emitter.on(_emitter4.default.events.SCROLL_BEFORE_UPDATE, function () { if (!_this.hasFocus()) return; var native = _this.getNativeRange(); if (native == null) return; if (native.start.node === _this.cursor.textNode) return; // cursor.restore() will handle // TODO unclear if this has negative side effects _this.emitter.once(_emitter4.default.events.SCROLL_UPDATE, function () { try { _this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset); } catch (ignored) {} }); }); this.emitter.on(_emitter4.default.events.SCROLL_OPTIMIZE, function (mutations, context) { if (context.range) { var _context$range = context.range, startNode = _context$range.startNode, startOffset = _context$range.startOffset, endNode = _context$range.endNode, endOffset = _context$range.endOffset; _this.setNativeRange(startNode, startOffset, endNode, endOffset); } }); this.update(_emitter4.default.sources.SILENT); } _createClass(Selection, [{ key: 'handleComposition', value: function handleComposition() { var _this2 = this; this.root.addEventListener('compositionstart', function () { _this2.composing = true; }); this.root.addEventListener('compositionend', function () { _this2.composing = false; if (_this2.cursor.parent) { var range = _this2.cursor.restore(); if (!range) return; setTimeout(function () { _this2.setNativeRange(range.startNode, range.startOffset, range.endNode, range.endOffset); }, 1); } }); } }, { key: 'handleDragging', value: function handleDragging() { var _this3 = this; this.emitter.listenDOM('mousedown', document.body, function () { _this3.mouseDown = true; }); this.emitter.listenDOM('mouseup', document.body, function () { _this3.mouseDown = false; _this3.update(_emitter4.default.sources.USER); }); } }, { key: 'focus', value: function focus() { if (this.hasFocus()) return; this.root.focus(); this.setRange(this.savedRange); } }, { key: 'format', value: function format(_format, value) { if (this.scroll.whitelist != null && !this.scroll.whitelist[_format]) return; this.scroll.update(); var nativeRange = this.getNativeRange(); if (nativeRange == null || !nativeRange.native.collapsed || _parchment2.default.query(_format, _parchment2.default.Scope.BLOCK)) return; if (nativeRange.start.node !== this.cursor.textNode) { var blot = _parchment2.default.find(nativeRange.start.node, false); if (blot == null) return; // TODO Give blot ability to not split if (blot instanceof _parchment2.default.Leaf) { var after = blot.split(nativeRange.start.offset); blot.parent.insertBefore(this.cursor, after); } else { blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen } this.cursor.attach(); } this.cursor.format(_format, value); this.scroll.optimize(); this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length); this.update(); } }, { key: 'getBounds', value: function getBounds(index) { var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; var scrollLength = this.scroll.length(); index = Math.min(index, scrollLength - 1); length = Math.min(index + length, scrollLength - 1) - index; var node = void 0, _scroll$leaf = this.scroll.leaf(index), _scroll$leaf2 = _slicedToArray(_scroll$leaf, 2), leaf = _scroll$leaf2[0], offset = _scroll$leaf2[1]; if (leaf == null) return null; var _leaf$position = leaf.position(offset, true); var _leaf$position2 = _slicedToArray(_leaf$position, 2); node = _leaf$position2[0]; offset = _leaf$position2[1]; var range = document.createRange(); if (length > 0) { range.setStart(node, offset); var _scroll$leaf3 = this.scroll.leaf(index + length); var _scroll$leaf4 = _slicedToArray(_scroll$leaf3, 2); leaf = _scroll$leaf4[0]; offset = _scroll$leaf4[1]; if (leaf == null) return null; var _leaf$position3 = leaf.position(offset, true); var _leaf$position4 = _slicedToArray(_leaf$position3, 2); node = _leaf$position4[0]; offset = _leaf$position4[1]; range.setEnd(node, offset); return range.getBoundingClientRect(); } else { var side = 'left'; var rect = void 0; if (node instanceof Text) { if (offset < node.data.length) { range.setStart(node, offset); range.setEnd(node, offset + 1); } else { range.setStart(node, offset - 1); range.setEnd(node, offset); side = 'right'; } rect = range.getBoundingClientRect(); } else { rect = leaf.domNode.getBoundingClientRect(); if (offset > 0) side = 'right'; } return { bottom: rect.top + rect.height, height: rect.height, left: rect[side], right: rect[side], top: rect.top, width: 0 }; } } }, { key: 'getNativeRange', value: function getNativeRange() { var selection = document.getSelection(); if (selection == null || selection.rangeCount <= 0) return null; var nativeRange = selection.getRangeAt(0); if (nativeRange == null) return null; var range = this.normalizeNative(nativeRange); debug.info('getNativeRange', range); return range; } }, { key: 'getRange', value: function getRange() { var normalized = this.getNativeRange(); if (normalized == null) return [null, null]; var range = this.normalizedToRange(normalized); return [range, normalized]; } }, { key: 'hasFocus', value: function hasFocus() { return document.activeElement === this.root; } }, { key: 'normalizedToRange', value: function normalizedToRange(range) { var _this4 = this; var positions = [[range.start.node, range.start.offset]]; if (!range.native.collapsed) { positions.push([range.end.node, range.end.offset]); } var indexes = positions.map(function (position) { var _position = _slicedToArray(position, 2), node = _position[0], offset = _position[1]; var blot = _parchment2.default.find(node, true); var index = blot.offset(_this4.scroll); if (offset === 0) { return index; } else if (blot instanceof _parchment2.default.Container) { return index + blot.length(); } else { return index + blot.index(node, offset); } }); var end = Math.min(Math.max.apply(Math, _toConsumableArray(indexes)), this.scroll.length() - 1); var start = Math.min.apply(Math, [end].concat(_toConsumableArray(indexes))); return new Range(start, end - start); } }, { key: 'normalizeNative', value: function normalizeNative(nativeRange) { if (!contains(this.root, nativeRange.startContainer) || !nativeRange.collapsed && !contains(this.root, nativeRange.endContainer)) { return null; } var range = { start: { node: nativeRange.startContainer, offset: nativeRange.startOffset }, end: { node: nativeRange.endContainer, offset: nativeRange.endOffset }, native: nativeRange }; [range.start, range.end].forEach(function (position) { var node = position.node, offset = position.offset; while (!(node instanceof Text) && node.childNodes.length > 0) { if (node.childNodes.length > offset) { node = node.childNodes[offset]; offset = 0; } else if (node.childNodes.length === offset) { node = node.lastChild; offset = node instanceof Text ? node.data.length : node.childNodes.length + 1; } else { break; } } position.node = node, position.offset = offset; }); return range; } }, { key: 'rangeToNative', value: function rangeToNative(range) { var _this5 = this; var indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length]; var args = []; var scrollLength = this.scroll.length(); indexes.forEach(function (index, i) { index = Math.min(scrollLength - 1, index); var node = void 0, _scroll$leaf5 = _this5.scroll.leaf(index), _scroll$leaf6 = _slicedToArray(_scroll$leaf5, 2), leaf = _scroll$leaf6[0], offset = _scroll$leaf6[1]; var _leaf$position5 = leaf.position(offset, i !== 0); var _leaf$position6 = _slicedToArray(_leaf$position5, 2); node = _leaf$position6[0]; offset = _leaf$position6[1]; args.push(node, offset); }); if (args.length < 2) { args = args.concat(args); } return args; } }, { key: 'scrollIntoView', value: function scrollIntoView(scrollingContainer) { var range = this.lastRange; if (range == null) return; var bounds = this.getBounds(range.index, range.length); if (bounds == null) return; var limit = this.scroll.length() - 1; var _scroll$line = this.scroll.line(Math.min(range.index, limit)), _scroll$line2 = _slicedToArray(_scroll$line, 1), first = _scroll$line2[0]; var last = first; if (range.length > 0) { var _scroll$line3 = this.scroll.line(Math.min(range.index + range.length, limit)); var _scroll$line4 = _slicedToArray(_scroll$line3, 1); last = _scroll$line4[0]; } if (first == null || last == null) return; var scrollBounds = scrollingContainer.getBoundingClientRect(); if (bounds.top < scrollBounds.top) { scrollingContainer.scrollTop -= scrollBounds.top - bounds.top; } else if (bounds.bottom > scrollBounds.bottom) { scrollingContainer.scrollTop += bounds.bottom - scrollBounds.bottom; } } }, { key: 'setNativeRange', value: function setNativeRange(startNode, startOffset) { var endNode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : startNode; var endOffset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : startOffset; var force = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; debug.info('setNativeRange', startNode, startOffset, endNode, endOffset); if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) { return; } var selection = document.getSelection(); if (selection == null) return; if (startNode != null) { if (!this.hasFocus()) this.root.focus(); var native = (this.getNativeRange() || {}).native; if (native == null || force || startNode !== native.startContainer || startOffset !== native.startOffset || endNode !== native.endContainer || endOffset !== native.endOffset) { if (startNode.tagName == "BR") { startOffset = [].indexOf.call(startNode.parentNode.childNodes, startNode); startNode = startNode.parentNode; } if (endNode.tagName == "BR") { endOffset = [].indexOf.call(endNode.parentNode.childNodes, endNode); endNode = endNode.parentNode; } var range = document.createRange(); range.setStart(startNode, startOffset); range.setEnd(endNode, endOffset); selection.removeAllRanges(); selection.addRange(range); } } else { selection.removeAllRanges(); this.root.blur(); document.body.focus(); // root.blur() not enough on IE11+Travis+SauceLabs (but not local VMs) } } }, { key: 'setRange', value: function setRange(range) { var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API; if (typeof force === 'string') { source = force; force = false; } debug.info('setRange', range); if (range != null) { var args = this.rangeToNative(range); this.setNativeRange.apply(this, _toConsumableArray(args).concat([force])); } else { this.setNativeRange(null); } this.update(source); } }, { key: 'update', value: function update() { var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER; var oldRange = this.lastRange; var _getRange = this.getRange(), _getRange2 = _slicedToArray(_getRange, 2), lastRange = _getRange2[0], nativeRange = _getRange2[1]; this.lastRange = lastRange; if (this.lastRange != null) { this.savedRange = this.lastRange; } if (!(0, _deepEqual2.default)(oldRange, this.lastRange)) { var _emitter; if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) { this.cursor.restore(); } var args = [_emitter4.default.events.SELECTION_CHANGE, (0, _clone2.default)(this.lastRange), (0, _clone2.default)(oldRange), source]; (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args)); if (source !== _emitter4.default.sources.SILENT) { var _emitter2; (_emitter2 = this.emitter).emit.apply(_emitter2, args); } } } }]); return Selection; }(); function contains(parent, descendant) { try { // Firefox inserts inaccessible nodes around video elements descendant.parentNode; } catch (e) { return false; } // IE11 has bug with Text nodes // https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect if (descendant instanceof Text) { descendant = descendant.parentNode; } return parent.contains(descendant); } exports.Range = Range; exports.default = Selection; /***/ }, /* 16 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) { var parent = Object.getPrototypeOf(object);if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get;if (getter === undefined) { return undefined; }return getter.call(receiver); } }; var _parchment = __webpack_require__(0); var _parchment2 = _interopRequireDefault(_parchment); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Break = function (_Parchment$Embed) { _inherits(Break, _Parchment$Embed); function Break() { _classCallCheck(this, Break); return _possibleConstructorReturn(this, (Break.__proto__ || Object.getPrototypeOf(Break)).apply(this, arguments)); } _createClass(Break, [{ key: 'insertInto', value: function insertInto(parent, ref) { if (parent.children.length === 0) { _get(Break.prototype.__proto__ || Object.getPrototypeOf(Break.prototype), 'insertInto', this).call(this, parent, ref); } else { this.remove(); } } }, { key: 'length', value: function length() { return 0; } }, { key: 'value', value: function value() { return ''; } }], [{ key: 'value', value: function value() { return undefined; } }]); return Break; }(_parchment2.default.Embed); Break.blotName = 'break'; Break.tagName = 'BR'; exports.default = Break; /***/ }, /* 17 */ /***/function (module, exports, __webpack_require__) { "use strict"; var __extends = this && this.__extends || function () { var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) d[p] = b[p]; } }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); Object.defineProperty(exports, "__esModule", { value: true }); var linked_list_1 = __webpack_require__(44); var shadow_1 = __webpack_require__(30); var Registry = __webpack_require__(1); var ContainerBlot = /** @class */function (_super) { __extends(ContainerBlot, _super); function ContainerBlot(domNode) { var _this = _super.call(this, domNode) || this; _this.build(); return _this; } ContainerBlot.prototype.appendChild = function (other) { this.insertBefore(other); }; ContainerBlot.prototype.attach = function () { _super.prototype.attach.call(this); this.children.forEach(function (child) { child.attach(); }); }; ContainerBlot.prototype.build = function () { var _this = this; this.children = new linked_list_1.default(); // Need to be reversed for if DOM nodes already in order [].slice.call(this.domNode.childNodes).reverse().forEach(function (node) { try { var child = makeBlot(node); _this.insertBefore(child, _this.children.head || undefined); } catch (err) { if (err instanceof Registry.ParchmentError) return;else throw err; } }); }; ContainerBlot.prototype.deleteAt = function (index, length) { if (index === 0 && length === this.length()) { return this.remove(); } this.children.forEachAt(index, length, function (child, offset, length) { child.deleteAt(offset, length); }); }; ContainerBlot.prototype.descendant = function (criteria, index) { var _a = this.children.find(index), child = _a[0], offset = _a[1]; if (criteria.blotName == null && criteria(child) || criteria.blotName != null && child instanceof criteria) { return [child, offset]; } else if (child instanceof ContainerBlot) { return child.descendant(criteria, offset); } else { return [null, -1]; } }; ContainerBlot.prototype.descendants = function (criteria, index, length) { if (index === void 0) { index = 0; } if (length === void 0) { length = Number.MAX_VALUE; } var descendants = []; var lengthLeft = length; this.children.forEachAt(index, length, function (child, index, length) { if (criteria.blotName == null && criteria(child) || criteria.blotName != null && child instanceof criteria) { descendants.push(child); } if (child instanceof ContainerBlot) { descendants = descendants.concat(child.descendants(criteria, index, lengthLeft)); } lengthLeft -= length; }); return descendants; }; ContainerBlot.prototype.detach = function () { this.children.forEach(function (child) { child.detach(); }); _super.prototype.detach.call(this); }; ContainerBlot.prototype.formatAt = function (index, length, name, value) { this.children.forEachAt(index, length, function (child, offset, length) { child.formatAt(offset, length, name, value); }); }; ContainerBlot.prototype.insertAt = function (index, value, def) { var _a = this.children.find(index), child = _a[0], offset = _a[1]; if (child) { child.insertAt(offset, value, def); } else { var blot = def == null ? Registry.create('text', value) : Registry.create(value, def); this.appendChild(blot); } }; ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) { if (this.statics.allowedChildren != null && !this.statics.allowedChildren.some(function (child) { return childBlot instanceof child; })) { throw new Registry.ParchmentError("Cannot insert " + childBlot.statics.blotName + " into " + this.statics.blotName); } childBlot.insertInto(this, refBlot); }; ContainerBlot.prototype.length = function () { return this.children.reduce(function (memo, child) { return memo + child.length(); }, 0); }; ContainerBlot.prototype.moveChildren = function (targetParent, refNode) { this.children.forEach(function (child) { targetParent.insertBefore(child, refNode); }); }; ContainerBlot.prototype.optimize = function (context) { _super.prototype.optimize.call(this, context); if (this.children.length === 0) { if (this.statics.defaultChild != null) { var child = Registry.create(this.statics.defaultChild); this.appendChild(child); child.optimize(context); } else { this.remove(); } } }; ContainerBlot.prototype.path = function (index, inclusive) { if (inclusive === void 0) { inclusive = false; } var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1]; var position = [[this, index]]; if (child instanceof ContainerBlot) { return position.concat(child.path(offset, inclusive)); } else if (child != null) { position.push([child, offset]); } return position; }; ContainerBlot.prototype.removeChild = function (child) { this.children.remove(child); }; ContainerBlot.prototype.replace = function (target) { if (target instanceof ContainerBlot) { target.moveChildren(this); } _super.prototype.replace.call(this, target); }; ContainerBlot.prototype.split = function (index, force) { if (force === void 0) { force = false; } if (!force) { if (index === 0) return this; if (index === this.length()) return this.next; } var after = this.clone(); this.parent.insertBefore(after, this.next); this.children.forEachAt(index, this.length(), function (child, offset, length) { child = child.split(offset, force); after.appendChild(child); }); return after; }; ContainerBlot.prototype.unwrap = function () { this.moveChildren(this.parent, this.next); this.remove(); }; ContainerBlot.prototype.update = function (mutations, context) { var _this = this; var addedNodes = []; var removedNodes = []; mutations.forEach(function (mutation) { if (mutation.target === _this.domNode && mutation.type === 'childList') { addedNodes.push.apply(addedNodes, mutation.addedNodes); removedNodes.push.apply(removedNodes, mutation.removedNodes); } }); removedNodes.forEach(function (node) { // Check node has actually been removed // One exception is Chrome does not immediately remove IFRAMEs // from DOM but MutationRecord is correct in its reported removal if (node.parentNode != null && // @ts-ignore node.tagName !== 'IFRAME' && document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) { return; } var blot = Registry.find(node); if (blot == null) return; if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) { blot.detach(); } }); addedNodes.filter(function (node) { return node.parentNode == _this.domNode; }).sort(function (a, b) { if (a === b) return 0; if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) { return 1; } return -1; }).forEach(function (node) { var refBlot = null; if (node.nextSibling != null) { refBlot = Registry.find(node.nextSibling); } var blot = makeBlot(node); if (blot.next != refBlot || blot.next == null) { if (blot.parent != null) { blot.parent.removeChild(_this); } _this.insertBefore(blot, refBlot || undefined); } }); }; return ContainerBlot; }(shadow_1.default); function makeBlot(node) { var blot = Registry.find(node); if (blot == null) { try { blot = Registry.create(node); } catch (e) { blot = Registry.create(Registry.Scope.INLINE); [].slice.call(node.childNodes).forEach(function (child) { // @ts-ignore blot.domNode.appendChild(child); }); if (node.parentNode) { node.parentNode.replaceChild(blot.domNode, node); } blot.attach(); } } return blot; } exports.default = ContainerBlot; /***/ }, /* 18 */ /***/function (module, exports, __webpack_require__) { "use strict"; var __extends = this && this.__extends || function () { var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) d[p] = b[p]; } }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); Object.defineProperty(exports, "__esModule", { value: true }); var attributor_1 = __webpack_require__(12); var store_1 = __webpack_require__(31); var container_1 = __webpack_require__(17); var Registry = __webpack_require__(1); var FormatBlot = /** @class */function (_super) { __extends(FormatBlot, _super); function FormatBlot(domNode) { var _this = _super.call(this, domNode) || this; _this.attributes = new store_1.default(_this.domNode); return _this; } FormatBlot.formats = function (domNode) { if (typeof this.tagName === 'string') { return true; } else if (Array.isArray(this.tagName)) { return domNode.tagName.toLowerCase(); } return undefined; }; FormatBlot.prototype.format = function (name, value) { var format = Registry.query(name); if (format instanceof attributor_1.default) { this.attributes.attribute(format, value); } else if (value) { if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) { this.replaceWith(name, value); } } }; FormatBlot.prototype.formats = function () { var formats = this.attributes.values(); var format = this.statics.formats(this.domNode); if (format != null) { formats[this.statics.blotName] = format; } return formats; }; FormatBlot.prototype.replaceWith = function (name, value) { var replacement = _super.prototype.replaceWith.call(this, name, value); this.attributes.copy(replacement); return replacement; }; FormatBlot.prototype.update = function (mutations, context) { var _this = this; _super.prototype.update.call(this, mutations, context); if (mutations.some(function (mutation) { return mutation.target === _this.domNode && mutation.type === 'attributes'; })) { this.attributes.build(); } }; FormatBlot.prototype.wrap = function (name, value) { var wrapper = _super.prototype.wrap.call(this, name, value); if (wrapper instanceof FormatBlot && wrapper.statics.scope === this.statics.scope) { this.attributes.move(wrapper); } return wrapper; }; return FormatBlot; }(container_1.default); exports.default = FormatBlot; /***/ }, /* 19 */ /***/function (module, exports, __webpack_require__) { "use strict"; var __extends = this && this.__extends || function () { var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) d[p] = b[p]; } }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); Object.defineProperty(exports, "__esModule", { value: true }); var shadow_1 = __webpack_require__(30); var Registry = __webpack_require__(1); var LeafBlot = /** @class */function (_super) { __extends(LeafBlot, _super); function LeafBlot() { return _super !== null && _super.apply(this, arguments) || this; } LeafBlot.value = function (domNode) { return true; }; LeafBlot.prototype.index = function (node, offset) { if (this.domNode === node || this.domNode.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) { return Math.min(offset, 1); } return -1; }; LeafBlot.prototype.position = function (index, inclusive) { var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode); if (index > 0) offset += 1; return [this.parent.domNode, offset]; }; LeafBlot.prototype.value = function () { var _a; return _a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a; }; LeafBlot.scope = Registry.Scope.INLINE_BLOT; return LeafBlot; }(shadow_1.default); exports.default = LeafBlot; /***/ }, /* 20 */ /***/function (module, exports, __webpack_require__) { var equal = __webpack_require__(11); var extend = __webpack_require__(3); var lib = { attributes: { compose: function compose(a, b, keepNull) { if ((typeof a === 'undefined' ? 'undefined' : _typeof2(a)) !== 'object') a = {}; if ((typeof b === 'undefined' ? 'undefined' : _typeof2(b)) !== 'object') b = {}; var attributes = extend(true, {}, b); if (!keepNull) { attributes = Object.keys(attributes).reduce(function (copy, key) { if (attributes[key] != null) { copy[key] = attributes[key]; } return copy; }, {}); } for (var key in a) { if (a[key] !== undefined && b[key] === undefined) { attributes[key] = a[key]; } } return Object.keys(attributes).length > 0 ? attributes : undefined; }, diff: function diff(a, b) { if ((typeof a === 'undefined' ? 'undefined' : _typeof2(a)) !== 'object') a = {}; if ((typeof b === 'undefined' ? 'undefined' : _typeof2(b)) !== 'object') b = {}; var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function (attributes, key) { if (!equal(a[key], b[key])) { attributes[key] = b[key] === undefined ? null : b[key]; } return attributes; }, {}); return Object.keys(attributes).length > 0 ? attributes : undefined; }, transform: function transform(a, b, priority) { if ((typeof a === 'undefined' ? 'undefined' : _typeof2(a)) !== 'object') return b; if ((typeof b === 'undefined' ? 'undefined' : _typeof2(b)) !== 'object') return undefined; if (!priority) return b; // b simply overwrites us without priority var attributes = Object.keys(b).reduce(function (attributes, key) { if (a[key] === undefined) attributes[key] = b[key]; // null is a valid value return attributes; }, {}); return Object.keys(attributes).length > 0 ? attributes : undefined; } }, iterator: function iterator(ops) { return new Iterator(ops); }, length: function length(op) { if (typeof op['delete'] === 'number') { return op['delete']; } else if (typeof op.retain === 'number') { return op.retain; } else { return typeof op.insert === 'string' ? op.insert.length : 1; } } }; function Iterator(ops) { this.ops = ops; this.index = 0; this.offset = 0; }; Iterator.prototype.hasNext = function () { return this.peekLength() < Infinity; }; Iterator.prototype.next = function (length) { if (!length) length = Infinity; var nextOp = this.ops[this.index]; if (nextOp) { var offset = this.offset; var opLength = lib.length(nextOp); if (length >= opLength - offset) { length = opLength - offset; this.index += 1; this.offset = 0; } else { this.offset += length; } if (typeof nextOp['delete'] === 'number') { return { 'delete': length }; } else { var retOp = {}; if (nextOp.attributes) { retOp.attributes = nextOp.attributes; } if (typeof nextOp.retain === 'number') { retOp.retain = length; } else if (typeof nextOp.insert === 'string') { retOp.insert = nextOp.insert.substr(offset, length); } else { // offset should === 0, length should === 1 retOp.insert = nextOp.insert; } return retOp; } } else { return { retain: Infinity }; } }; Iterator.prototype.peek = function () { return this.ops[this.index]; }; Iterator.prototype.peekLength = function () { if (this.ops[this.index]) { // Should never return 0 if our index is being managed correctly return lib.length(this.ops[this.index]) - this.offset; } else { return Infinity; } }; Iterator.prototype.peekType = function () { if (this.ops[this.index]) { if (typeof this.ops[this.index]['delete'] === 'number') { return 'delete'; } else if (typeof this.ops[this.index].retain === 'number') { return 'retain'; } else { return 'insert'; } } return 'retain'; }; Iterator.prototype.rest = function () { if (!this.hasNext()) { return []; } else if (this.offset === 0) { return this.ops.slice(this.index); } else { var offset = this.offset; var index = this.index; var next = this.next(); var rest = this.ops.slice(this.index); this.offset = offset; this.index = index; return [next].concat(rest); } }; module.exports = lib; /***/ }, /* 21 */ /***/function (module, exports) { var clone = function () { 'use strict'; function _instanceof(obj, type) { return type != null && obj instanceof type; } var nativeMap; try { nativeMap = Map; } catch (_) { // maybe a reference error because no `Map`. Give it a dummy value that no // value will ever be an instanceof. nativeMap = function nativeMap() {}; } var nativeSet; try { nativeSet = Set; } catch (_) { nativeSet = function nativeSet() {}; } var nativePromise; try { nativePromise = Promise; } catch (_) { nativePromise = function nativePromise() {}; } /** * Clones (copies) an Object using deep copying. * * This function supports circular references by default, but if you are certain * there are no circular references in your object, you can save some CPU time * by calling clone(obj, false). * * Caution: if `circular` is false and `parent` contains circular references, * your program may enter an infinite loop and crash. * * @param `parent` - the object to be cloned * @param `circular` - set to true if the object to be cloned may contain * circular references. (optional - true by default) * @param `depth` - set to a number if the object is only to be cloned to * a particular depth. (optional - defaults to Infinity) * @param `prototype` - sets the prototype to be used when cloning an object. * (optional - defaults to parent prototype). * @param `includeNonEnumerable` - set to true if the non-enumerable properties * should be cloned as well. Non-enumerable properties on the prototype * chain will be ignored. (optional - false by default) */ function clone(parent, circular, depth, prototype, includeNonEnumerable) { if ((typeof circular === 'undefined' ? 'undefined' : _typeof2(circular)) === 'object') { depth = circular.depth; prototype = circular.prototype; includeNonEnumerable = circular.includeNonEnumerable; circular = circular.circular; } // maintain two arrays for circular references, where corresponding parents // and children have the same index var allParents = []; var allChildren = []; var useBuffer = typeof Buffer != 'undefined'; if (typeof circular == 'undefined') circular = true; if (typeof depth == 'undefined') depth = Infinity; // recurse this function so we don't reset allParents and allChildren function _clone(parent, depth) { // cloning null always returns null if (parent === null) return null; if (depth === 0) return parent; var child; var proto; if ((typeof parent === 'undefined' ? 'undefined' : _typeof2(parent)) != 'object') { return parent; } if (_instanceof(parent, nativeMap)) { child = new nativeMap(); } else if (_instanceof(parent, nativeSet)) { child = new nativeSet(); } else if (_instanceof(parent, nativePromise)) { child = new nativePromise(function (resolve, reject) { parent.then(function (value) { resolve(_clone(value, depth - 1)); }, function (err) { reject(_clone(err, depth - 1)); }); }); } else if (clone.__isArray(parent)) { child = []; } else if (clone.__isRegExp(parent)) { child = new RegExp(parent.source, __getRegExpFlags(parent)); if (parent.lastIndex) child.lastIndex = parent.lastIndex; } else if (clone.__isDate(parent)) { child = new Date(parent.getTime()); } else if (useBuffer && Buffer.isBuffer(parent)) { if (Buffer.allocUnsafe) { // Node.js >= 4.5.0 child = Buffer.allocUnsafe(parent.length); } else { // Older Node.js versions child = new Buffer(parent.length); } parent.copy(child); return child; } else if (_instanceof(parent, Error)) { child = Object.create(parent); } else { if (typeof prototype == 'undefined') { proto = Object.getPrototypeOf(parent); child = Object.create(proto); } else { child = Object.create(prototype); proto = prototype; } } if (circular) { var index = allParents.indexOf(parent); if (index != -1) { return allChildren[index]; } allParents.push(parent); allChildren.push(child); } if (_instanceof(parent, nativeMap)) { parent.forEach(function (value, key) { var keyChild = _clone(key, depth - 1); var valueChild = _clone(value, depth - 1); child.set(keyChild, valueChild); }); } if (_instanceof(parent, nativeSet)) { parent.forEach(function (value) { var entryChild = _clone(value, depth - 1); child.add(entryChild); }); } for (var i in parent) { var attrs; if (proto) { attrs = Object.getOwnPropertyDescriptor(proto, i); } if (attrs && attrs.set == null) { continue; } child[i] = _clone(parent[i], depth - 1); } if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(parent); for (var i = 0; i < symbols.length; i++) { // Don't need to worry about cloning a symbol because it is a primitive, // like a number or string. var symbol = symbols[i]; var descriptor = Object.getOwnPropertyDescriptor(parent, symbol); if (descriptor && !descriptor.enumerable && !includeNonEnumerable) { continue; } child[symbol] = _clone(parent[symbol], depth - 1); if (!descriptor.enumerable) { Object.defineProperty(child, symbol, { enumerable: false }); } } } if (includeNonEnumerable) { var allPropertyNames = Object.getOwnPropertyNames(parent); for (var i = 0; i < allPropertyNames.length; i++) { var propertyName = allPropertyNames[i]; var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName); if (descriptor && descriptor.enumerable) { continue; } child[propertyName] = _clone(parent[propertyName], depth - 1); Object.defineProperty(child, propertyName, { enumerable: false }); } } return child; } return _clone(parent, depth); } /** * Simple flat clone using prototype, accepts only objects, usefull for property * override on FLAT configuration object (no nested props). * * USE WITH CAUTION! This may not behave as you wish if you do not know how this * works. */ clone.clonePrototype = function clonePrototype(parent) { if (parent === null) return null; var c = function c() {}; c.prototype = parent; return new c(); }; // private utility functions function __objToStr(o) { return Object.prototype.toString.call(o); } clone.__objToStr = __objToStr; function __isDate(o) { return (typeof o === 'undefined' ? 'undefined' : _typeof2(o)) === 'object' && __objToStr(o) === '[object Date]'; } clone.__isDate = __isDate; function __isArray(o) { return (typeof o === 'undefined' ? 'undefined' : _typeof2(o)) === 'object' && __objToStr(o) === '[object Array]'; } clone.__isArray = __isArray; function __isRegExp(o) { return (typeof o === 'undefined' ? 'undefined' : _typeof2(o)) === 'object' && __objToStr(o) === '[object RegExp]'; } clone.__isRegExp = __isRegExp; function __getRegExpFlags(re) { var flags = ''; if (re.global) flags += 'g'; if (re.ignoreCase) flags += 'i'; if (re.multiline) flags += 'm'; return flags; } clone.__getRegExpFlags = __getRegExpFlags; return clone; }(); if ((typeof module === 'undefined' ? 'undefined' : _typeof2(module)) === 'object' && module.exports) { module.exports = clone; } /***/ }, /* 22 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [];var _n = true;var _d = false;var _e = undefined;try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value);if (i && _arr.length === i) break; } } catch (err) { _d = true;_e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } }return _arr; }return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) { var parent = Object.getPrototypeOf(object);if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get;if (getter === undefined) { return undefined; }return getter.call(receiver); } }; var _parchment = __webpack_require__(0); var _parchment2 = _interopRequireDefault(_parchment); var _emitter = __webpack_require__(8); var _emitter2 = _interopRequireDefault(_emitter); var _block = __webpack_require__(4); var _block2 = _interopRequireDefault(_block); var _break = __webpack_require__(16); var _break2 = _interopRequireDefault(_break); var _code = __webpack_require__(13); var _code2 = _interopRequireDefault(_code); var _container = __webpack_require__(25); var _container2 = _interopRequireDefault(_container); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function isLine(blot) { return blot instanceof _block2.default || blot instanceof _block.BlockEmbed; } var Scroll = function (_Parchment$Scroll) { _inherits(Scroll, _Parchment$Scroll); function Scroll(domNode, config) { _classCallCheck(this, Scroll); var _this = _possibleConstructorReturn(this, (Scroll.__proto__ || Object.getPrototypeOf(Scroll)).call(this, domNode)); _this.emitter = config.emitter; if (Array.isArray(config.whitelist)) { _this.whitelist = config.whitelist.reduce(function (whitelist, format) { whitelist[format] = true; return whitelist; }, {}); } // Some reason fixes composition issues with character languages in Windows/Chrome, Safari _this.domNode.addEventListener('DOMNodeInserted', function () {}); _this.optimize(); _this.enable(); return _this; } _createClass(Scroll, [{ key: 'batchStart', value: function batchStart() { this.batch = true; } }, { key: 'batchEnd', value: function batchEnd() { this.batch = false; this.optimize(); } }, { key: 'deleteAt', value: function deleteAt(index, length) { var _line = this.line(index), _line2 = _slicedToArray(_line, 2), first = _line2[0], offset = _line2[1]; var _line3 = this.line(index + length), _line4 = _slicedToArray(_line3, 1), last = _line4[0]; _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'deleteAt', this).call(this, index, length); if (last != null && first !== last && offset > 0) { if (first instanceof _block.BlockEmbed || last instanceof _block.BlockEmbed) { this.optimize(); return; } if (first instanceof _code2.default) { var newlineIndex = first.newlineIndex(first.length(), true); if (newlineIndex > -1) { first = first.split(newlineIndex + 1); if (first === last) { this.optimize(); return; } } } else if (last instanceof _code2.default) { var _newlineIndex = last.newlineIndex(0); if (_newlineIndex > -1) { last.split(_newlineIndex + 1); } } var ref = last.children.head instanceof _break2.default ? null : last.children.head; first.moveChildren(last, ref); first.remove(); } this.optimize(); } }, { key: 'enable', value: function enable() { var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; this.domNode.setAttribute('contenteditable', enabled); } }, { key: 'formatAt', value: function formatAt(index, length, format, value) { if (this.whitelist != null && !this.whitelist[format]) return; _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'formatAt', this).call(this, index, length, format, value); this.optimize(); } }, { key: 'insertAt', value: function insertAt(index, value, def) { if (def != null && this.whitelist != null && !this.whitelist[value]) return; if (index >= this.length()) { if (def == null || _parchment2.default.query(value, _parchment2.default.Scope.BLOCK) == null) { var blot = _parchment2.default.create(this.statics.defaultChild); this.appendChild(blot); if (def == null && value.endsWith('\n')) { value = value.slice(0, -1); } blot.insertAt(0, value, def); } else { var embed = _parchment2.default.create(value, def); this.appendChild(embed); } } else { _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertAt', this).call(this, index, value, def); } this.optimize(); } }, { key: 'insertBefore', value: function insertBefore(blot, ref) { if (blot.statics.scope === _parchment2.default.Scope.INLINE_BLOT) { var wrapper = _parchment2.default.create(this.statics.defaultChild); wrapper.appendChild(blot); blot = wrapper; } _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertBefore', this).call(this, blot, ref); } }, { key: 'leaf', value: function leaf(index) { return this.path(index).pop() || [null, -1]; } }, { key: 'line', value: function line(index) { if (index === this.length()) { return this.line(index - 1); } return this.descendant(isLine, index); } }, { key: 'lines', value: function lines() { var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE; var getLines = function getLines(blot, index, length) { var lines = [], lengthLeft = length; blot.children.forEachAt(index, length, function (child, index, length) { if (isLine(child)) { lines.push(child); } else if (child instanceof _parchment2.default.Container) { lines = lines.concat(getLines(child, index, lengthLeft)); } lengthLeft -= length; }); return lines; }; return getLines(this, index, length); } }, { key: 'optimize', value: function optimize() { var mutations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; if (this.batch === true) return; _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'optimize', this).call(this, mutations, context); if (mutations.length > 0) { this.emitter.emit(_emitter2.default.events.SCROLL_OPTIMIZE, mutations, context); } } }, { key: 'path', value: function path(index) { return _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'path', this).call(this, index).slice(1); // Exclude self } }, { key: 'update', value: function update(mutations) { if (this.batch === true) return; var source = _emitter2.default.sources.USER; if (typeof mutations === 'string') { source = mutations; } if (!Array.isArray(mutations)) { mutations = this.observer.takeRecords(); } if (mutations.length > 0) { this.emitter.emit(_emitter2.default.events.SCROLL_BEFORE_UPDATE, source, mutations); } _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'update', this).call(this, mutations.concat([])); // pass copy if (mutations.length > 0) { this.emitter.emit(_emitter2.default.events.SCROLL_UPDATE, source, mutations); } } }]); return Scroll; }(_parchment2.default.Scroll); Scroll.blotName = 'scroll'; Scroll.className = 'ql-editor'; Scroll.tagName = 'DIV'; Scroll.defaultChild = 'block'; Scroll.allowedChildren = [_block2.default, _block.BlockEmbed, _container2.default]; exports.default = Scroll; /***/ }, /* 23 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SHORTKEY = exports.default = undefined; var _typeof = typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol" ? function (obj) { return typeof obj === 'undefined' ? 'undefined' : _typeof2(obj); } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === 'undefined' ? 'undefined' : _typeof2(obj); }; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [];var _n = true;var _d = false;var _e = undefined;try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value);if (i && _arr.length === i) break; } } catch (err) { _d = true;_e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } }return _arr; }return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _clone = __webpack_require__(21); var _clone2 = _interopRequireDefault(_clone); var _deepEqual = __webpack_require__(11); var _deepEqual2 = _interopRequireDefault(_deepEqual); var _extend = __webpack_require__(3); var _extend2 = _interopRequireDefault(_extend); var _quillDelta = __webpack_require__(2); var _quillDelta2 = _interopRequireDefault(_quillDelta); var _op = __webpack_require__(20); var _op2 = _interopRequireDefault(_op); var _parchment = __webpack_require__(0); var _parchment2 = _interopRequireDefault(_parchment); var _quill = __webpack_require__(5); var _quill2 = _interopRequireDefault(_quill); var _logger = __webpack_require__(10); var _logger2 = _interopRequireDefault(_logger); var _module = __webpack_require__(9); var _module2 = _interopRequireDefault(_module); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; }return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var debug = (0, _logger2.default)('quill:keyboard'); var SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey'; var Keyboard = function (_Module) { _inherits(Keyboard, _Module); _createClass(Keyboard, null, [{ key: 'match', value: function match(evt, binding) { binding = normalize(binding); if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(function (key) { return !!binding[key] !== evt[key] && binding[key] !== null; })) { return false; } return binding.key === (evt.which || evt.keyCode); } }]); function Keyboard(quill, options) { _classCallCheck(this, Keyboard); var _this = _possibleConstructorReturn(this, (Keyboard.__proto__ || Object.getPrototypeOf(Keyboard)).call(this, quill, options)); _this.bindings = {}; Object.keys(_this.options.bindings).forEach(function (name) { if (name === 'list autofill' && quill.scroll.whitelist != null && !quill.scroll.whitelist['list']) { return; } if (_this.options.bindings[name]) { _this.addBinding(_this.options.bindings[name]); } }); _this.addBinding({ key: Keyboard.keys.ENTER, shiftKey: null }, handleEnter); _this.addBinding({ key: Keyboard.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function () {}); if (/Firefox/i.test(navigator.userAgent)) { // Need to handle delete and backspace for Firefox in the general case #1171 _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true }, handleBackspace); _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true }, handleDelete); } else { _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace); _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true, suffix: /^.?$/ }, handleDelete); } _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange); _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: false }, handleDeleteRange); _this.addBinding({ key: Keyboard.keys.BACKSPACE, altKey: null, ctrlKey: null, metaKey: null, shiftKey: null }, { collapsed: true, offset: 0 }, handleBackspace); _this.listen(); return _this; } _createClass(Keyboard, [{ key: 'addBinding', value: function addBinding(key) { var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var binding = normalize(key); if (binding == null || binding.key == null) { return debug.warn('Attempted to add invalid keyboard binding', binding); } if (typeof context === 'function') { context = { handler: context }; } if (typeof handler === 'function') { handler = { handler: handler }; } binding = (0, _extend2.default)(binding, context, handler); this.bindings[binding.key] = this.bindings[binding.key] || []; this.bindings[binding.key].push(binding); } }, { key: 'listen', value: function listen() { var _this2 = this; this.quill.root.addEventListener('keydown', function (evt) { if (evt.defaultPrevented) return; var which = evt.which || evt.keyCode; var bindings = (_this2.bindings[which] || []).filter(function (binding) { return Keyboard.match(evt, binding); }); if (bindings.length === 0) return; var range = _this2.quill.getSelection(); if (range == null || !_this2.quill.hasFocus()) return; var _quill$getLine = _this2.quill.getLine(range.index), _quill$getLine2 = _slicedToArray(_quill$getLine, 2), line = _quill$getLine2[0], offset = _quill$getLine2[1]; var _quill$getLeaf = _this2.quill.getLeaf(range.index), _quill$getLeaf2 = _slicedToArray(_quill$getLeaf, 2), leafStart = _quill$getLeaf2[0], offsetStart = _quill$getLeaf2[1]; var _ref = range.length === 0 ? [leafStart, offsetStart] : _this2.quill.getLeaf(range.index + range.length), _ref2 = _slicedToArray(_ref, 2), leafEnd = _ref2[0], offsetEnd = _ref2[1]; var prefixText = leafStart instanceof _parchment2.default.Text ? leafStart.value().slice(0, offsetStart) : ''; var suffixText = leafEnd instanceof _parchment2.default.Text ? leafEnd.value().slice(offsetEnd) : ''; var curContext = { collapsed: range.length === 0, empty: range.length === 0 && line.length() <= 1, format: _this2.quill.getFormat(range), offset: offset, prefix: prefixText, suffix: suffixText }; var prevented = bindings.some(function (binding) { if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false; if (binding.empty != null && binding.empty !== curContext.empty) return false; if (binding.offset != null && binding.offset !== curContext.offset) return false; if (Array.isArray(binding.format)) { // any format is present if (binding.format.every(function (name) { return curContext.format[name] == null; })) { return false; } } else if (_typeof(binding.format) === 'object') { // all formats must match if (!Object.keys(binding.format).every(function (name) { if (binding.format[name] === true) return curContext.format[name] != null; if (binding.format[name] === false) return curContext.format[name] == null; return (0, _deepEqual2.default)(binding.format[name], curContext.format[name]); })) { return false; } } if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false; if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false; return binding.handler.call(_this2, range, curContext) !== true; }); if (prevented) { evt.preventDefault(); } }); } }]); return Keyboard; }(_module2.default); Keyboard.keys = { BACKSPACE: 8, TAB: 9, ENTER: 13, ESCAPE: 27, LEFT: 37, UP: 38, RIGHT: 39, DOWN: 40, DELETE: 46 }; Keyboard.DEFAULTS = { bindings: { 'bold': makeFormatHandler('bold'), 'italic': makeFormatHandler('italic'), 'underline': makeFormatHandler('underline'), 'indent': { // highlight tab or tab at beginning of list, indent or blockquote key: Keyboard.keys.TAB, format: ['blockquote', 'indent', 'list'], handler: function handler(range, context) { if (context.collapsed && context.offset !== 0) return true; this.quill.format('indent', '+1', _quill2.default.sources.USER); } }, 'outdent': { key: Keyboard.keys.TAB, shiftKey: true, format: ['blockquote', 'indent', 'list'], // highlight tab or tab at beginning of list, indent or blockquote handler: function handler(range, context) { if (context.collapsed && context.offset !== 0) return true; this.quill.format('indent', '-1', _quill2.default.sources.USER); } }, 'outdent backspace': { key: Keyboard.keys.BACKSPACE, collapsed: true, shiftKey: null, metaKey: null, ctrlKey: null, altKey: null, format: ['indent', 'list'], offset: 0, handler: function handler(range, context) { if (context.format.indent != null) { this.quill.format('indent', '-1', _quill2.default.sources.USER); } else if (context.format.list != null) { this.quill.format('list', false, _quill2.default.sources.USER); } } }, 'indent code-block': makeCodeBlockHandler(true), 'outdent code-block': makeCodeBlockHandler(false), 'remove tab': { key: Keyboard.keys.TAB, shiftKey: true, collapsed: true, prefix: /\t$/, handler: function handler(range) { this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER); } }, 'tab': { key: Keyboard.keys.TAB, handler: function handler(range) { this.quill.history.cutoff(); var delta = new _quillDelta2.default().retain(range.index).delete(range.length).insert('\t'); this.quill.updateContents(delta, _quill2.default.sources.USER); this.quill.history.cutoff(); this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); } }, 'list empty enter': { key: Keyboard.keys.ENTER, collapsed: true, format: ['list'], empty: true, handler: function handler(range, context) { this.quill.format('list', false, _quill2.default.sources.USER); if (context.format.indent) { this.quill.format('indent', false, _quill2.default.sources.USER); } } }, 'checklist enter': { key: Keyboard.keys.ENTER, collapsed: true, format: { list: 'checked' }, handler: function handler(range) { var _quill$getLine3 = this.quill.getLine(range.index), _quill$getLine4 = _slicedToArray(_quill$getLine3, 2), line = _quill$getLine4[0], offset = _quill$getLine4[1]; var formats = (0, _extend2.default)({}, line.formats(), { list: 'checked' }); var delta = new _quillDelta2.default().retain(range.index).insert('\n', formats).retain(line.length() - offset - 1).retain(1, { list: 'unchecked' }); this.quill.updateContents(delta, _quill2.default.sources.USER); this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); this.quill.scrollIntoView(); } }, 'header enter': { key: Keyboard.keys.ENTER, collapsed: true, format: ['header'], suffix: /^$/, handler: function handler(range, context) { var _quill$getLine5 = this.quill.getLine(range.index), _quill$getLine6 = _slicedToArray(_quill$getLine5, 2), line = _quill$getLine6[0], offset = _quill$getLine6[1]; var delta = new _quillDelta2.default().retain(range.index).insert('\n', context.format).retain(line.length() - offset - 1).retain(1, { header: null }); this.quill.updateContents(delta, _quill2.default.sources.USER); this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); this.quill.scrollIntoView(); } }, 'list autofill': { key: ' ', collapsed: true, format: { list: false }, prefix: /^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/, handler: function handler(range, context) { var length = context.prefix.length; var _quill$getLine7 = this.quill.getLine(range.index), _quill$getLine8 = _slicedToArray(_quill$getLine7, 2), line = _quill$getLine8[0], offset = _quill$getLine8[1]; if (offset > length) return true; var value = void 0; switch (context.prefix.trim()) { case '[]':case '[ ]': value = 'unchecked'; break; case '[x]': value = 'checked'; break; case '-':case '*': value = 'bullet'; break; default: value = 'ordered'; } this.quill.insertText(range.index, ' ', _quill2.default.sources.USER); this.quill.history.cutoff(); var delta = new _quillDelta2.default().retain(range.index - offset).delete(length + 1).retain(line.length() - 2 - offset).retain(1, { list: value }); this.quill.updateContents(delta, _quill2.default.sources.USER); this.quill.history.cutoff(); this.quill.setSelection(range.index - length, _quill2.default.sources.SILENT); } }, 'code exit': { key: Keyboard.keys.ENTER, collapsed: true, format: ['code-block'], prefix: /\n\n$/, suffix: /^\s+$/, handler: function handler(range) { var _quill$getLine9 = this.quill.getLine(range.index), _quill$getLine10 = _slicedToArray(_quill$getLine9, 2), line = _quill$getLine10[0], offset = _quill$getLine10[1]; var delta = new _quillDelta2.default().retain(range.index + line.length() - offset - 2).retain(1, { 'code-block': null }).delete(1); this.quill.updateContents(delta, _quill2.default.sources.USER); } }, 'embed left': makeEmbedArrowHandler(Keyboard.keys.LEFT, false), 'embed left shift': makeEmbedArrowHandler(Keyboard.keys.LEFT, true), 'embed right': makeEmbedArrowHandler(Keyboard.keys.RIGHT, false), 'embed right shift': makeEmbedArrowHandler(Keyboard.keys.RIGHT, true) } }; function makeEmbedArrowHandler(key, shiftKey) { var _ref3; var where = key === Keyboard.keys.LEFT ? 'prefix' : 'suffix'; return _ref3 = { key: key, shiftKey: shiftKey, altKey: null }, _defineProperty(_ref3, where, /^$/), _defineProperty(_ref3, 'handler', function handler(range) { var index = range.index; if (key === Keyboard.keys.RIGHT) { index += range.length + 1; } var _quill$getLeaf3 = this.quill.getLeaf(index), _quill$getLeaf4 = _slicedToArray(_quill$getLeaf3, 1), leaf = _quill$getLeaf4[0]; if (!(leaf instanceof _parchment2.default.Embed)) return true; if (key === Keyboard.keys.LEFT) { if (shiftKey) { this.quill.setSelection(range.index - 1, range.length + 1, _quill2.default.sources.USER); } else { this.quill.setSelection(range.index - 1, _quill2.default.sources.USER); } } else { if (shiftKey) { this.quill.setSelection(range.index, range.length + 1, _quill2.default.sources.USER); } else { this.quill.setSelection(range.index + range.length + 1, _quill2.default.sources.USER); } } return false; }), _ref3; } function handleBackspace(range, context) { if (range.index === 0 || this.quill.getLength() <= 1) return; var _quill$getLine11 = this.quill.getLine(range.index), _quill$getLine12 = _slicedToArray(_quill$getLine11, 1), line = _quill$getLine12[0]; var formats = {}; if (context.offset === 0) { var _quill$getLine13 = this.quill.getLine(range.index - 1), _quill$getLine14 = _slicedToArray(_quill$getLine13, 1), prev = _quill$getLine14[0]; if (prev != null && prev.length() > 1) { var curFormats = line.formats(); var prevFormats = this.quill.getFormat(range.index - 1, 1); formats = _op2.default.attributes.diff(curFormats, prevFormats) || {}; } } // Check for astral symbols var length = /[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(context.prefix) ? 2 : 1; this.quill.deleteText(range.index - length, length, _quill2.default.sources.USER); if (Object.keys(formats).length > 0) { this.quill.formatLine(range.index - length, length, formats, _quill2.default.sources.USER); } this.quill.focus(); } function handleDelete(range, context) { // Check for astral symbols var length = /^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(context.suffix) ? 2 : 1; if (range.index >= this.quill.getLength() - length) return; var formats = {}, nextLength = 0; var _quill$getLine15 = this.quill.getLine(range.index), _quill$getLine16 = _slicedToArray(_quill$getLine15, 1), line = _quill$getLine16[0]; if (context.offset >= line.length() - 1) { var _quill$getLine17 = this.quill.getLine(range.index + 1), _quill$getLine18 = _slicedToArray(_quill$getLine17, 1), next = _quill$getLine18[0]; if (next) { var curFormats = line.formats(); var nextFormats = this.quill.getFormat(range.index, 1); formats = _op2.default.attributes.diff(curFormats, nextFormats) || {}; nextLength = next.length(); } } this.quill.deleteText(range.index, length, _quill2.default.sources.USER); if (Object.keys(formats).length > 0) { this.quill.formatLine(range.index + nextLength - 1, length, formats, _quill2.default.sources.USER); } } function handleDeleteRange(range) { var lines = this.quill.getLines(range); var formats = {}; if (lines.length > 1) { var firstFormats = lines[0].formats(); var lastFormats = lines[lines.length - 1].formats(); formats = _op2.default.attributes.diff(lastFormats, firstFormats) || {}; } this.quill.deleteText(range, _quill2.default.sources.USER); if (Object.keys(formats).length > 0) { this.quill.formatLine(range.index, 1, formats, _quill2.default.sources.USER); } this.quill.setSelection(range.index, _quill2.default.sources.SILENT); this.quill.focus(); } function handleEnter(range, context) { var _this3 = this; if (range.length > 0) { this.quill.scroll.deleteAt(range.index, range.length); // So we do not trigger text-change } var lineFormats = Object.keys(context.format).reduce(function (lineFormats, format) { if (_parchment2.default.query(format, _parchment2.default.Scope.BLOCK) && !Array.isArray(context.format[format])) { lineFormats[format] = context.format[format]; } return lineFormats; }, {}); this.quill.insertText(range.index, '\n', lineFormats, _quill2.default.sources.USER); // Earlier scroll.deleteAt might have messed up our selection, // so insertText's built in selection preservation is not reliable this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); this.quill.focus(); Object.keys(context.format).forEach(function (name) { if (lineFormats[name] != null) return; if (Array.isArray(context.format[name])) return; if (name === 'link') return; _this3.quill.format(name, context.format[name], _quill2.default.sources.USER); }); } function makeCodeBlockHandler(indent) { return { key: Keyboard.keys.TAB, shiftKey: !indent, format: { 'code-block': true }, handler: function handler(range) { var CodeBlock = _parchment2.default.query('code-block'); var index = range.index, length = range.length; var _quill$scroll$descend = this.quill.scroll.descendant(CodeBlock, index), _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), block = _quill$scroll$descend2[0], offset = _quill$scroll$descend2[1]; if (block == null) return; var scrollIndex = this.quill.getIndex(block); var start = block.newlineIndex(offset, true) + 1; var end = block.newlineIndex(scrollIndex + offset + length); var lines = block.domNode.textContent.slice(start, end).split('\n'); offset = 0; lines.forEach(function (line, i) { if (indent) { block.insertAt(start + offset, CodeBlock.TAB); offset += CodeBlock.TAB.length; if (i === 0) { index += CodeBlock.TAB.length; } else { length += CodeBlock.TAB.length; } } else if (line.startsWith(CodeBlock.TAB)) { block.deleteAt(start + offset, CodeBlock.TAB.length); offset -= CodeBlock.TAB.length; if (i === 0) { index -= CodeBlock.TAB.length; } else { length -= CodeBlock.TAB.length; } } offset += line.length + 1; }); this.quill.update(_quill2.default.sources.USER); this.quill.setSelection(index, length, _quill2.default.sources.SILENT); } }; } function makeFormatHandler(format) { return { key: format[0].toUpperCase(), shortKey: true, handler: function handler(range, context) { this.quill.format(format, !context.format[format], _quill2.default.sources.USER); } }; } function normalize(binding) { if (typeof binding === 'string' || typeof binding === 'number') { return normalize({ key: binding }); } if ((typeof binding === 'undefined' ? 'undefined' : _typeof(binding)) === 'object') { binding = (0, _clone2.default)(binding, false); } if (typeof binding.key === 'string') { if (Keyboard.keys[binding.key.toUpperCase()] != null) { binding.key = Keyboard.keys[binding.key.toUpperCase()]; } else if (binding.key.length === 1) { binding.key = binding.key.toUpperCase().charCodeAt(0); } else { return null; } } if (binding.shortKey) { binding[SHORTKEY] = binding.shortKey; delete binding.shortKey; } return binding; } exports.default = Keyboard; exports.SHORTKEY = SHORTKEY; /***/ }, /* 24 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [];var _n = true;var _d = false;var _e = undefined;try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value);if (i && _arr.length === i) break; } } catch (err) { _d = true;_e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } }return _arr; }return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) { var parent = Object.getPrototypeOf(object);if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get;if (getter === undefined) { return undefined; }return getter.call(receiver); } }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _parchment = __webpack_require__(0); var _parchment2 = _interopRequireDefault(_parchment); var _text = __webpack_require__(7); var _text2 = _interopRequireDefault(_text); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Cursor = function (_Parchment$Embed) { _inherits(Cursor, _Parchment$Embed); _createClass(Cursor, null, [{ key: 'value', value: function value() { return undefined; } }]); function Cursor(domNode, selection) { _classCallCheck(this, Cursor); var _this = _possibleConstructorReturn(this, (Cursor.__proto__ || Object.getPrototypeOf(Cursor)).call(this, domNode)); _this.selection = selection; _this.textNode = document.createTextNode(Cursor.CONTENTS); _this.domNode.appendChild(_this.textNode); _this._length = 0; return _this; } _createClass(Cursor, [{ key: 'detach', value: function detach() { // super.detach() will also clear domNode.__blot if (this.parent != null) this.parent.removeChild(this); } }, { key: 'format', value: function format(name, value) { if (this._length !== 0) { return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'format', this).call(this, name, value); } var target = this, index = 0; while (target != null && target.statics.scope !== _parchment2.default.Scope.BLOCK_BLOT) { index += target.offset(target.parent); target = target.parent; } if (target != null) { this._length = Cursor.CONTENTS.length; target.optimize(); target.formatAt(index, Cursor.CONTENTS.length, name, value); this._length = 0; } } }, { key: 'index', value: function index(node, offset) { if (node === this.textNode) return 0; return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'index', this).call(this, node, offset); } }, { key: 'length', value: function length() { return this._length; } }, { key: 'position', value: function position() { return [this.textNode, this.textNode.data.length]; } }, { key: 'remove', value: function remove() { _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'remove', this).call(this); this.parent = null; } }, { key: 'restore', value: function restore() { if (this.selection.composing || this.parent == null) return; var textNode = this.textNode; var range = this.selection.getNativeRange(); var restoreText = void 0, start = void 0, end = void 0; if (range != null && range.start.node === textNode && range.end.node === textNode) { var _ref = [textNode, range.start.offset, range.end.offset]; restoreText = _ref[0]; start = _ref[1]; end = _ref[2]; } // Link format will insert text outside of anchor tag while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) { this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode); } if (this.textNode.data !== Cursor.CONTENTS) { var text = this.textNode.data.split(Cursor.CONTENTS).join(''); if (this.next instanceof _text2.default) { restoreText = this.next.domNode; this.next.insertAt(0, text); this.textNode.data = Cursor.CONTENTS; } else { this.textNode.data = text; this.parent.insertBefore(_parchment2.default.create(this.textNode), this); this.textNode = document.createTextNode(Cursor.CONTENTS); this.domNode.appendChild(this.textNode); } } this.remove(); if (start != null) { var _map = [start, end].map(function (offset) { return Math.max(0, Math.min(restoreText.data.length, offset - 1)); }); var _map2 = _slicedToArray(_map, 2); start = _map2[0]; end = _map2[1]; return { startNode: restoreText, startOffset: start, endNode: restoreText, endOffset: end }; } } }, { key: 'update', value: function update(mutations, context) { var _this2 = this; if (mutations.some(function (mutation) { return mutation.type === 'characterData' && mutation.target === _this2.textNode; })) { var range = this.restore(); if (range) context.range = range; } } }, { key: 'value', value: function value() { return ''; } }]); return Cursor; }(_parchment2.default.Embed); Cursor.blotName = 'cursor'; Cursor.className = 'ql-cursor'; Cursor.tagName = 'span'; Cursor.CONTENTS = '\uFEFF'; // Zero width no break space exports.default = Cursor; /***/ }, /* 25 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _parchment = __webpack_require__(0); var _parchment2 = _interopRequireDefault(_parchment); var _block = __webpack_require__(4); var _block2 = _interopRequireDefault(_block); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Container = function (_Parchment$Container) { _inherits(Container, _Parchment$Container); function Container() { _classCallCheck(this, Container); return _possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).apply(this, arguments)); } return Container; }(_parchment2.default.Container); Container.allowedChildren = [_block2.default, _block.BlockEmbed, Container]; exports.default = Container; /***/ }, /* 26 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ColorStyle = exports.ColorClass = exports.ColorAttributor = undefined; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) { var parent = Object.getPrototypeOf(object);if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get;if (getter === undefined) { return undefined; }return getter.call(receiver); } }; var _parchment = __webpack_require__(0); var _parchment2 = _interopRequireDefault(_parchment); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var ColorAttributor = function (_Parchment$Attributor) { _inherits(ColorAttributor, _Parchment$Attributor); function ColorAttributor() { _classCallCheck(this, ColorAttributor); return _possibleConstructorReturn(this, (ColorAttributor.__proto__ || Object.getPrototypeOf(ColorAttributor)).apply(this, arguments)); } _createClass(ColorAttributor, [{ key: 'value', value: function value(domNode) { var value = _get(ColorAttributor.prototype.__proto__ || Object.getPrototypeOf(ColorAttributor.prototype), 'value', this).call(this, domNode); if (!value.startsWith('rgb(')) return value; value = value.replace(/^[^\d]+/, '').replace(/[^\d]+$/, ''); return '#' + value.split(',').map(function (component) { return ('00' + parseInt(component).toString(16)).slice(-2); }).join(''); } }]); return ColorAttributor; }(_parchment2.default.Attributor.Style); var ColorClass = new _parchment2.default.Attributor.Class('color', 'ql-color', { scope: _parchment2.default.Scope.INLINE }); var ColorStyle = new ColorAttributor('color', 'color', { scope: _parchment2.default.Scope.INLINE }); exports.ColorAttributor = ColorAttributor; exports.ColorClass = ColorClass; exports.ColorStyle = ColorStyle; /***/ }, /* 27 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.sanitize = exports.default = undefined; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) { var parent = Object.getPrototypeOf(object);if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get;if (getter === undefined) { return undefined; }return getter.call(receiver); } }; var _inline = __webpack_require__(6); var _inline2 = _interopRequireDefault(_inline); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Link = function (_Inline) { _inherits(Link, _Inline); function Link() { _classCallCheck(this, Link); return _possibleConstructorReturn(this, (Link.__proto__ || Object.getPrototypeOf(Link)).apply(this, arguments)); } _createClass(Link, [{ key: 'format', value: function format(name, value) { if (name !== this.statics.blotName || !value) return _get(Link.prototype.__proto__ || Object.getPrototypeOf(Link.prototype), 'format', this).call(this, name, value); value = this.constructor.sanitize(value); this.domNode.setAttribute('href', value); } }], [{ key: 'create', value: function create(value) { var node = _get(Link.__proto__ || Object.getPrototypeOf(Link), 'create', this).call(this, value); value = this.sanitize(value); node.setAttribute('href', value); node.setAttribute('rel', 'noopener noreferrer'); node.setAttribute('target', '_blank'); return node; } }, { key: 'formats', value: function formats(domNode) { return domNode.getAttribute('href'); } }, { key: 'sanitize', value: function sanitize(url) { return _sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL; } }]); return Link; }(_inline2.default); Link.blotName = 'link'; Link.tagName = 'A'; Link.SANITIZED_URL = 'about:blank'; Link.PROTOCOL_WHITELIST = ['http', 'https', 'mailto', 'tel']; function _sanitize(url, protocols) { var anchor = document.createElement('a'); anchor.href = url; var protocol = anchor.href.slice(0, anchor.href.indexOf(':')); return protocols.indexOf(protocol) > -1; } exports.default = Link; exports.sanitize = _sanitize; /***/ }, /* 28 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _typeof = typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol" ? function (obj) { return typeof obj === 'undefined' ? 'undefined' : _typeof2(obj); } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === 'undefined' ? 'undefined' : _typeof2(obj); }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _keyboard = __webpack_require__(23); var _keyboard2 = _interopRequireDefault(_keyboard); var _dropdown = __webpack_require__(107); var _dropdown2 = _interopRequireDefault(_dropdown); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var optionsCounter = 0; function toggleAriaAttribute(element, attribute) { element.setAttribute(attribute, !(element.getAttribute(attribute) === 'true')); } var Picker = function () { function Picker(select) { var _this = this; _classCallCheck(this, Picker); this.select = select; this.container = document.createElement('span'); this.buildPicker(); this.select.style.display = 'none'; this.select.parentNode.insertBefore(this.container, this.select); this.label.addEventListener('mousedown', function () { _this.togglePicker(); }); this.label.addEventListener('keydown', function (event) { switch (event.keyCode) { // Allows the "Enter" key to open the picker case _keyboard2.default.keys.ENTER: _this.togglePicker(); break; // Allows the "Escape" key to close the picker case _keyboard2.default.keys.ESCAPE: _this.escape(); event.preventDefault(); break; default: } }); this.select.addEventListener('change', this.update.bind(this)); } _createClass(Picker, [{ key: 'togglePicker', value: function togglePicker() { this.container.classList.toggle('ql-expanded'); // Toggle aria-expanded and aria-hidden to make the picker accessible toggleAriaAttribute(this.label, 'aria-expanded'); toggleAriaAttribute(this.options, 'aria-hidden'); } }, { key: 'buildItem', value: function buildItem(option) { var _this2 = this; var item = document.createElement('span'); item.tabIndex = '0'; item.setAttribute('role', 'button'); item.classList.add('ql-picker-item'); if (option.hasAttribute('value')) { item.setAttribute('data-value', option.getAttribute('value')); } if (option.textContent) { item.setAttribute('data-label', option.textContent); } item.addEventListener('click', function () { _this2.selectItem(item, true); }); item.addEventListener('keydown', function (event) { switch (event.keyCode) { // Allows the "Enter" key to select an item case _keyboard2.default.keys.ENTER: _this2.selectItem(item, true); event.preventDefault(); break; // Allows the "Escape" key to close the picker case _keyboard2.default.keys.ESCAPE: _this2.escape(); event.preventDefault(); break; default: } }); return item; } }, { key: 'buildLabel', value: function buildLabel() { var label = document.createElement('span'); label.classList.add('ql-picker-label'); label.innerHTML = _dropdown2.default; label.tabIndex = '0'; label.setAttribute('role', 'button'); label.setAttribute('aria-expanded', 'false'); this.container.appendChild(label); return label; } }, { key: 'buildOptions', value: function buildOptions() { var _this3 = this; var options = document.createElement('span'); options.classList.add('ql-picker-options'); // Don't want screen readers to read this until options are visible options.setAttribute('aria-hidden', 'true'); options.tabIndex = '-1'; // Need a unique id for aria-controls options.id = 'ql-picker-options-' + optionsCounter; optionsCounter += 1; this.label.setAttribute('aria-controls', options.id); this.options = options; [].slice.call(this.select.options).forEach(function (option) { var item = _this3.buildItem(option); options.appendChild(item); if (option.selected === true) { _this3.selectItem(item); } }); this.container.appendChild(options); } }, { key: 'buildPicker', value: function buildPicker() { var _this4 = this; [].slice.call(this.select.attributes).forEach(function (item) { _this4.container.setAttribute(item.name, item.value); }); this.container.classList.add('ql-picker'); this.label = this.buildLabel(); this.buildOptions(); } }, { key: 'escape', value: function escape() { var _this5 = this; // Close menu and return focus to trigger label this.close(); // Need setTimeout for accessibility to ensure that the browser executes // focus on the next process thread and after any DOM content changes setTimeout(function () { return _this5.label.focus(); }, 1); } }, { key: 'close', value: function close() { this.container.classList.remove('ql-expanded'); this.label.setAttribute('aria-expanded', 'false'); this.options.setAttribute('aria-hidden', 'true'); } }, { key: 'selectItem', value: function selectItem(item) { var trigger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var selected = this.container.querySelector('.ql-selected'); if (item === selected) return; if (selected != null) { selected.classList.remove('ql-selected'); } if (item == null) return; item.classList.add('ql-selected'); this.select.selectedIndex = [].indexOf.call(item.parentNode.children, item); if (item.hasAttribute('data-value')) { this.label.setAttribute('data-value', item.getAttribute('data-value')); } else { this.label.removeAttribute('data-value'); } if (item.hasAttribute('data-label')) { this.label.setAttribute('data-label', item.getAttribute('data-label')); } else { this.label.removeAttribute('data-label'); } if (trigger) { if (typeof Event === 'function') { this.select.dispatchEvent(new Event('change')); } else if ((typeof Event === 'undefined' ? 'undefined' : _typeof(Event)) === 'object') { // IE11 var event = document.createEvent('Event'); event.initEvent('change', true, true); this.select.dispatchEvent(event); } this.close(); } } }, { key: 'update', value: function update() { var option = void 0; if (this.select.selectedIndex > -1) { var item = this.container.querySelector('.ql-picker-options').children[this.select.selectedIndex]; option = this.select.options[this.select.selectedIndex]; this.selectItem(item); } else { this.selectItem(null); } var isActive = option != null && option !== this.select.querySelector('option[selected]'); this.label.classList.toggle('ql-active', isActive); } }]); return Picker; }(); exports.default = Picker; /***/ }, /* 29 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _parchment = __webpack_require__(0); var _parchment2 = _interopRequireDefault(_parchment); var _quill = __webpack_require__(5); var _quill2 = _interopRequireDefault(_quill); var _block = __webpack_require__(4); var _block2 = _interopRequireDefault(_block); var _break = __webpack_require__(16); var _break2 = _interopRequireDefault(_break); var _container = __webpack_require__(25); var _container2 = _interopRequireDefault(_container); var _cursor = __webpack_require__(24); var _cursor2 = _interopRequireDefault(_cursor); var _embed = __webpack_require__(35); var _embed2 = _interopRequireDefault(_embed); var _inline = __webpack_require__(6); var _inline2 = _interopRequireDefault(_inline); var _scroll = __webpack_require__(22); var _scroll2 = _interopRequireDefault(_scroll); var _text = __webpack_require__(7); var _text2 = _interopRequireDefault(_text); var _clipboard = __webpack_require__(55); var _clipboard2 = _interopRequireDefault(_clipboard); var _history = __webpack_require__(42); var _history2 = _interopRequireDefault(_history); var _keyboard = __webpack_require__(23); var _keyboard2 = _interopRequireDefault(_keyboard); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } _quill2.default.register({ 'blots/block': _block2.default, 'blots/block/embed': _block.BlockEmbed, 'blots/break': _break2.default, 'blots/container': _container2.default, 'blots/cursor': _cursor2.default, 'blots/embed': _embed2.default, 'blots/inline': _inline2.default, 'blots/scroll': _scroll2.default, 'blots/text': _text2.default, 'modules/clipboard': _clipboard2.default, 'modules/history': _history2.default, 'modules/keyboard': _keyboard2.default }); _parchment2.default.register(_block2.default, _break2.default, _cursor2.default, _inline2.default, _scroll2.default, _text2.default); exports.default = _quill2.default; /***/ }, /* 30 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Registry = __webpack_require__(1); var ShadowBlot = /** @class */function () { function ShadowBlot(domNode) { this.domNode = domNode; // @ts-ignore this.domNode[Registry.DATA_KEY] = { blot: this }; } Object.defineProperty(ShadowBlot.prototype, "statics", { // Hack for accessing inherited static methods get: function get() { return this.constructor; }, enumerable: true, configurable: true }); ShadowBlot.create = function (value) { if (this.tagName == null) { throw new Registry.ParchmentError('Blot definition missing tagName'); } var node; if (Array.isArray(this.tagName)) { if (typeof value === 'string') { value = value.toUpperCase(); if (parseInt(value).toString() === value) { value = parseInt(value); } } if (typeof value === 'number') { node = document.createElement(this.tagName[value - 1]); } else if (this.tagName.indexOf(value) > -1) { node = document.createElement(value); } else { node = document.createElement(this.tagName[0]); } } else { node = document.createElement(this.tagName); } if (this.className) { node.classList.add(this.className); } return node; }; ShadowBlot.prototype.attach = function () { if (this.parent != null) { this.scroll = this.parent.scroll; } }; ShadowBlot.prototype.clone = function () { var domNode = this.domNode.cloneNode(false); return Registry.create(domNode); }; ShadowBlot.prototype.detach = function () { if (this.parent != null) this.parent.removeChild(this); // @ts-ignore delete this.domNode[Registry.DATA_KEY]; }; ShadowBlot.prototype.deleteAt = function (index, length) { var blot = this.isolate(index, length); blot.remove(); }; ShadowBlot.prototype.formatAt = function (index, length, name, value) { var blot = this.isolate(index, length); if (Registry.query(name, Registry.Scope.BLOT) != null && value) { blot.wrap(name, value); } else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) { var parent = Registry.create(this.statics.scope); blot.wrap(parent); parent.format(name, value); } }; ShadowBlot.prototype.insertAt = function (index, value, def) { var blot = def == null ? Registry.create('text', value) : Registry.create(value, def); var ref = this.split(index); this.parent.insertBefore(blot, ref); }; ShadowBlot.prototype.insertInto = function (parentBlot, refBlot) { if (refBlot === void 0) { refBlot = null; } if (this.parent != null) { this.parent.children.remove(this); } var refDomNode = null; parentBlot.children.insertBefore(this, refBlot); if (refBlot != null) { refDomNode = refBlot.domNode; } if (this.domNode.parentNode != parentBlot.domNode || this.domNode.nextSibling != refDomNode) { parentBlot.domNode.insertBefore(this.domNode, refDomNode); } this.parent = parentBlot; this.attach(); }; ShadowBlot.prototype.isolate = function (index, length) { var target = this.split(index); target.split(length); return target; }; ShadowBlot.prototype.length = function () { return 1; }; ShadowBlot.prototype.offset = function (root) { if (root === void 0) { root = this.parent; } if (this.parent == null || this == root) return 0; return this.parent.children.offset(this) + this.parent.offset(root); }; ShadowBlot.prototype.optimize = function (context) { // TODO clean up once we use WeakMap // @ts-ignore if (this.domNode[Registry.DATA_KEY] != null) { // @ts-ignore delete this.domNode[Registry.DATA_KEY].mutations; } }; ShadowBlot.prototype.remove = function () { if (this.domNode.parentNode != null) { this.domNode.parentNode.removeChild(this.domNode); } this.detach(); }; ShadowBlot.prototype.replace = function (target) { if (target.parent == null) return; target.parent.insertBefore(this, target.next); target.remove(); }; ShadowBlot.prototype.replaceWith = function (name, value) { var replacement = typeof name === 'string' ? Registry.create(name, value) : name; replacement.replace(this); return replacement; }; ShadowBlot.prototype.split = function (index, force) { return index === 0 ? this : this.next; }; ShadowBlot.prototype.update = function (mutations, context) { // Nothing to do by default }; ShadowBlot.prototype.wrap = function (name, value) { var wrapper = typeof name === 'string' ? Registry.create(name, value) : name; if (this.parent != null) { this.parent.insertBefore(wrapper, this.next); } wrapper.appendChild(this); return wrapper; }; ShadowBlot.blotName = 'abstract'; return ShadowBlot; }(); exports.default = ShadowBlot; /***/ }, /* 31 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var attributor_1 = __webpack_require__(12); var class_1 = __webpack_require__(32); var style_1 = __webpack_require__(33); var Registry = __webpack_require__(1); var AttributorStore = /** @class */function () { function AttributorStore(domNode) { this.attributes = {}; this.domNode = domNode; this.build(); } AttributorStore.prototype.attribute = function (attribute, value) { // verb if (value) { if (attribute.add(this.domNode, value)) { if (attribute.value(this.domNode) != null) { this.attributes[attribute.attrName] = attribute; } else { delete this.attributes[attribute.attrName]; } } } else { attribute.remove(this.domNode); delete this.attributes[attribute.attrName]; } }; AttributorStore.prototype.build = function () { var _this = this; this.attributes = {}; var attributes = attributor_1.default.keys(this.domNode); var classes = class_1.default.keys(this.domNode); var styles = style_1.default.keys(this.domNode); attributes.concat(classes).concat(styles).forEach(function (name) { var attr = Registry.query(name, Registry.Scope.ATTRIBUTE); if (attr instanceof attributor_1.default) { _this.attributes[attr.attrName] = attr; } }); }; AttributorStore.prototype.copy = function (target) { var _this = this; Object.keys(this.attributes).forEach(function (key) { var value = _this.attributes[key].value(_this.domNode); target.format(key, value); }); }; AttributorStore.prototype.move = function (target) { var _this = this; this.copy(target); Object.keys(this.attributes).forEach(function (key) { _this.attributes[key].remove(_this.domNode); }); this.attributes = {}; }; AttributorStore.prototype.values = function () { var _this = this; return Object.keys(this.attributes).reduce(function (attributes, name) { attributes[name] = _this.attributes[name].value(_this.domNode); return attributes; }, {}); }; return AttributorStore; }(); exports.default = AttributorStore; /***/ }, /* 32 */ /***/function (module, exports, __webpack_require__) { "use strict"; var __extends = this && this.__extends || function () { var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) d[p] = b[p]; } }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); Object.defineProperty(exports, "__esModule", { value: true }); var attributor_1 = __webpack_require__(12); function match(node, prefix) { var className = node.getAttribute('class') || ''; return className.split(/\s+/).filter(function (name) { return name.indexOf(prefix + "-") === 0; }); } var ClassAttributor = /** @class */function (_super) { __extends(ClassAttributor, _super); function ClassAttributor() { return _super !== null && _super.apply(this, arguments) || this; } ClassAttributor.keys = function (node) { return (node.getAttribute('class') || '').split(/\s+/).map(function (name) { return name.split('-').slice(0, -1).join('-'); }); }; ClassAttributor.prototype.add = function (node, value) { if (!this.canAdd(node, value)) return false; this.remove(node); node.classList.add(this.keyName + "-" + value); return true; }; ClassAttributor.prototype.remove = function (node) { var matches = match(node, this.keyName); matches.forEach(function (name) { node.classList.remove(name); }); if (node.classList.length === 0) { node.removeAttribute('class'); } }; ClassAttributor.prototype.value = function (node) { var result = match(node, this.keyName)[0] || ''; var value = result.slice(this.keyName.length + 1); // +1 for hyphen return this.canAdd(node, value) ? value : ''; }; return ClassAttributor; }(attributor_1.default); exports.default = ClassAttributor; /***/ }, /* 33 */ /***/function (module, exports, __webpack_require__) { "use strict"; var __extends = this && this.__extends || function () { var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) d[p] = b[p]; } }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); Object.defineProperty(exports, "__esModule", { value: true }); var attributor_1 = __webpack_require__(12); function camelize(name) { var parts = name.split('-'); var rest = parts.slice(1).map(function (part) { return part[0].toUpperCase() + part.slice(1); }).join(''); return parts[0] + rest; } var StyleAttributor = /** @class */function (_super) { __extends(StyleAttributor, _super); function StyleAttributor() { return _super !== null && _super.apply(this, arguments) || this; } StyleAttributor.keys = function (node) { return (node.getAttribute('style') || '').split(';').map(function (value) { var arr = value.split(':'); return arr[0].trim(); }); }; StyleAttributor.prototype.add = function (node, value) { if (!this.canAdd(node, value)) return false; // @ts-ignore node.style[camelize(this.keyName)] = value; return true; }; StyleAttributor.prototype.remove = function (node) { // @ts-ignore node.style[camelize(this.keyName)] = ''; if (!node.getAttribute('style')) { node.removeAttribute('style'); } }; StyleAttributor.prototype.value = function (node) { // @ts-ignore var value = node.style[camelize(this.keyName)]; return this.canAdd(node, value) ? value : ''; }; return StyleAttributor; }(attributor_1.default); exports.default = StyleAttributor; /***/ }, /* 34 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Theme = function () { function Theme(quill, options) { _classCallCheck(this, Theme); this.quill = quill; this.options = options; this.modules = {}; } _createClass(Theme, [{ key: 'init', value: function init() { var _this = this; Object.keys(this.options.modules).forEach(function (name) { if (_this.modules[name] == null) { _this.addModule(name); } }); } }, { key: 'addModule', value: function addModule(name) { var moduleClass = this.quill.constructor.import('modules/' + name); this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {}); return this.modules[name]; } }]); return Theme; }(); Theme.DEFAULTS = { modules: {} }; Theme.themes = { 'default': Theme }; exports.default = Theme; /***/ }, /* 35 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) { var parent = Object.getPrototypeOf(object);if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get;if (getter === undefined) { return undefined; }return getter.call(receiver); } }; var _parchment = __webpack_require__(0); var _parchment2 = _interopRequireDefault(_parchment); var _text = __webpack_require__(7); var _text2 = _interopRequireDefault(_text); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var GUARD_TEXT = '\uFEFF'; var Embed = function (_Parchment$Embed) { _inherits(Embed, _Parchment$Embed); function Embed(node) { _classCallCheck(this, Embed); var _this = _possibleConstructorReturn(this, (Embed.__proto__ || Object.getPrototypeOf(Embed)).call(this, node)); _this.contentNode = document.createElement('span'); _this.contentNode.setAttribute('contenteditable', false); [].slice.call(_this.domNode.childNodes).forEach(function (childNode) { _this.contentNode.appendChild(childNode); }); _this.leftGuard = document.createTextNode(GUARD_TEXT); _this.rightGuard = document.createTextNode(GUARD_TEXT); _this.domNode.appendChild(_this.leftGuard); _this.domNode.appendChild(_this.contentNode); _this.domNode.appendChild(_this.rightGuard); return _this; } _createClass(Embed, [{ key: 'index', value: function index(node, offset) { if (node === this.leftGuard) return 0; if (node === this.rightGuard) return 1; return _get(Embed.prototype.__proto__ || Object.getPrototypeOf(Embed.prototype), 'index', this).call(this, node, offset); } }, { key: 'restore', value: function restore(node) { var range = void 0, textNode = void 0; var text = node.data.split(GUARD_TEXT).join(''); if (node === this.leftGuard) { if (this.prev instanceof _text2.default) { var prevLength = this.prev.length(); this.prev.insertAt(prevLength, text); range = { startNode: this.prev.domNode, startOffset: prevLength + text.length }; } else { textNode = document.createTextNode(text); this.parent.insertBefore(_parchment2.default.create(textNode), this); range = { startNode: textNode, startOffset: text.length }; } } else if (node === this.rightGuard) { if (this.next instanceof _text2.default) { this.next.insertAt(0, text); range = { startNode: this.next.domNode, startOffset: text.length }; } else { textNode = document.createTextNode(text); this.parent.insertBefore(_parchment2.default.create(textNode), this.next); range = { startNode: textNode, startOffset: text.length }; } } node.data = GUARD_TEXT; return range; } }, { key: 'update', value: function update(mutations, context) { var _this2 = this; mutations.forEach(function (mutation) { if (mutation.type === 'characterData' && (mutation.target === _this2.leftGuard || mutation.target === _this2.rightGuard)) { var range = _this2.restore(mutation.target); if (range) context.range = range; } }); } }]); return Embed; }(_parchment2.default.Embed); exports.default = Embed; /***/ }, /* 36 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AlignStyle = exports.AlignClass = exports.AlignAttribute = undefined; var _parchment = __webpack_require__(0); var _parchment2 = _interopRequireDefault(_parchment); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var config = { scope: _parchment2.default.Scope.BLOCK, whitelist: ['right', 'center', 'justify'] }; var AlignAttribute = new _parchment2.default.Attributor.Attribute('align', 'align', config); var AlignClass = new _parchment2.default.Attributor.Class('align', 'ql-align', config); var AlignStyle = new _parchment2.default.Attributor.Style('align', 'text-align', config); exports.AlignAttribute = AlignAttribute; exports.AlignClass = AlignClass; exports.AlignStyle = AlignStyle; /***/ }, /* 37 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BackgroundStyle = exports.BackgroundClass = undefined; var _parchment = __webpack_require__(0); var _parchment2 = _interopRequireDefault(_parchment); var _color = __webpack_require__(26); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var BackgroundClass = new _parchment2.default.Attributor.Class('background', 'ql-bg', { scope: _parchment2.default.Scope.INLINE }); var BackgroundStyle = new _color.ColorAttributor('background', 'background-color', { scope: _parchment2.default.Scope.INLINE }); exports.BackgroundClass = BackgroundClass; exports.BackgroundStyle = BackgroundStyle; /***/ }, /* 38 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DirectionStyle = exports.DirectionClass = exports.DirectionAttribute = undefined; var _parchment = __webpack_require__(0); var _parchment2 = _interopRequireDefault(_parchment); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var config = { scope: _parchment2.default.Scope.BLOCK, whitelist: ['rtl'] }; var DirectionAttribute = new _parchment2.default.Attributor.Attribute('direction', 'dir', config); var DirectionClass = new _parchment2.default.Attributor.Class('direction', 'ql-direction', config); var DirectionStyle = new _parchment2.default.Attributor.Style('direction', 'direction', config); exports.DirectionAttribute = DirectionAttribute; exports.DirectionClass = DirectionClass; exports.DirectionStyle = DirectionStyle; /***/ }, /* 39 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.FontClass = exports.FontStyle = undefined; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) { var parent = Object.getPrototypeOf(object);if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get;if (getter === undefined) { return undefined; }return getter.call(receiver); } }; var _parchment = __webpack_require__(0); var _parchment2 = _interopRequireDefault(_parchment); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var config = { scope: _parchment2.default.Scope.INLINE, whitelist: ['serif', 'monospace'] }; var FontClass = new _parchment2.default.Attributor.Class('font', 'ql-font', config); var FontStyleAttributor = function (_Parchment$Attributor) { _inherits(FontStyleAttributor, _Parchment$Attributor); function FontStyleAttributor() { _classCallCheck(this, FontStyleAttributor); return _possibleConstructorReturn(this, (FontStyleAttributor.__proto__ || Object.getPrototypeOf(FontStyleAttributor)).apply(this, arguments)); } _createClass(FontStyleAttributor, [{ key: 'value', value: function value(node) { return _get(FontStyleAttributor.prototype.__proto__ || Object.getPrototypeOf(FontStyleAttributor.prototype), 'value', this).call(this, node).replace(/["']/g, ''); } }]); return FontStyleAttributor; }(_parchment2.default.Attributor.Style); var FontStyle = new FontStyleAttributor('font', 'font-family', config); exports.FontStyle = FontStyle; exports.FontClass = FontClass; /***/ }, /* 40 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SizeStyle = exports.SizeClass = undefined; var _parchment = __webpack_require__(0); var _parchment2 = _interopRequireDefault(_parchment); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var SizeClass = new _parchment2.default.Attributor.Class('size', 'ql-size', { scope: _parchment2.default.Scope.INLINE, whitelist: ['small', 'large', 'huge'] }); var SizeStyle = new _parchment2.default.Attributor.Style('size', 'font-size', { scope: _parchment2.default.Scope.INLINE, whitelist: ['10px', '18px', '32px'] }); exports.SizeClass = SizeClass; exports.SizeStyle = SizeStyle; /***/ }, /* 41 */ /***/function (module, exports, __webpack_require__) { "use strict"; module.exports = { 'align': { '': __webpack_require__(76), 'center': __webpack_require__(77), 'right': __webpack_require__(78), 'justify': __webpack_require__(79) }, 'background': __webpack_require__(80), 'blockquote': __webpack_require__(81), 'bold': __webpack_require__(82), 'clean': __webpack_require__(83), 'code': __webpack_require__(58), 'code-block': __webpack_require__(58), 'color': __webpack_require__(84), 'direction': { '': __webpack_require__(85), 'rtl': __webpack_require__(86) }, 'float': { 'center': __webpack_require__(87), 'full': __webpack_require__(88), 'left': __webpack_require__(89), 'right': __webpack_require__(90) }, 'formula': __webpack_require__(91), 'header': { '1': __webpack_require__(92), '2': __webpack_require__(93) }, 'italic': __webpack_require__(94), 'image': __webpack_require__(95), 'indent': { '+1': __webpack_require__(96), '-1': __webpack_require__(97) }, 'link': __webpack_require__(98), 'list': { 'ordered': __webpack_require__(99), 'bullet': __webpack_require__(100), 'check': __webpack_require__(101) }, 'script': { 'sub': __webpack_require__(102), 'super': __webpack_require__(103) }, 'strike': __webpack_require__(104), 'underline': __webpack_require__(105), 'video': __webpack_require__(106) }; /***/ }, /* 42 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getLastChangeIndex = exports.default = undefined; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _parchment = __webpack_require__(0); var _parchment2 = _interopRequireDefault(_parchment); var _quill = __webpack_require__(5); var _quill2 = _interopRequireDefault(_quill); var _module = __webpack_require__(9); var _module2 = _interopRequireDefault(_module); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var History = function (_Module) { _inherits(History, _Module); function History(quill, options) { _classCallCheck(this, History); var _this = _possibleConstructorReturn(this, (History.__proto__ || Object.getPrototypeOf(History)).call(this, quill, options)); _this.lastRecorded = 0; _this.ignoreChange = false; _this.clear(); _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (eventName, delta, oldDelta, source) { if (eventName !== _quill2.default.events.TEXT_CHANGE || _this.ignoreChange) return; if (!_this.options.userOnly || source === _quill2.default.sources.USER) { _this.record(delta, oldDelta); } else { _this.transform(delta); } }); _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true }, _this.undo.bind(_this)); _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true, shiftKey: true }, _this.redo.bind(_this)); if (/Win/i.test(navigator.platform)) { _this.quill.keyboard.addBinding({ key: 'Y', shortKey: true }, _this.redo.bind(_this)); } return _this; } _createClass(History, [{ key: 'change', value: function change(source, dest) { if (this.stack[source].length === 0) return; var delta = this.stack[source].pop(); this.stack[dest].push(delta); this.lastRecorded = 0; this.ignoreChange = true; this.quill.updateContents(delta[source], _quill2.default.sources.USER); this.ignoreChange = false; var index = getLastChangeIndex(delta[source]); this.quill.setSelection(index); } }, { key: 'clear', value: function clear() { this.stack = { undo: [], redo: [] }; } }, { key: 'cutoff', value: function cutoff() { this.lastRecorded = 0; } }, { key: 'record', value: function record(changeDelta, oldDelta) { if (changeDelta.ops.length === 0) return; this.stack.redo = []; var undoDelta = this.quill.getContents().diff(oldDelta); var timestamp = Date.now(); if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) { var delta = this.stack.undo.pop(); undoDelta = undoDelta.compose(delta.undo); changeDelta = delta.redo.compose(changeDelta); } else { this.lastRecorded = timestamp; } this.stack.undo.push({ redo: changeDelta, undo: undoDelta }); if (this.stack.undo.length > this.options.maxStack) { this.stack.undo.shift(); } } }, { key: 'redo', value: function redo() { this.change('redo', 'undo'); } }, { key: 'transform', value: function transform(delta) { this.stack.undo.forEach(function (change) { change.undo = delta.transform(change.undo, true); change.redo = delta.transform(change.redo, true); }); this.stack.redo.forEach(function (change) { change.undo = delta.transform(change.undo, true); change.redo = delta.transform(change.redo, true); }); } }, { key: 'undo', value: function undo() { this.change('undo', 'redo'); } }]); return History; }(_module2.default); History.DEFAULTS = { delay: 1000, maxStack: 100, userOnly: false }; function endsWithNewlineChange(delta) { var lastOp = delta.ops[delta.ops.length - 1]; if (lastOp == null) return false; if (lastOp.insert != null) { return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\n'); } if (lastOp.attributes != null) { return Object.keys(lastOp.attributes).some(function (attr) { return _parchment2.default.query(attr, _parchment2.default.Scope.BLOCK) != null; }); } return false; } function getLastChangeIndex(delta) { var deleteLength = delta.reduce(function (length, op) { length += op.delete || 0; return length; }, 0); var changeIndex = delta.length() - deleteLength; if (endsWithNewlineChange(delta)) { changeIndex -= 1; } return changeIndex; } exports.default = History; exports.getLastChangeIndex = getLastChangeIndex; /***/ }, /* 43 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.BaseTooltip = undefined; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) { var parent = Object.getPrototypeOf(object);if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get;if (getter === undefined) { return undefined; }return getter.call(receiver); } }; var _extend = __webpack_require__(3); var _extend2 = _interopRequireDefault(_extend); var _quillDelta = __webpack_require__(2); var _quillDelta2 = _interopRequireDefault(_quillDelta); var _emitter = __webpack_require__(8); var _emitter2 = _interopRequireDefault(_emitter); var _keyboard = __webpack_require__(23); var _keyboard2 = _interopRequireDefault(_keyboard); var _theme = __webpack_require__(34); var _theme2 = _interopRequireDefault(_theme); var _colorPicker = __webpack_require__(59); var _colorPicker2 = _interopRequireDefault(_colorPicker); var _iconPicker = __webpack_require__(60); var _iconPicker2 = _interopRequireDefault(_iconPicker); var _picker = __webpack_require__(28); var _picker2 = _interopRequireDefault(_picker); var _tooltip = __webpack_require__(61); var _tooltip2 = _interopRequireDefault(_tooltip); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var ALIGNS = [false, 'center', 'right', 'justify']; var COLORS = ["#000000", "#e60000", "#ff9900", "#ffff00", "#008a00", "#0066cc", "#9933ff", "#ffffff", "#facccc", "#ffebcc", "#ffffcc", "#cce8cc", "#cce0f5", "#ebd6ff", "#bbbbbb", "#f06666", "#ffc266", "#ffff66", "#66b966", "#66a3e0", "#c285ff", "#888888", "#a10000", "#b26b00", "#b2b200", "#006100", "#0047b2", "#6b24b2", "#444444", "#5c0000", "#663d00", "#666600", "#003700", "#002966", "#3d1466"]; var FONTS = [false, 'serif', 'monospace']; var HEADERS = ['1', '2', '3', false]; var SIZES = ['small', false, 'large', 'huge']; var BaseTheme = function (_Theme) { _inherits(BaseTheme, _Theme); function BaseTheme(quill, options) { _classCallCheck(this, BaseTheme); var _this = _possibleConstructorReturn(this, (BaseTheme.__proto__ || Object.getPrototypeOf(BaseTheme)).call(this, quill, options)); var listener = function listener(e) { if (!document.body.contains(quill.root)) { return document.body.removeEventListener('click', listener); } if (_this.tooltip != null && !_this.tooltip.root.contains(e.target) && document.activeElement !== _this.tooltip.textbox && !_this.quill.hasFocus()) { _this.tooltip.hide(); } if (_this.pickers != null) { _this.pickers.forEach(function (picker) { if (!picker.container.contains(e.target)) { picker.close(); } }); } }; quill.emitter.listenDOM('click', document.body, listener); return _this; } _createClass(BaseTheme, [{ key: 'addModule', value: function addModule(name) { var module = _get(BaseTheme.prototype.__proto__ || Object.getPrototypeOf(BaseTheme.prototype), 'addModule', this).call(this, name); if (name === 'toolbar') { this.extendToolbar(module); } return module; } }, { key: 'buildButtons', value: function buildButtons(buttons, icons) { buttons.forEach(function (button) { var className = button.getAttribute('class') || ''; className.split(/\s+/).forEach(function (name) { if (!name.startsWith('ql-')) return; name = name.slice('ql-'.length); if (icons[name] == null) return; if (name === 'direction') { button.innerHTML = icons[name][''] + icons[name]['rtl']; } else if (typeof icons[name] === 'string') { button.innerHTML = icons[name]; } else { var value = button.value || ''; if (value != null && icons[name][value]) { button.innerHTML = icons[name][value]; } } }); }); } }, { key: 'buildPickers', value: function buildPickers(selects, icons) { var _this2 = this; this.pickers = selects.map(function (select) { if (select.classList.contains('ql-align')) { if (select.querySelector('option') == null) { fillSelect(select, ALIGNS); } return new _iconPicker2.default(select, icons.align); } else if (select.classList.contains('ql-background') || select.classList.contains('ql-color')) { var format = select.classList.contains('ql-background') ? 'background' : 'color'; if (select.querySelector('option') == null) { fillSelect(select, COLORS, format === 'background' ? '#ffffff' : '#000000'); } return new _colorPicker2.default(select, icons[format]); } else { if (select.querySelector('option') == null) { if (select.classList.contains('ql-font')) { fillSelect(select, FONTS); } else if (select.classList.contains('ql-header')) { fillSelect(select, HEADERS); } else if (select.classList.contains('ql-size')) { fillSelect(select, SIZES); } } return new _picker2.default(select); } }); var update = function update() { _this2.pickers.forEach(function (picker) { picker.update(); }); }; this.quill.on(_emitter2.default.events.EDITOR_CHANGE, update); } }]); return BaseTheme; }(_theme2.default); BaseTheme.DEFAULTS = (0, _extend2.default)(true, {}, _theme2.default.DEFAULTS, { modules: { toolbar: { handlers: { formula: function formula() { this.quill.theme.tooltip.edit('formula'); }, image: function image() { var _this3 = this; var fileInput = this.container.querySelector('input.ql-image[type=file]'); if (fileInput == null) { fileInput = document.createElement('input'); fileInput.setAttribute('type', 'file'); fileInput.setAttribute('accept', 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon'); fileInput.classList.add('ql-image'); fileInput.addEventListener('change', function () { if (fileInput.files != null && fileInput.files[0] != null) { var reader = new FileReader(); reader.onload = function (e) { var range = _this3.quill.getSelection(true); _this3.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert({ image: e.target.result }), _emitter2.default.sources.USER); _this3.quill.setSelection(range.index + 1, _emitter2.default.sources.SILENT); fileInput.value = ""; }; reader.readAsDataURL(fileInput.files[0]); } }); this.container.appendChild(fileInput); } fileInput.click(); }, video: function video() { this.quill.theme.tooltip.edit('video'); } } } } }); var BaseTooltip = function (_Tooltip) { _inherits(BaseTooltip, _Tooltip); function BaseTooltip(quill, boundsContainer) { _classCallCheck(this, BaseTooltip); var _this4 = _possibleConstructorReturn(this, (BaseTooltip.__proto__ || Object.getPrototypeOf(BaseTooltip)).call(this, quill, boundsContainer)); _this4.textbox = _this4.root.querySelector('input[type="text"]'); _this4.listen(); return _this4; } _createClass(BaseTooltip, [{ key: 'listen', value: function listen() { var _this5 = this; this.textbox.addEventListener('keydown', function (event) { if (_keyboard2.default.match(event, 'enter')) { _this5.save(); event.preventDefault(); } else if (_keyboard2.default.match(event, 'escape')) { _this5.cancel(); event.preventDefault(); } }); } }, { key: 'cancel', value: function cancel() { this.hide(); } }, { key: 'edit', value: function edit() { var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'link'; var preview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; this.root.classList.remove('ql-hidden'); this.root.classList.add('ql-editing'); if (preview != null) { this.textbox.value = preview; } else if (mode !== this.root.getAttribute('data-mode')) { this.textbox.value = ''; } this.position(this.quill.getBounds(this.quill.selection.savedRange)); this.textbox.select(); this.textbox.setAttribute('placeholder', this.textbox.getAttribute('data-' + mode) || ''); this.root.setAttribute('data-mode', mode); } }, { key: 'restoreFocus', value: function restoreFocus() { var scrollTop = this.quill.scrollingContainer.scrollTop; this.quill.focus(); this.quill.scrollingContainer.scrollTop = scrollTop; } }, { key: 'save', value: function save() { var value = this.textbox.value; switch (this.root.getAttribute('data-mode')) { case 'link': { var scrollTop = this.quill.root.scrollTop; if (this.linkRange) { this.quill.formatText(this.linkRange, 'link', value, _emitter2.default.sources.USER); delete this.linkRange; } else { this.restoreFocus(); this.quill.format('link', value, _emitter2.default.sources.USER); } this.quill.root.scrollTop = scrollTop; break; } case 'video': { value = extractVideoUrl(value); } // eslint-disable-next-line no-fallthrough case 'formula': { if (!value) break; var range = this.quill.getSelection(true); if (range != null) { var index = range.index + range.length; this.quill.insertEmbed(index, this.root.getAttribute('data-mode'), value, _emitter2.default.sources.USER); if (this.root.getAttribute('data-mode') === 'formula') { this.quill.insertText(index + 1, ' ', _emitter2.default.sources.USER); } this.quill.setSelection(index + 2, _emitter2.default.sources.USER); } break; } default: } this.textbox.value = ''; this.hide(); } }]); return BaseTooltip; }(_tooltip2.default); function extractVideoUrl(url) { var match = url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/) || url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/); if (match) { return (match[1] || 'https') + '://www.youtube.com/embed/' + match[2] + '?showinfo=0'; } if (match = url.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/)) { // eslint-disable-line no-cond-assign return (match[1] || 'https') + '://player.vimeo.com/video/' + match[2] + '/'; } return url; } function fillSelect(select, values) { var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; values.forEach(function (value) { var option = document.createElement('option'); if (value === defaultValue) { option.setAttribute('selected', 'selected'); } else { option.setAttribute('value', value); } select.appendChild(option); }); } exports.BaseTooltip = BaseTooltip; exports.default = BaseTheme; /***/ }, /* 44 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var LinkedList = /** @class */function () { function LinkedList() { this.head = this.tail = null; this.length = 0; } LinkedList.prototype.append = function () { var nodes = []; for (var _i = 0; _i < arguments.length; _i++) { nodes[_i] = arguments[_i]; } this.insertBefore(nodes[0], null); if (nodes.length > 1) { this.append.apply(this, nodes.slice(1)); } }; LinkedList.prototype.contains = function (node) { var cur, next = this.iterator(); while (cur = next()) { if (cur === node) return true; } return false; }; LinkedList.prototype.insertBefore = function (node, refNode) { if (!node) return; node.next = refNode; if (refNode != null) { node.prev = refNode.prev; if (refNode.prev != null) { refNode.prev.next = node; } refNode.prev = node; if (refNode === this.head) { this.head = node; } } else if (this.tail != null) { this.tail.next = node; node.prev = this.tail; this.tail = node; } else { node.prev = null; this.head = this.tail = node; } this.length += 1; }; LinkedList.prototype.offset = function (target) { var index = 0, cur = this.head; while (cur != null) { if (cur === target) return index; index += cur.length(); cur = cur.next; } return -1; }; LinkedList.prototype.remove = function (node) { if (!this.contains(node)) return; if (node.prev != null) node.prev.next = node.next; if (node.next != null) node.next.prev = node.prev; if (node === this.head) this.head = node.next; if (node === this.tail) this.tail = node.prev; this.length -= 1; }; LinkedList.prototype.iterator = function (curNode) { if (curNode === void 0) { curNode = this.head; } // TODO use yield when we can return function () { var ret = curNode; if (curNode != null) curNode = curNode.next; return ret; }; }; LinkedList.prototype.find = function (index, inclusive) { if (inclusive === void 0) { inclusive = false; } var cur, next = this.iterator(); while (cur = next()) { var length = cur.length(); if (index < length || inclusive && index === length && (cur.next == null || cur.next.length() !== 0)) { return [cur, index]; } index -= length; } return [null, 0]; }; LinkedList.prototype.forEach = function (callback) { var cur, next = this.iterator(); while (cur = next()) { callback(cur); } }; LinkedList.prototype.forEachAt = function (index, length, callback) { if (length <= 0) return; var _a = this.find(index), startNode = _a[0], offset = _a[1]; var cur, curIndex = index - offset, next = this.iterator(startNode); while ((cur = next()) && curIndex < index + length) { var curLength = cur.length(); if (index > curIndex) { callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index)); } else { callback(cur, 0, Math.min(curLength, index + length - curIndex)); } curIndex += curLength; } }; LinkedList.prototype.map = function (callback) { return this.reduce(function (memo, cur) { memo.push(callback(cur)); return memo; }, []); }; LinkedList.prototype.reduce = function (callback, memo) { var cur, next = this.iterator(); while (cur = next()) { memo = callback(memo, cur); } return memo; }; return LinkedList; }(); exports.default = LinkedList; /***/ }, /* 45 */ /***/function (module, exports, __webpack_require__) { "use strict"; var __extends = this && this.__extends || function () { var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) d[p] = b[p]; } }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); Object.defineProperty(exports, "__esModule", { value: true }); var container_1 = __webpack_require__(17); var Registry = __webpack_require__(1); var OBSERVER_CONFIG = { attributes: true, characterData: true, characterDataOldValue: true, childList: true, subtree: true }; var MAX_OPTIMIZE_ITERATIONS = 100; var ScrollBlot = /** @class */function (_super) { __extends(ScrollBlot, _super); function ScrollBlot(node) { var _this = _super.call(this, node) || this; _this.scroll = _this; _this.observer = new MutationObserver(function (mutations) { _this.update(mutations); }); _this.observer.observe(_this.domNode, OBSERVER_CONFIG); _this.attach(); return _this; } ScrollBlot.prototype.detach = function () { _super.prototype.detach.call(this); this.observer.disconnect(); }; ScrollBlot.prototype.deleteAt = function (index, length) { this.update(); if (index === 0 && length === this.length()) { this.children.forEach(function (child) { child.remove(); }); } else { _super.prototype.deleteAt.call(this, index, length); } }; ScrollBlot.prototype.formatAt = function (index, length, name, value) { this.update(); _super.prototype.formatAt.call(this, index, length, name, value); }; ScrollBlot.prototype.insertAt = function (index, value, def) { this.update(); _super.prototype.insertAt.call(this, index, value, def); }; ScrollBlot.prototype.optimize = function (mutations, context) { var _this = this; if (mutations === void 0) { mutations = []; } if (context === void 0) { context = {}; } _super.prototype.optimize.call(this, context); // We must modify mutations directly, cannot make copy and then modify var records = [].slice.call(this.observer.takeRecords()); // Array.push currently seems to be implemented by a non-tail recursive function // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords()); while (records.length > 0) { mutations.push(records.pop()); } // TODO use WeakMap var mark = function mark(blot, markParent) { if (markParent === void 0) { markParent = true; } if (blot == null || blot === _this) return; if (blot.domNode.parentNode == null) return; // @ts-ignore if (blot.domNode[Registry.DATA_KEY].mutations == null) { // @ts-ignore blot.domNode[Registry.DATA_KEY].mutations = []; } if (markParent) mark(blot.parent); }; var optimize = function optimize(blot) { // Post-order traversal if ( // @ts-ignore blot.domNode[Registry.DATA_KEY] == null || // @ts-ignore blot.domNode[Registry.DATA_KEY].mutations == null) { return; } if (blot instanceof container_1.default) { blot.children.forEach(optimize); } blot.optimize(context); }; var remaining = mutations; for (var i = 0; remaining.length > 0; i += 1) { if (i >= MAX_OPTIMIZE_ITERATIONS) { throw new Error('[Parchment] Maximum optimize iterations reached'); } remaining.forEach(function (mutation) { var blot = Registry.find(mutation.target, true); if (blot == null) return; if (blot.domNode === mutation.target) { if (mutation.type === 'childList') { mark(Registry.find(mutation.previousSibling, false)); [].forEach.call(mutation.addedNodes, function (node) { var child = Registry.find(node, false); mark(child, false); if (child instanceof container_1.default) { child.children.forEach(function (grandChild) { mark(grandChild, false); }); } }); } else if (mutation.type === 'attributes') { mark(blot.prev); } } mark(blot); }); this.children.forEach(optimize); remaining = [].slice.call(this.observer.takeRecords()); records = remaining.slice(); while (records.length > 0) { mutations.push(records.pop()); } } }; ScrollBlot.prototype.update = function (mutations, context) { var _this = this; if (context === void 0) { context = {}; } mutations = mutations || this.observer.takeRecords(); // TODO use WeakMap mutations.map(function (mutation) { var blot = Registry.find(mutation.target, true); if (blot == null) return null; // @ts-ignore if (blot.domNode[Registry.DATA_KEY].mutations == null) { // @ts-ignore blot.domNode[Registry.DATA_KEY].mutations = [mutation]; return blot; } else { // @ts-ignore blot.domNode[Registry.DATA_KEY].mutations.push(mutation); return null; } }).forEach(function (blot) { if (blot == null || blot === _this || //@ts-ignore blot.domNode[Registry.DATA_KEY] == null) return; // @ts-ignore blot.update(blot.domNode[Registry.DATA_KEY].mutations || [], context); }); // @ts-ignore if (this.domNode[Registry.DATA_KEY].mutations != null) { // @ts-ignore _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations, context); } this.optimize(mutations, context); }; ScrollBlot.blotName = 'scroll'; ScrollBlot.defaultChild = 'block'; ScrollBlot.scope = Registry.Scope.BLOCK_BLOT; ScrollBlot.tagName = 'DIV'; return ScrollBlot; }(container_1.default); exports.default = ScrollBlot; /***/ }, /* 46 */ /***/function (module, exports, __webpack_require__) { "use strict"; var __extends = this && this.__extends || function () { var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) d[p] = b[p]; } }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); Object.defineProperty(exports, "__esModule", { value: true }); var format_1 = __webpack_require__(18); var Registry = __webpack_require__(1); // Shallow object comparison function isEqual(obj1, obj2) { if (Object.keys(obj1).length !== Object.keys(obj2).length) return false; // @ts-ignore for (var prop in obj1) { // @ts-ignore if (obj1[prop] !== obj2[prop]) return false; } return true; } var InlineBlot = /** @class */function (_super) { __extends(InlineBlot, _super); function InlineBlot() { return _super !== null && _super.apply(this, arguments) || this; } InlineBlot.formats = function (domNode) { if (domNode.tagName === InlineBlot.tagName) return undefined; return _super.formats.call(this, domNode); }; InlineBlot.prototype.format = function (name, value) { var _this = this; if (name === this.statics.blotName && !value) { this.children.forEach(function (child) { if (!(child instanceof format_1.default)) { child = child.wrap(InlineBlot.blotName, true); } _this.attributes.copy(child); }); this.unwrap(); } else { _super.prototype.format.call(this, name, value); } }; InlineBlot.prototype.formatAt = function (index, length, name, value) { if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) { var blot = this.isolate(index, length); blot.format(name, value); } else { _super.prototype.formatAt.call(this, index, length, name, value); } }; InlineBlot.prototype.optimize = function (context) { _super.prototype.optimize.call(this, context); var formats = this.formats(); if (Object.keys(formats).length === 0) { return this.unwrap(); // unformatted span } var next = this.next; if (next instanceof InlineBlot && next.prev === this && isEqual(formats, next.formats())) { next.moveChildren(this); next.remove(); } }; InlineBlot.blotName = 'inline'; InlineBlot.scope = Registry.Scope.INLINE_BLOT; InlineBlot.tagName = 'SPAN'; return InlineBlot; }(format_1.default); exports.default = InlineBlot; /***/ }, /* 47 */ /***/function (module, exports, __webpack_require__) { "use strict"; var __extends = this && this.__extends || function () { var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) d[p] = b[p]; } }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); Object.defineProperty(exports, "__esModule", { value: true }); var format_1 = __webpack_require__(18); var Registry = __webpack_require__(1); var BlockBlot = /** @class */function (_super) { __extends(BlockBlot, _super); function BlockBlot() { return _super !== null && _super.apply(this, arguments) || this; } BlockBlot.formats = function (domNode) { var tagName = Registry.query(BlockBlot.blotName).tagName; if (domNode.tagName === tagName) return undefined; return _super.formats.call(this, domNode); }; BlockBlot.prototype.format = function (name, value) { if (Registry.query(name, Registry.Scope.BLOCK) == null) { return; } else if (name === this.statics.blotName && !value) { this.replaceWith(BlockBlot.blotName); } else { _super.prototype.format.call(this, name, value); } }; BlockBlot.prototype.formatAt = function (index, length, name, value) { if (Registry.query(name, Registry.Scope.BLOCK) != null) { this.format(name, value); } else { _super.prototype.formatAt.call(this, index, length, name, value); } }; BlockBlot.prototype.insertAt = function (index, value, def) { if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) { // Insert text or inline _super.prototype.insertAt.call(this, index, value, def); } else { var after = this.split(index); var blot = Registry.create(value, def); after.parent.insertBefore(blot, after); } }; BlockBlot.prototype.update = function (mutations, context) { if (navigator.userAgent.match(/Trident/)) { this.build(); } else { _super.prototype.update.call(this, mutations, context); } }; BlockBlot.blotName = 'block'; BlockBlot.scope = Registry.Scope.BLOCK_BLOT; BlockBlot.tagName = 'P'; return BlockBlot; }(format_1.default); exports.default = BlockBlot; /***/ }, /* 48 */ /***/function (module, exports, __webpack_require__) { "use strict"; var __extends = this && this.__extends || function () { var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) d[p] = b[p]; } }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); Object.defineProperty(exports, "__esModule", { value: true }); var leaf_1 = __webpack_require__(19); var EmbedBlot = /** @class */function (_super) { __extends(EmbedBlot, _super); function EmbedBlot() { return _super !== null && _super.apply(this, arguments) || this; } EmbedBlot.formats = function (domNode) { return undefined; }; EmbedBlot.prototype.format = function (name, value) { // super.formatAt wraps, which is what we want in general, // but this allows subclasses to overwrite for formats // that just apply to particular embeds _super.prototype.formatAt.call(this, 0, this.length(), name, value); }; EmbedBlot.prototype.formatAt = function (index, length, name, value) { if (index === 0 && length === this.length()) { this.format(name, value); } else { _super.prototype.formatAt.call(this, index, length, name, value); } }; EmbedBlot.prototype.formats = function () { return this.statics.formats(this.domNode); }; return EmbedBlot; }(leaf_1.default); exports.default = EmbedBlot; /***/ }, /* 49 */ /***/function (module, exports, __webpack_require__) { "use strict"; var __extends = this && this.__extends || function () { var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) d[p] = b[p]; } }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); Object.defineProperty(exports, "__esModule", { value: true }); var leaf_1 = __webpack_require__(19); var Registry = __webpack_require__(1); var TextBlot = /** @class */function (_super) { __extends(TextBlot, _super); function TextBlot(node) { var _this = _super.call(this, node) || this; _this.text = _this.statics.value(_this.domNode); return _this; } TextBlot.create = function (value) { return document.createTextNode(value); }; TextBlot.value = function (domNode) { var text = domNode.data; // @ts-ignore if (text['normalize']) text = text['normalize'](); return text; }; TextBlot.prototype.deleteAt = function (index, length) { this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length); }; TextBlot.prototype.index = function (node, offset) { if (this.domNode === node) { return offset; } return -1; }; TextBlot.prototype.insertAt = function (index, value, def) { if (def == null) { this.text = this.text.slice(0, index) + value + this.text.slice(index); this.domNode.data = this.text; } else { _super.prototype.insertAt.call(this, index, value, def); } }; TextBlot.prototype.length = function () { return this.text.length; }; TextBlot.prototype.optimize = function (context) { _super.prototype.optimize.call(this, context); this.text = this.statics.value(this.domNode); if (this.text.length === 0) { this.remove(); } else if (this.next instanceof TextBlot && this.next.prev === this) { this.insertAt(this.length(), this.next.value()); this.next.remove(); } }; TextBlot.prototype.position = function (index, inclusive) { if (inclusive === void 0) { inclusive = false; } return [this.domNode, index]; }; TextBlot.prototype.split = function (index, force) { if (force === void 0) { force = false; } if (!force) { if (index === 0) return this; if (index === this.length()) return this.next; } var after = Registry.create(this.domNode.splitText(index)); this.parent.insertBefore(after, this.next); this.text = this.statics.value(this.domNode); return after; }; TextBlot.prototype.update = function (mutations, context) { var _this = this; if (mutations.some(function (mutation) { return mutation.type === 'characterData' && mutation.target === _this.domNode; })) { this.text = this.statics.value(this.domNode); } }; TextBlot.prototype.value = function () { return this.text; }; TextBlot.blotName = 'text'; TextBlot.scope = Registry.Scope.INLINE_BLOT; return TextBlot; }(leaf_1.default); exports.default = TextBlot; /***/ }, /* 50 */ /***/function (module, exports, __webpack_require__) { "use strict"; var elem = document.createElement('div'); elem.classList.toggle('test-class', false); if (elem.classList.contains('test-class')) { var _toggle = DOMTokenList.prototype.toggle; DOMTokenList.prototype.toggle = function (token, force) { if (arguments.length > 1 && !this.contains(token) === !force) { return force; } else { return _toggle.call(this, token); } }; } if (!String.prototype.startsWith) { String.prototype.startsWith = function (searchString, position) { position = position || 0; return this.substr(position, searchString.length) === searchString; }; } if (!String.prototype.endsWith) { String.prototype.endsWith = function (searchString, position) { var subjectString = this.toString(); if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { position = subjectString.length; } position -= searchString.length; var lastIndex = subjectString.indexOf(searchString, position); return lastIndex !== -1 && lastIndex === position; }; } if (!Array.prototype.find) { Object.defineProperty(Array.prototype, "find", { value: function value(predicate) { if (this === null) { throw new TypeError('Array.prototype.find called on null or undefined'); } if (typeof predicate !== 'function') { throw new TypeError('predicate must be a function'); } var list = Object(this); var length = list.length >>> 0; var thisArg = arguments[1]; var value; for (var i = 0; i < length; i++) { value = list[i]; if (predicate.call(thisArg, value, i, list)) { return value; } } return undefined; } }); } document.addEventListener("DOMContentLoaded", function () { // Disable resizing in Firefox document.execCommand("enableObjectResizing", false, false); // Disable automatic linkifying in IE11 document.execCommand("autoUrlDetect", false, false); }); /***/ }, /* 51 */ /***/function (module, exports) { /** * This library modifies the diff-patch-match library by Neil Fraser * by removing the patch and match functionality and certain advanced * options in the diff function. The original license is as follows: * * === * * Diff Match and Patch * * Copyright 2006 Google Inc. * http://code.google.com/p/google-diff-match-patch/ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * The data structure representing a diff is an array of tuples: * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']] * which means: delete 'Hello', add 'Goodbye' and keep ' world.' */ var DIFF_DELETE = -1; var DIFF_INSERT = 1; var DIFF_EQUAL = 0; /** * Find the differences between two texts. Simplifies the problem by stripping * any common prefix or suffix off the texts before diffing. * @param {string} text1 Old string to be diffed. * @param {string} text2 New string to be diffed. * @param {Int} cursor_pos Expected edit position in text1 (optional) * @return {Array} Array of diff tuples. */ function diff_main(text1, text2, cursor_pos) { // Check for equality (speedup). if (text1 == text2) { if (text1) { return [[DIFF_EQUAL, text1]]; } return []; } // Check cursor_pos within bounds if (cursor_pos < 0 || text1.length < cursor_pos) { cursor_pos = null; } // Trim off common prefix (speedup). var commonlength = diff_commonPrefix(text1, text2); var commonprefix = text1.substring(0, commonlength); text1 = text1.substring(commonlength); text2 = text2.substring(commonlength); // Trim off common suffix (speedup). commonlength = diff_commonSuffix(text1, text2); var commonsuffix = text1.substring(text1.length - commonlength); text1 = text1.substring(0, text1.length - commonlength); text2 = text2.substring(0, text2.length - commonlength); // Compute the diff on the middle block. var diffs = diff_compute_(text1, text2); // Restore the prefix and suffix. if (commonprefix) { diffs.unshift([DIFF_EQUAL, commonprefix]); } if (commonsuffix) { diffs.push([DIFF_EQUAL, commonsuffix]); } diff_cleanupMerge(diffs); if (cursor_pos != null) { diffs = fix_cursor(diffs, cursor_pos); } diffs = fix_emoji(diffs); return diffs; }; /** * Find the differences between two texts. Assumes that the texts do not * have any common prefix or suffix. * @param {string} text1 Old string to be diffed. * @param {string} text2 New string to be diffed. * @return {Array} Array of diff tuples. */ function diff_compute_(text1, text2) { var diffs; if (!text1) { // Just add some text (speedup). return [[DIFF_INSERT, text2]]; } if (!text2) { // Just delete some text (speedup). return [[DIFF_DELETE, text1]]; } var longtext = text1.length > text2.length ? text1 : text2; var shorttext = text1.length > text2.length ? text2 : text1; var i = longtext.indexOf(shorttext); if (i != -1) { // Shorter text is inside the longer text (speedup). diffs = [[DIFF_INSERT, longtext.substring(0, i)], [DIFF_EQUAL, shorttext], [DIFF_INSERT, longtext.substring(i + shorttext.length)]]; // Swap insertions for deletions if diff is reversed. if (text1.length > text2.length) { diffs[0][0] = diffs[2][0] = DIFF_DELETE; } return diffs; } if (shorttext.length == 1) { // Single character string. // After the previous speedup, the character can't be an equality. return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; } // Check to see if the problem can be split in two. var hm = diff_halfMatch_(text1, text2); if (hm) { // A half-match was found, sort out the return data. var text1_a = hm[0]; var text1_b = hm[1]; var text2_a = hm[2]; var text2_b = hm[3]; var mid_common = hm[4]; // Send both pairs off for separate processing. var diffs_a = diff_main(text1_a, text2_a); var diffs_b = diff_main(text1_b, text2_b); // Merge the results. return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b); } return diff_bisect_(text1, text2); }; /** * Find the 'middle snake' of a diff, split the problem in two * and return the recursively constructed diff. * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations. * @param {string} text1 Old string to be diffed. * @param {string} text2 New string to be diffed. * @return {Array} Array of diff tuples. * @private */ function diff_bisect_(text1, text2) { // Cache the text lengths to prevent multiple calls. var text1_length = text1.length; var text2_length = text2.length; var max_d = Math.ceil((text1_length + text2_length) / 2); var v_offset = max_d; var v_length = 2 * max_d; var v1 = new Array(v_length); var v2 = new Array(v_length); // Setting all elements to -1 is faster in Chrome & Firefox than mixing // integers and undefined. for (var x = 0; x < v_length; x++) { v1[x] = -1; v2[x] = -1; } v1[v_offset + 1] = 0; v2[v_offset + 1] = 0; var delta = text1_length - text2_length; // If the total number of characters is odd, then the front path will collide // with the reverse path. var front = delta % 2 != 0; // Offsets for start and end of k loop. // Prevents mapping of space beyond the grid. var k1start = 0; var k1end = 0; var k2start = 0; var k2end = 0; for (var d = 0; d < max_d; d++) { // Walk the front path one step. for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) { var k1_offset = v_offset + k1; var x1; if (k1 == -d || k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1]) { x1 = v1[k1_offset + 1]; } else { x1 = v1[k1_offset - 1] + 1; } var y1 = x1 - k1; while (x1 < text1_length && y1 < text2_length && text1.charAt(x1) == text2.charAt(y1)) { x1++; y1++; } v1[k1_offset] = x1; if (x1 > text1_length) { // Ran off the right of the graph. k1end += 2; } else if (y1 > text2_length) { // Ran off the bottom of the graph. k1start += 2; } else if (front) { var k2_offset = v_offset + delta - k1; if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) { // Mirror x2 onto top-left coordinate system. var x2 = text1_length - v2[k2_offset]; if (x1 >= x2) { // Overlap detected. return diff_bisectSplit_(text1, text2, x1, y1); } } } } // Walk the reverse path one step. for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) { var k2_offset = v_offset + k2; var x2; if (k2 == -d || k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1]) { x2 = v2[k2_offset + 1]; } else { x2 = v2[k2_offset - 1] + 1; } var y2 = x2 - k2; while (x2 < text1_length && y2 < text2_length && text1.charAt(text1_length - x2 - 1) == text2.charAt(text2_length - y2 - 1)) { x2++; y2++; } v2[k2_offset] = x2; if (x2 > text1_length) { // Ran off the left of the graph. k2end += 2; } else if (y2 > text2_length) { // Ran off the top of the graph. k2start += 2; } else if (!front) { var k1_offset = v_offset + delta - k2; if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) { var x1 = v1[k1_offset]; var y1 = v_offset + x1 - k1_offset; // Mirror x2 onto top-left coordinate system. x2 = text1_length - x2; if (x1 >= x2) { // Overlap detected. return diff_bisectSplit_(text1, text2, x1, y1); } } } } } // Diff took too long and hit the deadline or // number of diffs equals number of characters, no commonality at all. return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; }; /** * Given the location of the 'middle snake', split the diff in two parts * and recurse. * @param {string} text1 Old string to be diffed. * @param {string} text2 New string to be diffed. * @param {number} x Index of split point in text1. * @param {number} y Index of split point in text2. * @return {Array} Array of diff tuples. */ function diff_bisectSplit_(text1, text2, x, y) { var text1a = text1.substring(0, x); var text2a = text2.substring(0, y); var text1b = text1.substring(x); var text2b = text2.substring(y); // Compute both diffs serially. var diffs = diff_main(text1a, text2a); var diffsb = diff_main(text1b, text2b); return diffs.concat(diffsb); }; /** * Determine the common prefix of two strings. * @param {string} text1 First string. * @param {string} text2 Second string. * @return {number} The number of characters common to the start of each * string. */ function diff_commonPrefix(text1, text2) { // Quick check for common null cases. if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) { return 0; } // Binary search. // Performance analysis: http://neil.fraser.name/news/2007/10/09/ var pointermin = 0; var pointermax = Math.min(text1.length, text2.length); var pointermid = pointermax; var pointerstart = 0; while (pointermin < pointermid) { if (text1.substring(pointerstart, pointermid) == text2.substring(pointerstart, pointermid)) { pointermin = pointermid; pointerstart = pointermin; } else { pointermax = pointermid; } pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); } return pointermid; }; /** * Determine the common suffix of two strings. * @param {string} text1 First string. * @param {string} text2 Second string. * @return {number} The number of characters common to the end of each string. */ function diff_commonSuffix(text1, text2) { // Quick check for common null cases. if (!text1 || !text2 || text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) { return 0; } // Binary search. // Performance analysis: http://neil.fraser.name/news/2007/10/09/ var pointermin = 0; var pointermax = Math.min(text1.length, text2.length); var pointermid = pointermax; var pointerend = 0; while (pointermin < pointermid) { if (text1.substring(text1.length - pointermid, text1.length - pointerend) == text2.substring(text2.length - pointermid, text2.length - pointerend)) { pointermin = pointermid; pointerend = pointermin; } else { pointermax = pointermid; } pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); } return pointermid; }; /** * Do the two texts share a substring which is at least half the length of the * longer text? * This speedup can produce non-minimal diffs. * @param {string} text1 First string. * @param {string} text2 Second string. * @return {Array.<string>} Five element Array, containing the prefix of * text1, the suffix of text1, the prefix of text2, the suffix of * text2 and the common middle. Or null if there was no match. */ function diff_halfMatch_(text1, text2) { var longtext = text1.length > text2.length ? text1 : text2; var shorttext = text1.length > text2.length ? text2 : text1; if (longtext.length < 4 || shorttext.length * 2 < longtext.length) { return null; // Pointless. } /** * Does a substring of shorttext exist within longtext such that the substring * is at least half the length of longtext? * Closure, but does not reference any external variables. * @param {string} longtext Longer string. * @param {string} shorttext Shorter string. * @param {number} i Start index of quarter length substring within longtext. * @return {Array.<string>} Five element Array, containing the prefix of * longtext, the suffix of longtext, the prefix of shorttext, the suffix * of shorttext and the common middle. Or null if there was no match. * @private */ function diff_halfMatchI_(longtext, shorttext, i) { // Start with a 1/4 length substring at position i as a seed. var seed = longtext.substring(i, i + Math.floor(longtext.length / 4)); var j = -1; var best_common = ''; var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b; while ((j = shorttext.indexOf(seed, j + 1)) != -1) { var prefixLength = diff_commonPrefix(longtext.substring(i), shorttext.substring(j)); var suffixLength = diff_commonSuffix(longtext.substring(0, i), shorttext.substring(0, j)); if (best_common.length < suffixLength + prefixLength) { best_common = shorttext.substring(j - suffixLength, j) + shorttext.substring(j, j + prefixLength); best_longtext_a = longtext.substring(0, i - suffixLength); best_longtext_b = longtext.substring(i + prefixLength); best_shorttext_a = shorttext.substring(0, j - suffixLength); best_shorttext_b = shorttext.substring(j + prefixLength); } } if (best_common.length * 2 >= longtext.length) { return [best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b, best_common]; } else { return null; } } // First check if the second quarter is the seed for a half-match. var hm1 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 4)); // Check again based on the third quarter. var hm2 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 2)); var hm; if (!hm1 && !hm2) { return null; } else if (!hm2) { hm = hm1; } else if (!hm1) { hm = hm2; } else { // Both matched. Select the longest. hm = hm1[4].length > hm2[4].length ? hm1 : hm2; } // A half-match was found, sort out the return data. var text1_a, text1_b, text2_a, text2_b; if (text1.length > text2.length) { text1_a = hm[0]; text1_b = hm[1]; text2_a = hm[2]; text2_b = hm[3]; } else { text2_a = hm[0]; text2_b = hm[1]; text1_a = hm[2]; text1_b = hm[3]; } var mid_common = hm[4]; return [text1_a, text1_b, text2_a, text2_b, mid_common]; }; /** * Reorder and merge like edit sections. Merge equalities. * Any edit section can move as long as it doesn't cross an equality. * @param {Array} diffs Array of diff tuples. */ function diff_cleanupMerge(diffs) { diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end. var pointer = 0; var count_delete = 0; var count_insert = 0; var text_delete = ''; var text_insert = ''; var commonlength; while (pointer < diffs.length) { switch (diffs[pointer][0]) { case DIFF_INSERT: count_insert++; text_insert += diffs[pointer][1]; pointer++; break; case DIFF_DELETE: count_delete++; text_delete += diffs[pointer][1]; pointer++; break; case DIFF_EQUAL: // Upon reaching an equality, check for prior redundancies. if (count_delete + count_insert > 1) { if (count_delete !== 0 && count_insert !== 0) { // Factor out any common prefixies. commonlength = diff_commonPrefix(text_insert, text_delete); if (commonlength !== 0) { if (pointer - count_delete - count_insert > 0 && diffs[pointer - count_delete - count_insert - 1][0] == DIFF_EQUAL) { diffs[pointer - count_delete - count_insert - 1][1] += text_insert.substring(0, commonlength); } else { diffs.splice(0, 0, [DIFF_EQUAL, text_insert.substring(0, commonlength)]); pointer++; } text_insert = text_insert.substring(commonlength); text_delete = text_delete.substring(commonlength); } // Factor out any common suffixies. commonlength = diff_commonSuffix(text_insert, text_delete); if (commonlength !== 0) { diffs[pointer][1] = text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1]; text_insert = text_insert.substring(0, text_insert.length - commonlength); text_delete = text_delete.substring(0, text_delete.length - commonlength); } } // Delete the offending records and add the merged ones. if (count_delete === 0) { diffs.splice(pointer - count_insert, count_delete + count_insert, [DIFF_INSERT, text_insert]); } else if (count_insert === 0) { diffs.splice(pointer - count_delete, count_delete + count_insert, [DIFF_DELETE, text_delete]); } else { diffs.splice(pointer - count_delete - count_insert, count_delete + count_insert, [DIFF_DELETE, text_delete], [DIFF_INSERT, text_insert]); } pointer = pointer - count_delete - count_insert + (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1; } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) { // Merge this equality with the previous one. diffs[pointer - 1][1] += diffs[pointer][1]; diffs.splice(pointer, 1); } else { pointer++; } count_insert = 0; count_delete = 0; text_delete = ''; text_insert = ''; break; } } if (diffs[diffs.length - 1][1] === '') { diffs.pop(); // Remove the dummy entry at the end. } // Second pass: look for single edits surrounded on both sides by equalities // which can be shifted sideways to eliminate an equality. // e.g: A<ins>BA</ins>C -> <ins>AB</ins>AC var changes = false; pointer = 1; // Intentionally ignore the first and last element (don't need checking). while (pointer < diffs.length - 1) { if (diffs[pointer - 1][0] == DIFF_EQUAL && diffs[pointer + 1][0] == DIFF_EQUAL) { // This is a single edit surrounded by equalities. if (diffs[pointer][1].substring(diffs[pointer][1].length - diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) { // Shift the edit over the previous equality. diffs[pointer][1] = diffs[pointer - 1][1] + diffs[pointer][1].substring(0, diffs[pointer][1].length - diffs[pointer - 1][1].length); diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1]; diffs.splice(pointer - 1, 1); changes = true; } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == diffs[pointer + 1][1]) { // Shift the edit over the next equality. diffs[pointer - 1][1] += diffs[pointer + 1][1]; diffs[pointer][1] = diffs[pointer][1].substring(diffs[pointer + 1][1].length) + diffs[pointer + 1][1]; diffs.splice(pointer + 1, 1); changes = true; } } pointer++; } // If shifts were made, the diff needs reordering and another shift sweep. if (changes) { diff_cleanupMerge(diffs); } }; var diff = diff_main; diff.INSERT = DIFF_INSERT; diff.DELETE = DIFF_DELETE; diff.EQUAL = DIFF_EQUAL; module.exports = diff; /* * Modify a diff such that the cursor position points to the start of a change: * E.g. * cursor_normalize_diff([[DIFF_EQUAL, 'abc']], 1) * => [1, [[DIFF_EQUAL, 'a'], [DIFF_EQUAL, 'bc']]] * cursor_normalize_diff([[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xyz']], 2) * => [2, [[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xy'], [DIFF_DELETE, 'z']]] * * @param {Array} diffs Array of diff tuples * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds! * @return {Array} A tuple [cursor location in the modified diff, modified diff] */ function cursor_normalize_diff(diffs, cursor_pos) { if (cursor_pos === 0) { return [DIFF_EQUAL, diffs]; } for (var current_pos = 0, i = 0; i < diffs.length; i++) { var d = diffs[i]; if (d[0] === DIFF_DELETE || d[0] === DIFF_EQUAL) { var next_pos = current_pos + d[1].length; if (cursor_pos === next_pos) { return [i + 1, diffs]; } else if (cursor_pos < next_pos) { // copy to prevent side effects diffs = diffs.slice(); // split d into two diff changes var split_pos = cursor_pos - current_pos; var d_left = [d[0], d[1].slice(0, split_pos)]; var d_right = [d[0], d[1].slice(split_pos)]; diffs.splice(i, 1, d_left, d_right); return [i + 1, diffs]; } else { current_pos = next_pos; } } } throw new Error('cursor_pos is out of bounds!'); } /* * Modify a diff such that the edit position is "shifted" to the proposed edit location (cursor_position). * * Case 1) * Check if a naive shift is possible: * [0, X], [ 1, Y] -> [ 1, Y], [0, X] (if X + Y === Y + X) * [0, X], [-1, Y] -> [-1, Y], [0, X] (if X + Y === Y + X) - holds same result * Case 2) * Check if the following shifts are possible: * [0, 'pre'], [ 1, 'prefix'] -> [ 1, 'pre'], [0, 'pre'], [ 1, 'fix'] * [0, 'pre'], [-1, 'prefix'] -> [-1, 'pre'], [0, 'pre'], [-1, 'fix'] * ^ ^ * d d_next * * @param {Array} diffs Array of diff tuples * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds! * @return {Array} Array of diff tuples */ function fix_cursor(diffs, cursor_pos) { var norm = cursor_normalize_diff(diffs, cursor_pos); var ndiffs = norm[1]; var cursor_pointer = norm[0]; var d = ndiffs[cursor_pointer]; var d_next = ndiffs[cursor_pointer + 1]; if (d == null) { // Text was deleted from end of original string, // cursor is now out of bounds in new string return diffs; } else if (d[0] !== DIFF_EQUAL) { // A modification happened at the cursor location. // This is the expected outcome, so we can return the original diff. return diffs; } else { if (d_next != null && d[1] + d_next[1] === d_next[1] + d[1]) { // Case 1) // It is possible to perform a naive shift ndiffs.splice(cursor_pointer, 2, d_next, d); return merge_tuples(ndiffs, cursor_pointer, 2); } else if (d_next != null && d_next[1].indexOf(d[1]) === 0) { // Case 2) // d[1] is a prefix of d_next[1] // We can assume that d_next[0] !== 0, since d[0] === 0 // Shift edit locations.. ndiffs.splice(cursor_pointer, 2, [d_next[0], d[1]], [0, d[1]]); var suffix = d_next[1].slice(d[1].length); if (suffix.length > 0) { ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]); } return merge_tuples(ndiffs, cursor_pointer, 3); } else { // Not possible to perform any modification return diffs; } } } /* * Check diff did not split surrogate pairs. * Ex. [0, '\uD83D'], [-1, '\uDC36'], [1, '\uDC2F'] -> [-1, '\uD83D\uDC36'], [1, '\uD83D\uDC2F'] * '\uD83D\uDC36' === '🐶', '\uD83D\uDC2F' === '🐯' * * @param {Array} diffs Array of diff tuples * @return {Array} Array of diff tuples */ function fix_emoji(diffs) { var compact = false; var starts_with_pair_end = function starts_with_pair_end(str) { return str.charCodeAt(0) >= 0xDC00 && str.charCodeAt(0) <= 0xDFFF; }; var ends_with_pair_start = function ends_with_pair_start(str) { return str.charCodeAt(str.length - 1) >= 0xD800 && str.charCodeAt(str.length - 1) <= 0xDBFF; }; for (var i = 2; i < diffs.length; i += 1) { if (diffs[i - 2][0] === DIFF_EQUAL && ends_with_pair_start(diffs[i - 2][1]) && diffs[i - 1][0] === DIFF_DELETE && starts_with_pair_end(diffs[i - 1][1]) && diffs[i][0] === DIFF_INSERT && starts_with_pair_end(diffs[i][1])) { compact = true; diffs[i - 1][1] = diffs[i - 2][1].slice(-1) + diffs[i - 1][1]; diffs[i][1] = diffs[i - 2][1].slice(-1) + diffs[i][1]; diffs[i - 2][1] = diffs[i - 2][1].slice(0, -1); } } if (!compact) { return diffs; } var fixed_diffs = []; for (var i = 0; i < diffs.length; i += 1) { if (diffs[i][1].length > 0) { fixed_diffs.push(diffs[i]); } } return fixed_diffs; } /* * Try to merge tuples with their neigbors in a given range. * E.g. [0, 'a'], [0, 'b'] -> [0, 'ab'] * * @param {Array} diffs Array of diff tuples. * @param {Int} start Position of the first element to merge (diffs[start] is also merged with diffs[start - 1]). * @param {Int} length Number of consecutive elements to check. * @return {Array} Array of merged diff tuples. */ function merge_tuples(diffs, start, length) { // Check from (start-1) to (start+length). for (var i = start + length - 1; i >= 0 && i >= start - 1; i--) { if (i + 1 < diffs.length) { var left_d = diffs[i]; var right_d = diffs[i + 1]; if (left_d[0] === right_d[1]) { diffs.splice(i, 2, [left_d[0], left_d[1] + right_d[1]]); } } } return diffs; } /***/ }, /* 52 */ /***/function (module, exports) { exports = module.exports = typeof Object.keys === 'function' ? Object.keys : shim; exports.shim = shim; function shim(obj) { var keys = []; for (var key in obj) { keys.push(key); }return keys; } /***/ }, /* 53 */ /***/function (module, exports) { var supportsArgumentsClass = function () { return Object.prototype.toString.call(arguments); }() == '[object Arguments]'; exports = module.exports = supportsArgumentsClass ? supported : unsupported; exports.supported = supported; function supported(object) { return Object.prototype.toString.call(object) == '[object Arguments]'; }; exports.unsupported = unsupported; function unsupported(object) { return object && (typeof object === 'undefined' ? 'undefined' : _typeof2(object)) == 'object' && typeof object.length == 'number' && Object.prototype.hasOwnProperty.call(object, 'callee') && !Object.prototype.propertyIsEnumerable.call(object, 'callee') || false; }; /***/ }, /* 54 */ /***/function (module, exports) { 'use strict'; var has = Object.prototype.hasOwnProperty, prefix = '~'; /** * Constructor to create a storage for our `EE` objects. * An `Events` instance is a plain object whose properties are event names. * * @constructor * @api private */ function Events() {} // // We try to not inherit from `Object.prototype`. In some engines creating an // instance in this way is faster than calling `Object.create(null)` directly. // If `Object.create(null)` is not supported we prefix the event names with a // character to make sure that the built-in object properties are not // overridden or used as an attack vector. // if (Object.create) { Events.prototype = Object.create(null); // // This hack is needed because the `__proto__` property is still inherited in // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. // if (!new Events().__proto__) prefix = false; } /** * Representation of a single event listener. * * @param {Function} fn The listener function. * @param {Mixed} context The context to invoke the listener with. * @param {Boolean} [once=false] Specify if the listener is a one-time listener. * @constructor * @api private */ function EE(fn, context, once) { this.fn = fn; this.context = context; this.once = once || false; } /** * Minimal `EventEmitter` interface that is molded against the Node.js * `EventEmitter` interface. * * @constructor * @api public */ function EventEmitter() { this._events = new Events(); this._eventsCount = 0; } /** * Return an array listing the events for which the emitter has registered * listeners. * * @returns {Array} * @api public */ EventEmitter.prototype.eventNames = function eventNames() { var names = [], events, name; if (this._eventsCount === 0) return names; for (name in events = this._events) { if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); } if (Object.getOwnPropertySymbols) { return names.concat(Object.getOwnPropertySymbols(events)); } return names; }; /** * Return the listeners registered for a given event. * * @param {String|Symbol} event The event name. * @param {Boolean} exists Only check if there are listeners. * @returns {Array|Boolean} * @api public */ EventEmitter.prototype.listeners = function listeners(event, exists) { var evt = prefix ? prefix + event : event, available = this._events[evt]; if (exists) return !!available; if (!available) return []; if (available.fn) return [available.fn]; for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) { ee[i] = available[i].fn; } return ee; }; /** * Calls each of the listeners registered for a given event. * * @param {String|Symbol} event The event name. * @returns {Boolean} `true` if the event had listeners, else `false`. * @api public */ EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { var evt = prefix ? prefix + event : event; if (!this._events[evt]) return false; var listeners = this._events[evt], len = arguments.length, args, i; if (listeners.fn) { if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); switch (len) { case 1: return listeners.fn.call(listeners.context), true; case 2: return listeners.fn.call(listeners.context, a1), true; case 3: return listeners.fn.call(listeners.context, a1, a2), true; case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; } for (i = 1, args = new Array(len - 1); i < len; i++) { args[i - 1] = arguments[i]; } listeners.fn.apply(listeners.context, args); } else { var length = listeners.length, j; for (i = 0; i < length; i++) { if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); switch (len) { case 1: listeners[i].fn.call(listeners[i].context);break; case 2: listeners[i].fn.call(listeners[i].context, a1);break; case 3: listeners[i].fn.call(listeners[i].context, a1, a2);break; case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3);break; default: if (!args) for (j = 1, args = new Array(len - 1); j < len; j++) { args[j - 1] = arguments[j]; } listeners[i].fn.apply(listeners[i].context, args); } } } return true; }; /** * Add a listener for a given event. * * @param {String|Symbol} event The event name. * @param {Function} fn The listener function. * @param {Mixed} [context=this] The context to invoke the listener with. * @returns {EventEmitter} `this`. * @api public */ EventEmitter.prototype.on = function on(event, fn, context) { var listener = new EE(fn, context || this), evt = prefix ? prefix + event : event; if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;else if (!this._events[evt].fn) this._events[evt].push(listener);else this._events[evt] = [this._events[evt], listener]; return this; }; /** * Add a one-time listener for a given event. * * @param {String|Symbol} event The event name. * @param {Function} fn The listener function. * @param {Mixed} [context=this] The context to invoke the listener with. * @returns {EventEmitter} `this`. * @api public */ EventEmitter.prototype.once = function once(event, fn, context) { var listener = new EE(fn, context || this, true), evt = prefix ? prefix + event : event; if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;else if (!this._events[evt].fn) this._events[evt].push(listener);else this._events[evt] = [this._events[evt], listener]; return this; }; /** * Remove the listeners of a given event. * * @param {String|Symbol} event The event name. * @param {Function} fn Only remove the listeners that match this function. * @param {Mixed} context Only remove the listeners that have this context. * @param {Boolean} once Only remove one-time listeners. * @returns {EventEmitter} `this`. * @api public */ EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { var evt = prefix ? prefix + event : event; if (!this._events[evt]) return this; if (!fn) { if (--this._eventsCount === 0) this._events = new Events();else delete this._events[evt]; return this; } var listeners = this._events[evt]; if (listeners.fn) { if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) { if (--this._eventsCount === 0) this._events = new Events();else delete this._events[evt]; } } else { for (var i = 0, events = [], length = listeners.length; i < length; i++) { if (listeners[i].fn !== fn || once && !listeners[i].once || context && listeners[i].context !== context) { events.push(listeners[i]); } } // // Reset the array, or remove it completely if we have no more listeners. // if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;else if (--this._eventsCount === 0) this._events = new Events();else delete this._events[evt]; } return this; }; /** * Remove all listeners, or those of the specified event. * * @param {String|Symbol} [event] The event name. * @returns {EventEmitter} `this`. * @api public */ EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { var evt; if (event) { evt = prefix ? prefix + event : event; if (this._events[evt]) { if (--this._eventsCount === 0) this._events = new Events();else delete this._events[evt]; } } else { this._events = new Events(); this._eventsCount = 0; } return this; }; // // Alias methods names because people roll like that. // EventEmitter.prototype.off = EventEmitter.prototype.removeListener; EventEmitter.prototype.addListener = EventEmitter.prototype.on; // // This function doesn't apply anymore. // EventEmitter.prototype.setMaxListeners = function setMaxListeners() { return this; }; // // Expose the prefix. // EventEmitter.prefixed = prefix; // // Allow `EventEmitter` to be imported as module namespace. // EventEmitter.EventEmitter = EventEmitter; // // Expose the module. // if ('undefined' !== typeof module) { module.exports = EventEmitter; } /***/ }, /* 55 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.matchText = exports.matchSpacing = exports.matchNewline = exports.matchBlot = exports.matchAttributor = exports.default = undefined; var _typeof = typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol" ? function (obj) { return typeof obj === 'undefined' ? 'undefined' : _typeof2(obj); } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === 'undefined' ? 'undefined' : _typeof2(obj); }; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [];var _n = true;var _d = false;var _e = undefined;try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value);if (i && _arr.length === i) break; } } catch (err) { _d = true;_e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } }return _arr; }return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _extend2 = __webpack_require__(3); var _extend3 = _interopRequireDefault(_extend2); var _quillDelta = __webpack_require__(2); var _quillDelta2 = _interopRequireDefault(_quillDelta); var _parchment = __webpack_require__(0); var _parchment2 = _interopRequireDefault(_parchment); var _quill = __webpack_require__(5); var _quill2 = _interopRequireDefault(_quill); var _logger = __webpack_require__(10); var _logger2 = _interopRequireDefault(_logger); var _module = __webpack_require__(9); var _module2 = _interopRequireDefault(_module); var _align = __webpack_require__(36); var _background = __webpack_require__(37); var _code = __webpack_require__(13); var _code2 = _interopRequireDefault(_code); var _color = __webpack_require__(26); var _direction = __webpack_require__(38); var _font = __webpack_require__(39); var _size = __webpack_require__(40); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; }return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var debug = (0, _logger2.default)('quill:clipboard'); var DOM_KEY = '__ql-matcher'; var CLIPBOARD_CONFIG = [[Node.TEXT_NODE, matchText], [Node.TEXT_NODE, matchNewline], ['br', matchBreak], [Node.ELEMENT_NODE, matchNewline], [Node.ELEMENT_NODE, matchBlot], [Node.ELEMENT_NODE, matchSpacing], [Node.ELEMENT_NODE, matchAttributor], [Node.ELEMENT_NODE, matchStyles], ['li', matchIndent], ['b', matchAlias.bind(matchAlias, 'bold')], ['i', matchAlias.bind(matchAlias, 'italic')], ['style', matchIgnore]]; var ATTRIBUTE_ATTRIBUTORS = [_align.AlignAttribute, _direction.DirectionAttribute].reduce(function (memo, attr) { memo[attr.keyName] = attr; return memo; }, {}); var STYLE_ATTRIBUTORS = [_align.AlignStyle, _background.BackgroundStyle, _color.ColorStyle, _direction.DirectionStyle, _font.FontStyle, _size.SizeStyle].reduce(function (memo, attr) { memo[attr.keyName] = attr; return memo; }, {}); var Clipboard = function (_Module) { _inherits(Clipboard, _Module); function Clipboard(quill, options) { _classCallCheck(this, Clipboard); var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this, quill, options)); _this.quill.root.addEventListener('paste', _this.onPaste.bind(_this)); _this.container = _this.quill.addContainer('ql-clipboard'); _this.container.setAttribute('contenteditable', true); _this.container.setAttribute('tabindex', -1); _this.matchers = []; CLIPBOARD_CONFIG.concat(_this.options.matchers).forEach(function (_ref) { var _ref2 = _slicedToArray(_ref, 2), selector = _ref2[0], matcher = _ref2[1]; if (!options.matchVisual && matcher === matchSpacing) return; _this.addMatcher(selector, matcher); }); return _this; } _createClass(Clipboard, [{ key: 'addMatcher', value: function addMatcher(selector, matcher) { this.matchers.push([selector, matcher]); } }, { key: 'convert', value: function convert(html) { if (typeof html === 'string') { this.container.innerHTML = html.replace(/\>\r?\n +\</g, '><'); // Remove spaces between tags return this.convert(); } var formats = this.quill.getFormat(this.quill.selection.savedRange.index); if (formats[_code2.default.blotName]) { var text = this.container.innerText; this.container.innerHTML = ''; return new _quillDelta2.default().insert(text, _defineProperty({}, _code2.default.blotName, formats[_code2.default.blotName])); } var _prepareMatching = this.prepareMatching(), _prepareMatching2 = _slicedToArray(_prepareMatching, 2), elementMatchers = _prepareMatching2[0], textMatchers = _prepareMatching2[1]; var delta = traverse(this.container, elementMatchers, textMatchers); // Remove trailing newline if (deltaEndsWith(delta, '\n') && delta.ops[delta.ops.length - 1].attributes == null) { delta = delta.compose(new _quillDelta2.default().retain(delta.length() - 1).delete(1)); } debug.log('convert', this.container.innerHTML, delta); this.container.innerHTML = ''; return delta; } }, { key: 'dangerouslyPasteHTML', value: function dangerouslyPasteHTML(index, html) { var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _quill2.default.sources.API; if (typeof index === 'string') { this.quill.setContents(this.convert(index), html); this.quill.setSelection(0, _quill2.default.sources.SILENT); } else { var paste = this.convert(html); this.quill.updateContents(new _quillDelta2.default().retain(index).concat(paste), source); this.quill.setSelection(index + paste.length(), _quill2.default.sources.SILENT); } } }, { key: 'onPaste', value: function onPaste(e) { var _this2 = this; if (e.defaultPrevented || !this.quill.isEnabled()) return; var range = this.quill.getSelection(); var delta = new _quillDelta2.default().retain(range.index); var scrollTop = this.quill.scrollingContainer.scrollTop; this.container.focus(); this.quill.selection.update(_quill2.default.sources.SILENT); setTimeout(function () { delta = delta.concat(_this2.convert()).delete(range.length); _this2.quill.updateContents(delta, _quill2.default.sources.USER); // range.length contributes to delta.length() _this2.quill.setSelection(delta.length() - range.length, _quill2.default.sources.SILENT); _this2.quill.scrollingContainer.scrollTop = scrollTop; _this2.quill.focus(); }, 1); } }, { key: 'prepareMatching', value: function prepareMatching() { var _this3 = this; var elementMatchers = [], textMatchers = []; this.matchers.forEach(function (pair) { var _pair = _slicedToArray(pair, 2), selector = _pair[0], matcher = _pair[1]; switch (selector) { case Node.TEXT_NODE: textMatchers.push(matcher); break; case Node.ELEMENT_NODE: elementMatchers.push(matcher); break; default: [].forEach.call(_this3.container.querySelectorAll(selector), function (node) { // TODO use weakmap node[DOM_KEY] = node[DOM_KEY] || []; node[DOM_KEY].push(matcher); }); break; } }); return [elementMatchers, textMatchers]; } }]); return Clipboard; }(_module2.default); Clipboard.DEFAULTS = { matchers: [], matchVisual: true }; function applyFormat(delta, format, value) { if ((typeof format === 'undefined' ? 'undefined' : _typeof(format)) === 'object') { return Object.keys(format).reduce(function (delta, key) { return applyFormat(delta, key, format[key]); }, delta); } else { return delta.reduce(function (delta, op) { if (op.attributes && op.attributes[format]) { return delta.push(op); } else { return delta.insert(op.insert, (0, _extend3.default)({}, _defineProperty({}, format, value), op.attributes)); } }, new _quillDelta2.default()); } } function computeStyle(node) { if (node.nodeType !== Node.ELEMENT_NODE) return {}; var DOM_KEY = '__ql-computed-style'; return node[DOM_KEY] || (node[DOM_KEY] = window.getComputedStyle(node)); } function deltaEndsWith(delta, text) { var endText = ""; for (var i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) { var op = delta.ops[i]; if (typeof op.insert !== 'string') break; endText = op.insert + endText; } return endText.slice(-1 * text.length) === text; } function isLine(node) { if (node.childNodes.length === 0) return false; // Exclude embed blocks var style = computeStyle(node); return ['block', 'list-item'].indexOf(style.display) > -1; } function traverse(node, elementMatchers, textMatchers) { // Post-order if (node.nodeType === node.TEXT_NODE) { return textMatchers.reduce(function (delta, matcher) { return matcher(node, delta); }, new _quillDelta2.default()); } else if (node.nodeType === node.ELEMENT_NODE) { return [].reduce.call(node.childNodes || [], function (delta, childNode) { var childrenDelta = traverse(childNode, elementMatchers, textMatchers); if (childNode.nodeType === node.ELEMENT_NODE) { childrenDelta = elementMatchers.reduce(function (childrenDelta, matcher) { return matcher(childNode, childrenDelta); }, childrenDelta); childrenDelta = (childNode[DOM_KEY] || []).reduce(function (childrenDelta, matcher) { return matcher(childNode, childrenDelta); }, childrenDelta); } return delta.concat(childrenDelta); }, new _quillDelta2.default()); } else { return new _quillDelta2.default(); } } function matchAlias(format, node, delta) { return applyFormat(delta, format, true); } function matchAttributor(node, delta) { var attributes = _parchment2.default.Attributor.Attribute.keys(node); var classes = _parchment2.default.Attributor.Class.keys(node); var styles = _parchment2.default.Attributor.Style.keys(node); var formats = {}; attributes.concat(classes).concat(styles).forEach(function (name) { var attr = _parchment2.default.query(name, _parchment2.default.Scope.ATTRIBUTE); if (attr != null) { formats[attr.attrName] = attr.value(node); if (formats[attr.attrName]) return; } attr = ATTRIBUTE_ATTRIBUTORS[name]; if (attr != null && (attr.attrName === name || attr.keyName === name)) { formats[attr.attrName] = attr.value(node) || undefined; } attr = STYLE_ATTRIBUTORS[name]; if (attr != null && (attr.attrName === name || attr.keyName === name)) { attr = STYLE_ATTRIBUTORS[name]; formats[attr.attrName] = attr.value(node) || undefined; } }); if (Object.keys(formats).length > 0) { delta = applyFormat(delta, formats); } return delta; } function matchBlot(node, delta) { var match = _parchment2.default.query(node); if (match == null) return delta; if (match.prototype instanceof _parchment2.default.Embed) { var embed = {}; var value = match.value(node); if (value != null) { embed[match.blotName] = value; delta = new _quillDelta2.default().insert(embed, match.formats(node)); } } else if (typeof match.formats === 'function') { delta = applyFormat(delta, match.blotName, match.formats(node)); } return delta; } function matchBreak(node, delta) { if (!deltaEndsWith(delta, '\n')) { delta.insert('\n'); } return delta; } function matchIgnore() { return new _quillDelta2.default(); } function matchIndent(node, delta) { var match = _parchment2.default.query(node); if (match == null || match.blotName !== 'list-item' || !deltaEndsWith(delta, '\n')) { return delta; } var indent = -1, parent = node.parentNode; while (!parent.classList.contains('ql-clipboard')) { if ((_parchment2.default.query(parent) || {}).blotName === 'list') { indent += 1; } parent = parent.parentNode; } if (indent <= 0) return delta; return delta.compose(new _quillDelta2.default().retain(delta.length() - 1).retain(1, { indent: indent })); } function matchNewline(node, delta) { if (!deltaEndsWith(delta, '\n')) { if (isLine(node) || delta.length() > 0 && node.nextSibling && isLine(node.nextSibling)) { delta.insert('\n'); } } return delta; } function matchSpacing(node, delta) { if (isLine(node) && node.nextElementSibling != null && !deltaEndsWith(delta, '\n\n')) { var nodeHeight = node.offsetHeight + parseFloat(computeStyle(node).marginTop) + parseFloat(computeStyle(node).marginBottom); if (node.nextElementSibling.offsetTop > node.offsetTop + nodeHeight * 1.5) { delta.insert('\n'); } } return delta; } function matchStyles(node, delta) { var formats = {}; var style = node.style || {}; if (style.fontStyle && computeStyle(node).fontStyle === 'italic') { formats.italic = true; } if (style.fontWeight && (computeStyle(node).fontWeight.startsWith('bold') || parseInt(computeStyle(node).fontWeight) >= 700)) { formats.bold = true; } if (Object.keys(formats).length > 0) { delta = applyFormat(delta, formats); } if (parseFloat(style.textIndent || 0) > 0) { // Could be 0.5in delta = new _quillDelta2.default().insert('\t').concat(delta); } return delta; } function matchText(node, delta) { var text = node.data; // Word represents empty line with <o:p> </o:p> if (node.parentNode.tagName === 'O:P') { return delta.insert(text.trim()); } if (text.trim().length === 0 && node.parentNode.classList.contains('ql-clipboard')) { return delta; } if (!computeStyle(node.parentNode).whiteSpace.startsWith('pre')) { // eslint-disable-next-line func-style var replacer = function replacer(collapse, match) { match = match.replace(/[^\u00a0]/g, ''); // \u00a0 is nbsp; return match.length < 1 && collapse ? ' ' : match; }; text = text.replace(/\r\n/g, ' ').replace(/\n/g, ' '); text = text.replace(/\s\s+/g, replacer.bind(replacer, true)); // collapse whitespace if (node.previousSibling == null && isLine(node.parentNode) || node.previousSibling != null && isLine(node.previousSibling)) { text = text.replace(/^\s+/, replacer.bind(replacer, false)); } if (node.nextSibling == null && isLine(node.parentNode) || node.nextSibling != null && isLine(node.nextSibling)) { text = text.replace(/\s+$/, replacer.bind(replacer, false)); } } return delta.insert(text); } exports.default = Clipboard; exports.matchAttributor = matchAttributor; exports.matchBlot = matchBlot; exports.matchNewline = matchNewline; exports.matchSpacing = matchSpacing; exports.matchText = matchText; /***/ }, /* 56 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) { var parent = Object.getPrototypeOf(object);if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get;if (getter === undefined) { return undefined; }return getter.call(receiver); } }; var _inline = __webpack_require__(6); var _inline2 = _interopRequireDefault(_inline); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Bold = function (_Inline) { _inherits(Bold, _Inline); function Bold() { _classCallCheck(this, Bold); return _possibleConstructorReturn(this, (Bold.__proto__ || Object.getPrototypeOf(Bold)).apply(this, arguments)); } _createClass(Bold, [{ key: 'optimize', value: function optimize(context) { _get(Bold.prototype.__proto__ || Object.getPrototypeOf(Bold.prototype), 'optimize', this).call(this, context); if (this.domNode.tagName !== this.statics.tagName[0]) { this.replaceWith(this.statics.blotName); } } }], [{ key: 'create', value: function create() { return _get(Bold.__proto__ || Object.getPrototypeOf(Bold), 'create', this).call(this); } }, { key: 'formats', value: function formats() { return true; } }]); return Bold; }(_inline2.default); Bold.blotName = 'bold'; Bold.tagName = ['STRONG', 'B']; exports.default = Bold; /***/ }, /* 57 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.addControls = exports.default = undefined; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [];var _n = true;var _d = false;var _e = undefined;try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value);if (i && _arr.length === i) break; } } catch (err) { _d = true;_e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } }return _arr; }return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _quillDelta = __webpack_require__(2); var _quillDelta2 = _interopRequireDefault(_quillDelta); var _parchment = __webpack_require__(0); var _parchment2 = _interopRequireDefault(_parchment); var _quill = __webpack_require__(5); var _quill2 = _interopRequireDefault(_quill); var _logger = __webpack_require__(10); var _logger2 = _interopRequireDefault(_logger); var _module = __webpack_require__(9); var _module2 = _interopRequireDefault(_module); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; }return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var debug = (0, _logger2.default)('quill:toolbar'); var Toolbar = function (_Module) { _inherits(Toolbar, _Module); function Toolbar(quill, options) { _classCallCheck(this, Toolbar); var _this = _possibleConstructorReturn(this, (Toolbar.__proto__ || Object.getPrototypeOf(Toolbar)).call(this, quill, options)); if (Array.isArray(_this.options.container)) { var container = document.createElement('div'); addControls(container, _this.options.container); quill.container.parentNode.insertBefore(container, quill.container); _this.container = container; } else if (typeof _this.options.container === 'string') { _this.container = document.querySelector(_this.options.container); } else { _this.container = _this.options.container; } if (!(_this.container instanceof HTMLElement)) { var _ret; return _ret = debug.error('Container required for toolbar', _this.options), _possibleConstructorReturn(_this, _ret); } _this.container.classList.add('ql-toolbar'); _this.controls = []; _this.handlers = {}; Object.keys(_this.options.handlers).forEach(function (format) { _this.addHandler(format, _this.options.handlers[format]); }); [].forEach.call(_this.container.querySelectorAll('button, select'), function (input) { _this.attach(input); }); _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (type, range) { if (type === _quill2.default.events.SELECTION_CHANGE) { _this.update(range); } }); _this.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () { var _this$quill$selection = _this.quill.selection.getRange(), _this$quill$selection2 = _slicedToArray(_this$quill$selection, 1), range = _this$quill$selection2[0]; // quill.getSelection triggers update _this.update(range); }); return _this; } _createClass(Toolbar, [{ key: 'addHandler', value: function addHandler(format, handler) { this.handlers[format] = handler; } }, { key: 'attach', value: function attach(input) { var _this2 = this; var format = [].find.call(input.classList, function (className) { return className.indexOf('ql-') === 0; }); if (!format) return; format = format.slice('ql-'.length); if (input.tagName === 'BUTTON') { input.setAttribute('type', 'button'); } if (this.handlers[format] == null) { if (this.quill.scroll.whitelist != null && this.quill.scroll.whitelist[format] == null) { debug.warn('ignoring attaching to disabled format', format, input); return; } if (_parchment2.default.query(format) == null) { debug.warn('ignoring attaching to nonexistent format', format, input); return; } } var eventName = input.tagName === 'SELECT' ? 'change' : 'click'; input.addEventListener(eventName, function (e) { var value = void 0; if (input.tagName === 'SELECT') { if (input.selectedIndex < 0) return; var selected = input.options[input.selectedIndex]; if (selected.hasAttribute('selected')) { value = false; } else { value = selected.value || false; } } else { if (input.classList.contains('ql-active')) { value = false; } else { value = input.value || !input.hasAttribute('value'); } e.preventDefault(); } _this2.quill.focus(); var _quill$selection$getR = _this2.quill.selection.getRange(), _quill$selection$getR2 = _slicedToArray(_quill$selection$getR, 1), range = _quill$selection$getR2[0]; if (_this2.handlers[format] != null) { _this2.handlers[format].call(_this2, value); } else if (_parchment2.default.query(format).prototype instanceof _parchment2.default.Embed) { value = prompt('Enter ' + format); if (!value) return; _this2.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert(_defineProperty({}, format, value)), _quill2.default.sources.USER); } else { _this2.quill.format(format, value, _quill2.default.sources.USER); } _this2.update(range); }); // TODO use weakmap this.controls.push([format, input]); } }, { key: 'update', value: function update(range) { var formats = range == null ? {} : this.quill.getFormat(range); this.controls.forEach(function (pair) { var _pair = _slicedToArray(pair, 2), format = _pair[0], input = _pair[1]; if (input.tagName === 'SELECT') { var option = void 0; if (range == null) { option = null; } else if (formats[format] == null) { option = input.querySelector('option[selected]'); } else if (!Array.isArray(formats[format])) { var value = formats[format]; if (typeof value === 'string') { value = value.replace(/\"/g, '\\"'); } option = input.querySelector('option[value="' + value + '"]'); } if (option == null) { input.value = ''; // TODO make configurable? input.selectedIndex = -1; } else { option.selected = true; } } else { if (range == null) { input.classList.remove('ql-active'); } else if (input.hasAttribute('value')) { // both being null should match (default values) // '1' should match with 1 (headers) var isActive = formats[format] === input.getAttribute('value') || formats[format] != null && formats[format].toString() === input.getAttribute('value') || formats[format] == null && !input.getAttribute('value'); input.classList.toggle('ql-active', isActive); } else { input.classList.toggle('ql-active', formats[format] != null); } } }); } }]); return Toolbar; }(_module2.default); Toolbar.DEFAULTS = {}; function addButton(container, format, value) { var input = document.createElement('button'); input.setAttribute('type', 'button'); input.classList.add('ql-' + format); if (value != null) { input.value = value; } container.appendChild(input); } function addControls(container, groups) { if (!Array.isArray(groups[0])) { groups = [groups]; } groups.forEach(function (controls) { var group = document.createElement('span'); group.classList.add('ql-formats'); controls.forEach(function (control) { if (typeof control === 'string') { addButton(group, control); } else { var format = Object.keys(control)[0]; var value = control[format]; if (Array.isArray(value)) { addSelect(group, format, value); } else { addButton(group, format, value); } } }); container.appendChild(group); }); } function addSelect(container, format, values) { var input = document.createElement('select'); input.classList.add('ql-' + format); values.forEach(function (value) { var option = document.createElement('option'); if (value !== false) { option.setAttribute('value', value); } else { option.setAttribute('selected', 'selected'); } input.appendChild(option); }); container.appendChild(input); } Toolbar.DEFAULTS = { container: null, handlers: { clean: function clean() { var _this3 = this; var range = this.quill.getSelection(); if (range == null) return; if (range.length == 0) { var formats = this.quill.getFormat(); Object.keys(formats).forEach(function (name) { // Clean functionality in existing apps only clean inline formats if (_parchment2.default.query(name, _parchment2.default.Scope.INLINE) != null) { _this3.quill.format(name, false); } }); } else { this.quill.removeFormat(range, _quill2.default.sources.USER); } }, direction: function direction(value) { var align = this.quill.getFormat()['align']; if (value === 'rtl' && align == null) { this.quill.format('align', 'right', _quill2.default.sources.USER); } else if (!value && align === 'right') { this.quill.format('align', false, _quill2.default.sources.USER); } this.quill.format('direction', value, _quill2.default.sources.USER); }, indent: function indent(value) { var range = this.quill.getSelection(); var formats = this.quill.getFormat(range); var indent = parseInt(formats.indent || 0); if (value === '+1' || value === '-1') { var modifier = value === '+1' ? 1 : -1; if (formats.direction === 'rtl') modifier *= -1; this.quill.format('indent', indent + modifier, _quill2.default.sources.USER); } }, link: function link(value) { if (value === true) { value = prompt('Enter link URL:'); } this.quill.format('link', value, _quill2.default.sources.USER); }, list: function list(value) { var range = this.quill.getSelection(); var formats = this.quill.getFormat(range); if (value === 'check') { if (formats['list'] === 'checked' || formats['list'] === 'unchecked') { this.quill.format('list', false, _quill2.default.sources.USER); } else { this.quill.format('list', 'unchecked', _quill2.default.sources.USER); } } else { this.quill.format('list', value, _quill2.default.sources.USER); } } } }; exports.default = Toolbar; exports.addControls = addControls; /***/ }, /* 58 */ /***/function (module, exports) { module.exports = "<svg viewbox=\"0 0 18 18\"> <polyline class=\"ql-even ql-stroke\" points=\"5 7 3 9 5 11\"></polyline> <polyline class=\"ql-even ql-stroke\" points=\"13 7 15 9 13 11\"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>"; /***/ }, /* 59 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) { var parent = Object.getPrototypeOf(object);if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get;if (getter === undefined) { return undefined; }return getter.call(receiver); } }; var _picker = __webpack_require__(28); var _picker2 = _interopRequireDefault(_picker); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var ColorPicker = function (_Picker) { _inherits(ColorPicker, _Picker); function ColorPicker(select, label) { _classCallCheck(this, ColorPicker); var _this = _possibleConstructorReturn(this, (ColorPicker.__proto__ || Object.getPrototypeOf(ColorPicker)).call(this, select)); _this.label.innerHTML = label; _this.container.classList.add('ql-color-picker'); [].slice.call(_this.container.querySelectorAll('.ql-picker-item'), 0, 7).forEach(function (item) { item.classList.add('ql-primary'); }); return _this; } _createClass(ColorPicker, [{ key: 'buildItem', value: function buildItem(option) { var item = _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'buildItem', this).call(this, option); item.style.backgroundColor = option.getAttribute('value') || ''; return item; } }, { key: 'selectItem', value: function selectItem(item, trigger) { _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'selectItem', this).call(this, item, trigger); var colorLabel = this.label.querySelector('.ql-color-label'); var value = item ? item.getAttribute('data-value') || '' : ''; if (colorLabel) { if (colorLabel.tagName === 'line') { colorLabel.style.stroke = value; } else { colorLabel.style.fill = value; } } } }]); return ColorPicker; }(_picker2.default); exports.default = ColorPicker; /***/ }, /* 60 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) { var parent = Object.getPrototypeOf(object);if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get;if (getter === undefined) { return undefined; }return getter.call(receiver); } }; var _picker = __webpack_require__(28); var _picker2 = _interopRequireDefault(_picker); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var IconPicker = function (_Picker) { _inherits(IconPicker, _Picker); function IconPicker(select, icons) { _classCallCheck(this, IconPicker); var _this = _possibleConstructorReturn(this, (IconPicker.__proto__ || Object.getPrototypeOf(IconPicker)).call(this, select)); _this.container.classList.add('ql-icon-picker'); [].forEach.call(_this.container.querySelectorAll('.ql-picker-item'), function (item) { item.innerHTML = icons[item.getAttribute('data-value') || '']; }); _this.defaultItem = _this.container.querySelector('.ql-selected'); _this.selectItem(_this.defaultItem); return _this; } _createClass(IconPicker, [{ key: 'selectItem', value: function selectItem(item, trigger) { _get(IconPicker.prototype.__proto__ || Object.getPrototypeOf(IconPicker.prototype), 'selectItem', this).call(this, item, trigger); item = item || this.defaultItem; this.label.innerHTML = item.innerHTML; } }]); return IconPicker; }(_picker2.default); exports.default = IconPicker; /***/ }, /* 61 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Tooltip = function () { function Tooltip(quill, boundsContainer) { var _this = this; _classCallCheck(this, Tooltip); this.quill = quill; this.boundsContainer = boundsContainer || document.body; this.root = quill.addContainer('ql-tooltip'); this.root.innerHTML = this.constructor.TEMPLATE; if (this.quill.root === this.quill.scrollingContainer) { this.quill.root.addEventListener('scroll', function () { _this.root.style.marginTop = -1 * _this.quill.root.scrollTop + 'px'; }); } this.hide(); } _createClass(Tooltip, [{ key: 'hide', value: function hide() { this.root.classList.add('ql-hidden'); } }, { key: 'position', value: function position(reference) { var left = reference.left + reference.width / 2 - this.root.offsetWidth / 2; // root.scrollTop should be 0 if scrollContainer !== root var top = reference.bottom + this.quill.root.scrollTop; this.root.style.left = left + 'px'; this.root.style.top = top + 'px'; this.root.classList.remove('ql-flip'); var containerBounds = this.boundsContainer.getBoundingClientRect(); var rootBounds = this.root.getBoundingClientRect(); var shift = 0; if (rootBounds.right > containerBounds.right) { shift = containerBounds.right - rootBounds.right; this.root.style.left = left + shift + 'px'; } if (rootBounds.left < containerBounds.left) { shift = containerBounds.left - rootBounds.left; this.root.style.left = left + shift + 'px'; } if (rootBounds.bottom > containerBounds.bottom) { var height = rootBounds.bottom - rootBounds.top; var verticalShift = reference.bottom - reference.top + height; this.root.style.top = top - verticalShift + 'px'; this.root.classList.add('ql-flip'); } return shift; } }, { key: 'show', value: function show() { this.root.classList.remove('ql-editing'); this.root.classList.remove('ql-hidden'); } }]); return Tooltip; }(); exports.default = Tooltip; /***/ }, /* 62 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [];var _n = true;var _d = false;var _e = undefined;try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value);if (i && _arr.length === i) break; } } catch (err) { _d = true;_e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } }return _arr; }return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) { var parent = Object.getPrototypeOf(object);if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get;if (getter === undefined) { return undefined; }return getter.call(receiver); } }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _extend = __webpack_require__(3); var _extend2 = _interopRequireDefault(_extend); var _emitter = __webpack_require__(8); var _emitter2 = _interopRequireDefault(_emitter); var _base = __webpack_require__(43); var _base2 = _interopRequireDefault(_base); var _link = __webpack_require__(27); var _link2 = _interopRequireDefault(_link); var _selection = __webpack_require__(15); var _icons = __webpack_require__(41); var _icons2 = _interopRequireDefault(_icons); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var TOOLBAR_CONFIG = [[{ header: ['1', '2', '3', false] }], ['bold', 'italic', 'underline', 'link'], [{ list: 'ordered' }, { list: 'bullet' }], ['clean']]; var SnowTheme = function (_BaseTheme) { _inherits(SnowTheme, _BaseTheme); function SnowTheme(quill, options) { _classCallCheck(this, SnowTheme); if (options.modules.toolbar != null && options.modules.toolbar.container == null) { options.modules.toolbar.container = TOOLBAR_CONFIG; } var _this = _possibleConstructorReturn(this, (SnowTheme.__proto__ || Object.getPrototypeOf(SnowTheme)).call(this, quill, options)); _this.quill.container.classList.add('ql-snow'); return _this; } _createClass(SnowTheme, [{ key: 'extendToolbar', value: function extendToolbar(toolbar) { toolbar.container.classList.add('ql-snow'); this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default); this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default); this.tooltip = new SnowTooltip(this.quill, this.options.bounds); if (toolbar.container.querySelector('.ql-link')) { this.quill.keyboard.addBinding({ key: 'K', shortKey: true }, function (range, context) { toolbar.handlers['link'].call(toolbar, !context.format.link); }); } } }]); return SnowTheme; }(_base2.default); SnowTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, { modules: { toolbar: { handlers: { link: function link(value) { if (value) { var range = this.quill.getSelection(); if (range == null || range.length == 0) return; var preview = this.quill.getText(range); if (/^\S+@\S+\.\S+$/.test(preview) && preview.indexOf('mailto:') !== 0) { preview = 'mailto:' + preview; } var tooltip = this.quill.theme.tooltip; tooltip.edit('link', preview); } else { this.quill.format('link', false); } } } } } }); var SnowTooltip = function (_BaseTooltip) { _inherits(SnowTooltip, _BaseTooltip); function SnowTooltip(quill, bounds) { _classCallCheck(this, SnowTooltip); var _this2 = _possibleConstructorReturn(this, (SnowTooltip.__proto__ || Object.getPrototypeOf(SnowTooltip)).call(this, quill, bounds)); _this2.preview = _this2.root.querySelector('a.ql-preview'); return _this2; } _createClass(SnowTooltip, [{ key: 'listen', value: function listen() { var _this3 = this; _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'listen', this).call(this); this.root.querySelector('a.ql-action').addEventListener('click', function (event) { if (_this3.root.classList.contains('ql-editing')) { _this3.save(); } else { _this3.edit('link', _this3.preview.textContent); } event.preventDefault(); }); this.root.querySelector('a.ql-remove').addEventListener('click', function (event) { if (_this3.linkRange != null) { var range = _this3.linkRange; _this3.restoreFocus(); _this3.quill.formatText(range, 'link', false, _emitter2.default.sources.USER); delete _this3.linkRange; } event.preventDefault(); _this3.hide(); }); this.quill.on(_emitter2.default.events.SELECTION_CHANGE, function (range, oldRange, source) { if (range == null) return; if (range.length === 0 && source === _emitter2.default.sources.USER) { var _quill$scroll$descend = _this3.quill.scroll.descendant(_link2.default, range.index), _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), link = _quill$scroll$descend2[0], offset = _quill$scroll$descend2[1]; if (link != null) { _this3.linkRange = new _selection.Range(range.index - offset, link.length()); var preview = _link2.default.formats(link.domNode); _this3.preview.textContent = preview; _this3.preview.setAttribute('href', preview); _this3.show(); _this3.position(_this3.quill.getBounds(_this3.linkRange)); return; } } else { delete _this3.linkRange; } _this3.hide(); }); } }, { key: 'show', value: function show() { _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'show', this).call(this); this.root.removeAttribute('data-mode'); } }]); return SnowTooltip; }(_base.BaseTooltip); SnowTooltip.TEMPLATE = ['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>', '<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">', '<a class="ql-action"></a>', '<a class="ql-remove"></a>'].join(''); exports.default = SnowTheme; /***/ }, /* 63 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _core = __webpack_require__(29); var _core2 = _interopRequireDefault(_core); var _align = __webpack_require__(36); var _direction = __webpack_require__(38); var _indent = __webpack_require__(64); var _blockquote = __webpack_require__(65); var _blockquote2 = _interopRequireDefault(_blockquote); var _header = __webpack_require__(66); var _header2 = _interopRequireDefault(_header); var _list = __webpack_require__(67); var _list2 = _interopRequireDefault(_list); var _background = __webpack_require__(37); var _color = __webpack_require__(26); var _font = __webpack_require__(39); var _size = __webpack_require__(40); var _bold = __webpack_require__(56); var _bold2 = _interopRequireDefault(_bold); var _italic = __webpack_require__(68); var _italic2 = _interopRequireDefault(_italic); var _link = __webpack_require__(27); var _link2 = _interopRequireDefault(_link); var _script = __webpack_require__(69); var _script2 = _interopRequireDefault(_script); var _strike = __webpack_require__(70); var _strike2 = _interopRequireDefault(_strike); var _underline = __webpack_require__(71); var _underline2 = _interopRequireDefault(_underline); var _image = __webpack_require__(72); var _image2 = _interopRequireDefault(_image); var _video = __webpack_require__(73); var _video2 = _interopRequireDefault(_video); var _code = __webpack_require__(13); var _code2 = _interopRequireDefault(_code); var _formula = __webpack_require__(74); var _formula2 = _interopRequireDefault(_formula); var _syntax = __webpack_require__(75); var _syntax2 = _interopRequireDefault(_syntax); var _toolbar = __webpack_require__(57); var _toolbar2 = _interopRequireDefault(_toolbar); var _icons = __webpack_require__(41); var _icons2 = _interopRequireDefault(_icons); var _picker = __webpack_require__(28); var _picker2 = _interopRequireDefault(_picker); var _colorPicker = __webpack_require__(59); var _colorPicker2 = _interopRequireDefault(_colorPicker); var _iconPicker = __webpack_require__(60); var _iconPicker2 = _interopRequireDefault(_iconPicker); var _tooltip = __webpack_require__(61); var _tooltip2 = _interopRequireDefault(_tooltip); var _bubble = __webpack_require__(108); var _bubble2 = _interopRequireDefault(_bubble); var _snow = __webpack_require__(62); var _snow2 = _interopRequireDefault(_snow); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } _core2.default.register({ 'attributors/attribute/direction': _direction.DirectionAttribute, 'attributors/class/align': _align.AlignClass, 'attributors/class/background': _background.BackgroundClass, 'attributors/class/color': _color.ColorClass, 'attributors/class/direction': _direction.DirectionClass, 'attributors/class/font': _font.FontClass, 'attributors/class/size': _size.SizeClass, 'attributors/style/align': _align.AlignStyle, 'attributors/style/background': _background.BackgroundStyle, 'attributors/style/color': _color.ColorStyle, 'attributors/style/direction': _direction.DirectionStyle, 'attributors/style/font': _font.FontStyle, 'attributors/style/size': _size.SizeStyle }, true); _core2.default.register({ 'formats/align': _align.AlignClass, 'formats/direction': _direction.DirectionClass, 'formats/indent': _indent.IndentClass, 'formats/background': _background.BackgroundStyle, 'formats/color': _color.ColorStyle, 'formats/font': _font.FontClass, 'formats/size': _size.SizeClass, 'formats/blockquote': _blockquote2.default, 'formats/code-block': _code2.default, 'formats/header': _header2.default, 'formats/list': _list2.default, 'formats/bold': _bold2.default, 'formats/code': _code.Code, 'formats/italic': _italic2.default, 'formats/link': _link2.default, 'formats/script': _script2.default, 'formats/strike': _strike2.default, 'formats/underline': _underline2.default, 'formats/image': _image2.default, 'formats/video': _video2.default, 'formats/list/item': _list.ListItem, 'modules/formula': _formula2.default, 'modules/syntax': _syntax2.default, 'modules/toolbar': _toolbar2.default, 'themes/bubble': _bubble2.default, 'themes/snow': _snow2.default, 'ui/icons': _icons2.default, 'ui/picker': _picker2.default, 'ui/icon-picker': _iconPicker2.default, 'ui/color-picker': _colorPicker2.default, 'ui/tooltip': _tooltip2.default }, true); exports.default = _core2.default; /***/ }, /* 64 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.IndentClass = undefined; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) { var parent = Object.getPrototypeOf(object);if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get;if (getter === undefined) { return undefined; }return getter.call(receiver); } }; var _parchment = __webpack_require__(0); var _parchment2 = _interopRequireDefault(_parchment); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var IdentAttributor = function (_Parchment$Attributor) { _inherits(IdentAttributor, _Parchment$Attributor); function IdentAttributor() { _classCallCheck(this, IdentAttributor); return _possibleConstructorReturn(this, (IdentAttributor.__proto__ || Object.getPrototypeOf(IdentAttributor)).apply(this, arguments)); } _createClass(IdentAttributor, [{ key: 'add', value: function add(node, value) { if (value === '+1' || value === '-1') { var indent = this.value(node) || 0; value = value === '+1' ? indent + 1 : indent - 1; } if (value === 0) { this.remove(node); return true; } else { return _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'add', this).call(this, node, value); } } }, { key: 'canAdd', value: function canAdd(node, value) { return _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'canAdd', this).call(this, node, value) || _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'canAdd', this).call(this, node, parseInt(value)); } }, { key: 'value', value: function value(node) { return parseInt(_get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'value', this).call(this, node)) || undefined; // Don't return NaN } }]); return IdentAttributor; }(_parchment2.default.Attributor.Class); var IndentClass = new IdentAttributor('indent', 'ql-indent', { scope: _parchment2.default.Scope.BLOCK, whitelist: [1, 2, 3, 4, 5, 6, 7, 8] }); exports.IndentClass = IndentClass; /***/ }, /* 65 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _block = __webpack_require__(4); var _block2 = _interopRequireDefault(_block); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Blockquote = function (_Block) { _inherits(Blockquote, _Block); function Blockquote() { _classCallCheck(this, Blockquote); return _possibleConstructorReturn(this, (Blockquote.__proto__ || Object.getPrototypeOf(Blockquote)).apply(this, arguments)); } return Blockquote; }(_block2.default); Blockquote.blotName = 'blockquote'; Blockquote.tagName = 'blockquote'; exports.default = Blockquote; /***/ }, /* 66 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _block = __webpack_require__(4); var _block2 = _interopRequireDefault(_block); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Header = function (_Block) { _inherits(Header, _Block); function Header() { _classCallCheck(this, Header); return _possibleConstructorReturn(this, (Header.__proto__ || Object.getPrototypeOf(Header)).apply(this, arguments)); } _createClass(Header, null, [{ key: 'formats', value: function formats(domNode) { return this.tagName.indexOf(domNode.tagName) + 1; } }]); return Header; }(_block2.default); Header.blotName = 'header'; Header.tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6']; exports.default = Header; /***/ }, /* 67 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.ListItem = undefined; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) { var parent = Object.getPrototypeOf(object);if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get;if (getter === undefined) { return undefined; }return getter.call(receiver); } }; var _parchment = __webpack_require__(0); var _parchment2 = _interopRequireDefault(_parchment); var _block = __webpack_require__(4); var _block2 = _interopRequireDefault(_block); var _container = __webpack_require__(25); var _container2 = _interopRequireDefault(_container); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; }return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var ListItem = function (_Block) { _inherits(ListItem, _Block); function ListItem() { _classCallCheck(this, ListItem); return _possibleConstructorReturn(this, (ListItem.__proto__ || Object.getPrototypeOf(ListItem)).apply(this, arguments)); } _createClass(ListItem, [{ key: 'format', value: function format(name, value) { if (name === List.blotName && !value) { this.replaceWith(_parchment2.default.create(this.statics.scope)); } else { _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'format', this).call(this, name, value); } } }, { key: 'remove', value: function remove() { if (this.prev == null && this.next == null) { this.parent.remove(); } else { _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'remove', this).call(this); } } }, { key: 'replaceWith', value: function replaceWith(name, value) { this.parent.isolate(this.offset(this.parent), this.length()); if (name === this.parent.statics.blotName) { this.parent.replaceWith(name, value); return this; } else { this.parent.unwrap(); return _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'replaceWith', this).call(this, name, value); } } }], [{ key: 'formats', value: function formats(domNode) { return domNode.tagName === this.tagName ? undefined : _get(ListItem.__proto__ || Object.getPrototypeOf(ListItem), 'formats', this).call(this, domNode); } }]); return ListItem; }(_block2.default); ListItem.blotName = 'list-item'; ListItem.tagName = 'LI'; var List = function (_Container) { _inherits(List, _Container); _createClass(List, null, [{ key: 'create', value: function create(value) { var tagName = value === 'ordered' ? 'OL' : 'UL'; var node = _get(List.__proto__ || Object.getPrototypeOf(List), 'create', this).call(this, tagName); if (value === 'checked' || value === 'unchecked') { node.setAttribute('data-checked', value === 'checked'); } return node; } }, { key: 'formats', value: function formats(domNode) { if (domNode.tagName === 'OL') return 'ordered'; if (domNode.tagName === 'UL') { if (domNode.hasAttribute('data-checked')) { return domNode.getAttribute('data-checked') === 'true' ? 'checked' : 'unchecked'; } else { return 'bullet'; } } return undefined; } }]); function List(domNode) { _classCallCheck(this, List); var _this2 = _possibleConstructorReturn(this, (List.__proto__ || Object.getPrototypeOf(List)).call(this, domNode)); var listEventHandler = function listEventHandler(e) { if (e.target.parentNode !== domNode) return; var format = _this2.statics.formats(domNode); var blot = _parchment2.default.find(e.target); if (format === 'checked') { blot.format('list', 'unchecked'); } else if (format === 'unchecked') { blot.format('list', 'checked'); } }; domNode.addEventListener('touchstart', listEventHandler); domNode.addEventListener('mousedown', listEventHandler); return _this2; } _createClass(List, [{ key: 'format', value: function format(name, value) { if (this.children.length > 0) { this.children.tail.format(name, value); } } }, { key: 'formats', value: function formats() { // We don't inherit from FormatBlot return _defineProperty({}, this.statics.blotName, this.statics.formats(this.domNode)); } }, { key: 'insertBefore', value: function insertBefore(blot, ref) { if (blot instanceof ListItem) { _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'insertBefore', this).call(this, blot, ref); } else { var index = ref == null ? this.length() : ref.offset(this); var after = this.split(index); after.parent.insertBefore(blot, after); } } }, { key: 'optimize', value: function optimize(context) { _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'optimize', this).call(this, context); var next = this.next; if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && next.domNode.tagName === this.domNode.tagName && next.domNode.getAttribute('data-checked') === this.domNode.getAttribute('data-checked')) { next.moveChildren(this); next.remove(); } } }, { key: 'replace', value: function replace(target) { if (target.statics.blotName !== this.statics.blotName) { var item = _parchment2.default.create(this.statics.defaultChild); target.moveChildren(item); this.appendChild(item); } _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'replace', this).call(this, target); } }]); return List; }(_container2.default); List.blotName = 'list'; List.scope = _parchment2.default.Scope.BLOCK_BLOT; List.tagName = ['OL', 'UL']; List.defaultChild = 'list-item'; List.allowedChildren = [ListItem]; exports.ListItem = ListItem; exports.default = List; /***/ }, /* 68 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _bold = __webpack_require__(56); var _bold2 = _interopRequireDefault(_bold); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Italic = function (_Bold) { _inherits(Italic, _Bold); function Italic() { _classCallCheck(this, Italic); return _possibleConstructorReturn(this, (Italic.__proto__ || Object.getPrototypeOf(Italic)).apply(this, arguments)); } return Italic; }(_bold2.default); Italic.blotName = 'italic'; Italic.tagName = ['EM', 'I']; exports.default = Italic; /***/ }, /* 69 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) { var parent = Object.getPrototypeOf(object);if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get;if (getter === undefined) { return undefined; }return getter.call(receiver); } }; var _inline = __webpack_require__(6); var _inline2 = _interopRequireDefault(_inline); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Script = function (_Inline) { _inherits(Script, _Inline); function Script() { _classCallCheck(this, Script); return _possibleConstructorReturn(this, (Script.__proto__ || Object.getPrototypeOf(Script)).apply(this, arguments)); } _createClass(Script, null, [{ key: 'create', value: function create(value) { if (value === 'super') { return document.createElement('sup'); } else if (value === 'sub') { return document.createElement('sub'); } else { return _get(Script.__proto__ || Object.getPrototypeOf(Script), 'create', this).call(this, value); } } }, { key: 'formats', value: function formats(domNode) { if (domNode.tagName === 'SUB') return 'sub'; if (domNode.tagName === 'SUP') return 'super'; return undefined; } }]); return Script; }(_inline2.default); Script.blotName = 'script'; Script.tagName = ['SUB', 'SUP']; exports.default = Script; /***/ }, /* 70 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _inline = __webpack_require__(6); var _inline2 = _interopRequireDefault(_inline); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Strike = function (_Inline) { _inherits(Strike, _Inline); function Strike() { _classCallCheck(this, Strike); return _possibleConstructorReturn(this, (Strike.__proto__ || Object.getPrototypeOf(Strike)).apply(this, arguments)); } return Strike; }(_inline2.default); Strike.blotName = 'strike'; Strike.tagName = 'S'; exports.default = Strike; /***/ }, /* 71 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _inline = __webpack_require__(6); var _inline2 = _interopRequireDefault(_inline); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Underline = function (_Inline) { _inherits(Underline, _Inline); function Underline() { _classCallCheck(this, Underline); return _possibleConstructorReturn(this, (Underline.__proto__ || Object.getPrototypeOf(Underline)).apply(this, arguments)); } return Underline; }(_inline2.default); Underline.blotName = 'underline'; Underline.tagName = 'U'; exports.default = Underline; /***/ }, /* 72 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) { var parent = Object.getPrototypeOf(object);if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get;if (getter === undefined) { return undefined; }return getter.call(receiver); } }; var _parchment = __webpack_require__(0); var _parchment2 = _interopRequireDefault(_parchment); var _link = __webpack_require__(27); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var ATTRIBUTES = ['alt', 'height', 'width']; var Image = function (_Parchment$Embed) { _inherits(Image, _Parchment$Embed); function Image() { _classCallCheck(this, Image); return _possibleConstructorReturn(this, (Image.__proto__ || Object.getPrototypeOf(Image)).apply(this, arguments)); } _createClass(Image, [{ key: 'format', value: function format(name, value) { if (ATTRIBUTES.indexOf(name) > -1) { if (value) { this.domNode.setAttribute(name, value); } else { this.domNode.removeAttribute(name); } } else { _get(Image.prototype.__proto__ || Object.getPrototypeOf(Image.prototype), 'format', this).call(this, name, value); } } }], [{ key: 'create', value: function create(value) { var node = _get(Image.__proto__ || Object.getPrototypeOf(Image), 'create', this).call(this, value); if (typeof value === 'string') { node.setAttribute('src', this.sanitize(value)); } return node; } }, { key: 'formats', value: function formats(domNode) { return ATTRIBUTES.reduce(function (formats, attribute) { if (domNode.hasAttribute(attribute)) { formats[attribute] = domNode.getAttribute(attribute); } return formats; }, {}); } }, { key: 'match', value: function match(url) { return (/\.(jpe?g|gif|png)$/.test(url) || /^data:image\/.+;base64/.test(url) ); } }, { key: 'sanitize', value: function sanitize(url) { return (0, _link.sanitize)(url, ['http', 'https', 'data']) ? url : '//:0'; } }, { key: 'value', value: function value(domNode) { return domNode.getAttribute('src'); } }]); return Image; }(_parchment2.default.Embed); Image.blotName = 'image'; Image.tagName = 'IMG'; exports.default = Image; /***/ }, /* 73 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) { var parent = Object.getPrototypeOf(object);if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get;if (getter === undefined) { return undefined; }return getter.call(receiver); } }; var _block = __webpack_require__(4); var _link = __webpack_require__(27); var _link2 = _interopRequireDefault(_link); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var ATTRIBUTES = ['height', 'width']; var Video = function (_BlockEmbed) { _inherits(Video, _BlockEmbed); function Video() { _classCallCheck(this, Video); return _possibleConstructorReturn(this, (Video.__proto__ || Object.getPrototypeOf(Video)).apply(this, arguments)); } _createClass(Video, [{ key: 'format', value: function format(name, value) { if (ATTRIBUTES.indexOf(name) > -1) { if (value) { this.domNode.setAttribute(name, value); } else { this.domNode.removeAttribute(name); } } else { _get(Video.prototype.__proto__ || Object.getPrototypeOf(Video.prototype), 'format', this).call(this, name, value); } } }], [{ key: 'create', value: function create(value) { var node = _get(Video.__proto__ || Object.getPrototypeOf(Video), 'create', this).call(this, value); node.setAttribute('frameborder', '0'); node.setAttribute('allowfullscreen', true); node.setAttribute('src', this.sanitize(value)); return node; } }, { key: 'formats', value: function formats(domNode) { return ATTRIBUTES.reduce(function (formats, attribute) { if (domNode.hasAttribute(attribute)) { formats[attribute] = domNode.getAttribute(attribute); } return formats; }, {}); } }, { key: 'sanitize', value: function sanitize(url) { return _link2.default.sanitize(url); } }, { key: 'value', value: function value(domNode) { return domNode.getAttribute('src'); } }]); return Video; }(_block.BlockEmbed); Video.blotName = 'video'; Video.className = 'ql-video'; Video.tagName = 'IFRAME'; exports.default = Video; /***/ }, /* 74 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.FormulaBlot = undefined; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) { var parent = Object.getPrototypeOf(object);if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get;if (getter === undefined) { return undefined; }return getter.call(receiver); } }; var _embed = __webpack_require__(35); var _embed2 = _interopRequireDefault(_embed); var _quill = __webpack_require__(5); var _quill2 = _interopRequireDefault(_quill); var _module = __webpack_require__(9); var _module2 = _interopRequireDefault(_module); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var FormulaBlot = function (_Embed) { _inherits(FormulaBlot, _Embed); function FormulaBlot() { _classCallCheck(this, FormulaBlot); return _possibleConstructorReturn(this, (FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot)).apply(this, arguments)); } _createClass(FormulaBlot, null, [{ key: 'create', value: function create(value) { var node = _get(FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot), 'create', this).call(this, value); if (typeof value === 'string') { window.katex.render(value, node, { throwOnError: false, errorColor: '#f00' }); node.setAttribute('data-value', value); } return node; } }, { key: 'value', value: function value(domNode) { return domNode.getAttribute('data-value'); } }]); return FormulaBlot; }(_embed2.default); FormulaBlot.blotName = 'formula'; FormulaBlot.className = 'ql-formula'; FormulaBlot.tagName = 'SPAN'; var Formula = function (_Module) { _inherits(Formula, _Module); _createClass(Formula, null, [{ key: 'register', value: function register() { _quill2.default.register(FormulaBlot, true); } }]); function Formula() { _classCallCheck(this, Formula); var _this2 = _possibleConstructorReturn(this, (Formula.__proto__ || Object.getPrototypeOf(Formula)).call(this)); if (window.katex == null) { throw new Error('Formula module requires KaTeX.'); } return _this2; } return Formula; }(_module2.default); exports.FormulaBlot = FormulaBlot; exports.default = Formula; /***/ }, /* 75 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.CodeToken = exports.CodeBlock = undefined; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) { var parent = Object.getPrototypeOf(object);if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get;if (getter === undefined) { return undefined; }return getter.call(receiver); } }; var _parchment = __webpack_require__(0); var _parchment2 = _interopRequireDefault(_parchment); var _quill = __webpack_require__(5); var _quill2 = _interopRequireDefault(_quill); var _module = __webpack_require__(9); var _module2 = _interopRequireDefault(_module); var _code = __webpack_require__(13); var _code2 = _interopRequireDefault(_code); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var SyntaxCodeBlock = function (_CodeBlock) { _inherits(SyntaxCodeBlock, _CodeBlock); function SyntaxCodeBlock() { _classCallCheck(this, SyntaxCodeBlock); return _possibleConstructorReturn(this, (SyntaxCodeBlock.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock)).apply(this, arguments)); } _createClass(SyntaxCodeBlock, [{ key: 'replaceWith', value: function replaceWith(block) { this.domNode.textContent = this.domNode.textContent; this.attach(); _get(SyntaxCodeBlock.prototype.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock.prototype), 'replaceWith', this).call(this, block); } }, { key: 'highlight', value: function highlight(_highlight) { var text = this.domNode.textContent; if (this.cachedText !== text) { if (text.trim().length > 0 || this.cachedText == null) { this.domNode.innerHTML = _highlight(text); this.domNode.normalize(); this.attach(); } this.cachedText = text; } } }]); return SyntaxCodeBlock; }(_code2.default); SyntaxCodeBlock.className = 'ql-syntax'; var CodeToken = new _parchment2.default.Attributor.Class('token', 'hljs', { scope: _parchment2.default.Scope.INLINE }); var Syntax = function (_Module) { _inherits(Syntax, _Module); _createClass(Syntax, null, [{ key: 'register', value: function register() { _quill2.default.register(CodeToken, true); _quill2.default.register(SyntaxCodeBlock, true); } }]); function Syntax(quill, options) { _classCallCheck(this, Syntax); var _this2 = _possibleConstructorReturn(this, (Syntax.__proto__ || Object.getPrototypeOf(Syntax)).call(this, quill, options)); if (typeof _this2.options.highlight !== 'function') { throw new Error('Syntax module requires highlight.js. Please include the library on the page before Quill.'); } var timer = null; _this2.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () { clearTimeout(timer); timer = setTimeout(function () { _this2.highlight(); timer = null; }, _this2.options.interval); }); _this2.highlight(); return _this2; } _createClass(Syntax, [{ key: 'highlight', value: function highlight() { var _this3 = this; if (this.quill.selection.composing) return; this.quill.update(_quill2.default.sources.USER); var range = this.quill.getSelection(); this.quill.scroll.descendants(SyntaxCodeBlock).forEach(function (code) { code.highlight(_this3.options.highlight); }); this.quill.update(_quill2.default.sources.SILENT); if (range != null) { this.quill.setSelection(range, _quill2.default.sources.SILENT); } } }]); return Syntax; }(_module2.default); Syntax.DEFAULTS = { highlight: function () { if (window.hljs == null) return null; return function (text) { var result = window.hljs.highlightAuto(text); return result.value; }; }(), interval: 1000 }; exports.CodeBlock = SyntaxCodeBlock; exports.CodeToken = CodeToken; exports.default = Syntax; /***/ }, /* 76 */ /***/function (module, exports) { module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>"; /***/ }, /* 77 */ /***/function (module, exports) { module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>"; /***/ }, /* 78 */ /***/function (module, exports) { module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>"; /***/ }, /* 79 */ /***/function (module, exports) { module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>"; /***/ }, /* 80 */ /***/function (module, exports) { module.exports = "<svg viewbox=\"0 0 18 18\"> <g class=\"ql-fill ql-color-label\"> <polygon points=\"6 6.868 6 6 5 6 5 7 5.942 7 6 6.868\"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points=\"6.817 5 6 5 6 6 6.38 6 6.817 5\"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points=\"4 11.439 4 11 3 11 3 12 3.755 12 4 11.439\"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points=\"4.63 10 4 10 4 11 4.192 11 4.63 10\"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points=\"13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174\"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points=\"12 6.868 12 6 11.62 6 12 6.868\"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points=\"12.933 9 13 9 13 8 12.495 8 12.933 9\"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points=\"5.5 13 9 5 12.5 13\"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>"; /***/ }, /* 81 */ /***/function (module, exports) { module.exports = "<svg viewbox=\"0 0 18 18\"> <rect class=\"ql-fill ql-stroke\" height=3 width=3 x=4 y=5></rect> <rect class=\"ql-fill ql-stroke\" height=3 width=3 x=11 y=5></rect> <path class=\"ql-even ql-fill ql-stroke\" d=M7,8c0,4.031-3,5-3,5></path> <path class=\"ql-even ql-fill ql-stroke\" d=M14,8c0,4.031-3,5-3,5></path> </svg>"; /***/ }, /* 82 */ /***/function (module, exports) { module.exports = "<svg viewbox=\"0 0 18 18\"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>"; /***/ }, /* 83 */ /***/function (module, exports) { module.exports = "<svg class=\"\" viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>"; /***/ }, /* 84 */ /***/function (module, exports) { module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=\"ql-color-label ql-stroke ql-transparent\" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points=\"5.5 11 9 3 12.5 11\"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>"; /***/ }, /* 85 */ /***/function (module, exports) { module.exports = "<svg viewbox=\"0 0 18 18\"> <polygon class=\"ql-stroke ql-fill\" points=\"3 11 5 9 3 7 3 11\"></polygon> <line class=\"ql-stroke ql-fill\" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>"; /***/ }, /* 86 */ /***/function (module, exports) { module.exports = "<svg viewbox=\"0 0 18 18\"> <polygon class=\"ql-stroke ql-fill\" points=\"15 12 13 10 15 8 15 12\"></polygon> <line class=\"ql-stroke ql-fill\" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>"; /***/ }, /* 87 */ /***/function (module, exports) { module.exports = "<svg viewbox=\"0 0 18 18\"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>"; /***/ }, /* 88 */ /***/function (module, exports) { module.exports = "<svg viewbox=\"0 0 18 18\"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>"; /***/ }, /* 89 */ /***/function (module, exports) { module.exports = "<svg viewbox=\"0 0 18 18\"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>"; /***/ }, /* 90 */ /***/function (module, exports) { module.exports = "<svg viewbox=\"0 0 18 18\"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform=\"translate(24 18) rotate(-180)\"/> </svg>"; /***/ }, /* 91 */ /***/function (module, exports) { module.exports = "<svg viewbox=\"0 0 18 18\"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>"; /***/ }, /* 92 */ /***/function (module, exports) { module.exports = "<svg viewBox=\"0 0 18 18\"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>"; /***/ }, /* 93 */ /***/function (module, exports) { module.exports = "<svg viewBox=\"0 0 18 18\"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>"; /***/ }, /* 94 */ /***/function (module, exports) { module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>"; /***/ }, /* 95 */ /***/function (module, exports) { module.exports = "<svg viewbox=\"0 0 18 18\"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class=\"ql-even ql-fill\" points=\"5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12\"></polyline> </svg>"; /***/ }, /* 96 */ /***/function (module, exports) { module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=\"ql-fill ql-stroke\" points=\"3 7 3 11 5 9 3 7\"></polyline> </svg>"; /***/ }, /* 97 */ /***/function (module, exports) { module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points=\"5 7 5 11 3 9 5 7\"></polyline> </svg>"; /***/ }, /* 98 */ /***/function (module, exports) { module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class=\"ql-even ql-stroke\" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class=\"ql-even ql-stroke\" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>"; /***/ }, /* 99 */ /***/function (module, exports) { module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class=\"ql-stroke ql-thin\" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class=\"ql-stroke ql-thin\" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class=\"ql-stroke ql-thin\" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>"; /***/ }, /* 100 */ /***/function (module, exports) { module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>"; /***/ }, /* 101 */ /***/function (module, exports) { module.exports = "<svg class=\"\" viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points=\"3 4 4 5 6 3\"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points=\"3 14 4 15 6 13\"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points=\"3 9 4 10 6 8\"></polyline> </svg>"; /***/ }, /* 102 */ /***/function (module, exports) { module.exports = "<svg viewbox=\"0 0 18 18\"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>"; /***/ }, /* 103 */ /***/function (module, exports) { module.exports = "<svg viewbox=\"0 0 18 18\"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>"; /***/ }, /* 104 */ /***/function (module, exports) { module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=\"ql-stroke ql-thin\" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>"; /***/ }, /* 105 */ /***/function (module, exports) { module.exports = "<svg viewbox=\"0 0 18 18\"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>"; /***/ }, /* 106 */ /***/function (module, exports) { module.exports = "<svg viewbox=\"0 0 18 18\"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>"; /***/ }, /* 107 */ /***/function (module, exports) { module.exports = "<svg viewbox=\"0 0 18 18\"> <polygon class=ql-stroke points=\"7 11 9 13 11 11 7 11\"></polygon> <polygon class=ql-stroke points=\"7 7 9 5 11 7 7 7\"></polygon> </svg>"; /***/ }, /* 108 */ /***/function (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.BubbleTooltip = undefined; var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) { var parent = Object.getPrototypeOf(object);if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get;if (getter === undefined) { return undefined; }return getter.call(receiver); } }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _extend = __webpack_require__(3); var _extend2 = _interopRequireDefault(_extend); var _emitter = __webpack_require__(8); var _emitter2 = _interopRequireDefault(_emitter); var _base = __webpack_require__(43); var _base2 = _interopRequireDefault(_base); var _selection = __webpack_require__(15); var _icons = __webpack_require__(41); var _icons2 = _interopRequireDefault(_icons); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var TOOLBAR_CONFIG = [['bold', 'italic', 'link'], [{ header: 1 }, { header: 2 }, 'blockquote']]; var BubbleTheme = function (_BaseTheme) { _inherits(BubbleTheme, _BaseTheme); function BubbleTheme(quill, options) { _classCallCheck(this, BubbleTheme); if (options.modules.toolbar != null && options.modules.toolbar.container == null) { options.modules.toolbar.container = TOOLBAR_CONFIG; } var _this = _possibleConstructorReturn(this, (BubbleTheme.__proto__ || Object.getPrototypeOf(BubbleTheme)).call(this, quill, options)); _this.quill.container.classList.add('ql-bubble'); return _this; } _createClass(BubbleTheme, [{ key: 'extendToolbar', value: function extendToolbar(toolbar) { this.tooltip = new BubbleTooltip(this.quill, this.options.bounds); this.tooltip.root.appendChild(toolbar.container); this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default); this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default); } }]); return BubbleTheme; }(_base2.default); BubbleTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, { modules: { toolbar: { handlers: { link: function link(value) { if (!value) { this.quill.format('link', false); } else { this.quill.theme.tooltip.edit(); } } } } } }); var BubbleTooltip = function (_BaseTooltip) { _inherits(BubbleTooltip, _BaseTooltip); function BubbleTooltip(quill, bounds) { _classCallCheck(this, BubbleTooltip); var _this2 = _possibleConstructorReturn(this, (BubbleTooltip.__proto__ || Object.getPrototypeOf(BubbleTooltip)).call(this, quill, bounds)); _this2.quill.on(_emitter2.default.events.EDITOR_CHANGE, function (type, range, oldRange, source) { if (type !== _emitter2.default.events.SELECTION_CHANGE) return; if (range != null && range.length > 0 && source === _emitter2.default.sources.USER) { _this2.show(); // Lock our width so we will expand beyond our offsetParent boundaries _this2.root.style.left = '0px'; _this2.root.style.width = ''; _this2.root.style.width = _this2.root.offsetWidth + 'px'; var lines = _this2.quill.getLines(range.index, range.length); if (lines.length === 1) { _this2.position(_this2.quill.getBounds(range)); } else { var lastLine = lines[lines.length - 1]; var index = _this2.quill.getIndex(lastLine); var length = Math.min(lastLine.length() - 1, range.index + range.length - index); var _bounds = _this2.quill.getBounds(new _selection.Range(index, length)); _this2.position(_bounds); } } else if (document.activeElement !== _this2.textbox && _this2.quill.hasFocus()) { _this2.hide(); } }); return _this2; } _createClass(BubbleTooltip, [{ key: 'listen', value: function listen() { var _this3 = this; _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'listen', this).call(this); this.root.querySelector('.ql-close').addEventListener('click', function () { _this3.root.classList.remove('ql-editing'); }); this.quill.on(_emitter2.default.events.SCROLL_OPTIMIZE, function () { // Let selection be restored by toolbar handlers before repositioning setTimeout(function () { if (_this3.root.classList.contains('ql-hidden')) return; var range = _this3.quill.getSelection(); if (range != null) { _this3.position(_this3.quill.getBounds(range)); } }, 1); }); } }, { key: 'cancel', value: function cancel() { this.show(); } }, { key: 'position', value: function position(reference) { var shift = _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'position', this).call(this, reference); var arrow = this.root.querySelector('.ql-tooltip-arrow'); arrow.style.marginLeft = ''; if (shift === 0) return shift; arrow.style.marginLeft = -1 * shift - arrow.offsetWidth / 2 + 'px'; } }]); return BubbleTooltip; }(_base.BaseTooltip); BubbleTooltip.TEMPLATE = ['<span class="ql-tooltip-arrow"></span>', '<div class="ql-tooltip-editor">', '<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">', '<a class="ql-close"></a>', '</div>'].join(''); exports.BubbleTooltip = BubbleTooltip; exports.default = BubbleTheme; /***/ }, /* 109 */ /***/function (module, exports, __webpack_require__) { module.exports = __webpack_require__(63); /***/ }] /******/)["default"] ); }); /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(247).Buffer, __webpack_require__(251)(module))) /***/ }), /* 134 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCRadioFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(135); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCRadioFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCRadioFoundation, _super); function MDCRadioFoundation(adapter) { return _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCRadioFoundation.defaultAdapter, adapter)) || this; } Object.defineProperty(MDCRadioFoundation, "cssClasses", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCRadioFoundation, "strings", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCRadioFoundation, "defaultAdapter", { get: function get() { return { addClass: function addClass() { return undefined; }, removeClass: function removeClass() { return undefined; }, setNativeControlDisabled: function setNativeControlDisabled() { return undefined; } }; }, enumerable: true, configurable: true }); MDCRadioFoundation.prototype.setDisabled = function (disabled) { var DISABLED = MDCRadioFoundation.cssClasses.DISABLED; this.adapter_.setNativeControlDisabled(disabled); if (disabled) { this.adapter_.addClass(DISABLED); } else { this.adapter_.removeClass(DISABLED); } }; return MDCRadioFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCRadioFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 135 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; }); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var strings = { NATIVE_CONTROL_SELECTOR: '.mdc-radio__native-control' }; var cssClasses = { DISABLED: 'mdc-radio--disabled', ROOT: 'mdc-radio' }; //# sourceMappingURL=constants.js.map /***/ }), /* 136 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCSliderFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_animation_util__ = __webpack_require__(29); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(55); /** * @license * Copyright 2017 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var DOWN_EVENTS = ['mousedown', 'pointerdown', 'touchstart']; var UP_EVENTS = ['mouseup', 'pointerup', 'touchend']; var MOVE_EVENT_MAP = { mousedown: 'mousemove', pointerdown: 'pointermove', touchstart: 'touchmove' }; var KEY_IDS = { ARROW_DOWN: 'ArrowDown', ARROW_LEFT: 'ArrowLeft', ARROW_RIGHT: 'ArrowRight', ARROW_UP: 'ArrowUp', END: 'End', HOME: 'Home', PAGE_DOWN: 'PageDown', PAGE_UP: 'PageUp' }; var MDCSliderFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCSliderFoundation, _super); function MDCSliderFoundation(adapter) { var _this = _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCSliderFoundation.defaultAdapter, adapter)) || this; /** * We set this to NaN since we want it to be a number, but we can't use '0' or '-1' * because those could be valid tabindices set by the client code. */ _this.savedTabIndex_ = NaN; _this.active_ = false; _this.inTransit_ = false; _this.isDiscrete_ = false; _this.hasTrackMarker_ = false; _this.handlingThumbTargetEvt_ = false; _this.min_ = 0; _this.max_ = 100; _this.step_ = 0; _this.value_ = 0; _this.disabled_ = false; _this.preventFocusState_ = false; _this.thumbContainerPointerHandler_ = function () { return _this.handlingThumbTargetEvt_ = true; }; _this.interactionStartHandler_ = function (evt) { return _this.handleDown_(evt); }; _this.keydownHandler_ = function (evt) { return _this.handleKeydown_(evt); }; _this.focusHandler_ = function () { return _this.handleFocus_(); }; _this.blurHandler_ = function () { return _this.handleBlur_(); }; _this.resizeHandler_ = function () { return _this.layout(); }; return _this; } Object.defineProperty(MDCSliderFoundation, "cssClasses", { get: function get() { return __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCSliderFoundation, "strings", { get: function get() { return __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCSliderFoundation, "numbers", { get: function get() { return __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* numbers */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCSliderFoundation, "defaultAdapter", { get: function get() { // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { hasClass: function hasClass() { return false; }, addClass: function addClass() { return undefined; }, removeClass: function removeClass() { return undefined; }, getAttribute: function getAttribute() { return null; }, setAttribute: function setAttribute() { return undefined; }, removeAttribute: function removeAttribute() { return undefined; }, computeBoundingRect: function computeBoundingRect() { return { top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0 }; }, getTabIndex: function getTabIndex() { return 0; }, registerInteractionHandler: function registerInteractionHandler() { return undefined; }, deregisterInteractionHandler: function deregisterInteractionHandler() { return undefined; }, registerThumbContainerInteractionHandler: function registerThumbContainerInteractionHandler() { return undefined; }, deregisterThumbContainerInteractionHandler: function deregisterThumbContainerInteractionHandler() { return undefined; }, registerBodyInteractionHandler: function registerBodyInteractionHandler() { return undefined; }, deregisterBodyInteractionHandler: function deregisterBodyInteractionHandler() { return undefined; }, registerResizeHandler: function registerResizeHandler() { return undefined; }, deregisterResizeHandler: function deregisterResizeHandler() { return undefined; }, notifyInput: function notifyInput() { return undefined; }, notifyChange: function notifyChange() { return undefined; }, setThumbContainerStyleProperty: function setThumbContainerStyleProperty() { return undefined; }, setTrackStyleProperty: function setTrackStyleProperty() { return undefined; }, setMarkerValue: function setMarkerValue() { return undefined; }, appendTrackMarkers: function appendTrackMarkers() { return undefined; }, removeTrackMarkers: function removeTrackMarkers() { return undefined; }, setLastTrackMarkersStyleProperty: function setLastTrackMarkersStyleProperty() { return undefined; }, isRTL: function isRTL() { return false; } }; // tslint:enable:object-literal-sort-keys }, enumerable: true, configurable: true }); MDCSliderFoundation.prototype.init = function () { var _this = this; this.isDiscrete_ = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].IS_DISCRETE); this.hasTrackMarker_ = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].HAS_TRACK_MARKER); DOWN_EVENTS.forEach(function (evtName) { _this.adapter_.registerInteractionHandler(evtName, _this.interactionStartHandler_); _this.adapter_.registerThumbContainerInteractionHandler(evtName, _this.thumbContainerPointerHandler_); }); this.adapter_.registerInteractionHandler('keydown', this.keydownHandler_); this.adapter_.registerInteractionHandler('focus', this.focusHandler_); this.adapter_.registerInteractionHandler('blur', this.blurHandler_); this.adapter_.registerResizeHandler(this.resizeHandler_); this.layout(); // At last step, provide a reasonable default value to discrete slider if (this.isDiscrete_ && this.getStep() === 0) { this.step_ = 1; } }; MDCSliderFoundation.prototype.destroy = function () { var _this = this; DOWN_EVENTS.forEach(function (evtName) { _this.adapter_.deregisterInteractionHandler(evtName, _this.interactionStartHandler_); _this.adapter_.deregisterThumbContainerInteractionHandler(evtName, _this.thumbContainerPointerHandler_); }); this.adapter_.deregisterInteractionHandler('keydown', this.keydownHandler_); this.adapter_.deregisterInteractionHandler('focus', this.focusHandler_); this.adapter_.deregisterInteractionHandler('blur', this.blurHandler_); this.adapter_.deregisterResizeHandler(this.resizeHandler_); }; MDCSliderFoundation.prototype.setupTrackMarker = function () { if (this.isDiscrete_ && this.hasTrackMarker_ && this.getStep() !== 0) { var min = this.getMin(); var max = this.getMax(); var step = this.getStep(); var numMarkers = (max - min) / step; // In case distance between max & min is indivisible to step, // we place the secondary to last marker proportionally at where thumb // could reach and place the last marker at max value var indivisible = Math.ceil(numMarkers) !== numMarkers; if (indivisible) { numMarkers = Math.ceil(numMarkers); } this.adapter_.removeTrackMarkers(); this.adapter_.appendTrackMarkers(numMarkers); if (indivisible) { var lastStepRatio = (max - numMarkers * step) / step + 1; this.adapter_.setLastTrackMarkersStyleProperty('flex-grow', String(lastStepRatio)); } } }; MDCSliderFoundation.prototype.layout = function () { this.rect_ = this.adapter_.computeBoundingRect(); this.updateUIForCurrentValue_(); }; MDCSliderFoundation.prototype.getValue = function () { return this.value_; }; MDCSliderFoundation.prototype.setValue = function (value) { this.setValue_(value, false); }; MDCSliderFoundation.prototype.getMax = function () { return this.max_; }; MDCSliderFoundation.prototype.setMax = function (max) { if (max < this.min_) { throw new Error('Cannot set max to be less than the slider\'s minimum value'); } this.max_ = max; this.setValue_(this.value_, false, true); this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ARIA_VALUEMAX, String(this.max_)); this.setupTrackMarker(); }; MDCSliderFoundation.prototype.getMin = function () { return this.min_; }; MDCSliderFoundation.prototype.setMin = function (min) { if (min > this.max_) { throw new Error('Cannot set min to be greater than the slider\'s maximum value'); } this.min_ = min; this.setValue_(this.value_, false, true); this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ARIA_VALUEMIN, String(this.min_)); this.setupTrackMarker(); }; MDCSliderFoundation.prototype.getStep = function () { return this.step_; }; MDCSliderFoundation.prototype.setStep = function (step) { if (step < 0) { throw new Error('Step cannot be set to a negative number'); } if (this.isDiscrete_ && (typeof step !== 'number' || step < 1)) { step = 1; } this.step_ = step; this.setValue_(this.value_, false, true); this.setupTrackMarker(); }; MDCSliderFoundation.prototype.isDisabled = function () { return this.disabled_; }; MDCSliderFoundation.prototype.setDisabled = function (disabled) { this.disabled_ = disabled; this.toggleClass_(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].DISABLED, this.disabled_); if (this.disabled_) { this.savedTabIndex_ = this.adapter_.getTabIndex(); this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ARIA_DISABLED, 'true'); this.adapter_.removeAttribute('tabindex'); } else { this.adapter_.removeAttribute(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ARIA_DISABLED); if (!isNaN(this.savedTabIndex_)) { this.adapter_.setAttribute('tabindex', String(this.savedTabIndex_)); } } }; /** * Called when the user starts interacting with the slider */ MDCSliderFoundation.prototype.handleDown_ = function (downEvent) { var _this = this; if (this.disabled_) { return; } this.preventFocusState_ = true; this.setInTransit_(!this.handlingThumbTargetEvt_); this.handlingThumbTargetEvt_ = false; this.setActive_(true); var moveHandler = function moveHandler(moveEvent) { _this.handleMove_(moveEvent); }; var moveEventType = MOVE_EVENT_MAP[downEvent.type]; // Note: upHandler is [de]registered on ALL potential pointer-related release event types, since some browsers // do not always fire these consistently in pairs. // (See https://github.com/material-components/material-components-web/issues/1192) var upHandler = function upHandler() { _this.handleUp_(); _this.adapter_.deregisterBodyInteractionHandler(moveEventType, moveHandler); UP_EVENTS.forEach(function (evtName) { return _this.adapter_.deregisterBodyInteractionHandler(evtName, upHandler); }); }; this.adapter_.registerBodyInteractionHandler(moveEventType, moveHandler); UP_EVENTS.forEach(function (evtName) { return _this.adapter_.registerBodyInteractionHandler(evtName, upHandler); }); this.setValueFromEvt_(downEvent); }; /** * Called when the user moves the slider */ MDCSliderFoundation.prototype.handleMove_ = function (evt) { evt.preventDefault(); this.setValueFromEvt_(evt); }; /** * Called when the user's interaction with the slider ends */ MDCSliderFoundation.prototype.handleUp_ = function () { this.setActive_(false); this.adapter_.notifyChange(); }; /** * Returns the pageX of the event */ MDCSliderFoundation.prototype.getPageX_ = function (evt) { if (evt.targetTouches && evt.targetTouches.length > 0) { return evt.targetTouches[0].pageX; } return evt.pageX; }; /** * Sets the slider value from an event */ MDCSliderFoundation.prototype.setValueFromEvt_ = function (evt) { var pageX = this.getPageX_(evt); var value = this.computeValueFromPageX_(pageX); this.setValue_(value, true); }; /** * Computes the new value from the pageX position */ MDCSliderFoundation.prototype.computeValueFromPageX_ = function (pageX) { var _a = this, max = _a.max_, min = _a.min_; var xPos = pageX - this.rect_.left; var pctComplete = xPos / this.rect_.width; if (this.adapter_.isRTL()) { pctComplete = 1 - pctComplete; } // Fit the percentage complete between the range [min,max] // by remapping from [0, 1] to [min, min+(max-min)]. return min + pctComplete * (max - min); }; /** * Handles keydown events */ MDCSliderFoundation.prototype.handleKeydown_ = function (evt) { var keyId = this.getKeyId_(evt); var value = this.getValueForKeyId_(keyId); if (isNaN(value)) { return; } // Prevent page from scrolling due to key presses that would normally scroll the page evt.preventDefault(); this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].FOCUS); this.setValue_(value, true); this.adapter_.notifyChange(); }; /** * Returns the computed name of the event */ MDCSliderFoundation.prototype.getKeyId_ = function (kbdEvt) { if (kbdEvt.key === KEY_IDS.ARROW_LEFT || kbdEvt.keyCode === 37) { return KEY_IDS.ARROW_LEFT; } if (kbdEvt.key === KEY_IDS.ARROW_RIGHT || kbdEvt.keyCode === 39) { return KEY_IDS.ARROW_RIGHT; } if (kbdEvt.key === KEY_IDS.ARROW_UP || kbdEvt.keyCode === 38) { return KEY_IDS.ARROW_UP; } if (kbdEvt.key === KEY_IDS.ARROW_DOWN || kbdEvt.keyCode === 40) { return KEY_IDS.ARROW_DOWN; } if (kbdEvt.key === KEY_IDS.HOME || kbdEvt.keyCode === 36) { return KEY_IDS.HOME; } if (kbdEvt.key === KEY_IDS.END || kbdEvt.keyCode === 35) { return KEY_IDS.END; } if (kbdEvt.key === KEY_IDS.PAGE_UP || kbdEvt.keyCode === 33) { return KEY_IDS.PAGE_UP; } if (kbdEvt.key === KEY_IDS.PAGE_DOWN || kbdEvt.keyCode === 34) { return KEY_IDS.PAGE_DOWN; } return ''; }; /** * Computes the value given a keyboard key ID */ MDCSliderFoundation.prototype.getValueForKeyId_ = function (keyId) { var _a = this, max = _a.max_, min = _a.min_, step = _a.step_; var delta = step || (max - min) / 100; var valueNeedsToBeFlipped = this.adapter_.isRTL() && (keyId === KEY_IDS.ARROW_LEFT || keyId === KEY_IDS.ARROW_RIGHT); if (valueNeedsToBeFlipped) { delta = -delta; } switch (keyId) { case KEY_IDS.ARROW_LEFT: case KEY_IDS.ARROW_DOWN: return this.value_ - delta; case KEY_IDS.ARROW_RIGHT: case KEY_IDS.ARROW_UP: return this.value_ + delta; case KEY_IDS.HOME: return this.min_; case KEY_IDS.END: return this.max_; case KEY_IDS.PAGE_UP: return this.value_ + delta * __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* numbers */].PAGE_FACTOR; case KEY_IDS.PAGE_DOWN: return this.value_ - delta * __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* numbers */].PAGE_FACTOR; default: return NaN; } }; MDCSliderFoundation.prototype.handleFocus_ = function () { if (this.preventFocusState_) { return; } this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].FOCUS); }; MDCSliderFoundation.prototype.handleBlur_ = function () { this.preventFocusState_ = false; this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].FOCUS); }; /** * Sets the value of the slider */ MDCSliderFoundation.prototype.setValue_ = function (value, shouldFireInput, force) { if (force === void 0) { force = false; } if (value === this.value_ && !force) { return; } var _a = this, min = _a.min_, max = _a.max_; var valueSetToBoundary = value === min || value === max; if (this.step_ && !valueSetToBoundary) { value = this.quantize_(value); } if (value < min) { value = min; } else if (value > max) { value = max; } this.value_ = value; this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ARIA_VALUENOW, String(this.value_)); this.updateUIForCurrentValue_(); if (shouldFireInput) { this.adapter_.notifyInput(); if (this.isDiscrete_) { this.adapter_.setMarkerValue(value); } } }; /** * Calculates the quantized value */ MDCSliderFoundation.prototype.quantize_ = function (value) { var numSteps = Math.round(value / this.step_); return numSteps * this.step_; }; MDCSliderFoundation.prototype.updateUIForCurrentValue_ = function () { var _this = this; var _a = this, max = _a.max_, min = _a.min_, value = _a.value_; var pctComplete = (value - min) / (max - min); var translatePx = pctComplete * this.rect_.width; if (this.adapter_.isRTL()) { translatePx = this.rect_.width - translatePx; } var transformProp = Object(__WEBPACK_IMPORTED_MODULE_1__material_animation_util__["b" /* getCorrectPropertyName */])(window, 'transform'); var transitionendEvtName = Object(__WEBPACK_IMPORTED_MODULE_1__material_animation_util__["a" /* getCorrectEventName */])(window, 'transitionend'); if (this.inTransit_) { var onTransitionEnd_1 = function onTransitionEnd_1() { _this.setInTransit_(false); _this.adapter_.deregisterThumbContainerInteractionHandler(transitionendEvtName, onTransitionEnd_1); }; this.adapter_.registerThumbContainerInteractionHandler(transitionendEvtName, onTransitionEnd_1); } requestAnimationFrame(function () { // NOTE(traviskaufman): It would be nice to use calc() here, // but IE cannot handle calcs in transforms correctly. // See: https://goo.gl/NC2itk // Also note that the -50% offset is used to center the slider thumb. _this.adapter_.setThumbContainerStyleProperty(transformProp, "translateX(" + translatePx + "px) translateX(-50%)"); _this.adapter_.setTrackStyleProperty(transformProp, "scaleX(" + pctComplete + ")"); }); }; /** * Toggles the active state of the slider */ MDCSliderFoundation.prototype.setActive_ = function (active) { this.active_ = active; this.toggleClass_(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].ACTIVE, this.active_); }; /** * Toggles the inTransit state of the slider */ MDCSliderFoundation.prototype.setInTransit_ = function (inTransit) { this.inTransit_ = inTransit; this.toggleClass_(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].IN_TRANSIT, this.inTransit_); }; /** * Conditionally adds or removes a class based on shouldBePresent */ MDCSliderFoundation.prototype.toggleClass_ = function (className, shouldBePresent) { if (shouldBePresent) { this.adapter_.addClass(className); } else { this.adapter_.removeClass(className); } }; return MDCSliderFoundation; }(__WEBPACK_IMPORTED_MODULE_2__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCSliderFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 137 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; }); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var cssClasses = { ANIMATING: 'mdc-tab-scroller--animating', SCROLL_AREA_SCROLL: 'mdc-tab-scroller__scroll-area--scroll', SCROLL_TEST: 'mdc-tab-scroller__test' }; var strings = { AREA_SELECTOR: '.mdc-tab-scroller__scroll-area', CONTENT_SELECTOR: '.mdc-tab-scroller__scroll-content' }; //# sourceMappingURL=constants.js.map /***/ }), /* 138 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTabFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(277); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCTabFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCTabFoundation, _super); function MDCTabFoundation(adapter) { var _this = _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCTabFoundation.defaultAdapter, adapter)) || this; _this.focusOnActivate_ = true; return _this; } Object.defineProperty(MDCTabFoundation, "cssClasses", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCTabFoundation, "strings", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCTabFoundation, "defaultAdapter", { get: function get() { // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { addClass: function addClass() { return undefined; }, removeClass: function removeClass() { return undefined; }, hasClass: function hasClass() { return false; }, setAttr: function setAttr() { return undefined; }, activateIndicator: function activateIndicator() { return undefined; }, deactivateIndicator: function deactivateIndicator() { return undefined; }, notifyInteracted: function notifyInteracted() { return undefined; }, getOffsetLeft: function getOffsetLeft() { return 0; }, getOffsetWidth: function getOffsetWidth() { return 0; }, getContentOffsetLeft: function getContentOffsetLeft() { return 0; }, getContentOffsetWidth: function getContentOffsetWidth() { return 0; }, focus: function focus() { return undefined; } }; // tslint:enable:object-literal-sort-keys }, enumerable: true, configurable: true }); MDCTabFoundation.prototype.handleClick = function () { // It's up to the parent component to keep track of the active Tab and // ensure we don't activate a Tab that's already active. this.adapter_.notifyInteracted(); }; MDCTabFoundation.prototype.isActive = function () { return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ACTIVE); }; /** * Sets whether the tab should focus itself when activated */ MDCTabFoundation.prototype.setFocusOnActivate = function (focusOnActivate) { this.focusOnActivate_ = focusOnActivate; }; /** * Activates the Tab */ MDCTabFoundation.prototype.activate = function (previousIndicatorClientRect) { this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ACTIVE); this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED, 'true'); this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].TABINDEX, '0'); this.adapter_.activateIndicator(previousIndicatorClientRect); if (this.focusOnActivate_) { this.adapter_.focus(); } }; /** * Deactivates the Tab */ MDCTabFoundation.prototype.deactivate = function () { // Early exit if (!this.isActive()) { return; } this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ACTIVE); this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED, 'false'); this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].TABINDEX, '-1'); this.adapter_.deactivateIndicator(); }; /** * Returns the dimensions of the Tab */ MDCTabFoundation.prototype.computeDimensions = function () { var rootWidth = this.adapter_.getOffsetWidth(); var rootLeft = this.adapter_.getOffsetLeft(); var contentWidth = this.adapter_.getContentOffsetWidth(); var contentLeft = this.adapter_.getContentOffsetLeft(); return { contentLeft: rootLeft + contentLeft, contentRight: rootLeft + contentLeft + contentWidth, rootLeft: rootLeft, rootRight: rootLeft + rootWidth }; }; return MDCTabFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTabFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 139 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTabBarFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(140); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var ACCEPTABLE_KEYS = new Set(); // IE11 has no support for new Set with iterable so we need to initialize this by hand ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARROW_LEFT_KEY); ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARROW_RIGHT_KEY); ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].END_KEY); ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].HOME_KEY); ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ENTER_KEY); ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].SPACE_KEY); var KEYCODE_MAP = new Map(); // IE11 has no support for new Map with iterable so we need to initialize this by hand KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* numbers */].ARROW_LEFT_KEYCODE, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARROW_LEFT_KEY); KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* numbers */].ARROW_RIGHT_KEYCODE, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARROW_RIGHT_KEY); KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* numbers */].END_KEYCODE, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].END_KEY); KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* numbers */].HOME_KEYCODE, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].HOME_KEY); KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* numbers */].ENTER_KEYCODE, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ENTER_KEY); KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* numbers */].SPACE_KEYCODE, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].SPACE_KEY); var MDCTabBarFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCTabBarFoundation, _super); function MDCTabBarFoundation(adapter) { var _this = _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCTabBarFoundation.defaultAdapter, adapter)) || this; _this.useAutomaticActivation_ = false; return _this; } Object.defineProperty(MDCTabBarFoundation, "strings", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCTabBarFoundation, "numbers", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* numbers */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCTabBarFoundation, "defaultAdapter", { get: function get() { // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { scrollTo: function scrollTo() { return undefined; }, incrementScroll: function incrementScroll() { return undefined; }, getScrollPosition: function getScrollPosition() { return 0; }, getScrollContentWidth: function getScrollContentWidth() { return 0; }, getOffsetWidth: function getOffsetWidth() { return 0; }, isRTL: function isRTL() { return false; }, setActiveTab: function setActiveTab() { return undefined; }, activateTabAtIndex: function activateTabAtIndex() { return undefined; }, deactivateTabAtIndex: function deactivateTabAtIndex() { return undefined; }, focusTabAtIndex: function focusTabAtIndex() { return undefined; }, getTabIndicatorClientRectAtIndex: function getTabIndicatorClientRectAtIndex() { return { top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0 }; }, getTabDimensionsAtIndex: function getTabDimensionsAtIndex() { return { rootLeft: 0, rootRight: 0, contentLeft: 0, contentRight: 0 }; }, getPreviousActiveTabIndex: function getPreviousActiveTabIndex() { return -1; }, getFocusedTabIndex: function getFocusedTabIndex() { return -1; }, getIndexOfTabById: function getIndexOfTabById() { return -1; }, getTabListLength: function getTabListLength() { return 0; }, notifyTabActivated: function notifyTabActivated() { return undefined; } }; // tslint:enable:object-literal-sort-keys }, enumerable: true, configurable: true }); /** * Switches between automatic and manual activation modes. * See https://www.w3.org/TR/wai-aria-practices/#tabpanel for examples. */ MDCTabBarFoundation.prototype.setUseAutomaticActivation = function (useAutomaticActivation) { this.useAutomaticActivation_ = useAutomaticActivation; }; MDCTabBarFoundation.prototype.activateTab = function (index) { var previousActiveIndex = this.adapter_.getPreviousActiveTabIndex(); if (!this.indexIsInRange_(index) || index === previousActiveIndex) { return; } var previousClientRect; if (previousActiveIndex !== -1) { this.adapter_.deactivateTabAtIndex(previousActiveIndex); previousClientRect = this.adapter_.getTabIndicatorClientRectAtIndex(previousActiveIndex); } this.adapter_.activateTabAtIndex(index, previousClientRect); this.scrollIntoView(index); this.adapter_.notifyTabActivated(index); }; MDCTabBarFoundation.prototype.handleKeyDown = function (evt) { // Get the key from the event var key = this.getKeyFromEvent_(evt); // Early exit if the event key isn't one of the keyboard navigation keys if (key === undefined) { return; } // Prevent default behavior for movement keys, but not for activation keys, since :active is used to apply ripple if (!this.isActivationKey_(key)) { evt.preventDefault(); } if (this.useAutomaticActivation_) { if (this.isActivationKey_(key)) { return; } var index = this.determineTargetFromKey_(this.adapter_.getPreviousActiveTabIndex(), key); this.adapter_.setActiveTab(index); this.scrollIntoView(index); } else { var focusedTabIndex = this.adapter_.getFocusedTabIndex(); if (this.isActivationKey_(key)) { this.adapter_.setActiveTab(focusedTabIndex); } else { var index = this.determineTargetFromKey_(focusedTabIndex, key); this.adapter_.focusTabAtIndex(index); this.scrollIntoView(index); } } }; /** * Handles the MDCTab:interacted event */ MDCTabBarFoundation.prototype.handleTabInteraction = function (evt) { this.adapter_.setActiveTab(this.adapter_.getIndexOfTabById(evt.detail.tabId)); }; /** * Scrolls the tab at the given index into view * @param index The tab index to make visible */ MDCTabBarFoundation.prototype.scrollIntoView = function (index) { // Early exit if the index is out of range if (!this.indexIsInRange_(index)) { return; } // Always scroll to 0 if scrolling to the 0th index if (index === 0) { return this.adapter_.scrollTo(0); } // Always scroll to the max value if scrolling to the Nth index // MDCTabScroller.scrollTo() will never scroll past the max possible value if (index === this.adapter_.getTabListLength() - 1) { return this.adapter_.scrollTo(this.adapter_.getScrollContentWidth()); } if (this.isRTL_()) { return this.scrollIntoViewRTL_(index); } this.scrollIntoView_(index); }; /** * Private method for determining the index of the destination tab based on what key was pressed * @param origin The original index from which to determine the destination * @param key The name of the key */ MDCTabBarFoundation.prototype.determineTargetFromKey_ = function (origin, key) { var isRTL = this.isRTL_(); var maxIndex = this.adapter_.getTabListLength() - 1; var shouldGoToEnd = key === __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].END_KEY; var shouldDecrement = key === __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARROW_LEFT_KEY && !isRTL || key === __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARROW_RIGHT_KEY && isRTL; var shouldIncrement = key === __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARROW_RIGHT_KEY && !isRTL || key === __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARROW_LEFT_KEY && isRTL; var index = origin; if (shouldGoToEnd) { index = maxIndex; } else if (shouldDecrement) { index -= 1; } else if (shouldIncrement) { index += 1; } else { index = 0; } if (index < 0) { index = maxIndex; } else if (index > maxIndex) { index = 0; } return index; }; /** * Calculates the scroll increment that will make the tab at the given index visible * @param index The index of the tab * @param nextIndex The index of the next tab * @param scrollPosition The current scroll position * @param barWidth The width of the Tab Bar */ MDCTabBarFoundation.prototype.calculateScrollIncrement_ = function (index, nextIndex, scrollPosition, barWidth) { var nextTabDimensions = this.adapter_.getTabDimensionsAtIndex(nextIndex); var relativeContentLeft = nextTabDimensions.contentLeft - scrollPosition - barWidth; var relativeContentRight = nextTabDimensions.contentRight - scrollPosition; var leftIncrement = relativeContentRight - __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* numbers */].EXTRA_SCROLL_AMOUNT; var rightIncrement = relativeContentLeft + __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* numbers */].EXTRA_SCROLL_AMOUNT; if (nextIndex < index) { return Math.min(leftIncrement, 0); } return Math.max(rightIncrement, 0); }; /** * Calculates the scroll increment that will make the tab at the given index visible in RTL * @param index The index of the tab * @param nextIndex The index of the next tab * @param scrollPosition The current scroll position * @param barWidth The width of the Tab Bar * @param scrollContentWidth The width of the scroll content */ MDCTabBarFoundation.prototype.calculateScrollIncrementRTL_ = function (index, nextIndex, scrollPosition, barWidth, scrollContentWidth) { var nextTabDimensions = this.adapter_.getTabDimensionsAtIndex(nextIndex); var relativeContentLeft = scrollContentWidth - nextTabDimensions.contentLeft - scrollPosition; var relativeContentRight = scrollContentWidth - nextTabDimensions.contentRight - scrollPosition - barWidth; var leftIncrement = relativeContentRight + __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* numbers */].EXTRA_SCROLL_AMOUNT; var rightIncrement = relativeContentLeft - __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* numbers */].EXTRA_SCROLL_AMOUNT; if (nextIndex > index) { return Math.max(leftIncrement, 0); } return Math.min(rightIncrement, 0); }; /** * Determines the index of the adjacent tab closest to either edge of the Tab Bar * @param index The index of the tab * @param tabDimensions The dimensions of the tab * @param scrollPosition The current scroll position * @param barWidth The width of the tab bar */ MDCTabBarFoundation.prototype.findAdjacentTabIndexClosestToEdge_ = function (index, tabDimensions, scrollPosition, barWidth) { /** * Tabs are laid out in the Tab Scroller like this: * * Scroll Position * +---+ * | | Bar Width * | +-----------------------------------+ * | | | * | V V * | +-----------------------------------+ * V | Tab Scroller | * +------------+--------------+-------------------+ * | Tab | Tab | Tab | * +------------+--------------+-------------------+ * | | * +-----------------------------------+ * * To determine the next adjacent index, we look at the Tab root left and * Tab root right, both relative to the scroll position. If the Tab root * left is less than 0, then we know it's out of view to the left. If the * Tab root right minus the bar width is greater than 0, we know the Tab is * out of view to the right. From there, we either increment or decrement * the index. */ var relativeRootLeft = tabDimensions.rootLeft - scrollPosition; var relativeRootRight = tabDimensions.rootRight - scrollPosition - barWidth; var relativeRootDelta = relativeRootLeft + relativeRootRight; var leftEdgeIsCloser = relativeRootLeft < 0 || relativeRootDelta < 0; var rightEdgeIsCloser = relativeRootRight > 0 || relativeRootDelta > 0; if (leftEdgeIsCloser) { return index - 1; } if (rightEdgeIsCloser) { return index + 1; } return -1; }; /** * Determines the index of the adjacent tab closest to either edge of the Tab Bar in RTL * @param index The index of the tab * @param tabDimensions The dimensions of the tab * @param scrollPosition The current scroll position * @param barWidth The width of the tab bar * @param scrollContentWidth The width of the scroller content */ MDCTabBarFoundation.prototype.findAdjacentTabIndexClosestToEdgeRTL_ = function (index, tabDimensions, scrollPosition, barWidth, scrollContentWidth) { var rootLeft = scrollContentWidth - tabDimensions.rootLeft - barWidth - scrollPosition; var rootRight = scrollContentWidth - tabDimensions.rootRight - scrollPosition; var rootDelta = rootLeft + rootRight; var leftEdgeIsCloser = rootLeft > 0 || rootDelta > 0; var rightEdgeIsCloser = rootRight < 0 || rootDelta < 0; if (leftEdgeIsCloser) { return index + 1; } if (rightEdgeIsCloser) { return index - 1; } return -1; }; /** * Returns the key associated with a keydown event * @param evt The keydown event */ MDCTabBarFoundation.prototype.getKeyFromEvent_ = function (evt) { if (ACCEPTABLE_KEYS.has(evt.key)) { return evt.key; } return KEYCODE_MAP.get(evt.keyCode); }; MDCTabBarFoundation.prototype.isActivationKey_ = function (key) { return key === __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].SPACE_KEY || key === __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ENTER_KEY; }; /** * Returns whether a given index is inclusively between the ends * @param index The index to test */ MDCTabBarFoundation.prototype.indexIsInRange_ = function (index) { return index >= 0 && index < this.adapter_.getTabListLength(); }; /** * Returns the view's RTL property */ MDCTabBarFoundation.prototype.isRTL_ = function () { return this.adapter_.isRTL(); }; /** * Scrolls the tab at the given index into view for left-to-right user agents. * @param index The index of the tab to scroll into view */ MDCTabBarFoundation.prototype.scrollIntoView_ = function (index) { var scrollPosition = this.adapter_.getScrollPosition(); var barWidth = this.adapter_.getOffsetWidth(); var tabDimensions = this.adapter_.getTabDimensionsAtIndex(index); var nextIndex = this.findAdjacentTabIndexClosestToEdge_(index, tabDimensions, scrollPosition, barWidth); if (!this.indexIsInRange_(nextIndex)) { return; } var scrollIncrement = this.calculateScrollIncrement_(index, nextIndex, scrollPosition, barWidth); this.adapter_.incrementScroll(scrollIncrement); }; /** * Scrolls the tab at the given index into view in RTL * @param index The tab index to make visible */ MDCTabBarFoundation.prototype.scrollIntoViewRTL_ = function (index) { var scrollPosition = this.adapter_.getScrollPosition(); var barWidth = this.adapter_.getOffsetWidth(); var tabDimensions = this.adapter_.getTabDimensionsAtIndex(index); var scrollWidth = this.adapter_.getScrollContentWidth(); var nextIndex = this.findAdjacentTabIndexClosestToEdgeRTL_(index, tabDimensions, scrollPosition, barWidth, scrollWidth); if (!this.indexIsInRange_(nextIndex)) { return; } var scrollIncrement = this.calculateScrollIncrementRTL_(index, nextIndex, scrollPosition, barWidth, scrollWidth); this.adapter_.incrementScroll(scrollIncrement); }; return MDCTabBarFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTabBarFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 140 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return numbers; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; }); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var strings = { ARROW_LEFT_KEY: 'ArrowLeft', ARROW_RIGHT_KEY: 'ArrowRight', END_KEY: 'End', ENTER_KEY: 'Enter', HOME_KEY: 'Home', SPACE_KEY: 'Space', TAB_ACTIVATED_EVENT: 'MDCTabBar:activated', TAB_SCROLLER_SELECTOR: '.mdc-tab-scroller', TAB_SELECTOR: '.mdc-tab' }; var numbers = { ARROW_LEFT_KEYCODE: 37, ARROW_RIGHT_KEYCODE: 39, END_KEYCODE: 35, ENTER_KEYCODE: 13, EXTRA_SCROLL_AMOUNT: 20, HOME_KEYCODE: 36, SPACE_KEYCODE: 32 }; //# sourceMappingURL=constants.js.map /***/ }), /* 141 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCRippleFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(14); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(283); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(142); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ // Activation events registered on the root element of each instance for activation var ACTIVATION_EVENT_TYPES = ['touchstart', 'pointerdown', 'mousedown', 'keydown']; // Deactivation events registered on documentElement when a pointer-related down event occurs var POINTER_DEACTIVATION_EVENT_TYPES = ['touchend', 'pointerup', 'mouseup', 'contextmenu']; // simultaneous nested activations var activatedTargets = []; var MDCRippleFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["c" /* __extends */](MDCRippleFoundation, _super); function MDCRippleFoundation(adapter) { var _this = _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCRippleFoundation.defaultAdapter, adapter)) || this; _this.activationAnimationHasEnded_ = false; _this.activationTimer_ = 0; _this.fgDeactivationRemovalTimer_ = 0; _this.fgScale_ = '0'; _this.frame_ = { width: 0, height: 0 }; _this.initialSize_ = 0; _this.layoutFrame_ = 0; _this.maxRadius_ = 0; _this.unboundedCoords_ = { left: 0, top: 0 }; _this.activationState_ = _this.defaultActivationState_(); _this.activationTimerCallback_ = function () { _this.activationAnimationHasEnded_ = true; _this.runDeactivationUXLogicIfReady_(); }; _this.activateHandler_ = function (e) { return _this.activate_(e); }; _this.deactivateHandler_ = function () { return _this.deactivate_(); }; _this.focusHandler_ = function () { return _this.handleFocus(); }; _this.blurHandler_ = function () { return _this.handleBlur(); }; _this.resizeHandler_ = function () { return _this.layout(); }; return _this; } Object.defineProperty(MDCRippleFoundation, "cssClasses", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCRippleFoundation, "strings", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCRippleFoundation, "numbers", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCRippleFoundation, "defaultAdapter", { get: function get() { return { addClass: function addClass() { return undefined; }, browserSupportsCssVars: function browserSupportsCssVars() { return true; }, computeBoundingRect: function computeBoundingRect() { return { top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0 }; }, containsEventTarget: function containsEventTarget() { return true; }, deregisterDocumentInteractionHandler: function deregisterDocumentInteractionHandler() { return undefined; }, deregisterInteractionHandler: function deregisterInteractionHandler() { return undefined; }, deregisterResizeHandler: function deregisterResizeHandler() { return undefined; }, getWindowPageOffset: function getWindowPageOffset() { return { x: 0, y: 0 }; }, isSurfaceActive: function isSurfaceActive() { return true; }, isSurfaceDisabled: function isSurfaceDisabled() { return true; }, isUnbounded: function isUnbounded() { return true; }, registerDocumentInteractionHandler: function registerDocumentInteractionHandler() { return undefined; }, registerInteractionHandler: function registerInteractionHandler() { return undefined; }, registerResizeHandler: function registerResizeHandler() { return undefined; }, removeClass: function removeClass() { return undefined; }, updateCssVariable: function updateCssVariable() { return undefined; } }; }, enumerable: true, configurable: true }); MDCRippleFoundation.prototype.init = function () { var _this = this; var supportsPressRipple = this.supportsPressRipple_(); this.registerRootHandlers_(supportsPressRipple); if (supportsPressRipple) { var _a = MDCRippleFoundation.cssClasses, ROOT_1 = _a.ROOT, UNBOUNDED_1 = _a.UNBOUNDED; requestAnimationFrame(function () { _this.adapter_.addClass(ROOT_1); if (_this.adapter_.isUnbounded()) { _this.adapter_.addClass(UNBOUNDED_1); // Unbounded ripples need layout logic applied immediately to set coordinates for both shade and ripple _this.layoutInternal_(); } }); } }; MDCRippleFoundation.prototype.destroy = function () { var _this = this; if (this.supportsPressRipple_()) { if (this.activationTimer_) { clearTimeout(this.activationTimer_); this.activationTimer_ = 0; this.adapter_.removeClass(MDCRippleFoundation.cssClasses.FG_ACTIVATION); } if (this.fgDeactivationRemovalTimer_) { clearTimeout(this.fgDeactivationRemovalTimer_); this.fgDeactivationRemovalTimer_ = 0; this.adapter_.removeClass(MDCRippleFoundation.cssClasses.FG_DEACTIVATION); } var _a = MDCRippleFoundation.cssClasses, ROOT_2 = _a.ROOT, UNBOUNDED_2 = _a.UNBOUNDED; requestAnimationFrame(function () { _this.adapter_.removeClass(ROOT_2); _this.adapter_.removeClass(UNBOUNDED_2); _this.removeCssVars_(); }); } this.deregisterRootHandlers_(); this.deregisterDeactivationHandlers_(); }; /** * @param evt Optional event containing position information. */ MDCRippleFoundation.prototype.activate = function (evt) { this.activate_(evt); }; MDCRippleFoundation.prototype.deactivate = function () { this.deactivate_(); }; MDCRippleFoundation.prototype.layout = function () { var _this = this; if (this.layoutFrame_) { cancelAnimationFrame(this.layoutFrame_); } this.layoutFrame_ = requestAnimationFrame(function () { _this.layoutInternal_(); _this.layoutFrame_ = 0; }); }; MDCRippleFoundation.prototype.setUnbounded = function (unbounded) { var UNBOUNDED = MDCRippleFoundation.cssClasses.UNBOUNDED; if (unbounded) { this.adapter_.addClass(UNBOUNDED); } else { this.adapter_.removeClass(UNBOUNDED); } }; MDCRippleFoundation.prototype.handleFocus = function () { var _this = this; requestAnimationFrame(function () { return _this.adapter_.addClass(MDCRippleFoundation.cssClasses.BG_FOCUSED); }); }; MDCRippleFoundation.prototype.handleBlur = function () { var _this = this; requestAnimationFrame(function () { return _this.adapter_.removeClass(MDCRippleFoundation.cssClasses.BG_FOCUSED); }); }; /** * We compute this property so that we are not querying information about the client * until the point in time where the foundation requests it. This prevents scenarios where * client-side feature-detection may happen too early, such as when components are rendered on the server * and then initialized at mount time on the client. */ MDCRippleFoundation.prototype.supportsPressRipple_ = function () { return this.adapter_.browserSupportsCssVars(); }; MDCRippleFoundation.prototype.defaultActivationState_ = function () { return { activationEvent: undefined, hasDeactivationUXRun: false, isActivated: false, isProgrammatic: false, wasActivatedByPointer: false, wasElementMadeActive: false }; }; /** * supportsPressRipple Passed from init to save a redundant function call */ MDCRippleFoundation.prototype.registerRootHandlers_ = function (supportsPressRipple) { var _this = this; if (supportsPressRipple) { ACTIVATION_EVENT_TYPES.forEach(function (evtType) { _this.adapter_.registerInteractionHandler(evtType, _this.activateHandler_); }); if (this.adapter_.isUnbounded()) { this.adapter_.registerResizeHandler(this.resizeHandler_); } } this.adapter_.registerInteractionHandler('focus', this.focusHandler_); this.adapter_.registerInteractionHandler('blur', this.blurHandler_); }; MDCRippleFoundation.prototype.registerDeactivationHandlers_ = function (evt) { var _this = this; if (evt.type === 'keydown') { this.adapter_.registerInteractionHandler('keyup', this.deactivateHandler_); } else { POINTER_DEACTIVATION_EVENT_TYPES.forEach(function (evtType) { _this.adapter_.registerDocumentInteractionHandler(evtType, _this.deactivateHandler_); }); } }; MDCRippleFoundation.prototype.deregisterRootHandlers_ = function () { var _this = this; ACTIVATION_EVENT_TYPES.forEach(function (evtType) { _this.adapter_.deregisterInteractionHandler(evtType, _this.activateHandler_); }); this.adapter_.deregisterInteractionHandler('focus', this.focusHandler_); this.adapter_.deregisterInteractionHandler('blur', this.blurHandler_); if (this.adapter_.isUnbounded()) { this.adapter_.deregisterResizeHandler(this.resizeHandler_); } }; MDCRippleFoundation.prototype.deregisterDeactivationHandlers_ = function () { var _this = this; this.adapter_.deregisterInteractionHandler('keyup', this.deactivateHandler_); POINTER_DEACTIVATION_EVENT_TYPES.forEach(function (evtType) { _this.adapter_.deregisterDocumentInteractionHandler(evtType, _this.deactivateHandler_); }); }; MDCRippleFoundation.prototype.removeCssVars_ = function () { var _this = this; var rippleStrings = MDCRippleFoundation.strings; var keys = Object.keys(rippleStrings); keys.forEach(function (key) { if (key.indexOf('VAR_') === 0) { _this.adapter_.updateCssVariable(rippleStrings[key], null); } }); }; MDCRippleFoundation.prototype.activate_ = function (evt) { var _this = this; if (this.adapter_.isSurfaceDisabled()) { return; } var activationState = this.activationState_; if (activationState.isActivated) { return; } // Avoid reacting to follow-on events fired by touch device after an already-processed user interaction var previousActivationEvent = this.previousActivationEvent_; var isSameInteraction = previousActivationEvent && evt !== undefined && previousActivationEvent.type !== evt.type; if (isSameInteraction) { return; } activationState.isActivated = true; activationState.isProgrammatic = evt === undefined; activationState.activationEvent = evt; activationState.wasActivatedByPointer = activationState.isProgrammatic ? false : evt !== undefined && (evt.type === 'mousedown' || evt.type === 'touchstart' || evt.type === 'pointerdown'); var hasActivatedChild = evt !== undefined && activatedTargets.length > 0 && activatedTargets.some(function (target) { return _this.adapter_.containsEventTarget(target); }); if (hasActivatedChild) { // Immediately reset activation state, while preserving logic that prevents touch follow-on events this.resetActivationState_(); return; } if (evt !== undefined) { activatedTargets.push(evt.target); this.registerDeactivationHandlers_(evt); } activationState.wasElementMadeActive = this.checkElementMadeActive_(evt); if (activationState.wasElementMadeActive) { this.animateActivation_(); } requestAnimationFrame(function () { // Reset array on next frame after the current event has had a chance to bubble to prevent ancestor ripples activatedTargets = []; if (!activationState.wasElementMadeActive && evt !== undefined && (evt.key === ' ' || evt.keyCode === 32)) { // If space was pressed, try again within an rAF call to detect :active, because different UAs report // active states inconsistently when they're called within event handling code: // - https://bugs.chromium.org/p/chromium/issues/detail?id=635971 // - https://bugzilla.mozilla.org/show_bug.cgi?id=1293741 // We try first outside rAF to support Edge, which does not exhibit this problem, but will crash if a CSS // variable is set within a rAF callback for a submit button interaction (#2241). activationState.wasElementMadeActive = _this.checkElementMadeActive_(evt); if (activationState.wasElementMadeActive) { _this.animateActivation_(); } } if (!activationState.wasElementMadeActive) { // Reset activation state immediately if element was not made active. _this.activationState_ = _this.defaultActivationState_(); } }); }; MDCRippleFoundation.prototype.checkElementMadeActive_ = function (evt) { return evt !== undefined && evt.type === 'keydown' ? this.adapter_.isSurfaceActive() : true; }; MDCRippleFoundation.prototype.animateActivation_ = function () { var _this = this; var _a = MDCRippleFoundation.strings, VAR_FG_TRANSLATE_START = _a.VAR_FG_TRANSLATE_START, VAR_FG_TRANSLATE_END = _a.VAR_FG_TRANSLATE_END; var _b = MDCRippleFoundation.cssClasses, FG_DEACTIVATION = _b.FG_DEACTIVATION, FG_ACTIVATION = _b.FG_ACTIVATION; var DEACTIVATION_TIMEOUT_MS = MDCRippleFoundation.numbers.DEACTIVATION_TIMEOUT_MS; this.layoutInternal_(); var translateStart = ''; var translateEnd = ''; if (!this.adapter_.isUnbounded()) { var _c = this.getFgTranslationCoordinates_(), startPoint = _c.startPoint, endPoint = _c.endPoint; translateStart = startPoint.x + "px, " + startPoint.y + "px"; translateEnd = endPoint.x + "px, " + endPoint.y + "px"; } this.adapter_.updateCssVariable(VAR_FG_TRANSLATE_START, translateStart); this.adapter_.updateCssVariable(VAR_FG_TRANSLATE_END, translateEnd); // Cancel any ongoing activation/deactivation animations clearTimeout(this.activationTimer_); clearTimeout(this.fgDeactivationRemovalTimer_); this.rmBoundedActivationClasses_(); this.adapter_.removeClass(FG_DEACTIVATION); // Force layout in order to re-trigger the animation. this.adapter_.computeBoundingRect(); this.adapter_.addClass(FG_ACTIVATION); this.activationTimer_ = setTimeout(function () { return _this.activationTimerCallback_(); }, DEACTIVATION_TIMEOUT_MS); }; MDCRippleFoundation.prototype.getFgTranslationCoordinates_ = function () { var _a = this.activationState_, activationEvent = _a.activationEvent, wasActivatedByPointer = _a.wasActivatedByPointer; var startPoint; if (wasActivatedByPointer) { startPoint = Object(__WEBPACK_IMPORTED_MODULE_3__util__["a" /* getNormalizedEventCoords */])(activationEvent, this.adapter_.getWindowPageOffset(), this.adapter_.computeBoundingRect()); } else { startPoint = { x: this.frame_.width / 2, y: this.frame_.height / 2 }; } // Center the element around the start point. startPoint = { x: startPoint.x - this.initialSize_ / 2, y: startPoint.y - this.initialSize_ / 2 }; var endPoint = { x: this.frame_.width / 2 - this.initialSize_ / 2, y: this.frame_.height / 2 - this.initialSize_ / 2 }; return { startPoint: startPoint, endPoint: endPoint }; }; MDCRippleFoundation.prototype.runDeactivationUXLogicIfReady_ = function () { var _this = this; // This method is called both when a pointing device is released, and when the activation animation ends. // The deactivation animation should only run after both of those occur. var FG_DEACTIVATION = MDCRippleFoundation.cssClasses.FG_DEACTIVATION; var _a = this.activationState_, hasDeactivationUXRun = _a.hasDeactivationUXRun, isActivated = _a.isActivated; var activationHasEnded = hasDeactivationUXRun || !isActivated; if (activationHasEnded && this.activationAnimationHasEnded_) { this.rmBoundedActivationClasses_(); this.adapter_.addClass(FG_DEACTIVATION); this.fgDeactivationRemovalTimer_ = setTimeout(function () { _this.adapter_.removeClass(FG_DEACTIVATION); }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].FG_DEACTIVATION_MS); } }; MDCRippleFoundation.prototype.rmBoundedActivationClasses_ = function () { var FG_ACTIVATION = MDCRippleFoundation.cssClasses.FG_ACTIVATION; this.adapter_.removeClass(FG_ACTIVATION); this.activationAnimationHasEnded_ = false; this.adapter_.computeBoundingRect(); }; MDCRippleFoundation.prototype.resetActivationState_ = function () { var _this = this; this.previousActivationEvent_ = this.activationState_.activationEvent; this.activationState_ = this.defaultActivationState_(); // Touch devices may fire additional events for the same interaction within a short time. // Store the previous event until it's safe to assume that subsequent events are for new interactions. setTimeout(function () { return _this.previousActivationEvent_ = undefined; }, MDCRippleFoundation.numbers.TAP_DELAY_MS); }; MDCRippleFoundation.prototype.deactivate_ = function () { var _this = this; var activationState = this.activationState_; // This can happen in scenarios such as when you have a keyup event that blurs the element. if (!activationState.isActivated) { return; } var state = __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, activationState); if (activationState.isProgrammatic) { requestAnimationFrame(function () { return _this.animateDeactivation_(state); }); this.resetActivationState_(); } else { this.deregisterDeactivationHandlers_(); requestAnimationFrame(function () { _this.activationState_.hasDeactivationUXRun = true; _this.animateDeactivation_(state); _this.resetActivationState_(); }); } }; MDCRippleFoundation.prototype.animateDeactivation_ = function (_a) { var wasActivatedByPointer = _a.wasActivatedByPointer, wasElementMadeActive = _a.wasElementMadeActive; if (wasActivatedByPointer || wasElementMadeActive) { this.runDeactivationUXLogicIfReady_(); } }; MDCRippleFoundation.prototype.layoutInternal_ = function () { var _this = this; this.frame_ = this.adapter_.computeBoundingRect(); var maxDim = Math.max(this.frame_.height, this.frame_.width); // Surface diameter is treated differently for unbounded vs. bounded ripples. // Unbounded ripple diameter is calculated smaller since the surface is expected to already be padded appropriately // to extend the hitbox, and the ripple is expected to meet the edges of the padded hitbox (which is typically // square). Bounded ripples, on the other hand, are fully expected to expand beyond the surface's longest diameter // (calculated based on the diagonal plus a constant padding), and are clipped at the surface's border via // `overflow: hidden`. var getBoundedRadius = function getBoundedRadius() { var hypotenuse = Math.sqrt(Math.pow(_this.frame_.width, 2) + Math.pow(_this.frame_.height, 2)); return hypotenuse + MDCRippleFoundation.numbers.PADDING; }; this.maxRadius_ = this.adapter_.isUnbounded() ? maxDim : getBoundedRadius(); // Ripple is sized as a fraction of the largest dimension of the surface, then scales up using a CSS scale transform this.initialSize_ = Math.floor(maxDim * MDCRippleFoundation.numbers.INITIAL_ORIGIN_SCALE); this.fgScale_ = "" + this.maxRadius_ / this.initialSize_; this.updateLayoutCssVars_(); }; MDCRippleFoundation.prototype.updateLayoutCssVars_ = function () { var _a = MDCRippleFoundation.strings, VAR_FG_SIZE = _a.VAR_FG_SIZE, VAR_LEFT = _a.VAR_LEFT, VAR_TOP = _a.VAR_TOP, VAR_FG_SCALE = _a.VAR_FG_SCALE; this.adapter_.updateCssVariable(VAR_FG_SIZE, this.initialSize_ + "px"); this.adapter_.updateCssVariable(VAR_FG_SCALE, this.fgScale_); if (this.adapter_.isUnbounded()) { this.unboundedCoords_ = { left: Math.round(this.frame_.width / 2 - this.initialSize_ / 2), top: Math.round(this.frame_.height / 2 - this.initialSize_ / 2) }; this.adapter_.updateCssVariable(VAR_LEFT, this.unboundedCoords_.left + "px"); this.adapter_.updateCssVariable(VAR_TOP, this.unboundedCoords_.top + "px"); } }; return MDCRippleFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCRippleFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 142 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["b"] = supportsCssVariables; /* harmony export (immutable) */ __webpack_exports__["a"] = getNormalizedEventCoords; /** * Stores result from supportsCssVariables to avoid redundant processing to * detect CSS custom variable support. */ var supportsCssVariables_; function detectEdgePseudoVarBug(windowObj) { // Detect versions of Edge with buggy var() support // See: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/11495448/ var document = windowObj.document; var node = document.createElement('div'); node.className = 'mdc-ripple-surface--test-edge-var-bug'; // Append to head instead of body because this script might be invoked in the // head, in which case the body doesn't exist yet. The probe works either way. document.head.appendChild(node); // The bug exists if ::before style ends up propagating to the parent element. // Additionally, getComputedStyle returns null in iframes with display: "none" in Firefox, // but Firefox is known to support CSS custom properties correctly. // See: https://bugzilla.mozilla.org/show_bug.cgi?id=548397 var computedStyle = windowObj.getComputedStyle(node); var hasPseudoVarBug = computedStyle !== null && computedStyle.borderTopStyle === 'solid'; if (node.parentNode) { node.parentNode.removeChild(node); } return hasPseudoVarBug; } function supportsCssVariables(windowObj, forceRefresh) { if (forceRefresh === void 0) { forceRefresh = false; } var CSS = windowObj.CSS; var supportsCssVars = supportsCssVariables_; if (typeof supportsCssVariables_ === 'boolean' && !forceRefresh) { return supportsCssVariables_; } var supportsFunctionPresent = CSS && typeof CSS.supports === 'function'; if (!supportsFunctionPresent) { return false; } var explicitlySupportsCssVars = CSS.supports('--css-vars', 'yes'); // See: https://bugs.webkit.org/show_bug.cgi?id=154669 // See: README section on Safari var weAreFeatureDetectingSafari10plus = CSS.supports('(--css-vars: yes)') && CSS.supports('color', '#00000000'); if (explicitlySupportsCssVars || weAreFeatureDetectingSafari10plus) { supportsCssVars = !detectEdgePseudoVarBug(windowObj); } else { supportsCssVars = false; } if (!forceRefresh) { supportsCssVariables_ = supportsCssVars; } return supportsCssVars; } function getNormalizedEventCoords(evt, pageOffset, clientRect) { if (!evt) { return { x: 0, y: 0 }; } var x = pageOffset.x, y = pageOffset.y; var documentX = x + clientRect.left; var documentY = y + clientRect.top; var normalizedX; var normalizedY; // Determine touch point relative to the ripple container. if (evt.type === 'touchstart') { var touchEvent = evt; normalizedX = touchEvent.changedTouches[0].pageX - documentX; normalizedY = touchEvent.changedTouches[0].pageY - documentY; } else { var mouseEvent = evt; normalizedX = mouseEvent.pageX - documentX; normalizedY = mouseEvent.pageY - documentY; } return { x: normalizedX, y: normalizedY }; } //# sourceMappingURL=util.js.map /***/ }), /* 143 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCDataTableFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(14); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(58); /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCDataTableFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["c" /* __extends */](MDCDataTableFoundation, _super); function MDCDataTableFoundation(adapter) { return _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCDataTableFoundation.defaultAdapter, adapter)) || this; } Object.defineProperty(MDCDataTableFoundation, "defaultAdapter", { get: function get() { return { addClassAtRowIndex: function addClassAtRowIndex() { return undefined; }, getRowCount: function getRowCount() { return 0; }, getRowElements: function getRowElements() { return []; }, getRowIdAtIndex: function getRowIdAtIndex() { return ''; }, getRowIndexByChildElement: function getRowIndexByChildElement() { return 0; }, getSelectedRowCount: function getSelectedRowCount() { return 0; }, isCheckboxAtRowIndexChecked: function isCheckboxAtRowIndexChecked() { return false; }, isHeaderRowCheckboxChecked: function isHeaderRowCheckboxChecked() { return false; }, isRowsSelectable: function isRowsSelectable() { return false; }, notifyRowSelectionChanged: function notifyRowSelectionChanged() { return undefined; }, notifySelectedAll: function notifySelectedAll() { return undefined; }, notifyUnselectedAll: function notifyUnselectedAll() { return undefined; }, registerHeaderRowCheckbox: function registerHeaderRowCheckbox() { return undefined; }, registerRowCheckboxes: function registerRowCheckboxes() { return undefined; }, removeClassAtRowIndex: function removeClassAtRowIndex() { return undefined; }, setAttributeAtRowIndex: function setAttributeAtRowIndex() { return undefined; }, setHeaderRowCheckboxChecked: function setHeaderRowCheckboxChecked() { return undefined; }, setHeaderRowCheckboxIndeterminate: function setHeaderRowCheckboxIndeterminate() { return undefined; }, setRowCheckboxCheckedAtIndex: function setRowCheckboxCheckedAtIndex() { return undefined; } }; }, enumerable: true, configurable: true }); /** * Re-initializes header row checkbox and row checkboxes when selectable rows are added or removed from table. * Use this if registering checkbox is synchronous. */ MDCDataTableFoundation.prototype.layout = function () { if (this.adapter_.isRowsSelectable()) { this.adapter_.registerHeaderRowCheckbox(); this.adapter_.registerRowCheckboxes(); this.setHeaderRowCheckboxState_(); } }; /** * Re-initializes header row checkbox and row checkboxes when selectable rows are added or removed from table. * Use this if registering checkbox is asynchronous. */ MDCDataTableFoundation.prototype.layoutAsync = function () { return __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __awaiter */](this, void 0, void 0, function () { return __WEBPACK_IMPORTED_MODULE_0_tslib__["d" /* __generator */](this, function (_a) { switch (_a.label) { case 0: if (!this.adapter_.isRowsSelectable()) return [3 /*break*/, 3]; return [4 /*yield*/, this.adapter_.registerHeaderRowCheckbox()]; case 1: _a.sent(); return [4 /*yield*/, this.adapter_.registerRowCheckboxes()]; case 2: _a.sent(); this.setHeaderRowCheckboxState_(); _a.label = 3; case 3: return [2 /*return*/]; } }); }); }; /** * @return Returns array of row elements. */ MDCDataTableFoundation.prototype.getRows = function () { return this.adapter_.getRowElements(); }; /** * Sets selected row ids. Overwrites previously selected rows. * @param rowIds Array of row ids that needs to be selected. */ MDCDataTableFoundation.prototype.setSelectedRowIds = function (rowIds) { for (var rowIndex = 0; rowIndex < this.adapter_.getRowCount(); rowIndex++) { var rowId = this.adapter_.getRowIdAtIndex(rowIndex); var isSelected = false; if (rowId && rowIds.indexOf(rowId) >= 0) { isSelected = true; } this.adapter_.setRowCheckboxCheckedAtIndex(rowIndex, isSelected); this.selectRowAtIndex_(rowIndex, isSelected); } this.setHeaderRowCheckboxState_(); }; /** * @return Returns array of selected row ids. */ MDCDataTableFoundation.prototype.getSelectedRowIds = function () { var selectedRowIds = []; for (var rowIndex = 0; rowIndex < this.adapter_.getRowCount(); rowIndex++) { if (this.adapter_.isCheckboxAtRowIndexChecked(rowIndex)) { selectedRowIds.push(this.adapter_.getRowIdAtIndex(rowIndex)); } } return selectedRowIds; }; /** * Handles header row checkbox change event. */ MDCDataTableFoundation.prototype.handleHeaderRowCheckboxChange = function () { var isHeaderChecked = this.adapter_.isHeaderRowCheckboxChecked(); for (var rowIndex = 0; rowIndex < this.adapter_.getRowCount(); rowIndex++) { this.adapter_.setRowCheckboxCheckedAtIndex(rowIndex, isHeaderChecked); this.selectRowAtIndex_(rowIndex, isHeaderChecked); } if (isHeaderChecked) { this.adapter_.notifySelectedAll(); } else { this.adapter_.notifyUnselectedAll(); } }; /** * Handles change event originated from row checkboxes. */ MDCDataTableFoundation.prototype.handleRowCheckboxChange = function (event) { var rowIndex = this.adapter_.getRowIndexByChildElement(event.target); if (rowIndex === -1) { return; } var selected = this.adapter_.isCheckboxAtRowIndexChecked(rowIndex); this.selectRowAtIndex_(rowIndex, selected); this.setHeaderRowCheckboxState_(); var rowId = this.adapter_.getRowIdAtIndex(rowIndex); this.adapter_.notifyRowSelectionChanged({ rowId: rowId, rowIndex: rowIndex, selected: selected }); }; /** * Updates header row checkbox state based on number of rows selected. */ MDCDataTableFoundation.prototype.setHeaderRowCheckboxState_ = function () { if (this.adapter_.getSelectedRowCount() === this.adapter_.getRowCount()) { this.adapter_.setHeaderRowCheckboxChecked(true); this.adapter_.setHeaderRowCheckboxIndeterminate(false); } else if (this.adapter_.getSelectedRowCount() === 0) { this.adapter_.setHeaderRowCheckboxIndeterminate(false); this.adapter_.setHeaderRowCheckboxChecked(false); } else { this.adapter_.setHeaderRowCheckboxIndeterminate(true); this.adapter_.setHeaderRowCheckboxChecked(false); } }; /** * Sets the attributes of row element based on selection state. */ MDCDataTableFoundation.prototype.selectRowAtIndex_ = function (rowIndex, selected) { if (selected) { this.adapter_.addClassAtRowIndex(rowIndex, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ROW_SELECTED); this.adapter_.setAttributeAtRowIndex(rowIndex, __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].ARIA_SELECTED, 'true'); } else { this.adapter_.removeClassAtRowIndex(rowIndex, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ROW_SELECTED); this.adapter_.setAttributeAtRowIndex(rowIndex, __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].ARIA_SELECTED, 'false'); } }; return MDCDataTableFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); //# sourceMappingURL=foundation.js.map /***/ }), /* 144 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCFormFieldFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(145); /** * @license * Copyright 2017 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCFormFieldFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCFormFieldFoundation, _super); function MDCFormFieldFoundation(adapter) { var _this = _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCFormFieldFoundation.defaultAdapter, adapter)) || this; _this.clickHandler_ = function () { return _this.handleClick_(); }; return _this; } Object.defineProperty(MDCFormFieldFoundation, "cssClasses", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCFormFieldFoundation, "strings", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCFormFieldFoundation, "defaultAdapter", { get: function get() { return { activateInputRipple: function activateInputRipple() { return undefined; }, deactivateInputRipple: function deactivateInputRipple() { return undefined; }, deregisterInteractionHandler: function deregisterInteractionHandler() { return undefined; }, registerInteractionHandler: function registerInteractionHandler() { return undefined; } }; }, enumerable: true, configurable: true }); MDCFormFieldFoundation.prototype.init = function () { this.adapter_.registerInteractionHandler('click', this.clickHandler_); }; MDCFormFieldFoundation.prototype.destroy = function () { this.adapter_.deregisterInteractionHandler('click', this.clickHandler_); }; MDCFormFieldFoundation.prototype.handleClick_ = function () { var _this = this; this.adapter_.activateInputRipple(); requestAnimationFrame(function () { return _this.adapter_.deactivateInputRipple(); }); }; return MDCFormFieldFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCFormFieldFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 145 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; }); /** * @license * Copyright 2017 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var cssClasses = { ROOT: 'mdc-form-field' }; var strings = { LABEL_SELECTOR: '.mdc-form-field > label' }; //# sourceMappingURL=constants.js.map /***/ }), /* 146 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCLinearProgressFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_animation_util__ = __webpack_require__(29); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(147); /** * @license * Copyright 2017 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCLinearProgressFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCLinearProgressFoundation, _super); function MDCLinearProgressFoundation(adapter) { return _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCLinearProgressFoundation.defaultAdapter, adapter)) || this; } Object.defineProperty(MDCLinearProgressFoundation, "cssClasses", { get: function get() { return __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCLinearProgressFoundation, "strings", { get: function get() { return __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCLinearProgressFoundation, "defaultAdapter", { get: function get() { return { addClass: function addClass() { return undefined; }, getBuffer: function getBuffer() { return null; }, getPrimaryBar: function getPrimaryBar() { return null; }, hasClass: function hasClass() { return false; }, removeClass: function removeClass() { return undefined; }, setStyle: function setStyle() { return undefined; } }; }, enumerable: true, configurable: true }); MDCLinearProgressFoundation.prototype.init = function () { this.isDeterminate_ = !this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].INDETERMINATE_CLASS); this.isReversed_ = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].REVERSED_CLASS); this.progress_ = 0; }; MDCLinearProgressFoundation.prototype.setDeterminate = function (isDeterminate) { this.isDeterminate_ = isDeterminate; if (this.isDeterminate_) { this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].INDETERMINATE_CLASS); this.setScale_(this.adapter_.getPrimaryBar(), this.progress_); } else { this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].INDETERMINATE_CLASS); this.setScale_(this.adapter_.getPrimaryBar(), 1); this.setScale_(this.adapter_.getBuffer(), 1); } }; MDCLinearProgressFoundation.prototype.setProgress = function (value) { this.progress_ = value; if (this.isDeterminate_) { this.setScale_(this.adapter_.getPrimaryBar(), value); } }; MDCLinearProgressFoundation.prototype.setBuffer = function (value) { if (this.isDeterminate_) { this.setScale_(this.adapter_.getBuffer(), value); } }; MDCLinearProgressFoundation.prototype.setReverse = function (isReversed) { this.isReversed_ = isReversed; if (this.isReversed_) { this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].REVERSED_CLASS); } else { this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].REVERSED_CLASS); } }; MDCLinearProgressFoundation.prototype.open = function () { this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].CLOSED_CLASS); }; MDCLinearProgressFoundation.prototype.close = function () { this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].CLOSED_CLASS); }; MDCLinearProgressFoundation.prototype.setScale_ = function (el, scaleValue) { if (!el) { return; } var value = "scaleX(" + scaleValue + ")"; this.adapter_.setStyle(el, Object(__WEBPACK_IMPORTED_MODULE_1__material_animation_util__["b" /* getCorrectPropertyName */])(window, 'transform'), value); }; return MDCLinearProgressFoundation; }(__WEBPACK_IMPORTED_MODULE_2__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCLinearProgressFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 147 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; }); /** * @license * Copyright 2017 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var cssClasses = { CLOSED_CLASS: 'mdc-linear-progress--closed', INDETERMINATE_CLASS: 'mdc-linear-progress--indeterminate', REVERSED_CLASS: 'mdc-linear-progress--reversed' }; var strings = { BUFFER_SELECTOR: '.mdc-linear-progress__buffer', PRIMARY_BAR_SELECTOR: '.mdc-linear-progress__primary-bar' }; //# sourceMappingURL=constants.js.map /***/ }), /* 148 */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(149); /***/ }), /* 149 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_initialize__ = __webpack_require__(59); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__webcomponents_webcomponentsjs_custom_elements_es5_adapter_js__ = __webpack_require__(299); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__webcomponents_webcomponentsjs_custom_elements_es5_adapter_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__webcomponents_webcomponentsjs_custom_elements_es5_adapter_js__); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* global require */ // The Adapter is required when transpiling classes to ES5 code. // https://github.com/webcomponents/webcomponentsjs/tree/v2.2.7#custom-elements-es5-adapterjs // Webcomponent polyfil window.WebComponents = window.WebComponents || {}; window.WebComponents.root = __webpack_require__(300); function loadFont(src) { var lnk = document.createElement('link'); lnk.setAttribute('href', src); lnk.setAttribute('rel', 'stylesheet'); lnk.setAttribute('type', 'text/css'); document.head.appendChild(lnk); } // https://stackoverflow.com/questions/54546007/why-doesnt-font-awesome-work-in-my-shadow-dom loadFont('https://fonts.googleapis.com/css?family=Roboto:300,400,500,700'); loadFont('https://fonts.googleapis.com/icon?family=Material+Icons'); loadFont('https://use.fontawesome.com/releases/v5.4.1/css/all.css'); var FlowMatic = function (_HTMLElement) { _inherits(FlowMatic, _HTMLElement); function FlowMatic() { _classCallCheck(this, FlowMatic); return _possibleConstructorReturn(this, (FlowMatic.__proto__ || Object.getPrototypeOf(FlowMatic)).call(this)); } _createClass(FlowMatic, [{ key: 'loadComponent', value: function loadComponent() { var _this2 = this; var oReq = new XMLHttpRequest(); oReq.addEventListener('load', function (r) { var template = document.createElement('template'); template.innerHTML = oReq.responseText; _this2.attachShadow({ mode: 'open' }).appendChild(template.content); _this2.loadScripts(_this2.shadowRoot).then(function () { Object(__WEBPACK_IMPORTED_MODULE_0__components_initialize__["a" /* initialize */])(_this2.shadowRoot, true); }); var event = new CustomEvent('flow-matic-loaded', { bubbles: true }); _this2.dispatchEvent(event); }); oReq.open('GET', '' + this.dataset.comp); oReq.send(); } }, { key: 'attributeChangedCallback', value: function attributeChangedCallback() { if (this.dataset.comp) { this.loadComponent(); } } // Scripts that are part of the response and stuck into a template with innerHTML // won't be parsed. On top of that js from a plugin that has a remote dependency // was being parsed before the remote script was loaded (everything was treated async). // This function collects a promise for each remote script and once they're all loaded // it adds the inline scripts. }, { key: 'loadScripts', value: function loadScripts(root) { var _this3 = this; if (window.FLOW_MATIC_SCRIPTS_LOADED) { return Promise.resolve(); } else { window.FLOW_MATIC_SCRIPTS_LOADED = true; } var scripts = Array.from(root.querySelectorAll('script')); var remoteScripts = scripts.filter(function (s) { return s.hasAttribute('src'); }); var inlineScripts = scripts.filter(function (s) { return !remoteScripts.includes(s); }); // load remote scripts var remoteScriptPromises = remoteScripts.map(function (script) { return new Promise(function (resolve) { var newScript = _this3.loadScript(script); newScript.addEventListener('load', function () { resolve(); }); }); }); // When all remote scripts are done, load inlines return Promise.all(remoteScriptPromises).then(function () { inlineScripts.forEach(_this3.loadScript); }); } // Browsers don't evaluate <script>s from innerHTML, so we need to add each of them. // https://stackoverflow.com/questions/1197575/can-scripts-be-inserted-with-innerhtml }, { key: 'loadScript', value: function loadScript(script) { var newScript = document.createElement('script'); for (var i = 0; i < script.attributes.length; i++) { newScript.setAttribute(script.attributes[i].nodeName, script.attributes[i].nodeValue); } newScript.innerHTML = script.innerHTML; document.head.appendChild(newScript); document.head.removeChild(newScript); return newScript; } }], [{ key: 'observedAttributes', get: function get() { // A list of attribute names to observe via attributeChangedCallback. return ['data-comp']; } }]); return FlowMatic; }(HTMLElement); __webpack_require__(304); customElements.define('flow-matic', FlowMatic); /***/ }), /* 150 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initButtons; /* unused harmony export VButton */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_ripple__ = __webpack_require__(151); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__base_component__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__mixins_event_handler__ = __webpack_require__(4); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function initButtons(e) { console.debug('\tButtons'); Object(__WEBPACK_IMPORTED_MODULE_1__base_component__["c" /* hookupComponents */])(e, '.v-button', VButton, __WEBPACK_IMPORTED_MODULE_0__material_ripple__["a" /* MDCRipple */]); } var VButton = function (_eventHandlerMixin) { _inherits(VButton, _eventHandlerMixin); function VButton(element, mdcComponent) { _classCallCheck(this, VButton); var _this = _possibleConstructorReturn(this, (VButton.__proto__ || Object.getPrototypeOf(VButton)).call(this, element, mdcComponent)); mdcComponent.unbounded = true; _this.element.addEventListener('V:postStarted', function (e) { return _this.disable(); }); _this.element.addEventListener('V:eventsHalted', function (e) { return _this.enable(); }); if (_this.element.dataset.disabledOnPostFinished === 'false') { _this.element.addEventListener('V:postFinished', function (e) { return _this.enable(); }); } else { _this.element.addEventListener('V:postFailed', function (e) { return _this.enable(); }); } return _this; } _createClass(VButton, [{ key: 'preview', value: function preview(result, acceptsMimeTypes, file) { if (this.element.classList.contains('v-button--image')) { this.element.style.backgroundImage = 'url(\'' + result + '\')'; } else { console.warn('WARNING: Attempted to preview an image on a Button (id: ' + this.element.id + ') that is NOT an image button.\nMake sure you set the type: :image on the button.'); } } }, { key: 'disable', value: function disable() { this.element.setAttribute('disabled', 'disabled'); } }, { key: 'enable', value: function enable() { this.element.removeAttribute('disabled'); } }, { key: 'actionsHalted', value: function actionsHalted(vEvent) { var parentDialog = this.parentComponent('.v-dialog'); if (!parentDialog) { return; } parentDialog.actionsHalted(vEvent); } }, { key: 'actionsSucceeded', value: function actionsSucceeded(vEvent) { var parentDialog = this.parentComponent('.v-dialog'); if (!parentDialog) { return; } parentDialog.actionsSucceeded(vEvent); } }, { key: 'actionsFinished', value: function actionsFinished(vEvent) { var parentDialog = this.parentComponent('.v-dialog'); if (!parentDialog) { return; } parentDialog.actionsFinished(vEvent); } }]); return VButton; }(Object(__WEBPACK_IMPORTED_MODULE_2__mixins_event_handler__["a" /* eventHandlerMixin */])(__WEBPACK_IMPORTED_MODULE_1__base_component__["a" /* VBaseComponent */])); /***/ }), /* 151 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util__ = __webpack_require__(30); /* unused harmony reexport util */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__component__ = __webpack_require__(6); /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_1__component__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(60); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation__ = __webpack_require__(9); /* unused harmony namespace reexport */ /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ //# sourceMappingURL=index.js.map /***/ }), /* 152 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(153); __webpack_require__(170); var entryUnbind = __webpack_require__(83); module.exports = entryUnbind('Array', 'flat'); /***/ }), /* 153 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(62); var flattenIntoArray = __webpack_require__(75); var toObject = __webpack_require__(79); var toLength = __webpack_require__(23); var toInteger = __webpack_require__(36); var arraySpeciesCreate = __webpack_require__(80); // `Array.prototype.flat` method // https://github.com/tc39/proposal-flatMap $({ target: 'Array', proto: true }, { flat: function flat() /* depthArg = 1 */{ var depthArg = arguments.length ? arguments[0] : undefined; var O = toObject(this); var sourceLen = toLength(O.length); var A = arraySpeciesCreate(O, 0); A.length = flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg)); return A; } }); /***/ }), /* 154 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var nativePropertyIsEnumerable = {}.propertyIsEnumerable; var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // Nashorn ~ JDK8 bug var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1); // `Object.prototype.propertyIsEnumerable` method implementation // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) { var descriptor = getOwnPropertyDescriptor(this, V); return !!descriptor && descriptor.enumerable; } : nativePropertyIsEnumerable; /***/ }), /* 155 */ /***/ (function(module, exports, __webpack_require__) { var fails = __webpack_require__(17); var classof = __webpack_require__(65); var split = ''.split; // fallback for non-array-like ES3 and non-enumerable old V8 strings module.exports = fails(function () { // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 // eslint-disable-next-line no-prototype-builtins return !Object('z').propertyIsEnumerable(0); }) ? function (it) { return classof(it) == 'String' ? split.call(it, '') : Object(it); } : Object; /***/ }), /* 156 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(7); var shared = __webpack_require__(22); var createNonEnumerableProperty = __webpack_require__(20); var has = __webpack_require__(19); var setGlobal = __webpack_require__(34); var nativeFunctionToString = __webpack_require__(70); var InternalStateModule = __webpack_require__(159); var getInternalState = InternalStateModule.get; var enforceInternalState = InternalStateModule.enforce; var TEMPLATE = String(nativeFunctionToString).split('toString'); shared('inspectSource', function (it) { return nativeFunctionToString.call(it); }); (module.exports = function (O, key, value, options) { var unsafe = options ? !!options.unsafe : false; var simple = options ? !!options.enumerable : false; var noTargetGet = options ? !!options.noTargetGet : false; if (typeof value == 'function') { if (typeof key == 'string' && !has(value, 'name')) createNonEnumerableProperty(value, 'name', key); enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : ''); } if (O === global) { if (simple) O[key] = value;else setGlobal(key, value); return; } else if (!unsafe) { delete O[key]; } else if (!noTargetGet && O[key]) { simple = true; } if (simple) O[key] = value;else createNonEnumerableProperty(O, key, value); // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative })(Function.prototype, 'toString', function toString() { return typeof this == 'function' && getInternalState(this).source || nativeFunctionToString.call(this); }); /***/ }), /* 157 */ /***/ (function(module, exports) { module.exports = false; /***/ }), /* 158 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(7); var setGlobal = __webpack_require__(34); var SHARED = '__core-js_shared__'; var store = global[SHARED] || setGlobal(SHARED, {}); module.exports = store; /***/ }), /* 159 */ /***/ (function(module, exports, __webpack_require__) { var NATIVE_WEAK_MAP = __webpack_require__(160); var global = __webpack_require__(7); var isObject = __webpack_require__(18); var createNonEnumerableProperty = __webpack_require__(20); var objectHas = __webpack_require__(19); var sharedKey = __webpack_require__(71); var hiddenKeys = __webpack_require__(35); var WeakMap = global.WeakMap; var set, get, has; var enforce = function enforce(it) { return has(it) ? get(it) : set(it, {}); }; var getterFor = function getterFor(TYPE) { return function (it) { var state; if (!isObject(it) || (state = get(it)).type !== TYPE) { throw TypeError('Incompatible receiver, ' + TYPE + ' required'); }return state; }; }; if (NATIVE_WEAK_MAP) { var store = new WeakMap(); var wmget = store.get; var wmhas = store.has; var wmset = store.set; set = function set(it, metadata) { wmset.call(store, it, metadata); return metadata; }; get = function get(it) { return wmget.call(store, it) || {}; }; has = function has(it) { return wmhas.call(store, it); }; } else { var STATE = sharedKey('state'); hiddenKeys[STATE] = true; set = function set(it, metadata) { createNonEnumerableProperty(it, STATE, metadata); return metadata; }; get = function get(it) { return objectHas(it, STATE) ? it[STATE] : {}; }; has = function has(it) { return objectHas(it, STATE); }; } module.exports = { set: set, get: get, has: has, enforce: enforce, getterFor: getterFor }; /***/ }), /* 160 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(7); var nativeFunctionToString = __webpack_require__(70); var WeakMap = global.WeakMap; module.exports = typeof WeakMap === 'function' && /native code/.test(nativeFunctionToString.call(WeakMap)); /***/ }), /* 161 */ /***/ (function(module, exports, __webpack_require__) { var has = __webpack_require__(19); var ownKeys = __webpack_require__(162); var getOwnPropertyDescriptorModule = __webpack_require__(63); var definePropertyModule = __webpack_require__(33); module.exports = function (target, source) { var keys = ownKeys(source); var defineProperty = definePropertyModule.f; var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key)); } }; /***/ }), /* 162 */ /***/ (function(module, exports, __webpack_require__) { var getBuiltIn = __webpack_require__(73); var getOwnPropertyNamesModule = __webpack_require__(164); var getOwnPropertySymbolsModule = __webpack_require__(167); var anObject = __webpack_require__(21); // all object keys, includes non-enumerable and symbols module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { var keys = getOwnPropertyNamesModule.f(anObject(it)); var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys; }; /***/ }), /* 163 */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(7); /***/ }), /* 164 */ /***/ (function(module, exports, __webpack_require__) { var internalObjectKeys = __webpack_require__(74); var enumBugKeys = __webpack_require__(37); var hiddenKeys = enumBugKeys.concat('length', 'prototype'); // `Object.getOwnPropertyNames` method // https://tc39.github.io/ecma262/#sec-object.getownpropertynames exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { return internalObjectKeys(O, hiddenKeys); }; /***/ }), /* 165 */ /***/ (function(module, exports, __webpack_require__) { var toIndexedObject = __webpack_require__(32); var toLength = __webpack_require__(23); var toAbsoluteIndex = __webpack_require__(166); // `Array.prototype.{ indexOf, includes }` methods implementation var createMethod = function createMethod(IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIndexedObject($this); var length = toLength(O.length); var index = toAbsoluteIndex(fromIndex, length); var value; // Array#includes uses SameValueZero equality algorithm // eslint-disable-next-line no-self-compare if (IS_INCLUDES && el != el) while (length > index) { value = O[index++]; // eslint-disable-next-line no-self-compare if (value != value) return true; // Array#indexOf ignores holes, Array#includes - not } else for (; length > index; index++) { if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; }return !IS_INCLUDES && -1; }; }; module.exports = { // `Array.prototype.includes` method // https://tc39.github.io/ecma262/#sec-array.prototype.includes includes: createMethod(true), // `Array.prototype.indexOf` method // https://tc39.github.io/ecma262/#sec-array.prototype.indexof indexOf: createMethod(false) }; /***/ }), /* 166 */ /***/ (function(module, exports, __webpack_require__) { var toInteger = __webpack_require__(36); var max = Math.max; var min = Math.min; // Helper for a popular repeating case of the spec: // Let integer be ? ToInteger(index). // If integer < 0, let result be max((length + integer), 0); else let result be min(length, length). module.exports = function (index, length) { var integer = toInteger(index); return integer < 0 ? max(integer + length, 0) : min(integer, length); }; /***/ }), /* 167 */ /***/ (function(module, exports) { exports.f = Object.getOwnPropertySymbols; /***/ }), /* 168 */ /***/ (function(module, exports, __webpack_require__) { var fails = __webpack_require__(17); var replacement = /#|\.prototype\./; var isForced = function isForced(feature, detection) { var value = data[normalize(feature)]; return value == POLYFILL ? true : value == NATIVE ? false : typeof detection == 'function' ? fails(detection) : !!detection; }; var normalize = isForced.normalize = function (string) { return String(string).replace(replacement, '.').toLowerCase(); }; var data = isForced.data = {}; var NATIVE = isForced.NATIVE = 'N'; var POLYFILL = isForced.POLYFILL = 'P'; module.exports = isForced; /***/ }), /* 169 */ /***/ (function(module, exports, __webpack_require__) { var fails = __webpack_require__(17); module.exports = !!Object.getOwnPropertySymbols && !fails(function () { // Chrome 38 Symbol has incorrect toString conversion // eslint-disable-next-line no-undef return !String(Symbol()); }); /***/ }), /* 170 */ /***/ (function(module, exports, __webpack_require__) { // this method was added to unscopables after implementation // in popular engines, so it's moved to a separate module var addToUnscopables = __webpack_require__(82); addToUnscopables('flat'); /***/ }), /* 171 */ /***/ (function(module, exports, __webpack_require__) { var anObject = __webpack_require__(21); var defineProperties = __webpack_require__(172); var enumBugKeys = __webpack_require__(37); var hiddenKeys = __webpack_require__(35); var html = __webpack_require__(174); var documentCreateElement = __webpack_require__(69); var sharedKey = __webpack_require__(71); var IE_PROTO = sharedKey('IE_PROTO'); var PROTOTYPE = 'prototype'; var Empty = function Empty() {/* empty */}; // Create object with fake `null` prototype: use iframe Object with cleared prototype var _createDict = function createDict() { // Thrash, waste and sodomy: IE GC bug var iframe = documentCreateElement('iframe'); var length = enumBugKeys.length; var lt = '<'; var script = 'script'; var gt = '>'; var js = 'java' + script + ':'; var iframeDocument; iframe.style.display = 'none'; html.appendChild(iframe); iframe.src = String(js); iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write(lt + script + gt + 'document.F=Object' + lt + '/' + script + gt); iframeDocument.close(); _createDict = iframeDocument.F; while (length--) { delete _createDict[PROTOTYPE][enumBugKeys[length]]; }return _createDict(); }; // `Object.create` method // https://tc39.github.io/ecma262/#sec-object.create module.exports = Object.create || function create(O, Properties) { var result; if (O !== null) { Empty[PROTOTYPE] = anObject(O); result = new Empty(); Empty[PROTOTYPE] = null; // add "__proto__" for Object.getPrototypeOf polyfill result[IE_PROTO] = O; } else result = _createDict(); return Properties === undefined ? result : defineProperties(result, Properties); }; hiddenKeys[IE_PROTO] = true; /***/ }), /* 172 */ /***/ (function(module, exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__(16); var definePropertyModule = __webpack_require__(33); var anObject = __webpack_require__(21); var objectKeys = __webpack_require__(173); // `Object.defineProperties` method // https://tc39.github.io/ecma262/#sec-object.defineproperties module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) { anObject(O); var keys = objectKeys(Properties); var length = keys.length; var index = 0; var key; while (length > index) { definePropertyModule.f(O, key = keys[index++], Properties[key]); }return O; }; /***/ }), /* 173 */ /***/ (function(module, exports, __webpack_require__) { var internalObjectKeys = __webpack_require__(74); var enumBugKeys = __webpack_require__(37); // `Object.keys` method // https://tc39.github.io/ecma262/#sec-object.keys module.exports = Object.keys || function keys(O) { return internalObjectKeys(O, enumBugKeys); }; /***/ }), /* 174 */ /***/ (function(module, exports, __webpack_require__) { var getBuiltIn = __webpack_require__(73); module.exports = getBuiltIn('document', 'documentElement'); /***/ }), /* 175 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initDialogs; /* unused harmony export VDialog */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__base_container__ = __webpack_require__(10); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_event_handler__ = __webpack_require__(4); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__base_component__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_dialog__ = __webpack_require__(176); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Here be dragons. /** * Causes the bound dialog's adapter to emit a closing event when applicable. * @param {String} action * @this {VDialog} */ function beforeClose() { var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; var mdcDialog = this.mdcComponent; if (this.shouldNotifyClosing) { mdcDialog.foundation_.adapter_.notifyClosing(action); this.shouldNotifyClosing = false; } } /** * Actually closes the bound dialog. * @param {String} action * @this {MDCDialogFoundation} */ function hideDialog() { var _this = this; var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; this.isOpen_ = false; this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_3__material_dialog__["b" /* MDCDialogFoundation */].cssClasses.CLOSING); this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_3__material_dialog__["b" /* MDCDialogFoundation */].cssClasses.OPEN); this.adapter_.removeBodyClass(__WEBPACK_IMPORTED_MODULE_3__material_dialog__["b" /* MDCDialogFoundation */].cssClasses.SCROLL_LOCK); cancelAnimationFrame(this.animationFrame_); this.animationFrame_ = 0; clearTimeout(this.animationTimer_); this.animationTimer_ = setTimeout(function () { _this.adapter_.releaseFocus(); _this.handleAnimationTimerEnd_(); _this.adapter_.notifyClosed(action); }, __WEBPACK_IMPORTED_MODULE_3__material_dialog__["b" /* MDCDialogFoundation */].numbers.DIALOG_ANIMATION_CLOSE_TIME_MS); } function initDialogs(e) { console.debug('\tDialogs'); Object(__WEBPACK_IMPORTED_MODULE_2__base_component__["c" /* hookupComponents */])(e, '.v-dialog', VDialog, __WEBPACK_IMPORTED_MODULE_3__material_dialog__["a" /* MDCDialog */]); } var VDialog = function (_eventHandlerMixin) { _inherits(VDialog, _eventHandlerMixin); function VDialog(element, mdcComponent) { _classCallCheck(this, VDialog); // Closeable state: var _this2 = _possibleConstructorReturn(this, (VDialog.__proto__ || Object.getPrototypeOf(VDialog)).call(this, element, mdcComponent)); _this2.shouldNotifyClosing = true; _this2.canClose = false; mdcComponent.listen('MDCDialog:opened', _this2.onShow.bind(_this2)); mdcComponent.listen('MDCDialog:closed', function () { _this2.reset(); _this2.clearErrors(); // Reset closeable state: _this2.shouldNotifyClosing = true; _this2.canClose = false; }); mdcComponent.listen('MDCDialog:closing', function (mdcEvent) { var action = mdcEvent.detail.action || ''; var event = new CustomEvent('close', { cancelable: true, bubbles: true, detail: { action: action } }); _this2.element.dispatchEvent(event); }); return _this2; } _createClass(VDialog, [{ key: 'open', value: function open() { this.mdcComponent.open(); } }, { key: 'closeDialog', value: function closeDialog() { this.mdcComponent.close(); } }, { key: 'close', value: function close() { var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; action = action || ''; beforeClose.call(this, action); if (this.canClose) { hideDialog.call(this.mdcComponent.foundation_, action); } } }, { key: 'actionsSucceeded', value: function actionsSucceeded(vEvent) { // A successful run-to-completion of an event chain should always // attempt to close the dialog. this.shouldNotifyClosing = false; // We should only be closing the dialog for components marked as autoClose var dialogAction = vEvent.vComponent.element.dataset.autoClose; if (dialogAction !== undefined) { this.canClose = true; this.close(vEvent.event.detail.action); } _get(VDialog.prototype.__proto__ || Object.getPrototypeOf(VDialog.prototype), 'actionsSucceeded', this).call(this, vEvent); // Bubble up } }, { key: 'actionsHalted', value: function actionsHalted(vEvent) { // A halted event chain should not close the dialog. this.shouldNotifyClosing = true; this.canClose = false; _get(VDialog.prototype.__proto__ || Object.getPrototypeOf(VDialog.prototype), 'actionsHalted', this).call(this, vEvent); // Bubble up } }, { key: 'afterInit', value: function afterInit() { var dialogHasHandlers = this.hasHandlers(); var buttonsHaveHandlers = this.buttons.map(function (c) { return c.hasHandlers(); }).some(Boolean); if (dialogHasHandlers || buttonsHaveHandlers) { // Stub in our own dialog close method to ensure events run to // completion before the dialog is closed: this.mdcComponent.foundation_.close = this.close.bind(this); } } }, { key: 'buttons', get: function get() { return this.components().filter(function (c) { return c.is('VButton'); }); } }]); return VDialog; }(Object(__WEBPACK_IMPORTED_MODULE_1__mixins_event_handler__["a" /* eventHandlerMixin */])(__WEBPACK_IMPORTED_MODULE_0__base_container__["a" /* VBaseContainer */])); /***/ }), /* 176 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util__ = __webpack_require__(84); /* unused harmony reexport util */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__component__ = __webpack_require__(179); /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_1__component__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(86); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation__ = __webpack_require__(85); /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_3__foundation__["a"]; }); /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ //# sourceMappingURL=index.js.map /***/ }), /* 177 */ /***/ (function(module, exports) { var candidateSelectors = ['input', 'select', 'textarea', 'a[href]', 'button', '[tabindex]', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable="false"])']; var candidateSelector = candidateSelectors.join(','); var matches = typeof Element === 'undefined' ? function () {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; function tabbable(el, options) { options = options || {}; var regularTabbables = []; var orderedTabbables = []; var candidates = el.querySelectorAll(candidateSelector); if (options.includeContainer) { if (matches.call(el, candidateSelector)) { candidates = Array.prototype.slice.apply(candidates); candidates.unshift(el); } } var i, candidate, candidateTabindex; for (i = 0; i < candidates.length; i++) { candidate = candidates[i]; if (!isNodeMatchingSelectorTabbable(candidate)) continue; candidateTabindex = getTabindex(candidate); if (candidateTabindex === 0) { regularTabbables.push(candidate); } else { orderedTabbables.push({ documentOrder: i, tabIndex: candidateTabindex, node: candidate }); } } var tabbableNodes = orderedTabbables.sort(sortOrderedTabbables).map(function (a) { return a.node; }).concat(regularTabbables); return tabbableNodes; } tabbable.isTabbable = isTabbable; tabbable.isFocusable = isFocusable; function isNodeMatchingSelectorTabbable(node) { if (!isNodeMatchingSelectorFocusable(node) || isNonTabbableRadio(node) || getTabindex(node) < 0) { return false; } return true; } function isTabbable(node) { if (!node) throw new Error('No node provided'); if (matches.call(node, candidateSelector) === false) return false; return isNodeMatchingSelectorTabbable(node); } function isNodeMatchingSelectorFocusable(node) { if (node.disabled || isHiddenInput(node) || isHidden(node)) { return false; } return true; } var focusableCandidateSelector = candidateSelectors.concat('iframe').join(','); function isFocusable(node) { if (!node) throw new Error('No node provided'); if (matches.call(node, focusableCandidateSelector) === false) return false; return isNodeMatchingSelectorFocusable(node); } function getTabindex(node) { var tabindexAttr = parseInt(node.getAttribute('tabindex'), 10); if (!isNaN(tabindexAttr)) return tabindexAttr; // Browsers do not return `tabIndex` correctly for contentEditable nodes; // so if they don't have a tabindex attribute specifically set, assume it's 0. if (isContentEditable(node)) return 0; return node.tabIndex; } function sortOrderedTabbables(a, b) { return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex; } function isContentEditable(node) { return node.contentEditable === 'true'; } function isInput(node) { return node.tagName === 'INPUT'; } function isHiddenInput(node) { return isInput(node) && node.type === 'hidden'; } function isRadio(node) { return isInput(node) && node.type === 'radio'; } function isNonTabbableRadio(node) { return isRadio(node) && !isTabbableRadio(node); } function getCheckedRadio(nodes) { for (var i = 0; i < nodes.length; i++) { if (nodes[i].checked) { return nodes[i]; } } } function isTabbableRadio(node) { if (!node.name) return true; // This won't account for the edge case where you have radio groups with the same // in separate forms on the same page. var radioSet = node.ownerDocument.querySelectorAll('input[type="radio"][name="' + node.name + '"]'); var checked = getCheckedRadio(radioSet); return !checked || checked === node; } function isHidden(node) { // offsetParent being null will allow detecting cases where an element is invisible or inside an invisible element, // as long as the element does not use position: fixed. For them, their visibility has to be checked directly as well. return node.offsetParent === null || getComputedStyle(node).visibility === 'hidden'; } module.exports = tabbable; /***/ }), /* 178 */ /***/ (function(module, exports) { module.exports = extend; var hasOwnProperty = Object.prototype.hasOwnProperty; function extend() { var target = {}; for (var i = 0; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; } /***/ }), /* 179 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCDialog; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_dom_ponyfill__ = __webpack_require__(5); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_ripple_component__ = __webpack_require__(6); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation__ = __webpack_require__(85); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util__ = __webpack_require__(84); /** * @license * Copyright 2017 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var strings = __WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* MDCDialogFoundation */].strings; var MDCDialog = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCDialog, _super); function MDCDialog() { return _super !== null && _super.apply(this, arguments) || this; } Object.defineProperty(MDCDialog.prototype, "isOpen", { get: function get() { return this.foundation_.isOpen(); }, enumerable: true, configurable: true }); Object.defineProperty(MDCDialog.prototype, "escapeKeyAction", { get: function get() { return this.foundation_.getEscapeKeyAction(); }, set: function set(action) { this.foundation_.setEscapeKeyAction(action); }, enumerable: true, configurable: true }); Object.defineProperty(MDCDialog.prototype, "scrimClickAction", { get: function get() { return this.foundation_.getScrimClickAction(); }, set: function set(action) { this.foundation_.setScrimClickAction(action); }, enumerable: true, configurable: true }); Object.defineProperty(MDCDialog.prototype, "autoStackButtons", { get: function get() { return this.foundation_.getAutoStackButtons(); }, set: function set(autoStack) { this.foundation_.setAutoStackButtons(autoStack); }, enumerable: true, configurable: true }); MDCDialog.attachTo = function (root) { return new MDCDialog(root); }; MDCDialog.prototype.initialize = function (focusTrapFactory) { var e_1, _a; var container = this.root_.querySelector(strings.CONTAINER_SELECTOR); if (!container) { throw new Error("Dialog component requires a " + strings.CONTAINER_SELECTOR + " container element"); } this.container_ = container; this.content_ = this.root_.querySelector(strings.CONTENT_SELECTOR); this.buttons_ = [].slice.call(this.root_.querySelectorAll(strings.BUTTON_SELECTOR)); this.defaultButton_ = this.root_.querySelector("[" + strings.BUTTON_DEFAULT_ATTRIBUTE + "]"); this.focusTrapFactory_ = focusTrapFactory; this.buttonRipples_ = []; try { for (var _b = __WEBPACK_IMPORTED_MODULE_0_tslib__["e" /* __values */](this.buttons_), _c = _b.next(); !_c.done; _c = _b.next()) { var buttonEl = _c.value; this.buttonRipples_.push(new __WEBPACK_IMPORTED_MODULE_3__material_ripple_component__["a" /* MDCRipple */](buttonEl)); } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_1) throw e_1.error; } } }; MDCDialog.prototype.initialSyncWithDOM = function () { var _this = this; this.focusTrap_ = __WEBPACK_IMPORTED_MODULE_5__util__["b" /* createFocusTrapInstance */](this.container_, this.focusTrapFactory_, this.getInitialFocusEl_() || undefined); this.handleClick_ = this.foundation_.handleClick.bind(this.foundation_); this.handleKeydown_ = this.foundation_.handleKeydown.bind(this.foundation_); this.handleDocumentKeydown_ = this.foundation_.handleDocumentKeydown.bind(this.foundation_); this.handleLayout_ = this.layout.bind(this); var LAYOUT_EVENTS = ['resize', 'orientationchange']; this.handleOpening_ = function () { LAYOUT_EVENTS.forEach(function (evtType) { return window.addEventListener(evtType, _this.handleLayout_); }); document.addEventListener('keydown', _this.handleDocumentKeydown_); }; this.handleClosing_ = function () { LAYOUT_EVENTS.forEach(function (evtType) { return window.removeEventListener(evtType, _this.handleLayout_); }); document.removeEventListener('keydown', _this.handleDocumentKeydown_); }; this.listen('click', this.handleClick_); this.listen('keydown', this.handleKeydown_); this.listen(strings.OPENING_EVENT, this.handleOpening_); this.listen(strings.CLOSING_EVENT, this.handleClosing_); }; MDCDialog.prototype.destroy = function () { this.unlisten('click', this.handleClick_); this.unlisten('keydown', this.handleKeydown_); this.unlisten(strings.OPENING_EVENT, this.handleOpening_); this.unlisten(strings.CLOSING_EVENT, this.handleClosing_); this.handleClosing_(); this.buttonRipples_.forEach(function (ripple) { return ripple.destroy(); }); _super.prototype.destroy.call(this); }; MDCDialog.prototype.layout = function () { this.foundation_.layout(); }; MDCDialog.prototype.open = function () { this.foundation_.open(); }; MDCDialog.prototype.close = function (action) { if (action === void 0) { action = ''; } this.foundation_.close(action); }; MDCDialog.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. var adapter = { addBodyClass: function addBodyClass(className) { return document.body.classList.add(className); }, addClass: function addClass(className) { return _this.root_.classList.add(className); }, areButtonsStacked: function areButtonsStacked() { return __WEBPACK_IMPORTED_MODULE_5__util__["a" /* areTopsMisaligned */](_this.buttons_); }, clickDefaultButton: function clickDefaultButton() { return _this.defaultButton_ && _this.defaultButton_.click(); }, eventTargetMatches: function eventTargetMatches(target, selector) { return target ? Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_ponyfill__["b" /* matches */])(target, selector) : false; }, getActionFromEvent: function getActionFromEvent(evt) { if (!evt.target) { return ''; } var element = Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_ponyfill__["a" /* closest */])(evt.target, "[" + strings.ACTION_ATTRIBUTE + "]"); return element && element.getAttribute(strings.ACTION_ATTRIBUTE); }, getInitialFocusEl: function getInitialFocusEl() { return _this.getInitialFocusEl_(); }, hasClass: function hasClass(className) { return _this.root_.classList.contains(className); }, isContentScrollable: function isContentScrollable() { return __WEBPACK_IMPORTED_MODULE_5__util__["c" /* isScrollable */](_this.content_); }, notifyClosed: function notifyClosed(action) { return _this.emit(strings.CLOSED_EVENT, action ? { action: action } : {}); }, notifyClosing: function notifyClosing(action) { return _this.emit(strings.CLOSING_EVENT, action ? { action: action } : {}); }, notifyOpened: function notifyOpened() { return _this.emit(strings.OPENED_EVENT, {}); }, notifyOpening: function notifyOpening() { return _this.emit(strings.OPENING_EVENT, {}); }, releaseFocus: function releaseFocus() { return _this.focusTrap_.deactivate(); }, removeBodyClass: function removeBodyClass(className) { return document.body.classList.remove(className); }, removeClass: function removeClass(className) { return _this.root_.classList.remove(className); }, reverseButtons: function reverseButtons() { _this.buttons_.reverse(); _this.buttons_.forEach(function (button) { button.parentElement.appendChild(button); }); }, trapFocus: function trapFocus() { return _this.focusTrap_.activate(); } }; return new __WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* MDCDialogFoundation */](adapter); }; MDCDialog.prototype.getInitialFocusEl_ = function () { return document.querySelector("[" + strings.INITIAL_FOCUS_ATTRIBUTE + "]"); }; return MDCDialog; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 180 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initDateTime; /* unused harmony export VDateTime */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_flatpickr__ = __webpack_require__(181); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_flatpickr___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_flatpickr__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_textfield__ = __webpack_require__(87); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__text_fields__ = __webpack_require__(100); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__base_component__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__config__ = __webpack_require__(101); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function initDateTime(e) { console.debug('\tDateTime'); Object(__WEBPACK_IMPORTED_MODULE_3__base_component__["c" /* hookupComponents */])(e, '.v-datetime', VDateTime, __WEBPACK_IMPORTED_MODULE_1__material_textfield__["a" /* MDCTextField */]); } var VDateTime = function (_VTextField) { _inherits(VDateTime, _VTextField); function VDateTime(element, mdcComponent) { _classCallCheck(this, VDateTime); var _this = _possibleConstructorReturn(this, (VDateTime.__proto__ || Object.getPrototypeOf(VDateTime)).call(this, element, mdcComponent)); var type = element.dataset.type; var defaultConfig = {}; if (!_this.root.documentElement) { defaultConfig.appendTo = _this.root.querySelector('.v-root'); } var config = Object.assign(defaultConfig, __WEBPACK_IMPORTED_MODULE_4__config__["a" /* default */].get('component.datetime.flatpickr', {}), JSON.parse(element.dataset.config)); if (type === 'datetime') { config.enableTime = true; } else if (type === 'time') { config.enableTime = true; config.noCalendar = true; } config.onOpen = function onOpen(selectedDates, dateStr, instance) { instance.mdc_text_field.foundation_.activateFocus(); }; config.onClose = function onClose(selectedDates, dateStr, instance) { instance.mdc_text_field.foundation_.deactivateFocus(); var event = new Event('closed'); element.dispatchEvent(event); }; _this.fp = __WEBPACK_IMPORTED_MODULE_0_flatpickr___default()(_this.input, config); _this.fp.mdc_text_field = mdcComponent; element.addEventListener('click', function () { return _this.toggle(); }); _this.originalValue = _this.fp.input.value; return _this; } _createClass(VDateTime, [{ key: 'clear', value: function clear() { if (this.fp.input.value !== '') { this.fp.clear(); } this.mdcComponent.foundation_.deactivateFocus(); } }, { key: 'reset', value: function reset() { this.fp.setDate(this.originalValue); } }, { key: 'open', value: function open() { this.fp.open(); } }, { key: 'close', value: function close() { this.fp.close(); } }, { key: 'toggle', value: function toggle() { this.fp.toggle(); } // checkDefaults() { // if(this.fp.config.mode = 'range'){ // if(this.fp.selectedDates[1]){ // // If we are in range mode and the endDate is defined as the beginning of the day, default it to be the // // end of the day. // let endDate = this.fp.selectedDates[1]; // if(endDate.getHours() == 0 && endDate.getMinutes() == 0 && endDate.getSeconds() == 0 && endDate.getMilliseconds() == 0){ // endDate.setHours(23); // endDate.setMinutes(59); // endDate.setSeconds(59); // endDate.getMilliseconds(9999); // this.fp.setDate(this.fp.selectedDates) // } // } // } // } }, { key: 'isDirty', value: function isDirty() { if (!this.dirtyable) { return false; } var currVal = new Date(this.fp.input.value); var prevVal = new Date(this.originalValue); return currVal.getTime() !== prevVal.getTime(); } }]); return VDateTime; }(__WEBPACK_IMPORTED_MODULE_2__text_fields__["a" /* VTextField */]); /***/ }), /* 181 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /* flatpickr v4.6.2, @license MIT */ (function (global, factory) { ( false ? 'undefined' : _typeof(exports)) === 'object' && typeof module !== 'undefined' ? module.exports = factory() : true ? !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : (global = global || self, global.flatpickr = factory()); })(this, function () { 'use strict'; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ var _assign = function __assign() { _assign = Object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } } return t; }; return _assign.apply(this, arguments); }; var HOOKS = ["onChange", "onClose", "onDayCreate", "onDestroy", "onKeyDown", "onMonthChange", "onOpen", "onParseConfig", "onReady", "onValueUpdate", "onYearChange", "onPreCalendarPosition"]; var defaults = { _disable: [], _enable: [], allowInput: false, altFormat: "F j, Y", altInput: false, altInputClass: "form-control input", animate: (typeof window === 'undefined' ? 'undefined' : _typeof(window)) === "object" && window.navigator.userAgent.indexOf("MSIE") === -1, ariaDateFormat: "F j, Y", clickOpens: true, closeOnSelect: true, conjunction: ", ", dateFormat: "Y-m-d", defaultHour: 12, defaultMinute: 0, defaultSeconds: 0, disable: [], disableMobile: false, enable: [], enableSeconds: false, enableTime: false, errorHandler: function errorHandler(err) { return typeof console !== "undefined" && console.warn(err); }, getWeek: function getWeek(givenDate) { var date = new Date(givenDate.getTime()); date.setHours(0, 0, 0, 0); // Thursday in current week decides the year. date.setDate(date.getDate() + 3 - (date.getDay() + 6) % 7); // January 4 is always in week 1. var week1 = new Date(date.getFullYear(), 0, 4); // Adjust to Thursday in week 1 and count number of weeks from date to week1. return 1 + Math.round(((date.getTime() - week1.getTime()) / 86400000 - 3 + (week1.getDay() + 6) % 7) / 7); }, hourIncrement: 1, ignoredFocusElements: [], inline: false, locale: "default", minuteIncrement: 5, mode: "single", monthSelectorType: "dropdown", nextArrow: "<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>", noCalendar: false, now: new Date(), onChange: [], onClose: [], onDayCreate: [], onDestroy: [], onKeyDown: [], onMonthChange: [], onOpen: [], onParseConfig: [], onReady: [], onValueUpdate: [], onYearChange: [], onPreCalendarPosition: [], plugins: [], position: "auto", positionElement: undefined, prevArrow: "<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>", shorthandCurrentMonth: false, showMonths: 1, static: false, time_24hr: false, weekNumbers: false, wrap: false }; var english = { weekdays: { shorthand: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], longhand: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] }, months: { shorthand: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], longhand: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"] }, daysInMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], firstDayOfWeek: 0, ordinal: function ordinal(nth) { var s = nth % 100; if (s > 3 && s < 21) return "th"; switch (s % 10) { case 1: return "st"; case 2: return "nd"; case 3: return "rd"; default: return "th"; } }, rangeSeparator: " to ", weekAbbreviation: "Wk", scrollTitle: "Scroll to increment", toggleTitle: "Click to toggle", amPM: ["AM", "PM"], yearAriaLabel: "Year", hourAriaLabel: "Hour", minuteAriaLabel: "Minute", time_24hr: false }; var pad = function pad(number) { return ("0" + number).slice(-2); }; var int = function int(bool) { return bool === true ? 1 : 0; }; /* istanbul ignore next */ function debounce(func, wait, immediate) { if (immediate === void 0) { immediate = false; } var timeout; return function () { var context = this, args = arguments; timeout !== null && clearTimeout(timeout); timeout = window.setTimeout(function () { timeout = null; if (!immediate) func.apply(context, args); }, wait); if (immediate && !timeout) func.apply(context, args); }; } var arrayify = function arrayify(obj) { return obj instanceof Array ? obj : [obj]; }; function toggleClass(elem, className, bool) { if (bool === true) return elem.classList.add(className); elem.classList.remove(className); } function createElement(tag, className, content) { var e = window.document.createElement(tag); className = className || ""; content = content || ""; e.className = className; if (content !== undefined) e.textContent = content; return e; } function clearNode(node) { while (node.firstChild) { node.removeChild(node.firstChild); } } function findParent(node, condition) { if (condition(node)) return node;else if (node.parentNode) return findParent(node.parentNode, condition); return undefined; // nothing found } function createNumberInput(inputClassName, opts) { var wrapper = createElement("div", "numInputWrapper"), numInput = createElement("input", "numInput " + inputClassName), arrowUp = createElement("span", "arrowUp"), arrowDown = createElement("span", "arrowDown"); if (navigator.userAgent.indexOf("MSIE 9.0") === -1) { numInput.type = "number"; } else { numInput.type = "text"; numInput.pattern = "\\d*"; } if (opts !== undefined) for (var key in opts) { numInput.setAttribute(key, opts[key]); }wrapper.appendChild(numInput); wrapper.appendChild(arrowUp); wrapper.appendChild(arrowDown); return wrapper; } function getEventTarget(event) { if (typeof event.composedPath === "function") { var path = event.composedPath(); return path[0]; } return event.target; } var doNothing = function doNothing() { return undefined; }; var monthToStr = function monthToStr(monthNumber, shorthand, locale) { return locale.months[shorthand ? "shorthand" : "longhand"][monthNumber]; }; var revFormat = { D: doNothing, F: function F(dateObj, monthName, locale) { dateObj.setMonth(locale.months.longhand.indexOf(monthName)); }, G: function G(dateObj, hour) { dateObj.setHours(parseFloat(hour)); }, H: function H(dateObj, hour) { dateObj.setHours(parseFloat(hour)); }, J: function J(dateObj, day) { dateObj.setDate(parseFloat(day)); }, K: function K(dateObj, amPM, locale) { dateObj.setHours(dateObj.getHours() % 12 + 12 * int(new RegExp(locale.amPM[1], "i").test(amPM))); }, M: function M(dateObj, shortMonth, locale) { dateObj.setMonth(locale.months.shorthand.indexOf(shortMonth)); }, S: function S(dateObj, seconds) { dateObj.setSeconds(parseFloat(seconds)); }, U: function U(_, unixSeconds) { return new Date(parseFloat(unixSeconds) * 1000); }, W: function W(dateObj, weekNum, locale) { var weekNumber = parseInt(weekNum); var date = new Date(dateObj.getFullYear(), 0, 2 + (weekNumber - 1) * 7, 0, 0, 0, 0); date.setDate(date.getDate() - date.getDay() + locale.firstDayOfWeek); return date; }, Y: function Y(dateObj, year) { dateObj.setFullYear(parseFloat(year)); }, Z: function Z(_, ISODate) { return new Date(ISODate); }, d: function d(dateObj, day) { dateObj.setDate(parseFloat(day)); }, h: function h(dateObj, hour) { dateObj.setHours(parseFloat(hour)); }, i: function i(dateObj, minutes) { dateObj.setMinutes(parseFloat(minutes)); }, j: function j(dateObj, day) { dateObj.setDate(parseFloat(day)); }, l: doNothing, m: function m(dateObj, month) { dateObj.setMonth(parseFloat(month) - 1); }, n: function n(dateObj, month) { dateObj.setMonth(parseFloat(month) - 1); }, s: function s(dateObj, seconds) { dateObj.setSeconds(parseFloat(seconds)); }, u: function u(_, unixMillSeconds) { return new Date(parseFloat(unixMillSeconds)); }, w: doNothing, y: function y(dateObj, year) { dateObj.setFullYear(2000 + parseFloat(year)); } }; var tokenRegex = { D: "(\\w+)", F: "(\\w+)", G: "(\\d\\d|\\d)", H: "(\\d\\d|\\d)", J: "(\\d\\d|\\d)\\w+", K: "", M: "(\\w+)", S: "(\\d\\d|\\d)", U: "(.+)", W: "(\\d\\d|\\d)", Y: "(\\d{4})", Z: "(.+)", d: "(\\d\\d|\\d)", h: "(\\d\\d|\\d)", i: "(\\d\\d|\\d)", j: "(\\d\\d|\\d)", l: "(\\w+)", m: "(\\d\\d|\\d)", n: "(\\d\\d|\\d)", s: "(\\d\\d|\\d)", u: "(.+)", w: "(\\d\\d|\\d)", y: "(\\d{2})" }; var formats = { // get the date in UTC Z: function Z(date) { return date.toISOString(); }, // weekday name, short, e.g. Thu D: function D(date, locale, options) { return locale.weekdays.shorthand[formats.w(date, locale, options)]; }, // full month name e.g. January F: function F(date, locale, options) { return monthToStr(formats.n(date, locale, options) - 1, false, locale); }, // padded hour 1-12 G: function G(date, locale, options) { return pad(formats.h(date, locale, options)); }, // hours with leading zero e.g. 03 H: function H(date) { return pad(date.getHours()); }, // day (1-30) with ordinal suffix e.g. 1st, 2nd J: function J(date, locale) { return locale.ordinal !== undefined ? date.getDate() + locale.ordinal(date.getDate()) : date.getDate(); }, // AM/PM K: function K(date, locale) { return locale.amPM[int(date.getHours() > 11)]; }, // shorthand month e.g. Jan, Sep, Oct, etc M: function M(date, locale) { return monthToStr(date.getMonth(), true, locale); }, // seconds 00-59 S: function S(date) { return pad(date.getSeconds()); }, // unix timestamp U: function U(date) { return date.getTime() / 1000; }, W: function W(date, _, options) { return options.getWeek(date); }, // full year e.g. 2016 Y: function Y(date) { return date.getFullYear(); }, // day in month, padded (01-30) d: function d(date) { return pad(date.getDate()); }, // hour from 1-12 (am/pm) h: function h(date) { return date.getHours() % 12 ? date.getHours() % 12 : 12; }, // minutes, padded with leading zero e.g. 09 i: function i(date) { return pad(date.getMinutes()); }, // day in month (1-30) j: function j(date) { return date.getDate(); }, // weekday name, full, e.g. Thursday l: function l(date, locale) { return locale.weekdays.longhand[date.getDay()]; }, // padded month number (01-12) m: function m(date) { return pad(date.getMonth() + 1); }, // the month number (1-12) n: function n(date) { return date.getMonth() + 1; }, // seconds 0-59 s: function s(date) { return date.getSeconds(); }, // Unix Milliseconds u: function u(date) { return date.getTime(); }, // number of the day of the week w: function w(date) { return date.getDay(); }, // last two digits of year e.g. 16 for 2016 y: function y(date) { return String(date.getFullYear()).substring(2); } }; var createDateFormatter = function createDateFormatter(_a) { var _b = _a.config, config = _b === void 0 ? defaults : _b, _c = _a.l10n, l10n = _c === void 0 ? english : _c; return function (dateObj, frmt, overrideLocale) { var locale = overrideLocale || l10n; if (config.formatDate !== undefined) { return config.formatDate(dateObj, frmt, locale); } return frmt.split("").map(function (c, i, arr) { return formats[c] && arr[i - 1] !== "\\" ? formats[c](dateObj, locale, config) : c !== "\\" ? c : ""; }).join(""); }; }; var createDateParser = function createDateParser(_a) { var _b = _a.config, config = _b === void 0 ? defaults : _b, _c = _a.l10n, l10n = _c === void 0 ? english : _c; return function (date, givenFormat, timeless, customLocale) { if (date !== 0 && !date) return undefined; var locale = customLocale || l10n; var parsedDate; var dateOrig = date; if (date instanceof Date) parsedDate = new Date(date.getTime());else if (typeof date !== "string" && date.toFixed !== undefined // timestamp ) // create a copy parsedDate = new Date(date);else if (typeof date === "string") { // date string var format = givenFormat || (config || defaults).dateFormat; var datestr = String(date).trim(); if (datestr === "today") { parsedDate = new Date(); timeless = true; } else if (/Z$/.test(datestr) || /GMT$/.test(datestr) // datestrings w/ timezone ) parsedDate = new Date(date);else if (config && config.parseDate) parsedDate = config.parseDate(date, format);else { parsedDate = !config || !config.noCalendar ? new Date(new Date().getFullYear(), 0, 1, 0, 0, 0, 0) : new Date(new Date().setHours(0, 0, 0, 0)); var matched = void 0, ops = []; for (var i = 0, matchIndex = 0, regexStr = ""; i < format.length; i++) { var token_1 = format[i]; var isBackSlash = token_1 === "\\"; var escaped = format[i - 1] === "\\" || isBackSlash; if (tokenRegex[token_1] && !escaped) { regexStr += tokenRegex[token_1]; var match = new RegExp(regexStr).exec(date); if (match && (matched = true)) { ops[token_1 !== "Y" ? "push" : "unshift"]({ fn: revFormat[token_1], val: match[++matchIndex] }); } } else if (!isBackSlash) regexStr += "."; // don't really care ops.forEach(function (_a) { var fn = _a.fn, val = _a.val; return parsedDate = fn(parsedDate, val, locale) || parsedDate; }); } parsedDate = matched ? parsedDate : undefined; } } /* istanbul ignore next */ if (!(parsedDate instanceof Date && !isNaN(parsedDate.getTime()))) { config.errorHandler(new Error("Invalid date provided: " + dateOrig)); return undefined; } if (timeless === true) parsedDate.setHours(0, 0, 0, 0); return parsedDate; }; }; /** * Compute the difference in dates, measured in ms */ function compareDates(date1, date2, timeless) { if (timeless === void 0) { timeless = true; } if (timeless !== false) { return new Date(date1.getTime()).setHours(0, 0, 0, 0) - new Date(date2.getTime()).setHours(0, 0, 0, 0); } return date1.getTime() - date2.getTime(); } var isBetween = function isBetween(ts, ts1, ts2) { return ts > Math.min(ts1, ts2) && ts < Math.max(ts1, ts2); }; var duration = { DAY: 86400000 }; if (typeof Object.assign !== "function") { Object.assign = function (target) { var args = []; for (var _i = 1; _i < arguments.length; _i++) { args[_i - 1] = arguments[_i]; } if (!target) { throw TypeError("Cannot convert undefined or null to object"); } var _loop_1 = function _loop_1(source) { if (source) { Object.keys(source).forEach(function (key) { return target[key] = source[key]; }); } }; for (var _a = 0, args_1 = args; _a < args_1.length; _a++) { var source = args_1[_a]; _loop_1(source); } return target; }; } var DEBOUNCED_CHANGE_MS = 300; function FlatpickrInstance(element, instanceConfig) { var self = { config: _assign({}, defaults, flatpickr.defaultConfig), l10n: english }; self.parseDate = createDateParser({ config: self.config, l10n: self.l10n }); self._handlers = []; self.pluginElements = []; self.loadedPlugins = []; self._bind = bind; self._setHoursFromDate = setHoursFromDate; self._positionCalendar = positionCalendar; self.changeMonth = changeMonth; self.changeYear = changeYear; self.clear = clear; self.close = close; self._createElement = createElement; self.destroy = destroy; self.isEnabled = isEnabled; self.jumpToDate = jumpToDate; self.open = open; self.redraw = redraw; self.set = set; self.setDate = setDate; self.toggle = toggle; function setupHelperFunctions() { self.utils = { getDaysInMonth: function getDaysInMonth(month, yr) { if (month === void 0) { month = self.currentMonth; } if (yr === void 0) { yr = self.currentYear; } if (month === 1 && (yr % 4 === 0 && yr % 100 !== 0 || yr % 400 === 0)) return 29; return self.l10n.daysInMonth[month]; } }; } function init() { self.element = self.input = element; self.isOpen = false; parseConfig(); setupLocale(); setupInputs(); setupDates(); setupHelperFunctions(); if (!self.isMobile) build(); bindEvents(); if (self.selectedDates.length || self.config.noCalendar) { if (self.config.enableTime) { setHoursFromDate(self.config.noCalendar ? self.latestSelectedDateObj || self.config.minDate : undefined); } updateValue(false); } setCalendarWidth(); self.showTimeInput = self.selectedDates.length > 0 || self.config.noCalendar; var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); /* TODO: investigate this further Currently, there is weird positioning behavior in safari causing pages to scroll up. https://github.com/chmln/flatpickr/issues/563 However, most browsers are not Safari and positioning is expensive when used in scale. https://github.com/chmln/flatpickr/issues/1096 */ if (!self.isMobile && isSafari) { positionCalendar(); } triggerEvent("onReady"); } function bindToInstance(fn) { return fn.bind(self); } function setCalendarWidth() { var config = self.config; if (config.weekNumbers === false && config.showMonths === 1) return;else if (config.noCalendar !== true) { window.requestAnimationFrame(function () { if (self.calendarContainer !== undefined) { self.calendarContainer.style.visibility = "hidden"; self.calendarContainer.style.display = "block"; } if (self.daysContainer !== undefined) { var daysWidth = (self.days.offsetWidth + 1) * config.showMonths; self.daysContainer.style.width = daysWidth + "px"; self.calendarContainer.style.width = daysWidth + (self.weekWrapper !== undefined ? self.weekWrapper.offsetWidth : 0) + "px"; self.calendarContainer.style.removeProperty("visibility"); self.calendarContainer.style.removeProperty("display"); } }); } } /** * The handler for all events targeting the time inputs */ function updateTime(e) { if (self.selectedDates.length === 0) { setDefaultTime(); } if (e !== undefined && e.type !== "blur") { timeWrapper(e); } var prevValue = self._input.value; setHoursFromInputs(); updateValue(); if (self._input.value !== prevValue) { self._debouncedChange(); } } function ampm2military(hour, amPM) { return hour % 12 + 12 * int(amPM === self.l10n.amPM[1]); } function military2ampm(hour) { switch (hour % 24) { case 0: case 12: return 12; default: return hour % 12; } } /** * Syncs the selected date object time with user's time input */ function setHoursFromInputs() { if (self.hourElement === undefined || self.minuteElement === undefined) return; var hours = (parseInt(self.hourElement.value.slice(-2), 10) || 0) % 24, minutes = (parseInt(self.minuteElement.value, 10) || 0) % 60, seconds = self.secondElement !== undefined ? (parseInt(self.secondElement.value, 10) || 0) % 60 : 0; if (self.amPM !== undefined) { hours = ampm2military(hours, self.amPM.textContent); } var limitMinHours = self.config.minTime !== undefined || self.config.minDate && self.minDateHasTime && self.latestSelectedDateObj && compareDates(self.latestSelectedDateObj, self.config.minDate, true) === 0; var limitMaxHours = self.config.maxTime !== undefined || self.config.maxDate && self.maxDateHasTime && self.latestSelectedDateObj && compareDates(self.latestSelectedDateObj, self.config.maxDate, true) === 0; if (limitMaxHours) { var maxTime = self.config.maxTime !== undefined ? self.config.maxTime : self.config.maxDate; hours = Math.min(hours, maxTime.getHours()); if (hours === maxTime.getHours()) minutes = Math.min(minutes, maxTime.getMinutes()); if (minutes === maxTime.getMinutes()) seconds = Math.min(seconds, maxTime.getSeconds()); } if (limitMinHours) { var minTime = self.config.minTime !== undefined ? self.config.minTime : self.config.minDate; hours = Math.max(hours, minTime.getHours()); if (hours === minTime.getHours()) minutes = Math.max(minutes, minTime.getMinutes()); if (minutes === minTime.getMinutes()) seconds = Math.max(seconds, minTime.getSeconds()); } setHours(hours, minutes, seconds); } /** * Syncs time input values with a date */ function setHoursFromDate(dateObj) { var date = dateObj || self.latestSelectedDateObj; if (date) setHours(date.getHours(), date.getMinutes(), date.getSeconds()); } function setDefaultHours() { var hours = self.config.defaultHour; var minutes = self.config.defaultMinute; var seconds = self.config.defaultSeconds; if (self.config.minDate !== undefined) { var minHr = self.config.minDate.getHours(); var minMinutes = self.config.minDate.getMinutes(); hours = Math.max(hours, minHr); if (hours === minHr) minutes = Math.max(minMinutes, minutes); if (hours === minHr && minutes === minMinutes) seconds = self.config.minDate.getSeconds(); } if (self.config.maxDate !== undefined) { var maxHr = self.config.maxDate.getHours(); var maxMinutes = self.config.maxDate.getMinutes(); hours = Math.min(hours, maxHr); if (hours === maxHr) minutes = Math.min(maxMinutes, minutes); if (hours === maxHr && minutes === maxMinutes) seconds = self.config.maxDate.getSeconds(); } setHours(hours, minutes, seconds); } /** * Sets the hours, minutes, and optionally seconds * of the latest selected date object and the * corresponding time inputs * @param {Number} hours the hour. whether its military * or am-pm gets inferred from config * @param {Number} minutes the minutes * @param {Number} seconds the seconds (optional) */ function setHours(hours, minutes, seconds) { if (self.latestSelectedDateObj !== undefined) { self.latestSelectedDateObj.setHours(hours % 24, minutes, seconds || 0, 0); } if (!self.hourElement || !self.minuteElement || self.isMobile) return; self.hourElement.value = pad(!self.config.time_24hr ? (12 + hours) % 12 + 12 * int(hours % 12 === 0) : hours); self.minuteElement.value = pad(minutes); if (self.amPM !== undefined) self.amPM.textContent = self.l10n.amPM[int(hours >= 12)]; if (self.secondElement !== undefined) self.secondElement.value = pad(seconds); } /** * Handles the year input and incrementing events * @param {Event} event the keyup or increment event */ function onYearInput(event) { var year = parseInt(event.target.value) + (event.delta || 0); if (year / 1000 > 1 || event.key === "Enter" && !/[^\d]/.test(year.toString())) { changeYear(year); } } /** * Essentially addEventListener + tracking * @param {Element} element the element to addEventListener to * @param {String} event the event name * @param {Function} handler the event handler */ function bind(element, event, handler, options) { if (event instanceof Array) return event.forEach(function (ev) { return bind(element, ev, handler, options); }); if (element instanceof Array) return element.forEach(function (el) { return bind(el, event, handler, options); }); element.addEventListener(event, handler, options); self._handlers.push({ element: element, event: event, handler: handler, options: options }); } /** * A mousedown handler which mimics click. * Minimizes latency, since we don't need to wait for mouseup in most cases. * Also, avoids handling right clicks. * * @param {Function} handler the event handler */ function onClick(handler) { return function (evt) { evt.which === 1 && handler(evt); }; } function triggerChange() { triggerEvent("onChange"); } /** * Adds all the necessary event listeners */ function bindEvents() { if (self.config.wrap) { ["open", "close", "toggle", "clear"].forEach(function (evt) { Array.prototype.forEach.call(self.element.querySelectorAll("[data-" + evt + "]"), function (el) { return bind(el, "click", self[evt]); }); }); } if (self.isMobile) { setupMobile(); return; } var debouncedResize = debounce(onResize, 50); self._debouncedChange = debounce(triggerChange, DEBOUNCED_CHANGE_MS); if (self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent)) bind(self.daysContainer, "mouseover", function (e) { if (self.config.mode === "range") onMouseOver(e.target); }); bind(window.document.body, "keydown", onKeyDown); if (!self.config.inline && !self.config.static) bind(window, "resize", debouncedResize); if (window.ontouchstart !== undefined) bind(window.document, "touchstart", documentClick);else bind(window.document, "mousedown", onClick(documentClick)); bind(window.document, "focus", documentClick, { capture: true }); if (self.config.clickOpens === true) { bind(self._input, "focus", self.open); bind(self._input, "mousedown", onClick(self.open)); } if (self.daysContainer !== undefined) { bind(self.monthNav, "mousedown", onClick(onMonthNavClick)); bind(self.monthNav, ["keyup", "increment"], onYearInput); bind(self.daysContainer, "mousedown", onClick(selectDate)); } if (self.timeContainer !== undefined && self.minuteElement !== undefined && self.hourElement !== undefined) { var selText = function selText(e) { return e.target.select(); }; bind(self.timeContainer, ["increment"], updateTime); bind(self.timeContainer, "blur", updateTime, { capture: true }); bind(self.timeContainer, "mousedown", onClick(timeIncrement)); bind([self.hourElement, self.minuteElement], ["focus", "click"], selText); if (self.secondElement !== undefined) bind(self.secondElement, "focus", function () { return self.secondElement && self.secondElement.select(); }); if (self.amPM !== undefined) { bind(self.amPM, "mousedown", onClick(function (e) { updateTime(e); triggerChange(); })); } } } /** * Set the calendar view to a particular date. * @param {Date} jumpDate the date to set the view to * @param {boolean} triggerChange if change events should be triggered */ function jumpToDate(jumpDate, triggerChange) { var jumpTo = jumpDate !== undefined ? self.parseDate(jumpDate) : self.latestSelectedDateObj || (self.config.minDate && self.config.minDate > self.now ? self.config.minDate : self.config.maxDate && self.config.maxDate < self.now ? self.config.maxDate : self.now); var oldYear = self.currentYear; var oldMonth = self.currentMonth; try { if (jumpTo !== undefined) { self.currentYear = jumpTo.getFullYear(); self.currentMonth = jumpTo.getMonth(); } } catch (e) { /* istanbul ignore next */ e.message = "Invalid date supplied: " + jumpTo; self.config.errorHandler(e); } if (triggerChange && self.currentYear !== oldYear) { triggerEvent("onYearChange"); buildMonthSwitch(); } if (triggerChange && (self.currentYear !== oldYear || self.currentMonth !== oldMonth)) { triggerEvent("onMonthChange"); } self.redraw(); } /** * The up/down arrow handler for time inputs * @param {Event} e the click event */ function timeIncrement(e) { if (~e.target.className.indexOf("arrow")) incrementNumInput(e, e.target.classList.contains("arrowUp") ? 1 : -1); } /** * Increments/decrements the value of input associ- * ated with the up/down arrow by dispatching an * "increment" event on the input. * * @param {Event} e the click event * @param {Number} delta the diff (usually 1 or -1) * @param {Element} inputElem the input element */ function incrementNumInput(e, delta, inputElem) { var target = e && e.target; var input = inputElem || target && target.parentNode && target.parentNode.firstChild; var event = createEvent("increment"); event.delta = delta; input && input.dispatchEvent(event); } function build() { var fragment = window.document.createDocumentFragment(); self.calendarContainer = createElement("div", "flatpickr-calendar"); self.calendarContainer.tabIndex = -1; if (!self.config.noCalendar) { fragment.appendChild(buildMonthNav()); self.innerContainer = createElement("div", "flatpickr-innerContainer"); if (self.config.weekNumbers) { var _a = buildWeeks(), weekWrapper = _a.weekWrapper, weekNumbers = _a.weekNumbers; self.innerContainer.appendChild(weekWrapper); self.weekNumbers = weekNumbers; self.weekWrapper = weekWrapper; } self.rContainer = createElement("div", "flatpickr-rContainer"); self.rContainer.appendChild(buildWeekdays()); if (!self.daysContainer) { self.daysContainer = createElement("div", "flatpickr-days"); self.daysContainer.tabIndex = -1; } buildDays(); self.rContainer.appendChild(self.daysContainer); self.innerContainer.appendChild(self.rContainer); fragment.appendChild(self.innerContainer); } if (self.config.enableTime) { fragment.appendChild(buildTime()); } toggleClass(self.calendarContainer, "rangeMode", self.config.mode === "range"); toggleClass(self.calendarContainer, "animate", self.config.animate === true); toggleClass(self.calendarContainer, "multiMonth", self.config.showMonths > 1); self.calendarContainer.appendChild(fragment); var customAppend = self.config.appendTo !== undefined && self.config.appendTo.nodeType !== undefined; if (self.config.inline || self.config.static) { self.calendarContainer.classList.add(self.config.inline ? "inline" : "static"); if (self.config.inline) { if (!customAppend && self.element.parentNode) self.element.parentNode.insertBefore(self.calendarContainer, self._input.nextSibling);else if (self.config.appendTo !== undefined) self.config.appendTo.appendChild(self.calendarContainer); } if (self.config.static) { var wrapper = createElement("div", "flatpickr-wrapper"); if (self.element.parentNode) self.element.parentNode.insertBefore(wrapper, self.element); wrapper.appendChild(self.element); if (self.altInput) wrapper.appendChild(self.altInput); wrapper.appendChild(self.calendarContainer); } } if (!self.config.static && !self.config.inline) (self.config.appendTo !== undefined ? self.config.appendTo : window.document.body).appendChild(self.calendarContainer); } function createDay(className, date, dayNumber, i) { var dateIsEnabled = isEnabled(date, true), dayElement = createElement("span", "flatpickr-day " + className, date.getDate().toString()); dayElement.dateObj = date; dayElement.$i = i; dayElement.setAttribute("aria-label", self.formatDate(date, self.config.ariaDateFormat)); if (className.indexOf("hidden") === -1 && compareDates(date, self.now) === 0) { self.todayDateElem = dayElement; dayElement.classList.add("today"); dayElement.setAttribute("aria-current", "date"); } if (dateIsEnabled) { dayElement.tabIndex = -1; if (isDateSelected(date)) { dayElement.classList.add("selected"); self.selectedDateElem = dayElement; if (self.config.mode === "range") { toggleClass(dayElement, "startRange", self.selectedDates[0] && compareDates(date, self.selectedDates[0], true) === 0); toggleClass(dayElement, "endRange", self.selectedDates[1] && compareDates(date, self.selectedDates[1], true) === 0); if (className === "nextMonthDay") dayElement.classList.add("inRange"); } } } else { dayElement.classList.add("flatpickr-disabled"); } if (self.config.mode === "range") { if (isDateInRange(date) && !isDateSelected(date)) dayElement.classList.add("inRange"); } if (self.weekNumbers && self.config.showMonths === 1 && className !== "prevMonthDay" && dayNumber % 7 === 1) { self.weekNumbers.insertAdjacentHTML("beforeend", "<span class='flatpickr-day'>" + self.config.getWeek(date) + "</span>"); } triggerEvent("onDayCreate", dayElement); return dayElement; } function focusOnDayElem(targetNode) { targetNode.focus(); if (self.config.mode === "range") onMouseOver(targetNode); } function getFirstAvailableDay(delta) { var startMonth = delta > 0 ? 0 : self.config.showMonths - 1; var endMonth = delta > 0 ? self.config.showMonths : -1; for (var m = startMonth; m != endMonth; m += delta) { var month = self.daysContainer.children[m]; var startIndex = delta > 0 ? 0 : month.children.length - 1; var endIndex = delta > 0 ? month.children.length : -1; for (var i = startIndex; i != endIndex; i += delta) { var c = month.children[i]; if (c.className.indexOf("hidden") === -1 && isEnabled(c.dateObj)) return c; } } return undefined; } function getNextAvailableDay(current, delta) { var givenMonth = current.className.indexOf("Month") === -1 ? current.dateObj.getMonth() : self.currentMonth; var endMonth = delta > 0 ? self.config.showMonths : -1; var loopDelta = delta > 0 ? 1 : -1; for (var m = givenMonth - self.currentMonth; m != endMonth; m += loopDelta) { var month = self.daysContainer.children[m]; var startIndex = givenMonth - self.currentMonth === m ? current.$i + delta : delta < 0 ? month.children.length - 1 : 0; var numMonthDays = month.children.length; for (var i = startIndex; i >= 0 && i < numMonthDays && i != (delta > 0 ? numMonthDays : -1); i += loopDelta) { var c = month.children[i]; if (c.className.indexOf("hidden") === -1 && isEnabled(c.dateObj) && Math.abs(current.$i - i) >= Math.abs(delta)) return focusOnDayElem(c); } } self.changeMonth(loopDelta); focusOnDay(getFirstAvailableDay(loopDelta), 0); return undefined; } function focusOnDay(current, offset) { var dayFocused = isInView(document.activeElement || document.body); var startElem = current !== undefined ? current : dayFocused ? document.activeElement : self.selectedDateElem !== undefined && isInView(self.selectedDateElem) ? self.selectedDateElem : self.todayDateElem !== undefined && isInView(self.todayDateElem) ? self.todayDateElem : getFirstAvailableDay(offset > 0 ? 1 : -1); if (startElem === undefined) return self._input.focus(); if (!dayFocused) return focusOnDayElem(startElem); getNextAvailableDay(startElem, offset); } function buildMonthDays(year, month) { var firstOfMonth = (new Date(year, month, 1).getDay() - self.l10n.firstDayOfWeek + 7) % 7; var prevMonthDays = self.utils.getDaysInMonth((month - 1 + 12) % 12); var daysInMonth = self.utils.getDaysInMonth(month), days = window.document.createDocumentFragment(), isMultiMonth = self.config.showMonths > 1, prevMonthDayClass = isMultiMonth ? "prevMonthDay hidden" : "prevMonthDay", nextMonthDayClass = isMultiMonth ? "nextMonthDay hidden" : "nextMonthDay"; var dayNumber = prevMonthDays + 1 - firstOfMonth, dayIndex = 0; // prepend days from the ending of previous month for (; dayNumber <= prevMonthDays; dayNumber++, dayIndex++) { days.appendChild(createDay(prevMonthDayClass, new Date(year, month - 1, dayNumber), dayNumber, dayIndex)); } // Start at 1 since there is no 0th day for (dayNumber = 1; dayNumber <= daysInMonth; dayNumber++, dayIndex++) { days.appendChild(createDay("", new Date(year, month, dayNumber), dayNumber, dayIndex)); } // append days from the next month for (var dayNum = daysInMonth + 1; dayNum <= 42 - firstOfMonth && (self.config.showMonths === 1 || dayIndex % 7 !== 0); dayNum++, dayIndex++) { days.appendChild(createDay(nextMonthDayClass, new Date(year, month + 1, dayNum % daysInMonth), dayNum, dayIndex)); } //updateNavigationCurrentMonth(); var dayContainer = createElement("div", "dayContainer"); dayContainer.appendChild(days); return dayContainer; } function buildDays() { if (self.daysContainer === undefined) { return; } clearNode(self.daysContainer); // TODO: week numbers for each month if (self.weekNumbers) clearNode(self.weekNumbers); var frag = document.createDocumentFragment(); for (var i = 0; i < self.config.showMonths; i++) { var d = new Date(self.currentYear, self.currentMonth, 1); d.setMonth(self.currentMonth + i); frag.appendChild(buildMonthDays(d.getFullYear(), d.getMonth())); } self.daysContainer.appendChild(frag); self.days = self.daysContainer.firstChild; if (self.config.mode === "range" && self.selectedDates.length === 1) { onMouseOver(); } } function buildMonthSwitch() { if (self.config.showMonths > 1 || self.config.monthSelectorType !== "dropdown") return; var shouldBuildMonth = function shouldBuildMonth(month) { if (self.config.minDate !== undefined && self.currentYear === self.config.minDate.getFullYear() && month < self.config.minDate.getMonth()) { return false; } return !(self.config.maxDate !== undefined && self.currentYear === self.config.maxDate.getFullYear() && month > self.config.maxDate.getMonth()); }; self.monthsDropdownContainer.tabIndex = -1; self.monthsDropdownContainer.innerHTML = ""; for (var i = 0; i < 12; i++) { if (!shouldBuildMonth(i)) continue; var month = createElement("option", "flatpickr-monthDropdown-month"); month.value = new Date(self.currentYear, i).getMonth().toString(); month.textContent = monthToStr(i, self.config.shorthandCurrentMonth, self.l10n); month.tabIndex = -1; if (self.currentMonth === i) { month.selected = true; } self.monthsDropdownContainer.appendChild(month); } } function buildMonth() { var container = createElement("div", "flatpickr-month"); var monthNavFragment = window.document.createDocumentFragment(); var monthElement; if (self.config.showMonths > 1 || self.config.monthSelectorType === "static") { monthElement = createElement("span", "cur-month"); } else { self.monthsDropdownContainer = createElement("select", "flatpickr-monthDropdown-months"); bind(self.monthsDropdownContainer, "change", function (e) { var target = e.target; var selectedMonth = parseInt(target.value, 10); self.changeMonth(selectedMonth - self.currentMonth); triggerEvent("onMonthChange"); }); buildMonthSwitch(); monthElement = self.monthsDropdownContainer; } var yearInput = createNumberInput("cur-year", { tabindex: "-1" }); var yearElement = yearInput.getElementsByTagName("input")[0]; yearElement.setAttribute("aria-label", self.l10n.yearAriaLabel); if (self.config.minDate) { yearElement.setAttribute("min", self.config.minDate.getFullYear().toString()); } if (self.config.maxDate) { yearElement.setAttribute("max", self.config.maxDate.getFullYear().toString()); yearElement.disabled = !!self.config.minDate && self.config.minDate.getFullYear() === self.config.maxDate.getFullYear(); } var currentMonth = createElement("div", "flatpickr-current-month"); currentMonth.appendChild(monthElement); currentMonth.appendChild(yearInput); monthNavFragment.appendChild(currentMonth); container.appendChild(monthNavFragment); return { container: container, yearElement: yearElement, monthElement: monthElement }; } function buildMonths() { clearNode(self.monthNav); self.monthNav.appendChild(self.prevMonthNav); if (self.config.showMonths) { self.yearElements = []; self.monthElements = []; } for (var m = self.config.showMonths; m--;) { var month = buildMonth(); self.yearElements.push(month.yearElement); self.monthElements.push(month.monthElement); self.monthNav.appendChild(month.container); } self.monthNav.appendChild(self.nextMonthNav); } function buildMonthNav() { self.monthNav = createElement("div", "flatpickr-months"); self.yearElements = []; self.monthElements = []; self.prevMonthNav = createElement("span", "flatpickr-prev-month"); self.prevMonthNav.innerHTML = self.config.prevArrow; self.nextMonthNav = createElement("span", "flatpickr-next-month"); self.nextMonthNav.innerHTML = self.config.nextArrow; buildMonths(); Object.defineProperty(self, "_hidePrevMonthArrow", { get: function get() { return self.__hidePrevMonthArrow; }, set: function set(bool) { if (self.__hidePrevMonthArrow !== bool) { toggleClass(self.prevMonthNav, "flatpickr-disabled", bool); self.__hidePrevMonthArrow = bool; } } }); Object.defineProperty(self, "_hideNextMonthArrow", { get: function get() { return self.__hideNextMonthArrow; }, set: function set(bool) { if (self.__hideNextMonthArrow !== bool) { toggleClass(self.nextMonthNav, "flatpickr-disabled", bool); self.__hideNextMonthArrow = bool; } } }); self.currentYearElement = self.yearElements[0]; updateNavigationCurrentMonth(); return self.monthNav; } function buildTime() { self.calendarContainer.classList.add("hasTime"); if (self.config.noCalendar) self.calendarContainer.classList.add("noCalendar"); self.timeContainer = createElement("div", "flatpickr-time"); self.timeContainer.tabIndex = -1; var separator = createElement("span", "flatpickr-time-separator", ":"); var hourInput = createNumberInput("flatpickr-hour", { "aria-label": self.l10n.hourAriaLabel }); self.hourElement = hourInput.getElementsByTagName("input")[0]; var minuteInput = createNumberInput("flatpickr-minute", { "aria-label": self.l10n.minuteAriaLabel }); self.minuteElement = minuteInput.getElementsByTagName("input")[0]; self.hourElement.tabIndex = self.minuteElement.tabIndex = -1; self.hourElement.value = pad(self.latestSelectedDateObj ? self.latestSelectedDateObj.getHours() : self.config.time_24hr ? self.config.defaultHour : military2ampm(self.config.defaultHour)); self.minuteElement.value = pad(self.latestSelectedDateObj ? self.latestSelectedDateObj.getMinutes() : self.config.defaultMinute); self.hourElement.setAttribute("step", self.config.hourIncrement.toString()); self.minuteElement.setAttribute("step", self.config.minuteIncrement.toString()); self.hourElement.setAttribute("min", self.config.time_24hr ? "0" : "1"); self.hourElement.setAttribute("max", self.config.time_24hr ? "23" : "12"); self.minuteElement.setAttribute("min", "0"); self.minuteElement.setAttribute("max", "59"); self.timeContainer.appendChild(hourInput); self.timeContainer.appendChild(separator); self.timeContainer.appendChild(minuteInput); if (self.config.time_24hr) self.timeContainer.classList.add("time24hr"); if (self.config.enableSeconds) { self.timeContainer.classList.add("hasSeconds"); var secondInput = createNumberInput("flatpickr-second"); self.secondElement = secondInput.getElementsByTagName("input")[0]; self.secondElement.value = pad(self.latestSelectedDateObj ? self.latestSelectedDateObj.getSeconds() : self.config.defaultSeconds); self.secondElement.setAttribute("step", self.minuteElement.getAttribute("step")); self.secondElement.setAttribute("min", "0"); self.secondElement.setAttribute("max", "59"); self.timeContainer.appendChild(createElement("span", "flatpickr-time-separator", ":")); self.timeContainer.appendChild(secondInput); } if (!self.config.time_24hr) { // add self.amPM if appropriate self.amPM = createElement("span", "flatpickr-am-pm", self.l10n.amPM[int((self.latestSelectedDateObj ? self.hourElement.value : self.config.defaultHour) > 11)]); self.amPM.title = self.l10n.toggleTitle; self.amPM.tabIndex = -1; self.timeContainer.appendChild(self.amPM); } return self.timeContainer; } function buildWeekdays() { if (!self.weekdayContainer) self.weekdayContainer = createElement("div", "flatpickr-weekdays");else clearNode(self.weekdayContainer); for (var i = self.config.showMonths; i--;) { var container = createElement("div", "flatpickr-weekdaycontainer"); self.weekdayContainer.appendChild(container); } updateWeekdays(); return self.weekdayContainer; } function updateWeekdays() { var firstDayOfWeek = self.l10n.firstDayOfWeek; var weekdays = self.l10n.weekdays.shorthand.slice(); if (firstDayOfWeek > 0 && firstDayOfWeek < weekdays.length) { weekdays = weekdays.splice(firstDayOfWeek, weekdays.length).concat(weekdays.splice(0, firstDayOfWeek)); } for (var i = self.config.showMonths; i--;) { self.weekdayContainer.children[i].innerHTML = "\n <span class='flatpickr-weekday'>\n " + weekdays.join("</span><span class='flatpickr-weekday'>") + "\n </span>\n "; } } /* istanbul ignore next */ function buildWeeks() { self.calendarContainer.classList.add("hasWeeks"); var weekWrapper = createElement("div", "flatpickr-weekwrapper"); weekWrapper.appendChild(createElement("span", "flatpickr-weekday", self.l10n.weekAbbreviation)); var weekNumbers = createElement("div", "flatpickr-weeks"); weekWrapper.appendChild(weekNumbers); return { weekWrapper: weekWrapper, weekNumbers: weekNumbers }; } function changeMonth(value, isOffset) { if (isOffset === void 0) { isOffset = true; } var delta = isOffset ? value : value - self.currentMonth; if (delta < 0 && self._hidePrevMonthArrow === true || delta > 0 && self._hideNextMonthArrow === true) return; self.currentMonth += delta; if (self.currentMonth < 0 || self.currentMonth > 11) { self.currentYear += self.currentMonth > 11 ? 1 : -1; self.currentMonth = (self.currentMonth + 12) % 12; triggerEvent("onYearChange"); buildMonthSwitch(); } buildDays(); triggerEvent("onMonthChange"); updateNavigationCurrentMonth(); } function clear(triggerChangeEvent, toInitial) { if (triggerChangeEvent === void 0) { triggerChangeEvent = true; } if (toInitial === void 0) { toInitial = true; } self.input.value = ""; if (self.altInput !== undefined) self.altInput.value = ""; if (self.mobileInput !== undefined) self.mobileInput.value = ""; self.selectedDates = []; self.latestSelectedDateObj = undefined; if (toInitial === true) { self.currentYear = self._initialDate.getFullYear(); self.currentMonth = self._initialDate.getMonth(); } self.showTimeInput = false; if (self.config.enableTime === true) { setDefaultHours(); } self.redraw(); if (triggerChangeEvent) // triggerChangeEvent is true (default) or an Event triggerEvent("onChange"); } function close() { self.isOpen = false; if (!self.isMobile) { if (self.calendarContainer !== undefined) { self.calendarContainer.classList.remove("open"); } if (self._input !== undefined) { self._input.classList.remove("active"); } } triggerEvent("onClose"); } function destroy() { if (self.config !== undefined) triggerEvent("onDestroy"); for (var i = self._handlers.length; i--;) { var h = self._handlers[i]; h.element.removeEventListener(h.event, h.handler, h.options); } self._handlers = []; if (self.mobileInput) { if (self.mobileInput.parentNode) self.mobileInput.parentNode.removeChild(self.mobileInput); self.mobileInput = undefined; } else if (self.calendarContainer && self.calendarContainer.parentNode) { if (self.config.static && self.calendarContainer.parentNode) { var wrapper = self.calendarContainer.parentNode; wrapper.lastChild && wrapper.removeChild(wrapper.lastChild); if (wrapper.parentNode) { while (wrapper.firstChild) { wrapper.parentNode.insertBefore(wrapper.firstChild, wrapper); }wrapper.parentNode.removeChild(wrapper); } } else self.calendarContainer.parentNode.removeChild(self.calendarContainer); } if (self.altInput) { self.input.type = "text"; if (self.altInput.parentNode) self.altInput.parentNode.removeChild(self.altInput); delete self.altInput; } if (self.input) { self.input.type = self.input._type; self.input.classList.remove("flatpickr-input"); self.input.removeAttribute("readonly"); self.input.value = ""; } ["_showTimeInput", "latestSelectedDateObj", "_hideNextMonthArrow", "_hidePrevMonthArrow", "__hideNextMonthArrow", "__hidePrevMonthArrow", "isMobile", "isOpen", "selectedDateElem", "minDateHasTime", "maxDateHasTime", "days", "daysContainer", "_input", "_positionElement", "innerContainer", "rContainer", "monthNav", "todayDateElem", "calendarContainer", "weekdayContainer", "prevMonthNav", "nextMonthNav", "monthsDropdownContainer", "currentMonthElement", "currentYearElement", "navigationCurrentMonth", "selectedDateElem", "config"].forEach(function (k) { try { delete self[k]; } catch (_) {} }); } function isCalendarElem(elem) { if (self.config.appendTo && self.config.appendTo.contains(elem)) return true; return self.calendarContainer.contains(elem); } function documentClick(e) { if (self.isOpen && !self.config.inline) { var eventTarget_1 = getEventTarget(e); var isCalendarElement = isCalendarElem(eventTarget_1); var isInput = eventTarget_1 === self.input || eventTarget_1 === self.altInput || self.element.contains(eventTarget_1) || // web components // e.path is not present in all browsers. circumventing typechecks e.path && e.path.indexOf && (~e.path.indexOf(self.input) || ~e.path.indexOf(self.altInput)); var lostFocus = e.type === "blur" ? isInput && e.relatedTarget && !isCalendarElem(e.relatedTarget) : !isInput && !isCalendarElement && !isCalendarElem(e.relatedTarget); var isIgnored = !self.config.ignoredFocusElements.some(function (elem) { return elem.contains(eventTarget_1); }); if (lostFocus && isIgnored) { self.close(); if (self.config.mode === "range" && self.selectedDates.length === 1) { self.clear(false); self.redraw(); } } } } function changeYear(newYear) { if (!newYear || self.config.minDate && newYear < self.config.minDate.getFullYear() || self.config.maxDate && newYear > self.config.maxDate.getFullYear()) return; var newYearNum = newYear, isNewYear = self.currentYear !== newYearNum; self.currentYear = newYearNum || self.currentYear; if (self.config.maxDate && self.currentYear === self.config.maxDate.getFullYear()) { self.currentMonth = Math.min(self.config.maxDate.getMonth(), self.currentMonth); } else if (self.config.minDate && self.currentYear === self.config.minDate.getFullYear()) { self.currentMonth = Math.max(self.config.minDate.getMonth(), self.currentMonth); } if (isNewYear) { self.redraw(); triggerEvent("onYearChange"); buildMonthSwitch(); } } function isEnabled(date, timeless) { if (timeless === void 0) { timeless = true; } var dateToCheck = self.parseDate(date, undefined, timeless); // timeless if (self.config.minDate && dateToCheck && compareDates(dateToCheck, self.config.minDate, timeless !== undefined ? timeless : !self.minDateHasTime) < 0 || self.config.maxDate && dateToCheck && compareDates(dateToCheck, self.config.maxDate, timeless !== undefined ? timeless : !self.maxDateHasTime) > 0) return false; if (self.config.enable.length === 0 && self.config.disable.length === 0) return true; if (dateToCheck === undefined) return false; var bool = self.config.enable.length > 0, array = bool ? self.config.enable : self.config.disable; for (var i = 0, d = void 0; i < array.length; i++) { d = array[i]; if (typeof d === "function" && d(dateToCheck) // disabled by function ) return bool;else if (d instanceof Date && dateToCheck !== undefined && d.getTime() === dateToCheck.getTime()) // disabled by date return bool;else if (typeof d === "string" && dateToCheck !== undefined) { // disabled by date string var parsed = self.parseDate(d, undefined, true); return parsed && parsed.getTime() === dateToCheck.getTime() ? bool : !bool; } else if ( // disabled by range (typeof d === 'undefined' ? 'undefined' : _typeof(d)) === "object" && dateToCheck !== undefined && d.from && d.to && dateToCheck.getTime() >= d.from.getTime() && dateToCheck.getTime() <= d.to.getTime()) return bool; } return !bool; } function isInView(elem) { if (self.daysContainer !== undefined) return elem.className.indexOf("hidden") === -1 && self.daysContainer.contains(elem); return false; } function onKeyDown(e) { // e.key e.keyCode // "Backspace" 8 // "Tab" 9 // "Enter" 13 // "Escape" (IE "Esc") 27 // "ArrowLeft" (IE "Left") 37 // "ArrowUp" (IE "Up") 38 // "ArrowRight" (IE "Right") 39 // "ArrowDown" (IE "Down") 40 // "Delete" (IE "Del") 46 var isInput = e.target === self._input; var allowInput = self.config.allowInput; var allowKeydown = self.isOpen && (!allowInput || !isInput); var allowInlineKeydown = self.config.inline && isInput && !allowInput; if (e.keyCode === 13 && isInput) { if (allowInput) { self.setDate(self._input.value, true, e.target === self.altInput ? self.config.altFormat : self.config.dateFormat); return e.target.blur(); } else { self.open(); } } else if (isCalendarElem(e.target) || allowKeydown || allowInlineKeydown) { var isTimeObj = !!self.timeContainer && self.timeContainer.contains(e.target); switch (e.keyCode) { case 13: if (isTimeObj) { e.preventDefault(); updateTime(); focusAndClose(); } else selectDate(e); break; case 27: // escape e.preventDefault(); focusAndClose(); break; case 8: case 46: if (isInput && !self.config.allowInput) { e.preventDefault(); self.clear(); } break; case 37: case 39: if (!isTimeObj && !isInput) { e.preventDefault(); if (self.daysContainer !== undefined && (allowInput === false || document.activeElement && isInView(document.activeElement))) { var delta_1 = e.keyCode === 39 ? 1 : -1; if (!e.ctrlKey) focusOnDay(undefined, delta_1);else { e.stopPropagation(); changeMonth(delta_1); focusOnDay(getFirstAvailableDay(1), 0); } } } else if (self.hourElement) self.hourElement.focus(); break; case 38: case 40: e.preventDefault(); var delta = e.keyCode === 40 ? 1 : -1; if (self.daysContainer && e.target.$i !== undefined || e.target === self.input) { if (e.ctrlKey) { e.stopPropagation(); changeYear(self.currentYear - delta); focusOnDay(getFirstAvailableDay(1), 0); } else if (!isTimeObj) focusOnDay(undefined, delta * 7); } else if (e.target === self.currentYearElement) { changeYear(self.currentYear - delta); } else if (self.config.enableTime) { if (!isTimeObj && self.hourElement) self.hourElement.focus(); updateTime(e); self._debouncedChange(); } break; case 9: if (isTimeObj) { var elems = [self.hourElement, self.minuteElement, self.secondElement, self.amPM].concat(self.pluginElements).filter(function (x) { return x; }); var i = elems.indexOf(e.target); if (i !== -1) { var target = elems[i + (e.shiftKey ? -1 : 1)]; e.preventDefault(); (target || self._input).focus(); } } else if (!self.config.noCalendar && self.daysContainer && self.daysContainer.contains(e.target) && e.shiftKey) { e.preventDefault(); self._input.focus(); } break; default: break; } } if (self.amPM !== undefined && e.target === self.amPM) { switch (e.key) { case self.l10n.amPM[0].charAt(0): case self.l10n.amPM[0].charAt(0).toLowerCase(): self.amPM.textContent = self.l10n.amPM[0]; setHoursFromInputs(); updateValue(); break; case self.l10n.amPM[1].charAt(0): case self.l10n.amPM[1].charAt(0).toLowerCase(): self.amPM.textContent = self.l10n.amPM[1]; setHoursFromInputs(); updateValue(); break; } } if (isInput || isCalendarElem(e.target)) { triggerEvent("onKeyDown", e); } } function onMouseOver(elem) { if (self.selectedDates.length !== 1 || elem && (!elem.classList.contains("flatpickr-day") || elem.classList.contains("flatpickr-disabled"))) return; var hoverDate = elem ? elem.dateObj.getTime() : self.days.firstElementChild.dateObj.getTime(), initialDate = self.parseDate(self.selectedDates[0], undefined, true).getTime(), rangeStartDate = Math.min(hoverDate, self.selectedDates[0].getTime()), rangeEndDate = Math.max(hoverDate, self.selectedDates[0].getTime()); var containsDisabled = false; var minRange = 0, maxRange = 0; for (var t = rangeStartDate; t < rangeEndDate; t += duration.DAY) { if (!isEnabled(new Date(t), true)) { containsDisabled = containsDisabled || t > rangeStartDate && t < rangeEndDate; if (t < initialDate && (!minRange || t > minRange)) minRange = t;else if (t > initialDate && (!maxRange || t < maxRange)) maxRange = t; } } for (var m = 0; m < self.config.showMonths; m++) { var month = self.daysContainer.children[m]; var _loop_1 = function _loop_1(i, l) { var dayElem = month.children[i], date = dayElem.dateObj; var timestamp = date.getTime(); var outOfRange = minRange > 0 && timestamp < minRange || maxRange > 0 && timestamp > maxRange; if (outOfRange) { dayElem.classList.add("notAllowed"); ["inRange", "startRange", "endRange"].forEach(function (c) { dayElem.classList.remove(c); }); return "continue"; } else if (containsDisabled && !outOfRange) return "continue"; ["startRange", "inRange", "endRange", "notAllowed"].forEach(function (c) { dayElem.classList.remove(c); }); if (elem !== undefined) { elem.classList.add(hoverDate <= self.selectedDates[0].getTime() ? "startRange" : "endRange"); if (initialDate < hoverDate && timestamp === initialDate) dayElem.classList.add("startRange");else if (initialDate > hoverDate && timestamp === initialDate) dayElem.classList.add("endRange"); if (timestamp >= minRange && (maxRange === 0 || timestamp <= maxRange) && isBetween(timestamp, initialDate, hoverDate)) dayElem.classList.add("inRange"); } }; for (var i = 0, l = month.children.length; i < l; i++) { _loop_1(i, l); } } } function onResize() { if (self.isOpen && !self.config.static && !self.config.inline) positionCalendar(); } function setDefaultTime() { self.setDate(self.config.minDate !== undefined ? new Date(self.config.minDate.getTime()) : new Date(), true); setDefaultHours(); updateValue(); } function open(e, positionElement) { if (positionElement === void 0) { positionElement = self._positionElement; } if (self.isMobile === true) { if (e) { e.preventDefault(); e.target && e.target.blur(); } if (self.mobileInput !== undefined) { self.mobileInput.focus(); self.mobileInput.click(); } triggerEvent("onOpen"); return; } if (self._input.disabled || self.config.inline) return; var wasOpen = self.isOpen; self.isOpen = true; if (!wasOpen) { self.calendarContainer.classList.add("open"); self._input.classList.add("active"); triggerEvent("onOpen"); positionCalendar(positionElement); } if (self.config.enableTime === true && self.config.noCalendar === true) { if (self.selectedDates.length === 0) { setDefaultTime(); } if (self.config.allowInput === false && (e === undefined || !self.timeContainer.contains(e.relatedTarget))) { setTimeout(function () { return self.hourElement.select(); }, 50); } } } function minMaxDateSetter(type) { return function (date) { var dateObj = self.config["_" + type + "Date"] = self.parseDate(date, self.config.dateFormat); var inverseDateObj = self.config["_" + (type === "min" ? "max" : "min") + "Date"]; if (dateObj !== undefined) { self[type === "min" ? "minDateHasTime" : "maxDateHasTime"] = dateObj.getHours() > 0 || dateObj.getMinutes() > 0 || dateObj.getSeconds() > 0; } if (self.selectedDates) { self.selectedDates = self.selectedDates.filter(function (d) { return isEnabled(d); }); if (!self.selectedDates.length && type === "min") setHoursFromDate(dateObj); updateValue(); } if (self.daysContainer) { redraw(); if (dateObj !== undefined) self.currentYearElement[type] = dateObj.getFullYear().toString();else self.currentYearElement.removeAttribute(type); self.currentYearElement.disabled = !!inverseDateObj && dateObj !== undefined && inverseDateObj.getFullYear() === dateObj.getFullYear(); } }; } function parseConfig() { var boolOpts = ["wrap", "weekNumbers", "allowInput", "clickOpens", "time_24hr", "enableTime", "noCalendar", "altInput", "shorthandCurrentMonth", "inline", "static", "enableSeconds", "disableMobile"]; var userConfig = _assign({}, instanceConfig, JSON.parse(JSON.stringify(element.dataset || {}))); var formats = {}; self.config.parseDate = userConfig.parseDate; self.config.formatDate = userConfig.formatDate; Object.defineProperty(self.config, "enable", { get: function get() { return self.config._enable; }, set: function set(dates) { self.config._enable = parseDateRules(dates); } }); Object.defineProperty(self.config, "disable", { get: function get() { return self.config._disable; }, set: function set(dates) { self.config._disable = parseDateRules(dates); } }); var timeMode = userConfig.mode === "time"; if (!userConfig.dateFormat && (userConfig.enableTime || timeMode)) { var defaultDateFormat = flatpickr.defaultConfig.dateFormat || defaults.dateFormat; formats.dateFormat = userConfig.noCalendar || timeMode ? "H:i" + (userConfig.enableSeconds ? ":S" : "") : defaultDateFormat + " H:i" + (userConfig.enableSeconds ? ":S" : ""); } if (userConfig.altInput && (userConfig.enableTime || timeMode) && !userConfig.altFormat) { var defaultAltFormat = flatpickr.defaultConfig.altFormat || defaults.altFormat; formats.altFormat = userConfig.noCalendar || timeMode ? "h:i" + (userConfig.enableSeconds ? ":S K" : " K") : defaultAltFormat + (" h:i" + (userConfig.enableSeconds ? ":S" : "") + " K"); } if (!userConfig.altInputClass) { self.config.altInputClass = self.input.className + " " + self.config.altInputClass; } Object.defineProperty(self.config, "minDate", { get: function get() { return self.config._minDate; }, set: minMaxDateSetter("min") }); Object.defineProperty(self.config, "maxDate", { get: function get() { return self.config._maxDate; }, set: minMaxDateSetter("max") }); var minMaxTimeSetter = function minMaxTimeSetter(type) { return function (val) { self.config[type === "min" ? "_minTime" : "_maxTime"] = self.parseDate(val, "H:i"); }; }; Object.defineProperty(self.config, "minTime", { get: function get() { return self.config._minTime; }, set: minMaxTimeSetter("min") }); Object.defineProperty(self.config, "maxTime", { get: function get() { return self.config._maxTime; }, set: minMaxTimeSetter("max") }); if (userConfig.mode === "time") { self.config.noCalendar = true; self.config.enableTime = true; } Object.assign(self.config, formats, userConfig); for (var i = 0; i < boolOpts.length; i++) { self.config[boolOpts[i]] = self.config[boolOpts[i]] === true || self.config[boolOpts[i]] === "true"; }HOOKS.filter(function (hook) { return self.config[hook] !== undefined; }).forEach(function (hook) { self.config[hook] = arrayify(self.config[hook] || []).map(bindToInstance); }); self.isMobile = !self.config.disableMobile && !self.config.inline && self.config.mode === "single" && !self.config.disable.length && !self.config.enable.length && !self.config.weekNumbers && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); for (var i = 0; i < self.config.plugins.length; i++) { var pluginConf = self.config.plugins[i](self) || {}; for (var key in pluginConf) { if (HOOKS.indexOf(key) > -1) { self.config[key] = arrayify(pluginConf[key]).map(bindToInstance).concat(self.config[key]); } else if (typeof userConfig[key] === "undefined") self.config[key] = pluginConf[key]; } } triggerEvent("onParseConfig"); } function setupLocale() { if (_typeof(self.config.locale) !== "object" && typeof flatpickr.l10ns[self.config.locale] === "undefined") self.config.errorHandler(new Error("flatpickr: invalid locale " + self.config.locale)); self.l10n = _assign({}, flatpickr.l10ns["default"], _typeof(self.config.locale) === "object" ? self.config.locale : self.config.locale !== "default" ? flatpickr.l10ns[self.config.locale] : undefined); tokenRegex.K = "(" + self.l10n.amPM[0] + "|" + self.l10n.amPM[1] + "|" + self.l10n.amPM[0].toLowerCase() + "|" + self.l10n.amPM[1].toLowerCase() + ")"; var userConfig = _assign({}, instanceConfig, JSON.parse(JSON.stringify(element.dataset || {}))); if (userConfig.time_24hr === undefined && flatpickr.defaultConfig.time_24hr === undefined) { self.config.time_24hr = self.l10n.time_24hr; } self.formatDate = createDateFormatter(self); self.parseDate = createDateParser({ config: self.config, l10n: self.l10n }); } function positionCalendar(customPositionElement) { if (self.calendarContainer === undefined) return; triggerEvent("onPreCalendarPosition"); var positionElement = customPositionElement || self._positionElement; var calendarHeight = Array.prototype.reduce.call(self.calendarContainer.children, function (acc, child) { return acc + child.offsetHeight; }, 0), calendarWidth = self.calendarContainer.offsetWidth, configPos = self.config.position.split(" "), configPosVertical = configPos[0], configPosHorizontal = configPos.length > 1 ? configPos[1] : null, inputBounds = positionElement.getBoundingClientRect(), distanceFromBottom = window.innerHeight - inputBounds.bottom, showOnTop = configPosVertical === "above" || configPosVertical !== "below" && distanceFromBottom < calendarHeight && inputBounds.top > calendarHeight; var top = window.pageYOffset + inputBounds.top + (!showOnTop ? positionElement.offsetHeight + 2 : -calendarHeight - 2); toggleClass(self.calendarContainer, "arrowTop", !showOnTop); toggleClass(self.calendarContainer, "arrowBottom", showOnTop); if (self.config.inline) return; var left = window.pageXOffset + inputBounds.left - (configPosHorizontal != null && configPosHorizontal === "center" ? (calendarWidth - inputBounds.width) / 2 : 0); var right = window.document.body.offsetWidth - inputBounds.right; var rightMost = left + calendarWidth > window.document.body.offsetWidth; var centerMost = right + calendarWidth > window.document.body.offsetWidth; toggleClass(self.calendarContainer, "rightMost", rightMost); if (self.config.static) return; self.calendarContainer.style.top = top + "px"; if (!rightMost) { self.calendarContainer.style.left = left + "px"; self.calendarContainer.style.right = "auto"; } else if (!centerMost) { self.calendarContainer.style.left = "auto"; self.calendarContainer.style.right = right + "px"; } else { var doc = document.styleSheets[0]; // some testing environments don't have css support if (doc === undefined) return; var bodyWidth = window.document.body.offsetWidth; var centerLeft = Math.max(0, bodyWidth / 2 - calendarWidth / 2); var centerBefore = ".flatpickr-calendar.centerMost:before"; var centerAfter = ".flatpickr-calendar.centerMost:after"; var centerIndex = doc.cssRules.length; var centerStyle = "{left:" + inputBounds.left + "px;right:auto;}"; toggleClass(self.calendarContainer, "rightMost", false); toggleClass(self.calendarContainer, "centerMost", true); doc.insertRule(centerBefore + "," + centerAfter + centerStyle, centerIndex); self.calendarContainer.style.left = centerLeft + "px"; self.calendarContainer.style.right = "auto"; } } function redraw() { if (self.config.noCalendar || self.isMobile) return; updateNavigationCurrentMonth(); buildDays(); } function focusAndClose() { self._input.focus(); if (window.navigator.userAgent.indexOf("MSIE") !== -1 || navigator.msMaxTouchPoints !== undefined) { // hack - bugs in the way IE handles focus keeps the calendar open setTimeout(self.close, 0); } else { self.close(); } } function selectDate(e) { e.preventDefault(); e.stopPropagation(); var isSelectable = function isSelectable(day) { return day.classList && day.classList.contains("flatpickr-day") && !day.classList.contains("flatpickr-disabled") && !day.classList.contains("notAllowed"); }; var t = findParent(e.target, isSelectable); if (t === undefined) return; var target = t; var selectedDate = self.latestSelectedDateObj = new Date(target.dateObj.getTime()); var shouldChangeMonth = (selectedDate.getMonth() < self.currentMonth || selectedDate.getMonth() > self.currentMonth + self.config.showMonths - 1) && self.config.mode !== "range"; self.selectedDateElem = target; if (self.config.mode === "single") self.selectedDates = [selectedDate];else if (self.config.mode === "multiple") { var selectedIndex = isDateSelected(selectedDate); if (selectedIndex) self.selectedDates.splice(parseInt(selectedIndex), 1);else self.selectedDates.push(selectedDate); } else if (self.config.mode === "range") { if (self.selectedDates.length === 2) { self.clear(false, false); } self.latestSelectedDateObj = selectedDate; self.selectedDates.push(selectedDate); // unless selecting same date twice, sort ascendingly if (compareDates(selectedDate, self.selectedDates[0], true) !== 0) self.selectedDates.sort(function (a, b) { return a.getTime() - b.getTime(); }); } setHoursFromInputs(); if (shouldChangeMonth) { var isNewYear = self.currentYear !== selectedDate.getFullYear(); self.currentYear = selectedDate.getFullYear(); self.currentMonth = selectedDate.getMonth(); if (isNewYear) { triggerEvent("onYearChange"); buildMonthSwitch(); } triggerEvent("onMonthChange"); } updateNavigationCurrentMonth(); buildDays(); updateValue(); if (self.config.enableTime) setTimeout(function () { return self.showTimeInput = true; }, 50); // maintain focus if (!shouldChangeMonth && self.config.mode !== "range" && self.config.showMonths === 1) focusOnDayElem(target);else if (self.selectedDateElem !== undefined && self.hourElement === undefined) { self.selectedDateElem && self.selectedDateElem.focus(); } if (self.hourElement !== undefined) self.hourElement !== undefined && self.hourElement.focus(); if (self.config.closeOnSelect) { var single = self.config.mode === "single" && !self.config.enableTime; var range = self.config.mode === "range" && self.selectedDates.length === 2 && !self.config.enableTime; if (single || range) { focusAndClose(); } } triggerChange(); } var CALLBACKS = { locale: [setupLocale, updateWeekdays], showMonths: [buildMonths, setCalendarWidth, buildWeekdays], minDate: [jumpToDate], maxDate: [jumpToDate] }; function set(option, value) { if (option !== null && (typeof option === 'undefined' ? 'undefined' : _typeof(option)) === "object") { Object.assign(self.config, option); for (var key in option) { if (CALLBACKS[key] !== undefined) CALLBACKS[key].forEach(function (x) { return x(); }); } } else { self.config[option] = value; if (CALLBACKS[option] !== undefined) CALLBACKS[option].forEach(function (x) { return x(); });else if (HOOKS.indexOf(option) > -1) self.config[option] = arrayify(value); } self.redraw(); updateValue(false); } function setSelectedDate(inputDate, format) { var dates = []; if (inputDate instanceof Array) dates = inputDate.map(function (d) { return self.parseDate(d, format); });else if (inputDate instanceof Date || typeof inputDate === "number") dates = [self.parseDate(inputDate, format)];else if (typeof inputDate === "string") { switch (self.config.mode) { case "single": case "time": dates = [self.parseDate(inputDate, format)]; break; case "multiple": dates = inputDate.split(self.config.conjunction).map(function (date) { return self.parseDate(date, format); }); break; case "range": dates = inputDate.split(self.l10n.rangeSeparator).map(function (date) { return self.parseDate(date, format); }); break; default: break; } } else self.config.errorHandler(new Error("Invalid date supplied: " + JSON.stringify(inputDate))); self.selectedDates = dates.filter(function (d) { return d instanceof Date && isEnabled(d, false); }); if (self.config.mode === "range") self.selectedDates.sort(function (a, b) { return a.getTime() - b.getTime(); }); } function setDate(date, triggerChange, format) { if (triggerChange === void 0) { triggerChange = false; } if (format === void 0) { format = self.config.dateFormat; } if (date !== 0 && !date || date instanceof Array && date.length === 0) return self.clear(triggerChange); setSelectedDate(date, format); self.showTimeInput = self.selectedDates.length > 0; self.latestSelectedDateObj = self.selectedDates[self.selectedDates.length - 1]; self.redraw(); jumpToDate(); setHoursFromDate(); if (self.selectedDates.length === 0) { self.clear(false); } updateValue(triggerChange); if (triggerChange) triggerEvent("onChange"); } function parseDateRules(arr) { return arr.slice().map(function (rule) { if (typeof rule === "string" || typeof rule === "number" || rule instanceof Date) { return self.parseDate(rule, undefined, true); } else if (rule && (typeof rule === 'undefined' ? 'undefined' : _typeof(rule)) === "object" && rule.from && rule.to) return { from: self.parseDate(rule.from, undefined), to: self.parseDate(rule.to, undefined) }; return rule; }).filter(function (x) { return x; }); // remove falsy values } function setupDates() { self.selectedDates = []; self.now = self.parseDate(self.config.now) || new Date(); // Workaround IE11 setting placeholder as the input's value var preloadedDate = self.config.defaultDate || ((self.input.nodeName === "INPUT" || self.input.nodeName === "TEXTAREA") && self.input.placeholder && self.input.value === self.input.placeholder ? null : self.input.value); if (preloadedDate) setSelectedDate(preloadedDate, self.config.dateFormat); self._initialDate = self.selectedDates.length > 0 ? self.selectedDates[0] : self.config.minDate && self.config.minDate.getTime() > self.now.getTime() ? self.config.minDate : self.config.maxDate && self.config.maxDate.getTime() < self.now.getTime() ? self.config.maxDate : self.now; self.currentYear = self._initialDate.getFullYear(); self.currentMonth = self._initialDate.getMonth(); if (self.selectedDates.length > 0) self.latestSelectedDateObj = self.selectedDates[0]; if (self.config.minTime !== undefined) self.config.minTime = self.parseDate(self.config.minTime, "H:i"); if (self.config.maxTime !== undefined) self.config.maxTime = self.parseDate(self.config.maxTime, "H:i"); self.minDateHasTime = !!self.config.minDate && (self.config.minDate.getHours() > 0 || self.config.minDate.getMinutes() > 0 || self.config.minDate.getSeconds() > 0); self.maxDateHasTime = !!self.config.maxDate && (self.config.maxDate.getHours() > 0 || self.config.maxDate.getMinutes() > 0 || self.config.maxDate.getSeconds() > 0); Object.defineProperty(self, "showTimeInput", { get: function get() { return self._showTimeInput; }, set: function set(bool) { self._showTimeInput = bool; if (self.calendarContainer) toggleClass(self.calendarContainer, "showTimeInput", bool); self.isOpen && positionCalendar(); } }); } function setupInputs() { self.input = self.config.wrap ? element.querySelector("[data-input]") : element; /* istanbul ignore next */ if (!self.input) { self.config.errorHandler(new Error("Invalid input element specified")); return; } // hack: store previous type to restore it after destroy() self.input._type = self.input.type; self.input.type = "text"; self.input.classList.add("flatpickr-input"); self._input = self.input; if (self.config.altInput) { // replicate self.element self.altInput = createElement(self.input.nodeName, self.config.altInputClass); self._input = self.altInput; self.altInput.placeholder = self.input.placeholder; self.altInput.disabled = self.input.disabled; self.altInput.required = self.input.required; self.altInput.tabIndex = self.input.tabIndex; self.altInput.type = "text"; self.input.setAttribute("type", "hidden"); if (!self.config.static && self.input.parentNode) self.input.parentNode.insertBefore(self.altInput, self.input.nextSibling); } if (!self.config.allowInput) self._input.setAttribute("readonly", "readonly"); self._positionElement = self.config.positionElement || self._input; } function setupMobile() { var inputType = self.config.enableTime ? self.config.noCalendar ? "time" : "datetime-local" : "date"; self.mobileInput = createElement("input", self.input.className + " flatpickr-mobile"); self.mobileInput.step = self.input.getAttribute("step") || "any"; self.mobileInput.tabIndex = 1; self.mobileInput.type = inputType; self.mobileInput.disabled = self.input.disabled; self.mobileInput.required = self.input.required; self.mobileInput.placeholder = self.input.placeholder; self.mobileFormatStr = inputType === "datetime-local" ? "Y-m-d\\TH:i:S" : inputType === "date" ? "Y-m-d" : "H:i:S"; if (self.selectedDates.length > 0) { self.mobileInput.defaultValue = self.mobileInput.value = self.formatDate(self.selectedDates[0], self.mobileFormatStr); } if (self.config.minDate) self.mobileInput.min = self.formatDate(self.config.minDate, "Y-m-d"); if (self.config.maxDate) self.mobileInput.max = self.formatDate(self.config.maxDate, "Y-m-d"); self.input.type = "hidden"; if (self.altInput !== undefined) self.altInput.type = "hidden"; try { if (self.input.parentNode) self.input.parentNode.insertBefore(self.mobileInput, self.input.nextSibling); } catch (_a) {} bind(self.mobileInput, "change", function (e) { self.setDate(e.target.value, false, self.mobileFormatStr); triggerEvent("onChange"); triggerEvent("onClose"); }); } function toggle(e) { if (self.isOpen === true) return self.close(); self.open(e); } function triggerEvent(event, data) { // If the instance has been destroyed already, all hooks have been removed if (self.config === undefined) return; var hooks = self.config[event]; if (hooks !== undefined && hooks.length > 0) { for (var i = 0; hooks[i] && i < hooks.length; i++) { hooks[i](self.selectedDates, self.input.value, self, data); } } if (event === "onChange") { self.input.dispatchEvent(createEvent("change")); // many front-end frameworks bind to the input event self.input.dispatchEvent(createEvent("input")); } } function createEvent(name) { var e = document.createEvent("Event"); e.initEvent(name, true, true); return e; } function isDateSelected(date) { for (var i = 0; i < self.selectedDates.length; i++) { if (compareDates(self.selectedDates[i], date) === 0) return "" + i; } return false; } function isDateInRange(date) { if (self.config.mode !== "range" || self.selectedDates.length < 2) return false; return compareDates(date, self.selectedDates[0]) >= 0 && compareDates(date, self.selectedDates[1]) <= 0; } function updateNavigationCurrentMonth() { if (self.config.noCalendar || self.isMobile || !self.monthNav) return; self.yearElements.forEach(function (yearElement, i) { var d = new Date(self.currentYear, self.currentMonth, 1); d.setMonth(self.currentMonth + i); if (self.config.showMonths > 1 || self.config.monthSelectorType === "static") { self.monthElements[i].textContent = monthToStr(d.getMonth(), self.config.shorthandCurrentMonth, self.l10n) + " "; } else { self.monthsDropdownContainer.value = d.getMonth().toString(); } yearElement.value = d.getFullYear().toString(); }); self._hidePrevMonthArrow = self.config.minDate !== undefined && (self.currentYear === self.config.minDate.getFullYear() ? self.currentMonth <= self.config.minDate.getMonth() : self.currentYear < self.config.minDate.getFullYear()); self._hideNextMonthArrow = self.config.maxDate !== undefined && (self.currentYear === self.config.maxDate.getFullYear() ? self.currentMonth + 1 > self.config.maxDate.getMonth() : self.currentYear > self.config.maxDate.getFullYear()); } function getDateStr(format) { return self.selectedDates.map(function (dObj) { return self.formatDate(dObj, format); }).filter(function (d, i, arr) { return self.config.mode !== "range" || self.config.enableTime || arr.indexOf(d) === i; }).join(self.config.mode !== "range" ? self.config.conjunction : self.l10n.rangeSeparator); } /** * Updates the values of inputs associated with the calendar */ function updateValue(triggerChange) { if (triggerChange === void 0) { triggerChange = true; } if (self.mobileInput !== undefined && self.mobileFormatStr) { self.mobileInput.value = self.latestSelectedDateObj !== undefined ? self.formatDate(self.latestSelectedDateObj, self.mobileFormatStr) : ""; } self.input.value = getDateStr(self.config.dateFormat); if (self.altInput !== undefined) { self.altInput.value = getDateStr(self.config.altFormat); } if (triggerChange !== false) triggerEvent("onValueUpdate"); } function onMonthNavClick(e) { var isPrevMonth = self.prevMonthNav.contains(e.target); var isNextMonth = self.nextMonthNav.contains(e.target); if (isPrevMonth || isNextMonth) { changeMonth(isPrevMonth ? -1 : 1); } else if (self.yearElements.indexOf(e.target) >= 0) { e.target.select(); } else if (e.target.classList.contains("arrowUp")) { self.changeYear(self.currentYear + 1); } else if (e.target.classList.contains("arrowDown")) { self.changeYear(self.currentYear - 1); } } function timeWrapper(e) { e.preventDefault(); var isKeyDown = e.type === "keydown", input = e.target; if (self.amPM !== undefined && e.target === self.amPM) { self.amPM.textContent = self.l10n.amPM[int(self.amPM.textContent === self.l10n.amPM[0])]; } var min = parseFloat(input.getAttribute("min")), max = parseFloat(input.getAttribute("max")), step = parseFloat(input.getAttribute("step")), curValue = parseInt(input.value, 10), delta = e.delta || (isKeyDown ? e.which === 38 ? 1 : -1 : 0); var newValue = curValue + step * delta; if (typeof input.value !== "undefined" && input.value.length === 2) { var isHourElem = input === self.hourElement, isMinuteElem = input === self.minuteElement; if (newValue < min) { newValue = max + newValue + int(!isHourElem) + (int(isHourElem) && int(!self.amPM)); if (isMinuteElem) incrementNumInput(undefined, -1, self.hourElement); } else if (newValue > max) { newValue = input === self.hourElement ? newValue - max - int(!self.amPM) : min; if (isMinuteElem) incrementNumInput(undefined, 1, self.hourElement); } if (self.amPM && isHourElem && (step === 1 ? newValue + curValue === 23 : Math.abs(newValue - curValue) > step)) { self.amPM.textContent = self.l10n.amPM[int(self.amPM.textContent === self.l10n.amPM[0])]; } input.value = pad(newValue); } } init(); return self; } /* istanbul ignore next */ function _flatpickr(nodeList, config) { // static list var nodes = Array.prototype.slice.call(nodeList).filter(function (x) { return x instanceof HTMLElement; }); var instances = []; for (var i = 0; i < nodes.length; i++) { var node = nodes[i]; try { if (node.getAttribute("data-fp-omit") !== null) continue; if (node._flatpickr !== undefined) { node._flatpickr.destroy(); node._flatpickr = undefined; } node._flatpickr = FlatpickrInstance(node, config || {}); instances.push(node._flatpickr); } catch (e) { console.error(e); } } return instances.length === 1 ? instances[0] : instances; } /* istanbul ignore next */ if (typeof HTMLElement !== "undefined" && typeof HTMLCollection !== "undefined" && typeof NodeList !== "undefined") { // browser env HTMLCollection.prototype.flatpickr = NodeList.prototype.flatpickr = function (config) { return _flatpickr(this, config); }; HTMLElement.prototype.flatpickr = function (config) { return _flatpickr([this], config); }; } /* istanbul ignore next */ var flatpickr = function flatpickr(selector, config) { if (typeof selector === "string") { return _flatpickr(window.document.querySelectorAll(selector), config); } else if (selector instanceof Node) { return _flatpickr([selector], config); } else { return _flatpickr(selector, config); } }; /* istanbul ignore next */ flatpickr.defaultConfig = {}; flatpickr.l10ns = { en: _assign({}, english), "default": _assign({}, english) }; flatpickr.localize = function (l10n) { flatpickr.l10ns["default"] = _assign({}, flatpickr.l10ns["default"], l10n); }; flatpickr.setDefaults = function (config) { flatpickr.defaultConfig = _assign({}, flatpickr.defaultConfig, config); }; flatpickr.parseDate = createDateParser({}); flatpickr.formatDate = createDateFormatter({}); flatpickr.compareDates = compareDates; /* istanbul ignore next */ if (typeof jQuery !== "undefined" && typeof jQuery.fn !== "undefined") { jQuery.fn.flatpickr = function (config) { return _flatpickr(this, config); }; } // eslint-disable-next-line @typescript-eslint/camelcase Date.prototype.fp_incr = function (days) { return new Date(this.getFullYear(), this.getMonth(), this.getDate() + (typeof days === "string" ? parseInt(days, 10) : days)); }; if (typeof window !== "undefined") { window.flatpickr = flatpickr; } return flatpickr; }); /***/ }), /* 182 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTextField; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_dom_events__ = __webpack_require__(8); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_dom_ponyfill__ = __webpack_require__(5); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_floating_label_component__ = __webpack_require__(88); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__material_line_ripple_component__ = __webpack_require__(90); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__material_notched_outline_component__ = __webpack_require__(39); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__material_ripple_component__ = __webpack_require__(6); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__material_ripple_foundation__ = __webpack_require__(9); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__character_counter_component__ = __webpack_require__(92); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__character_counter_foundation__ = __webpack_require__(41); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__constants__ = __webpack_require__(42); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__foundation__ = __webpack_require__(94); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__helper_text_component__ = __webpack_require__(95); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__helper_text_foundation__ = __webpack_require__(43); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__icon_component__ = __webpack_require__(97); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCTextField = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCTextField, _super); function MDCTextField() { return _super !== null && _super.apply(this, arguments) || this; } MDCTextField.attachTo = function (root) { return new MDCTextField(root); }; MDCTextField.prototype.initialize = function (rippleFactory, lineRippleFactory, helperTextFactory, characterCounterFactory, iconFactory, labelFactory, outlineFactory) { if (rippleFactory === void 0) { rippleFactory = function rippleFactory(el, foundation) { return new __WEBPACK_IMPORTED_MODULE_7__material_ripple_component__["a" /* MDCRipple */](el, foundation); }; } if (lineRippleFactory === void 0) { lineRippleFactory = function lineRippleFactory(el) { return new __WEBPACK_IMPORTED_MODULE_5__material_line_ripple_component__["a" /* MDCLineRipple */](el); }; } if (helperTextFactory === void 0) { helperTextFactory = function helperTextFactory(el) { return new __WEBPACK_IMPORTED_MODULE_13__helper_text_component__["a" /* MDCTextFieldHelperText */](el); }; } if (characterCounterFactory === void 0) { characterCounterFactory = function characterCounterFactory(el) { return new __WEBPACK_IMPORTED_MODULE_9__character_counter_component__["a" /* MDCTextFieldCharacterCounter */](el); }; } if (iconFactory === void 0) { iconFactory = function iconFactory(el) { return new __WEBPACK_IMPORTED_MODULE_15__icon_component__["a" /* MDCTextFieldIcon */](el); }; } if (labelFactory === void 0) { labelFactory = function labelFactory(el) { return new __WEBPACK_IMPORTED_MODULE_4__material_floating_label_component__["a" /* MDCFloatingLabel */](el); }; } if (outlineFactory === void 0) { outlineFactory = function outlineFactory(el) { return new __WEBPACK_IMPORTED_MODULE_6__material_notched_outline_component__["a" /* MDCNotchedOutline */](el); }; } this.input_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_11__constants__["e" /* strings */].INPUT_SELECTOR); var labelElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_11__constants__["e" /* strings */].LABEL_SELECTOR); this.label_ = labelElement ? labelFactory(labelElement) : null; var lineRippleElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_11__constants__["e" /* strings */].LINE_RIPPLE_SELECTOR); this.lineRipple_ = lineRippleElement ? lineRippleFactory(lineRippleElement) : null; var outlineElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_11__constants__["e" /* strings */].OUTLINE_SELECTOR); this.outline_ = outlineElement ? outlineFactory(outlineElement) : null; // Helper text var helperTextStrings = __WEBPACK_IMPORTED_MODULE_14__helper_text_foundation__["a" /* MDCTextFieldHelperTextFoundation */].strings; var nextElementSibling = this.root_.nextElementSibling; var hasHelperLine = nextElementSibling && nextElementSibling.classList.contains(__WEBPACK_IMPORTED_MODULE_11__constants__["c" /* cssClasses */].HELPER_LINE); var helperTextEl = hasHelperLine && nextElementSibling && nextElementSibling.querySelector(helperTextStrings.ROOT_SELECTOR); this.helperText_ = helperTextEl ? helperTextFactory(helperTextEl) : null; // Character counter var characterCounterStrings = __WEBPACK_IMPORTED_MODULE_10__character_counter_foundation__["a" /* MDCTextFieldCharacterCounterFoundation */].strings; var characterCounterEl = this.root_.querySelector(characterCounterStrings.ROOT_SELECTOR); // If character counter is not found in root element search in sibling element. if (!characterCounterEl && hasHelperLine && nextElementSibling) { characterCounterEl = nextElementSibling.querySelector(characterCounterStrings.ROOT_SELECTOR); } this.characterCounter_ = characterCounterEl ? characterCounterFactory(characterCounterEl) : null; this.leadingIcon_ = null; this.trailingIcon_ = null; var iconElements = this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_11__constants__["e" /* strings */].ICON_SELECTOR); if (iconElements.length > 0) { if (iconElements.length > 1) { // Has both icons. this.leadingIcon_ = iconFactory(iconElements[0]); this.trailingIcon_ = iconFactory(iconElements[1]); } else { if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_11__constants__["c" /* cssClasses */].WITH_LEADING_ICON)) { this.leadingIcon_ = iconFactory(iconElements[0]); } else { this.trailingIcon_ = iconFactory(iconElements[0]); } } } this.ripple = this.createRipple_(rippleFactory); }; MDCTextField.prototype.destroy = function () { if (this.ripple) { this.ripple.destroy(); } if (this.lineRipple_) { this.lineRipple_.destroy(); } if (this.helperText_) { this.helperText_.destroy(); } if (this.characterCounter_) { this.characterCounter_.destroy(); } if (this.leadingIcon_) { this.leadingIcon_.destroy(); } if (this.trailingIcon_) { this.trailingIcon_.destroy(); } if (this.label_) { this.label_.destroy(); } if (this.outline_) { this.outline_.destroy(); } _super.prototype.destroy.call(this); }; /** * Initializes the Text Field's internal state based on the environment's * state. */ MDCTextField.prototype.initialSyncWithDOM = function () { this.disabled = this.input_.disabled; }; Object.defineProperty(MDCTextField.prototype, "value", { get: function get() { return this.foundation_.getValue(); }, /** * @param value The value to set on the input. */ set: function set(value) { this.foundation_.setValue(value); }, enumerable: true, configurable: true }); Object.defineProperty(MDCTextField.prototype, "disabled", { get: function get() { return this.foundation_.isDisabled(); }, /** * @param disabled Sets the Text Field disabled or enabled. */ set: function set(disabled) { this.foundation_.setDisabled(disabled); }, enumerable: true, configurable: true }); Object.defineProperty(MDCTextField.prototype, "valid", { get: function get() { return this.foundation_.isValid(); }, /** * @param valid Sets the Text Field valid or invalid. */ set: function set(valid) { this.foundation_.setValid(valid); }, enumerable: true, configurable: true }); Object.defineProperty(MDCTextField.prototype, "required", { get: function get() { return this.input_.required; }, /** * @param required Sets the Text Field to required. */ set: function set(required) { this.input_.required = required; }, enumerable: true, configurable: true }); Object.defineProperty(MDCTextField.prototype, "pattern", { get: function get() { return this.input_.pattern; }, /** * @param pattern Sets the input element's validation pattern. */ set: function set(pattern) { this.input_.pattern = pattern; }, enumerable: true, configurable: true }); Object.defineProperty(MDCTextField.prototype, "minLength", { get: function get() { return this.input_.minLength; }, /** * @param minLength Sets the input element's minLength. */ set: function set(minLength) { this.input_.minLength = minLength; }, enumerable: true, configurable: true }); Object.defineProperty(MDCTextField.prototype, "maxLength", { get: function get() { return this.input_.maxLength; }, /** * @param maxLength Sets the input element's maxLength. */ set: function set(maxLength) { // Chrome throws exception if maxLength is set to a value less than zero if (maxLength < 0) { this.input_.removeAttribute('maxLength'); } else { this.input_.maxLength = maxLength; } }, enumerable: true, configurable: true }); Object.defineProperty(MDCTextField.prototype, "min", { get: function get() { return this.input_.min; }, /** * @param min Sets the input element's min. */ set: function set(min) { this.input_.min = min; }, enumerable: true, configurable: true }); Object.defineProperty(MDCTextField.prototype, "max", { get: function get() { return this.input_.max; }, /** * @param max Sets the input element's max. */ set: function set(max) { this.input_.max = max; }, enumerable: true, configurable: true }); Object.defineProperty(MDCTextField.prototype, "step", { get: function get() { return this.input_.step; }, /** * @param step Sets the input element's step. */ set: function set(step) { this.input_.step = step; }, enumerable: true, configurable: true }); Object.defineProperty(MDCTextField.prototype, "helperTextContent", { /** * Sets the helper text element content. */ set: function set(content) { this.foundation_.setHelperTextContent(content); }, enumerable: true, configurable: true }); Object.defineProperty(MDCTextField.prototype, "leadingIconAriaLabel", { /** * Sets the aria label of the leading icon. */ set: function set(label) { this.foundation_.setLeadingIconAriaLabel(label); }, enumerable: true, configurable: true }); Object.defineProperty(MDCTextField.prototype, "leadingIconContent", { /** * Sets the text content of the leading icon. */ set: function set(content) { this.foundation_.setLeadingIconContent(content); }, enumerable: true, configurable: true }); Object.defineProperty(MDCTextField.prototype, "trailingIconAriaLabel", { /** * Sets the aria label of the trailing icon. */ set: function set(label) { this.foundation_.setTrailingIconAriaLabel(label); }, enumerable: true, configurable: true }); Object.defineProperty(MDCTextField.prototype, "trailingIconContent", { /** * Sets the text content of the trailing icon. */ set: function set(content) { this.foundation_.setTrailingIconContent(content); }, enumerable: true, configurable: true }); Object.defineProperty(MDCTextField.prototype, "useNativeValidation", { /** * Enables or disables the use of native validation. Use this for custom validation. * @param useNativeValidation Set this to false to ignore native input validation. */ set: function set(useNativeValidation) { this.foundation_.setUseNativeValidation(useNativeValidation); }, enumerable: true, configurable: true }); /** * Focuses the input element. */ MDCTextField.prototype.focus = function () { this.input_.focus(); }; /** * Recomputes the outline SVG path for the outline element. */ MDCTextField.prototype.layout = function () { var openNotch = this.foundation_.shouldFloat; this.foundation_.notchOutline(openNotch); }; MDCTextField.prototype.getDefaultFoundation = function () { // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. var adapter = __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, this.getRootAdapterMethods_(), this.getInputAdapterMethods_(), this.getLabelAdapterMethods_(), this.getLineRippleAdapterMethods_(), this.getOutlineAdapterMethods_()); // tslint:enable:object-literal-sort-keys return new __WEBPACK_IMPORTED_MODULE_12__foundation__["a" /* MDCTextFieldFoundation */](adapter, this.getFoundationMap_()); }; MDCTextField.prototype.getRootAdapterMethods_ = function () { var _this = this; // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { addClass: function addClass(className) { return _this.root_.classList.add(className); }, removeClass: function removeClass(className) { return _this.root_.classList.remove(className); }, hasClass: function hasClass(className) { return _this.root_.classList.contains(className); }, registerTextFieldInteractionHandler: function registerTextFieldInteractionHandler(evtType, handler) { return _this.listen(evtType, handler); }, deregisterTextFieldInteractionHandler: function deregisterTextFieldInteractionHandler(evtType, handler) { return _this.unlisten(evtType, handler); }, registerValidationAttributeChangeHandler: function registerValidationAttributeChangeHandler(handler) { var getAttributesList = function getAttributesList(mutationsList) { return mutationsList.map(function (mutation) { return mutation.attributeName; }).filter(function (attributeName) { return attributeName; }); }; var observer = new MutationObserver(function (mutationsList) { return handler(getAttributesList(mutationsList)); }); var config = { attributes: true }; observer.observe(_this.input_, config); return observer; }, deregisterValidationAttributeChangeHandler: function deregisterValidationAttributeChangeHandler(observer) { return observer.disconnect(); } }; // tslint:enable:object-literal-sort-keys }; MDCTextField.prototype.getInputAdapterMethods_ = function () { var _this = this; // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { getNativeInput: function getNativeInput() { return _this.input_; }, isFocused: function isFocused() { return document.activeElement === _this.input_; }, registerInputInteractionHandler: function registerInputInteractionHandler(evtType, handler) { return _this.input_.addEventListener(evtType, handler, Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_events__["a" /* applyPassive */])()); }, deregisterInputInteractionHandler: function deregisterInputInteractionHandler(evtType, handler) { return _this.input_.removeEventListener(evtType, handler, Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_events__["a" /* applyPassive */])()); } }; // tslint:enable:object-literal-sort-keys }; MDCTextField.prototype.getLabelAdapterMethods_ = function () { var _this = this; return { floatLabel: function floatLabel(shouldFloat) { return _this.label_ && _this.label_.float(shouldFloat); }, getLabelWidth: function getLabelWidth() { return _this.label_ ? _this.label_.getWidth() : 0; }, hasLabel: function hasLabel() { return Boolean(_this.label_); }, shakeLabel: function shakeLabel(shouldShake) { return _this.label_ && _this.label_.shake(shouldShake); } }; }; MDCTextField.prototype.getLineRippleAdapterMethods_ = function () { var _this = this; return { activateLineRipple: function activateLineRipple() { if (_this.lineRipple_) { _this.lineRipple_.activate(); } }, deactivateLineRipple: function deactivateLineRipple() { if (_this.lineRipple_) { _this.lineRipple_.deactivate(); } }, setLineRippleTransformOrigin: function setLineRippleTransformOrigin(normalizedX) { if (_this.lineRipple_) { _this.lineRipple_.setRippleCenter(normalizedX); } } }; }; MDCTextField.prototype.getOutlineAdapterMethods_ = function () { var _this = this; return { closeOutline: function closeOutline() { return _this.outline_ && _this.outline_.closeNotch(); }, hasOutline: function hasOutline() { return Boolean(_this.outline_); }, notchOutline: function notchOutline(labelWidth) { return _this.outline_ && _this.outline_.notch(labelWidth); } }; }; /** * @return A map of all subcomponents to subfoundations. */ MDCTextField.prototype.getFoundationMap_ = function () { return { characterCounter: this.characterCounter_ ? this.characterCounter_.foundation : undefined, helperText: this.helperText_ ? this.helperText_.foundation : undefined, leadingIcon: this.leadingIcon_ ? this.leadingIcon_.foundation : undefined, trailingIcon: this.trailingIcon_ ? this.trailingIcon_.foundation : undefined }; }; MDCTextField.prototype.createRipple_ = function (rippleFactory) { var _this = this; var isTextArea = this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_11__constants__["c" /* cssClasses */].TEXTAREA); var isOutlined = this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_11__constants__["c" /* cssClasses */].OUTLINED); if (isTextArea || isOutlined) { return null; } // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. var adapter = __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, __WEBPACK_IMPORTED_MODULE_7__material_ripple_component__["a" /* MDCRipple */].createAdapter(this), { isSurfaceActive: function isSurfaceActive() { return __WEBPACK_IMPORTED_MODULE_3__material_dom_ponyfill__["b" /* matches */](_this.input_, ':active'); }, registerInteractionHandler: function registerInteractionHandler(evtType, handler) { return _this.input_.addEventListener(evtType, handler, Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_events__["a" /* applyPassive */])()); }, deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) { return _this.input_.removeEventListener(evtType, handler, Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_events__["a" /* applyPassive */])()); } }); // tslint:enable:object-literal-sort-keys return rippleFactory(this.root_, new __WEBPACK_IMPORTED_MODULE_8__material_ripple_foundation__["a" /* MDCRippleFoundation */](adapter)); }; return MDCTextField; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 183 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; }); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var cssClasses = { LABEL_FLOAT_ABOVE: 'mdc-floating-label--float-above', LABEL_SHAKE: 'mdc-floating-label--shake', ROOT: 'mdc-floating-label' }; //# sourceMappingURL=constants.js.map /***/ }), /* 184 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCLineRippleFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(185); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCLineRippleFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCLineRippleFoundation, _super); function MDCLineRippleFoundation(adapter) { var _this = _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCLineRippleFoundation.defaultAdapter, adapter)) || this; _this.transitionEndHandler_ = function (evt) { return _this.handleTransitionEnd(evt); }; return _this; } Object.defineProperty(MDCLineRippleFoundation, "cssClasses", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCLineRippleFoundation, "defaultAdapter", { /** * See {@link MDCLineRippleAdapter} for typing information on parameters and return types. */ get: function get() { // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { addClass: function addClass() { return undefined; }, removeClass: function removeClass() { return undefined; }, hasClass: function hasClass() { return false; }, setStyle: function setStyle() { return undefined; }, registerEventHandler: function registerEventHandler() { return undefined; }, deregisterEventHandler: function deregisterEventHandler() { return undefined; } }; // tslint:enable:object-literal-sort-keys }, enumerable: true, configurable: true }); MDCLineRippleFoundation.prototype.init = function () { this.adapter_.registerEventHandler('transitionend', this.transitionEndHandler_); }; MDCLineRippleFoundation.prototype.destroy = function () { this.adapter_.deregisterEventHandler('transitionend', this.transitionEndHandler_); }; MDCLineRippleFoundation.prototype.activate = function () { this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_DEACTIVATING); this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_ACTIVE); }; MDCLineRippleFoundation.prototype.setRippleCenter = function (xCoordinate) { this.adapter_.setStyle('transform-origin', xCoordinate + "px center"); }; MDCLineRippleFoundation.prototype.deactivate = function () { this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_DEACTIVATING); }; MDCLineRippleFoundation.prototype.handleTransitionEnd = function (evt) { // Wait for the line ripple to be either transparent or opaque // before emitting the animation end event var isDeactivating = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_DEACTIVATING); if (evt.propertyName === 'opacity') { if (isDeactivating) { this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_ACTIVE); this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_DEACTIVATING); } } }; return MDCLineRippleFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCLineRippleFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 185 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; }); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var cssClasses = { LINE_RIPPLE_ACTIVE: 'mdc-line-ripple--active', LINE_RIPPLE_DEACTIVATING: 'mdc-line-ripple--deactivating' }; //# sourceMappingURL=constants.js.map /***/ }), /* 186 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__component__ = __webpack_require__(92); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(41); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(93); /* unused harmony reexport characterCountCssClasses */ /* unused harmony reexport characterCountStrings */ /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ //# sourceMappingURL=index.js.map /***/ }), /* 187 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__component__ = __webpack_require__(95); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(43); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(96); /* unused harmony reexport helperTextCssClasses */ /* unused harmony reexport helperTextStrings */ /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ //# sourceMappingURL=index.js.map /***/ }), /* 188 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__component__ = __webpack_require__(97); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(98); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(99); /* unused harmony reexport iconCssClasses */ /* unused harmony reexport iconStrings */ /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ //# sourceMappingURL=index.js.map /***/ }), /* 189 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var PATH_SEPARATOR = '.'; /** * Retreive the nested value at `path`. * @param {Object} object The object to search * @param {string} path The period-delimited path to traverse * @return {Object} An object of the structure { ok: boolean, value: any } */ function dig(object, path) { var ret = { ok: false, value: undefined }; var keys = path.split(PATH_SEPARATOR); var k = void 0; var value = object; /* eslint-disable no-cond-assign */ while (k = keys.shift()) { value = value[k]; if (typeof value === 'undefined') { return ret; } } ret.ok = true; ret.value = value; return ret; } var VConfig = function () { function VConfig() { var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; _classCallCheck(this, VConfig); this.config = config; } /** * Retrieve the entire configuration object. * @return {Object} */ _createClass(VConfig, [{ key: 'all', value: function all() { return this.config; } /** * Determine whether `key` is present. * @param {string} key [description] * @return {Boolean} [description] */ }, { key: 'has', value: function has(key) { return dig(this.config, key).ok; } /** * Retrieve the nested value at `key`. If any keys during traversal do * not exist, `fallback` is returned. * @param {string} key The period-delimited path to traverse * @param {*} fallback * @return {*} */ }, { key: 'get', value: function get(key, fallback) { if (!this.has(key)) { return fallback; } var keys = key.split(PATH_SEPARATOR); var last = keys.pop(); var obj = dig(this.config, keys.join(PATH_SEPARATOR)).value; return obj[last]; } }]); return VConfig; }(); /* harmony default export */ __webpack_exports__["a"] = (VConfig); /***/ }), /* 190 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VLoads; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__action_parameter__ = __webpack_require__(24); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__base__ = __webpack_require__(12); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var VLoads = function (_VBase) { _inherits(VLoads, _VBase); function VLoads(options, url, params, event, root) { _classCallCheck(this, VLoads); var _this = _possibleConstructorReturn(this, (VLoads.__proto__ || Object.getPrototypeOf(VLoads)).call(this)); _this.root = root; _this.options = options; _this.params = params; _this.url = url; _this.event = event; return _this; } _createClass(VLoads, [{ key: 'waitForDownload', value: function waitForDownload(downloadID, f) { // Now, we need to start watching the local Cookies to // see when the download ID has been updated by the // response headers. var cookieTimer = setInterval(function () { // The local cookie cache is defined in the browser // as one large string; we need to search for the // name-value pattern with the above ID. var cookiePattern = new RegExp('downloadID=' + downloadID, 'i'); if (!downloadID) { clearInterval(cookieTimer); return f(); } // I check the local cookies for an update. // If the local cookies have been updated, clear // the timer and call the promise! else if (document.cookie.search(cookiePattern) >= 0) { clearInterval(cookieTimer); return f(); } console.debug('File still downloading (Make sure you set the downloadID in your cookie?)...', new Date().getTime()); }, downloadID ? 500 : 0); } }, { key: 'call', value: function call(results) { var _this2 = this; var expandedParams = Object(__WEBPACK_IMPORTED_MODULE_0__action_parameter__["b" /* expandParams */])(results, this.params); return new Promise(function (resolve) { var downloadID = null; if (_this2.options['wait_for_download']) { downloadID = new Date().getTime(); } var url = _this2.buildURL(_this2.url, expandedParams, _this2.inputValues(), downloadID ? { download_id: downloadID } : null); _this2.waitForDownload(downloadID, function () { results.push({ action: 'loads', statusCode: 200 }); resolve(results); }); _this2.options['target'] === '_blank' ? document.defaultView.open(url) : document.defaultView.location = url; }); } }]); return VLoads; }(__WEBPACK_IMPORTED_MODULE_1__base__["a" /* VBase */]); /***/ }), /* 191 */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(192); /***/ }), /* 192 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(193); __webpack_require__(194); var entryUnbind = __webpack_require__(83); module.exports = entryUnbind('Array', 'flatMap'); /***/ }), /* 193 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(62); var flattenIntoArray = __webpack_require__(75); var toObject = __webpack_require__(79); var toLength = __webpack_require__(23); var aFunction = __webpack_require__(78); var arraySpeciesCreate = __webpack_require__(80); // `Array.prototype.flatMap` method // https://github.com/tc39/proposal-flatMap $({ target: 'Array', proto: true }, { flatMap: function flatMap(callbackfn /* , thisArg */) { var O = toObject(this); var sourceLen = toLength(O.length); var A; aFunction(callbackfn); A = arraySpeciesCreate(O, 0); A.length = flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : undefined); return A; } }); /***/ }), /* 194 */ /***/ (function(module, exports, __webpack_require__) { // this method was added to unscopables after implementation // in popular engines, so it's moved to a separate module var addToUnscopables = __webpack_require__(82); addToUnscopables('flatMap'); /***/ }), /* 195 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VUrls; }); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var VUrls = function () { function VUrls() { _classCallCheck(this, VUrls); } _createClass(VUrls, [{ key: 'paramsArrayToHash', value: function paramsArrayToHash(params) { var results = {}; // Map params to object/hash var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = params[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var param = _step.value; results[param[0]] = param[1]; } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } return results; } }, { key: 'buildURL', value: function buildURL(baseUrl) { var url = baseUrl; for (var i = 1; i < arguments.length; i++) { var args = arguments[i]; if (Array.isArray(args)) { var _iteratorNormalCompletion2 = true; var _didIteratorError2 = false; var _iteratorError2 = undefined; try { for (var _iterator2 = args[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { var arg = _step2.value; url += this.seperator(url) + this.encodeQueryParam(arg[0], arg[1]); } } catch (err) { _didIteratorError2 = true; _iteratorError2 = err; } finally { try { if (!_iteratorNormalCompletion2 && _iterator2.return) { _iterator2.return(); } } finally { if (_didIteratorError2) { throw _iteratorError2; } } } } else if ((typeof args === 'undefined' ? 'undefined' : _typeof(args)) === 'object') { var q = this.serialize(arguments[i]); if (q && q.length > 0) { url += this.seperator(url) + q; } } else if (args && args.length > 0) { url += this.seperator(url) + args; } } return url; } }, { key: 'seperator', value: function seperator(url) { if (url.endsWith('?')) { return ''; } return url.includes("?") ? '&' : '?'; } }, { key: 'serialize', value: function serialize(obj, prefix) { var str = [], p; for (p in obj) { if (obj.hasOwnProperty(p)) { var k = prefix ? prefix + "[" + p + "]" : p, v = obj[p]; str.push(v !== null && (typeof v === 'undefined' ? 'undefined' : _typeof(v)) === "object" ? this.serialize(v, k) : this.encodeQueryParam(k, v)); } } return str.join("&"); } }, { key: 'encodeQueryParam', value: function encodeQueryParam(k, v) { return encodeURIComponent(k) + "=" + encodeURIComponent(v); } }]); return VUrls; }(); /***/ }), /* 196 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VPosts; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__base__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config__ = __webpack_require__(101); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__action_parameter__ = __webpack_require__(24); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__encode__ = __webpack_require__(197); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__get_event_target__ = __webpack_require__(102); var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Replaces a given element with the contents of the call to the url. // parameters are appended. var VPosts = function (_VBase) { _inherits(VPosts, _VBase); function VPosts(options, url, params, method, event, root) { _classCallCheck(this, VPosts); var _this = _possibleConstructorReturn(this, (VPosts.__proto__ || Object.getPrototypeOf(VPosts)).call(this, options, root)); _this.url = url; _this.params = params; _this.method = method; _this.event = event; _this.headers = options.headers; return _this; } _createClass(VPosts, [{ key: 'call', value: function call(results, eventParams) { var _this2 = this; this.clearErrors(); var method = this.method; var ev = new CustomEvent('V:postStarted', { bubbles: true, cancelable: false, detail: this, composed: true }); this.dispatchLifecycleEvent(this.event, ev); // Manually build the FormData. // Passing in a <form> element (if available) would skip over // unchecked toggle elements, which would be unexpected if the user // has specified a value for the toggle's `off_value` attribute. var formData = new FormData(); // NB: `inputValues` will appropriately handle `input_tag`. var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = this.inputValues()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var _ref = _step.value; var _ref2 = _slicedToArray(_ref, 2); var name = _ref2[0]; var value = _ref2[1]; formData.append(name, value); } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } if (eventParams) { var _iteratorNormalCompletion2 = true; var _didIteratorError2 = false; var _iteratorError2 = undefined; try { for (var _iterator2 = Object.entries(eventParams)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { var _ref3 = _step2.value; var _ref4 = _slicedToArray(_ref3, 2); var _name = _ref4[0]; var _value = _ref4[1]; formData.append(_name, _value); } } catch (err) { _didIteratorError2 = true; _iteratorError2 = err; } finally { try { if (!_iteratorNormalCompletion2 && _iterator2.return) { _iterator2.return(); } } finally { if (_didIteratorError2) { throw _iteratorError2; } } } } // Add CSRF authenticity token if present var csrf_meta_token = document.querySelector('meta[name=csrf-token]'); var csrf_meta_param = document.querySelector('meta[name=csrf-param]'); if (csrf_meta_token && csrf_meta_param) { formData.append(csrf_meta_param.content, csrf_meta_token.content); } // Add params from presenter: var expandedParams = Object(__WEBPACK_IMPORTED_MODULE_2__action_parameter__["b" /* expandParams */])(results, this.params); var _iteratorNormalCompletion3 = true; var _didIteratorError3 = false; var _iteratorError3 = undefined; try { for (var _iterator3 = Object.entries(expandedParams)[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { var _ref5 = _step3.value; var _ref6 = _slicedToArray(_ref5, 2); var _name2 = _ref6[0]; var _value2 = _ref6[1]; formData.append(_name2, Object(__WEBPACK_IMPORTED_MODULE_3__encode__["a" /* encode */])(_value2)); } } catch (err) { _didIteratorError3 = true; _iteratorError3 = err; } finally { try { if (!_iteratorNormalCompletion3 && _iterator3.return) { _iterator3.return(); } } finally { if (_didIteratorError3) { throw _iteratorError3; } } } var paramCount = Array.from(formData).length; if (paramCount < 1) { console.warn('Creating request with no data!' + ' Are you sure you\'ve hooked everything up correctly?'); } var errors = this.validate(formData); console.log('Validation errors'); console.dir(errors); if (errors.length > 0) { return new Promise(function (_, reject) { results.push({ action: 'posts', method: method, statusCode: 400, contentType: 'v/errors', content: errors }); reject(results); }); } var httpRequest = new XMLHttpRequest(); var url = this.url; var callHeaders = this.headers; var root = this.root; var vEvent = this; if (!httpRequest) { throw new Error('Cannot talk to server! Please upgrade your browser to one that supports XMLHttpRequest.'); } if (formData.has('rich_text_payload')) { callHeaders['X-Rich-Text-Payload'] = true; } var snackbarCallback = function snackbarCallback(contentType, response) { var element = root.querySelector('.mdc-snackbar'); if (!(element && element.vComponent)) { return; } var snackbar = element.vComponent; if (contentType && contentType.includes('application/json')) { var messages = JSON.parse(response).message; if (messages && messages.snackbar) { var message = messages.snackbar.join('<br/>'); if (message !== '') { snackbar.display(message); } } } }; return new Promise(function (resolve, reject) { httpRequest.onreadystatechange = function (event) { if (httpRequest.readyState === XMLHttpRequest.DONE) { var contentType = httpRequest.getResponseHeader('content-type'); console.debug(httpRequest.status + ':' + contentType); var result = { action: 'posts', method: httpRequest.method, statusCode: httpRequest.status, contentType: contentType, content: httpRequest.responseText, responseURL: httpRequest.responseURL }; var postFailed = httpRequest.status >= 400; var _ev = new CustomEvent(postFailed ? 'V:postFailed' : 'V:postSucceeded', { bubbles: true, cancelable: false, detail: { event: vEvent, result: result }, composed: true }); _this2.dispatchLifecycleEvent(_this2.event, _ev); if (httpRequest.status >= 200 && httpRequest.status < 300) { results.push(result); snackbarCallback(contentType, httpRequest.responseText); resolve(results); } // Response is an html error page else if (contentType && contentType.indexOf('text/html') !== -1) { root.open(contentType); root.write(httpRequest.responseText); root.close(); results.push(result); resolve(results); } else { results.push(result); reject(results); } var evFinished = new CustomEvent('V:postFinished', { bubbles: true, cancelable: false, detail: { event: vEvent, result: result }, composed: true }); _this2.dispatchLifecycleEvent(_this2.event, evFinished); } }; // Set up our request httpRequest.open(method, url); var configHeaders = __WEBPACK_IMPORTED_MODULE_1__config__["a" /* default */].get('request.headers.POST', {}); var _iteratorNormalCompletion4 = true; var _didIteratorError4 = false; var _iteratorError4 = undefined; try { for (var _iterator4 = Object.entries(configHeaders)[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { var _ref7 = _step4.value; var _ref8 = _slicedToArray(_ref7, 2); var key = _ref8[0]; var _value3 = _ref8[1]; httpRequest.setRequestHeader(key, _value3); } } catch (err) { _didIteratorError4 = true; _iteratorError4 = err; } finally { try { if (!_iteratorNormalCompletion4 && _iterator4.return) { _iterator4.return(); } } finally { if (_didIteratorError4) { throw _iteratorError4; } } } if (callHeaders) { var _iteratorNormalCompletion5 = true; var _didIteratorError5 = false; var _iteratorError5 = undefined; try { for (var _iterator5 = Object.entries(callHeaders)[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { var _ref9 = _step5.value; var _ref10 = _slicedToArray(_ref9, 2); var _key = _ref10[0]; var _value4 = _ref10[1]; httpRequest.setRequestHeader(_key, _value4); } } catch (err) { _didIteratorError5 = true; _iteratorError5 = err; } finally { try { if (!_iteratorNormalCompletion5 && _iterator5.return) { _iterator5.return(); } } finally { if (_didIteratorError5) { throw _iteratorError5; } } } } // Send our FormData object; HTTP headers are set automatically httpRequest.send(formData); }); } }, { key: 'isForm', value: function isForm() { var parentElement = this.parentElement(); return parentElement && parentElement.elements; } }, { key: 'form', value: function form() { if (this.isForm()) { return this.parentElement(); } return null; } }, { key: 'dispatchLifecycleEvent', value: function dispatchLifecycleEvent(domEvent, lifecycleEvent) { var target = Object(__WEBPACK_IMPORTED_MODULE_4__get_event_target__["a" /* getEventTarget */])(domEvent); if (!target || !target.isConnected) { // If an action has hidden `target` or its parent (via e.g. // `hides :some_element`), it will no longer be connected to the DOM // and its dispatched lifecycle events won't make it up to the root. // Instead, dispatch straight from the root instead of bubbling up // from the DOM event's target. target = this.root; } return target.dispatchEvent(lifecycleEvent); } }]); return VPosts; }(__WEBPACK_IMPORTED_MODULE_0__base__["a" /* VBase */]); /***/ }), /* 197 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = encode; function encode(value) { if (value === Object(value)) { return JSON.stringify(value); } else { return value; } } /***/ }), /* 198 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VReplaces; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__action_parameter__ = __webpack_require__(24); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__base__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__initialize__ = __webpack_require__(59); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__uninitialize__ = __webpack_require__(199); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var MOUSE_DELAY_AMOUNT = 0; // ms var KEYBOARD_DELAY_AMOUNT = 500; // ms // Create a NodeList from raw HTML. // Whitespace is trimmed to avoid creating superfluous text nodes. function htmlToNodes(html) { var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document; var template = document.createElement('template'); template.innerHTML = html.trim(); return template.content.children; } function assertXHRSupport() { if (typeof window.XMLHttpRequest !== 'function') { throw new Error('Support for XMLHttpRequest is required'); } } function delayAmount(event) { if (typeof window['InputEvent'] === 'function') { return event instanceof InputEvent ? KEYBOARD_DELAY_AMOUNT : MOUSE_DELAY_AMOUNT; } return event instanceof MouseEvent ? MOUSE_DELAY_AMOUNT : KEYBOARD_DELAY_AMOUNT; } // Replaces a given element with the contents of the call to the url. // parameters are appended. var VReplaces = function (_VBase) { _inherits(VReplaces, _VBase); function VReplaces(options, url, params, event, root) { _classCallCheck(this, VReplaces); var _this = _possibleConstructorReturn(this, (VReplaces.__proto__ || Object.getPrototypeOf(VReplaces)).call(this, options, root)); assertXHRSupport(); _this.element_id = options.target; _this.url = url; _this.params = params; _this.event = event; return _this; } _createClass(VReplaces, [{ key: 'call', value: function call(results) { var _this2 = this; var eventParams = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; this.clearErrors(); var httpRequest = new XMLHttpRequest(); var root = this.root; var elementId = this.element_id; var nodeToReplace = root.getElementById(elementId); var expandedParams = Object(__WEBPACK_IMPORTED_MODULE_0__action_parameter__["b" /* expandParams */])(results, this.params); var inputVals = this.inputValues().filter(function (vals) { return _this2.options.ignore_input_values.indexOf(vals[0]) == -1; }); var paramsCollection = [expandedParams, eventParams, inputVals, [['grid_nesting', this.options.grid_nesting]]]; var url = this.buildURL.apply(this, [this.url].concat(paramsCollection)); var delayAmt = delayAmount(this.event); return new Promise(function (resolve, reject) { if (!nodeToReplace) { var msg = 'Unable to located node: \'' + elementId + '\'' + ' This usually the result of issuing a replaces action ' + 'and specifying a element id that does not currently ' + 'exist on the page.'; console.error(msg); results.push({ action: 'replaces', statusCode: 500, contentType: 'v/errors', content: { exception: msg } }); reject(results); } else { clearTimeout(nodeToReplace.vTimeout); nodeToReplace.vTimeout = setTimeout(function () { httpRequest.onreadystatechange = function () { if (httpRequest.readyState === XMLHttpRequest.DONE) { console.debug(httpRequest.status + ':' + this.getResponseHeader('content-type')); if (httpRequest.status === 200) { // NodeList.childNodes is "live", meaning DOM // changes to its entries will mutate the list // itself. // (see: https://developer.mozilla.org/en-US/docs/Web/API/NodeList) // Array.from clones the entries, creating a // "dead" list. var newNodes = Array.from(htmlToNodes(httpRequest.responseText, root)); Object(__WEBPACK_IMPORTED_MODULE_3__uninitialize__["a" /* uninitialize */])(nodeToReplace); nodeToReplace.replaceWith.apply(nodeToReplace, _toConsumableArray(newNodes)); var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = newNodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var node = _step.value; Object(__WEBPACK_IMPORTED_MODULE_2__initialize__["a" /* initialize */])(node); } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } results.push({ action: 'replaces', statusCode: httpRequest.status, contentType: this.getResponseHeader('content-type'), content: httpRequest.responseText }); resolve(results); } else { results.push({ action: 'replaces', statusCode: httpRequest.status, contentType: this.getResponseHeader('content-type'), content: httpRequest.responseText }); reject(results); } } }; console.debug('GET:' + url); httpRequest.open('GET', url, true); httpRequest.setRequestHeader('X-NO-LAYOUT', true); httpRequest.send(); }, delayAmt); } }); } }]); return VReplaces; }(__WEBPACK_IMPORTED_MODULE_1__base__["a" /* VBase */]); /***/ }), /* 199 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = uninitialize; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__menus__ = __webpack_require__(103); function uninitialize(root) { console.debug('Uninitializing components'); Object(__WEBPACK_IMPORTED_MODULE_0__menus__["b" /* uninitMenus */])(root); } /***/ }), /* 200 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_menu_surface_constants__ = __webpack_require__(25); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__material_menu_surface_constants__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__component__ = __webpack_require__(104); /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_1__component__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(26); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation__ = __webpack_require__(106); /* unused harmony namespace reexport */ /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ // for backward compatibility //# sourceMappingURL=index.js.map /***/ }), /* 201 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCMenuSurface; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation__ = __webpack_require__(48); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util__ = __webpack_require__(202); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCMenuSurface = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCMenuSurface, _super); function MDCMenuSurface() { return _super !== null && _super.apply(this, arguments) || this; } MDCMenuSurface.attachTo = function (root) { return new MDCMenuSurface(root); }; MDCMenuSurface.prototype.initialSyncWithDOM = function () { var _this = this; var parentEl = this.root_.parentElement; this.anchorElement = parentEl && parentEl.classList.contains(__WEBPACK_IMPORTED_MODULE_2__constants__["c" /* cssClasses */].ANCHOR) ? parentEl : null; if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_2__constants__["c" /* cssClasses */].FIXED)) { this.setFixedPosition(true); } this.handleKeydown_ = function (evt) { return _this.foundation_.handleKeydown(evt); }; this.handleBodyClick_ = function (evt) { return _this.foundation_.handleBodyClick(evt); }; this.registerBodyClickListener_ = function () { return document.body.addEventListener('click', _this.handleBodyClick_); }; this.deregisterBodyClickListener_ = function () { return document.body.removeEventListener('click', _this.handleBodyClick_); }; this.listen('keydown', this.handleKeydown_); this.listen(__WEBPACK_IMPORTED_MODULE_2__constants__["e" /* strings */].OPENED_EVENT, this.registerBodyClickListener_); this.listen(__WEBPACK_IMPORTED_MODULE_2__constants__["e" /* strings */].CLOSED_EVENT, this.deregisterBodyClickListener_); }; MDCMenuSurface.prototype.destroy = function () { this.unlisten('keydown', this.handleKeydown_); this.unlisten(__WEBPACK_IMPORTED_MODULE_2__constants__["e" /* strings */].OPENED_EVENT, this.registerBodyClickListener_); this.unlisten(__WEBPACK_IMPORTED_MODULE_2__constants__["e" /* strings */].CLOSED_EVENT, this.deregisterBodyClickListener_); _super.prototype.destroy.call(this); }; MDCMenuSurface.prototype.isOpen = function () { return this.foundation_.isOpen(); }; MDCMenuSurface.prototype.open = function () { this.foundation_.open(); }; MDCMenuSurface.prototype.close = function (skipRestoreFocus) { if (skipRestoreFocus === void 0) { skipRestoreFocus = false; } this.foundation_.close(skipRestoreFocus); }; Object.defineProperty(MDCMenuSurface.prototype, "quickOpen", { set: function set(quickOpen) { this.foundation_.setQuickOpen(quickOpen); }, enumerable: true, configurable: true }); /** * Removes the menu-surface from it's current location and appends it to the * body to overcome any overflow:hidden issues. */ MDCMenuSurface.prototype.hoistMenuToBody = function () { document.body.appendChild(this.root_); this.setIsHoisted(true); }; /** Sets the foundation to use page offsets for an positioning when the menu is hoisted to the body. */ MDCMenuSurface.prototype.setIsHoisted = function (isHoisted) { this.foundation_.setIsHoisted(isHoisted); }; /** Sets the element that the menu-surface is anchored to. */ MDCMenuSurface.prototype.setMenuSurfaceAnchorElement = function (element) { this.anchorElement = element; }; /** Sets the menu-surface to position: fixed. */ MDCMenuSurface.prototype.setFixedPosition = function (isFixed) { if (isFixed) { this.root_.classList.add(__WEBPACK_IMPORTED_MODULE_2__constants__["c" /* cssClasses */].FIXED); } else { this.root_.classList.remove(__WEBPACK_IMPORTED_MODULE_2__constants__["c" /* cssClasses */].FIXED); } this.foundation_.setFixedPosition(isFixed); }; /** Sets the absolute x/y position to position based on. Requires the menu to be hoisted. */ MDCMenuSurface.prototype.setAbsolutePosition = function (x, y) { this.foundation_.setAbsolutePosition(x, y); this.setIsHoisted(true); }; /** * @param corner Default anchor corner alignment of top-left surface corner. */ MDCMenuSurface.prototype.setAnchorCorner = function (corner) { this.foundation_.setAnchorCorner(corner); }; MDCMenuSurface.prototype.setAnchorMargin = function (margin) { this.foundation_.setAnchorMargin(margin); }; MDCMenuSurface.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. var adapter = { addClass: function addClass(className) { return _this.root_.classList.add(className); }, removeClass: function removeClass(className) { return _this.root_.classList.remove(className); }, hasClass: function hasClass(className) { return _this.root_.classList.contains(className); }, hasAnchor: function hasAnchor() { return !!_this.anchorElement; }, notifyClose: function notifyClose() { return _this.emit(__WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* MDCMenuSurfaceFoundation */].strings.CLOSED_EVENT, {}); }, notifyOpen: function notifyOpen() { return _this.emit(__WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* MDCMenuSurfaceFoundation */].strings.OPENED_EVENT, {}); }, isElementInContainer: function isElementInContainer(el) { return _this.root_.contains(el); }, isRtl: function isRtl() { return getComputedStyle(_this.root_).getPropertyValue('direction') === 'rtl'; }, setTransformOrigin: function setTransformOrigin(origin) { var propertyName = __WEBPACK_IMPORTED_MODULE_4__util__["a" /* getTransformPropertyName */](window) + "-origin"; _this.root_.style.setProperty(propertyName, origin); }, isFocused: function isFocused() { return document.activeElement === _this.root_; }, saveFocus: function saveFocus() { _this.previousFocus_ = document.activeElement; }, restoreFocus: function restoreFocus() { if (_this.root_.contains(document.activeElement)) { if (_this.previousFocus_ && _this.previousFocus_.focus) { _this.previousFocus_.focus(); } } }, getInnerDimensions: function getInnerDimensions() { return { width: _this.root_.offsetWidth, height: _this.root_.offsetHeight }; }, getAnchorDimensions: function getAnchorDimensions() { return _this.anchorElement ? _this.anchorElement.getBoundingClientRect() : null; }, getWindowDimensions: function getWindowDimensions() { return { width: window.innerWidth, height: window.innerHeight }; }, getBodyDimensions: function getBodyDimensions() { return { width: document.body.clientWidth, height: document.body.clientHeight }; }, getWindowScroll: function getWindowScroll() { return { x: window.pageXOffset, y: window.pageYOffset }; }, setPosition: function setPosition(position) { _this.root_.style.left = 'left' in position ? position.left + "px" : ''; _this.root_.style.right = 'right' in position ? position.right + "px" : ''; _this.root_.style.top = 'top' in position ? position.top + "px" : ''; _this.root_.style.bottom = 'bottom' in position ? position.bottom + "px" : ''; }, setMaxHeight: function setMaxHeight(height) { _this.root_.style.maxHeight = height; } }; // tslint:enable:object-literal-sort-keys return new __WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* MDCMenuSurfaceFoundation */](adapter); }; return MDCMenuSurface; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 202 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getTransformPropertyName; }); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var cachedCssTransformPropertyName_; /** * Returns the name of the correct transform property to use on the current browser. */ function getTransformPropertyName(globalObj, forceRefresh) { if (forceRefresh === void 0) { forceRefresh = false; } if (cachedCssTransformPropertyName_ === undefined || forceRefresh) { var el = globalObj.document.createElement('div'); cachedCssTransformPropertyName_ = 'transform' in el.style ? 'transform' : 'webkitTransform'; } return cachedCssTransformPropertyName_; } //# sourceMappingURL=util.js.map /***/ }), /* 203 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VToggleVisibility; }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var VToggleVisibility = function () { function VToggleVisibility(options, params, event, root) { _classCallCheck(this, VToggleVisibility); this.targetId = options.target; this.params = params; this.event = event; this.root = root; } _createClass(VToggleVisibility, [{ key: 'call', value: function call(results) { var targetId = this.targetId; var action = this.params.action; var delayAmt = this.event instanceof FocusEvent ? 500 : 0; var elem = this.root.getElementById(targetId); if (!elem) { var err = new Error('Unable to locate node ' + targetId + '!' + ' Did you forget to attach it?'); results.push({ action: 'toggle_visibility', contentType: 'v/errors', content: { exception: err.message } }); return new Promise(function (_, reject) { return reject(results); }); } var promiseObj = new Promise(function (resolve) { clearTimeout(elem.vTimeout); elem.vTimeout = setTimeout(function () { console.debug('Toggling visibility on: ' + targetId); if (action === 'show') { if (elem.vComponent && elem.vComponent.show) { elem.vComponent.show(); } else { elem.classList.remove('v-hidden'); } } else if (action === 'hide') { if (elem.vComponent && elem.vComponent.hide) { elem.vComponent.hide(); } else { elem.classList.add('v-hidden'); } } else { if (elem.vComponent && elem.vComponent.toggleVisibility) { elem.vComponent.toggleVisibility(); } else { elem.classList.toggle('v-hidden'); } } if (elem.classList.contains('v-hidden') && elem.vComponent && elem.vComponent.onHide) { elem.vComponent.onHide(); } else if (elem.vComponent && elem.vComponent.onShow) { elem.vComponent.onShow(); } results.push({ action: 'toggle_visibility', statusCode: 200 }); resolve(results); }, delayAmt); }); return promiseObj; } }]); return VToggleVisibility; }(); /***/ }), /* 204 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VToggleDisabled; }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var VToggleDisabled = function () { function VToggleDisabled(options, params, event, root) { _classCallCheck(this, VToggleDisabled); this.targetId = options.target; this.params = params; this.event = event; this.root = root; } _createClass(VToggleDisabled, [{ key: 'call', value: function call(results) { var targetId = this.targetId; var action = this.params.action; var delayAmt = this.event instanceof FocusEvent ? 500 : 0; var elem = this.root.getElementById(targetId); if (!elem) { var err = new Error('Unable to locate node ' + targetId + '!' + ' Did you forget to attach it?'); results.push({ action: 'toggle_disabled', contentType: 'v/errors', content: { exception: err.message } }); return new Promise(function (_, reject) { return reject(results); }); } var promiseObj = new Promise(function (resolve) { clearTimeout(elem.vTimeout); elem.vTimeout = setTimeout(function () { console.debug('Toggling disabled on: ' + targetId); elem.disabled = action === 'disable'; results.push({ action: 'toggle_disabled', statusCode: 200 }); resolve(results); }, delayAmt); }); return promiseObj; } }]); return VToggleDisabled; }(); /***/ }), /* 205 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VAutoComplete; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__base__ = __webpack_require__(12); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Auto complete a datalist // The elementId is a datalist // The url is called as a GET expecting json back var VAutoComplete = function (_VBase) { _inherits(VAutoComplete, _VBase); function VAutoComplete(options, url, params, event, root) { _classCallCheck(this, VAutoComplete); var _this = _possibleConstructorReturn(this, (VAutoComplete.__proto__ || Object.getPrototypeOf(VAutoComplete)).call(this, options, root)); _this.element_id = options.target; _this.url = url; _this.params = params; _this.event = event; return _this; } _createClass(VAutoComplete, [{ key: 'call', value: function call(results) { // Clear the timeout if it has already been set. // This will prevent the previous task from executing // if it has been less than <MILLISECONDS> var parentElement = this.parentElement(); var updateElement = this.createUpdateElementHandler(this); var promiseObj = new Promise(function (resolve) { clearTimeout(parentElement.vTimeout); // Make a new timeout parentElement.vTimeout = setTimeout(updateElement, 500); results.push({ action: 'autocomplete', statusCode: 200 }); resolve(results); }); return promiseObj; } // This is used to get a proper binding of the object // https://stackoverflow.com/questions/750486/javascript-closure-inside-loops-simple-practical-example }, { key: 'createUpdateElementHandler', value: function createUpdateElementHandler(_this_) { return function () { _this_.updateElement(); }; } }, { key: 'updateElement', value: function updateElement() { this.clearErrors(); this.getData(this.populateOptions); } }, { key: 'dataList', value: function dataList() { return this.root.getElementById(this.element_id); } }, { key: 'getData', value: function getData(funcProcessData) { var comp = this.component(); console.log(comp); if (comp.value().length < 2) { return; } var httpRequest = new XMLHttpRequest(); if (!httpRequest) { throw new Error('Cannot talk to server! Please upgrade your browser to one that supports XMLHttpRequest.'); } var dataList = this.dataList(); var url = this.buildURL(this.url, this.params, this.inputValues()); httpRequest.onreadystatechange = function () { if (httpRequest.readyState === XMLHttpRequest.DONE) { console.log(httpRequest.status + ':' + this.getResponseHeader('content-type')); if (httpRequest.status === 200) { var response = JSON.parse(httpRequest.responseText); funcProcessData(response, dataList); } else { console.error("Unable to autocomplete! ElementId: " + this.element_id); } } }; console.log('GET:' + url); httpRequest.open('GET', url, true); httpRequest.send(); } }, { key: 'populateOptions', value: function populateOptions(response, dataList) { dataList.innerHTML = ""; response.forEach(function (item) { var value = item; var key = null; if (Array.isArray(item)) { value = item[0]; key = item[1]; } // Create a new <option> element. var option = document.createElement('option'); option.value = value; option.dataset.key = key; dataList.appendChild(option); }); } }]); return VAutoComplete; }(__WEBPACK_IMPORTED_MODULE_0__base__["a" /* VBase */]); /***/ }), /* 206 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VPromptIfDirty; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__base__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__dialog__ = __webpack_require__(107); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var HALT_PATTERNS = [/close/i, /halt/i, /stay/i, /stop/i, /cancel/i]; /** * shouldHalt determines whether the specified action should halt execution * of further actions. * @param {string} action * @return {bool} */ function shouldHalt(action) { var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = HALT_PATTERNS[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var pattern = _step.value; if (pattern.test(action)) { return true; } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } return false; } var VPromptIfDirty = function (_VBase) { _inherits(VPromptIfDirty, _VBase); function VPromptIfDirty(options, params, event, root) { _classCallCheck(this, VPromptIfDirty); var _this = _possibleConstructorReturn(this, (VPromptIfDirty.__proto__ || Object.getPrototypeOf(VPromptIfDirty)).call(this, options, root)); _this.targetId = options.target; _this.params = params; _this.event = event; _this.dialog = new __WEBPACK_IMPORTED_MODULE_1__dialog__["a" /* VDialog */](_this.options, _this.params, _this.event, root); return _this; } _createClass(VPromptIfDirty, [{ key: 'call', value: function call(results) { var _this2 = this; // We're in a dirty state if any dirtyable inputs are dirty: var dirty = this.inputComponents().filter(function (comp) { return comp.isDirty; }).map(function (comp) { return comp.isDirty(); }).some(Boolean); results.push({ action: 'prompt_if_dirty', statusCode: 412, squelch: true, dirty: dirty }); // If everything's clean, skip the dialog entirely and proceed: if (!dirty) { return new Promise(function (resolve, _) { return resolve(results); }); } // Otherwise, invoke the specified dialog and capture its result: return new Promise(function (resolve, reject) { return _this2.dialog.call(results).then(function (results) { var result = results.pop(); var action = result.dialogAction; // If the dialog's result indicates halting, bail out: if (shouldHalt(action)) { return reject(results); } // Otherwise, proceed with the next action: return resolve(results); }); }); } }]); return VPromptIfDirty; }(__WEBPACK_IMPORTED_MODULE_0__base__["a" /* VBase */]); /***/ }), /* 207 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VSnackbarEvent; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__action_parameter__ = __webpack_require__(24); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var VSnackbarEvent = function () { function VSnackbarEvent(options, params, event) { var root = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : document; _classCallCheck(this, VSnackbarEvent); this.options = options; this.text = params.text; this.event = event; this.root = root; var snackbarElem = this.root.querySelector('.mdc-snackbar'); this.snackbar = snackbarElem.vComponent; } _createClass(VSnackbarEvent, [{ key: 'call', value: function call(results) { var snackbar = this.snackbar; var message = Object(__WEBPACK_IMPORTED_MODULE_0__action_parameter__["a" /* expandParam */])(results, this.text); return new Promise(function (resolve) { console.debug('Showing snackbar'); snackbar.display(message); results.push({ action: 'snackbar', statusCode: 200 }); resolve(results); }); } }]); return VSnackbarEvent; }(); /***/ }), /* 208 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VClears; }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var VClears = function () { function VClears(options, params, event, root) { _classCallCheck(this, VClears); this.target = options.target; this.ids = params.ids; this.event = event; this.root = root; } _createClass(VClears, [{ key: 'call', value: function call(results) { var ids = this.ids; var root = this.root; return new Promise(function (resolve) { console.debug('Clearing'); results.push({ action: 'clears', statusCode: 200 }); var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = ids[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var id = _step.value; var elem = root.getElementById(id); if (elem && elem.vComponent && elem.vComponent.clear) { elem.vComponent.clear(); } else { console.warn('Unable to clear element with id: ' + id + '! Check to make sure you passed the correct id, and ' + 'that the control/input can be cleared.'); } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } resolve(results); }); } }]); return VClears; }(); /***/ }), /* 209 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VCloseDialog; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__base__ = __webpack_require__(12); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var VCloseDialog = function (_VBase) { _inherits(VCloseDialog, _VBase); function VCloseDialog(options, params, event, root) { _classCallCheck(this, VCloseDialog); var _this = _possibleConstructorReturn(this, (VCloseDialog.__proto__ || Object.getPrototypeOf(VCloseDialog)).call(this, options, root)); _this.elementId = options.target; return _this; } _createClass(VCloseDialog, [{ key: 'call', value: function call(results) { var _this2 = this; return new Promise(function (resolve) { var elem = _this2.root.getElementById(_this2.elementId); if (!elem) { var err = new Error('Unable to locate node ' + _this2.elementId + '!' + ' Did you forget to attach it?'); results.push({ action: 'close', contentType: 'v/errors', content: { exception: err.message } }); return new Promise(function (_, reject) { return reject(results); }); } if (!elem.vComponent || !elem.vComponent.respondTo('closeDialog')) { var _err = new Error('Element at node ' + _this2.elementId + ' does not contain a component that reponds to ' + 'the closeDialog() method. Are you targeting the correct element.'); results.push({ action: 'close_dialog', contentType: 'v/errors', content: { exception: _err.message } }); return new Promise(function (_, reject) { return reject(results); }); } elem.vComponent.closeDialog(); results.push({ action: 'close_dialog', statusCode: 200 }); // Otherwise, proceed with the next action: return resolve(results); }); } }]); return VCloseDialog; }(__WEBPACK_IMPORTED_MODULE_0__base__["a" /* VBase */]); /***/ }), /* 210 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VPostMessage; }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var VPostMessage = function () { function VPostMessage(options, params, event, root) { _classCallCheck(this, VPostMessage); this.params = params; this.event = event; this.root = root; } _createClass(VPostMessage, [{ key: 'call', value: function call(results) { var _this = this; return new Promise(function (resolve) { console.log('Post Message: ' + _this.params.message); window.parent.postMessage(_this.params.message, '*'); results.push({ action: 'close_frame', statusCode: 200 }); // Otherwise, proceed with the next action: return resolve(results); }); } }]); return VPostMessage; }(); /***/ }), /* 211 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VRemoves; }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var VRemoves = function () { function VRemoves(options, params, event, root) { _classCallCheck(this, VRemoves); this.target = options.target; this.ids = params.ids; this.event = event; this.root = root; } _createClass(VRemoves, [{ key: 'call', value: function call(results) { var ids = this.ids; var root = this.root; return new Promise(function (resolve) { results.push({ action: 'removes', statusCode: 200 }); var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = ids[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var id = _step.value; var elem = root.getElementById(id); elem.parentNode.removeChild(elem); } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } resolve(results); }); } }]); return VRemoves; }(); /***/ }), /* 212 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VStepperEvent; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__base__ = __webpack_require__(12); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var VStepperEvent = function (_VBase) { _inherits(VStepperEvent, _VBase); function VStepperEvent(options, params, event, root) { _classCallCheck(this, VStepperEvent); var _this = _possibleConstructorReturn(this, (VStepperEvent.__proto__ || Object.getPrototypeOf(VStepperEvent)).call(this, options, root)); _this.params = params; _this.event = event; return _this; } _createClass(VStepperEvent, [{ key: 'call', value: function call(results) { var parentElem = this.root.getElementById(this.params.stepper_id); var component = parentElem.vComponent; var navAction = this.params.navigate; return new Promise(function (resolve) { component.navigate(navAction); results.push({ action: 'stepper', statusCode: 200 }); resolve(results); }); } }]); return VStepperEvent; }(__WEBPACK_IMPORTED_MODULE_0__base__["a" /* VBase */]); /***/ }), /* 213 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VNavigates; }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var VNavigates = function () { function VNavigates(options, params, event, root) { _classCallCheck(this, VNavigates); this.direction = params.direction; } _createClass(VNavigates, [{ key: 'call', value: function call(results) { var direction = this.direction; return new Promise(function (resolve) { results.push({ action: 'navigates', statusCode: 200 }); resolve(results); switch (direction) { case 'back': window.history.back(); case 'forward': window.history.forward(); } }); } }]); return VNavigates; }(); /***/ }), /* 214 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VPluginEventAction; }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var VPluginEventAction = function () { function VPluginEventAction(actionType, options, params, event, root) { _classCallCheck(this, VPluginEventAction); this.actionType = actionType; this.options = options; this.params = params; this.event = event; this.root = root; } _createClass(VPluginEventAction, [{ key: "call", value: function call(results) { var actionType = this.actionType; var options = this.options; var params = this.params; var event = this.event; return document.defaultView[actionType](options, params, event, results); } }]); return VPluginEventAction; }(); /***/ }), /* 215 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = getRoot; function getRoot(element) { if (element.parentNode === null) return element; return getRoot(element.parentNode); } /***/ }), /* 216 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initLists; function createSelectAllHandler(component, target, listElements) { return function () { var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = listElements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var element = _step.value; element.checked = target.checked; } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } if (component.dataset.totalLines > listElements.length) { toggleSelectTotalHeader(component, listElements.length, target.checked); } }; } function createSelectTotalSetHandler(component) { return function (event) { event.preventDefault(); if (component.dataset.totalLines > 0) { toggleSelectTotalInput(component, !component.querySelector('#select-total').checked); } }; } function createListItemSelectHandler(component, listElements, selectAll) { return function () { var checked = 0; var unchecked = 0; toggleSelectTotalInput(component, false); // Clear select total results whenever a list item selection is modified var _iteratorNormalCompletion2 = true; var _didIteratorError2 = false; var _iteratorError2 = undefined; try { for (var _iterator2 = listElements[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { var element = _step2.value; element.checked ? checked++ : unchecked++; } } catch (err) { _didIteratorError2 = true; _iteratorError2 = err; } finally { try { if (!_iteratorNormalCompletion2 && _iterator2.return) { _iterator2.return(); } } finally { if (_didIteratorError2) { throw _iteratorError2; } } } selectAll.indeterminate = checked && unchecked; selectAll.checked = checked && !unchecked; toggleSelectTotalHeader(component, listElements.length, Boolean(checked) && !Boolean(unchecked)); }; } function toggleSelectTotalHeader(component, count) { var show = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; if (component.dataset.totalLines > 0) { updateSelectionCount(component, count); if (show === false) { component.querySelector('#list-item-select-all-header').classList.add('hidden'); } else { component.querySelector('#list-item-select-all-header').classList.remove('hidden'); } } } function toggleSelectTotalInput(component) { var selectTotal = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (component.dataset.totalLines > 0) { component.querySelector('#select-total').checked = selectTotal; component.querySelector('#list-item-select-all-toggle-on').classList.add('hidden'); component.querySelector('#list-item-select-all-toggle-off').classList.add('hidden'); component.querySelector('#list-item-select-all-toggle-' + (selectTotal ? 'on' : 'off')).classList.remove('hidden'); } } function updateSelectionCount(component, count) { if (component.dataset.totalLines > 0) { component.querySelector('#page-selection-count').innerHTML = count; } } function initLists(e) { console.debug('\tLists'); var components = e.querySelectorAll('.mdc-list'); if (components.length === 0 && e.offsetParent && e.offsetParent.vComponent !== undefined) { components = document.querySelectorAll('.mdc-list'); } if (components) { var _iteratorNormalCompletion3 = true; var _didIteratorError3 = false; var _iteratorError3 = undefined; try { for (var _iterator3 = components[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { var component = _step3.value; var selectAllLineItem = component.querySelector('.v-checkbox--select-control'); var selectableLineItems = component.querySelectorAll('.v-list-item--selectable-checkbox'); if (selectAllLineItem && selectableLineItems) { var _iteratorNormalCompletion4 = true; var _didIteratorError4 = false; var _iteratorError4 = undefined; try { for (var _iterator4 = component.querySelectorAll('.toggle-total-set')[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { var element = _step4.value; // Clone and replace element to prevent duplicate event handlers when additional records are loaded/paged var new_element = element.cloneNode(true); element.parentNode.replaceChild(new_element, element); new_element.addEventListener('click', createSelectTotalSetHandler(component)); } } catch (err) { _didIteratorError4 = true; _iteratorError4 = err; } finally { try { if (!_iteratorNormalCompletion4 && _iterator4.return) { _iterator4.return(); } } finally { if (_didIteratorError4) { throw _iteratorError4; } } } selectAllLineItem.addEventListener('change', createSelectAllHandler(component, selectAllLineItem, selectableLineItems)); var _iteratorNormalCompletion5 = true; var _didIteratorError5 = false; var _iteratorError5 = undefined; try { for (var _iterator5 = selectableLineItems[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { var _element = _step5.value; _element.addEventListener('change', createListItemSelectHandler(component, selectableLineItems, selectAllLineItem)); } } catch (err) { _didIteratorError5 = true; _iteratorError5 = err; } finally { try { if (!_iteratorNormalCompletion5 && _iterator5.return) { _iterator5.return(); } } finally { if (_didIteratorError5) { throw _iteratorError5; } } } updateSelectionCount(component, selectableLineItems.length); toggleSelectTotalInput(component); } } } catch (err) { _didIteratorError3 = true; _iteratorError3 = err; } finally { try { if (!_iteratorNormalCompletion3 && _iterator3.return) { _iterator3.return(); } } finally { if (_didIteratorError3) { throw _iteratorError3; } } } } } /***/ }), /* 217 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initDrawer; /* unused harmony export VModalDrawer */ /* unused harmony export VDismissibleDrawer */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_drawer__ = __webpack_require__(218); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__base_component__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__mixins_event_handler__ = __webpack_require__(4); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function initDrawer(e) { console.debug('\tDrawer'); Object(__WEBPACK_IMPORTED_MODULE_1__base_component__["c" /* hookupComponents */])(e, '.v-drawer__modal', VModalDrawer, __WEBPACK_IMPORTED_MODULE_0__material_drawer__["a" /* MDCDrawer */]); Object(__WEBPACK_IMPORTED_MODULE_1__base_component__["c" /* hookupComponents */])(e, '.v-drawer__dismissible', VDismissibleDrawer, __WEBPACK_IMPORTED_MODULE_0__material_drawer__["a" /* MDCDrawer */]); } var VDrawer = function (_eventHandlerMixin) { _inherits(VDrawer, _eventHandlerMixin); function VDrawer(element, mdcComponent) { _classCallCheck(this, VDrawer); var _this = _possibleConstructorReturn(this, (VDrawer.__proto__ || Object.getPrototypeOf(VDrawer)).call(this, element, mdcComponent)); var header = _this.root.querySelector('.v-header'); if (header) { header.addEventListener('MDCTopAppBar:nav', function () { if (_this.isActive()) { _this.mdcComponent.open = !_this.mdcComponent.open; } }); } return _this; } _createClass(VDrawer, [{ key: 'isActive', value: function isActive() { return getComputedStyle(this.element).getPropertyValue('--v-drawer-active') !== 'no'; } }]); return VDrawer; }(Object(__WEBPACK_IMPORTED_MODULE_2__mixins_event_handler__["a" /* eventHandlerMixin */])(__WEBPACK_IMPORTED_MODULE_1__base_component__["a" /* VBaseComponent */])); var VModalDrawer = function (_VDrawer) { _inherits(VModalDrawer, _VDrawer); function VModalDrawer(element, mdcComponent) { _classCallCheck(this, VModalDrawer); var _this2 = _possibleConstructorReturn(this, (VModalDrawer.__proto__ || Object.getPrototypeOf(VModalDrawer)).call(this, element, mdcComponent)); _this2.mdcComponent.open = false; return _this2; } return VModalDrawer; }(VDrawer); var VDismissibleDrawer = function (_VDrawer2) { _inherits(VDismissibleDrawer, _VDrawer2); function VDismissibleDrawer(element, mdcComponent) { _classCallCheck(this, VDismissibleDrawer); return _possibleConstructorReturn(this, (VDismissibleDrawer.__proto__ || Object.getPrototypeOf(VDismissibleDrawer)).call(this, element, mdcComponent)); } return VDismissibleDrawer; }(VDrawer); /***/ }), /* 218 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util__ = __webpack_require__(109); /* unused harmony reexport util */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__component__ = __webpack_require__(219); /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_1__component__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(110); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__dismissible_foundation__ = __webpack_require__(49); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__modal_foundation__ = __webpack_require__(111); /* unused harmony namespace reexport */ /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ //# sourceMappingURL=index.js.map /***/ }), /* 219 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCDrawer; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_list_component__ = __webpack_require__(105); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_list_foundation__ = __webpack_require__(47); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_focus_trap__ = __webpack_require__(38); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_focus_trap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_focus_trap__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__dismissible_foundation__ = __webpack_require__(49); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__modal_foundation__ = __webpack_require__(111); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__util__ = __webpack_require__(109); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var cssClasses = __WEBPACK_IMPORTED_MODULE_5__dismissible_foundation__["a" /* MDCDismissibleDrawerFoundation */].cssClasses, strings = __WEBPACK_IMPORTED_MODULE_5__dismissible_foundation__["a" /* MDCDismissibleDrawerFoundation */].strings; /** * @events `MDCDrawer:closed {}` Emits when the navigation drawer has closed. * @events `MDCDrawer:opened {}` Emits when the navigation drawer has opened. */ var MDCDrawer = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCDrawer, _super); function MDCDrawer() { return _super !== null && _super.apply(this, arguments) || this; } MDCDrawer.attachTo = function (root) { return new MDCDrawer(root); }; Object.defineProperty(MDCDrawer.prototype, "open", { /** * @return boolean Proxies to the foundation's `open`/`close` methods. * Also returns true if drawer is in the open position. */ get: function get() { return this.foundation_.isOpen(); }, /** * Toggles the drawer open and closed. */ set: function set(isOpen) { if (isOpen) { this.foundation_.open(); } else { this.foundation_.close(); } }, enumerable: true, configurable: true }); Object.defineProperty(MDCDrawer.prototype, "list", { get: function get() { return this.list_; }, enumerable: true, configurable: true }); MDCDrawer.prototype.initialize = function (focusTrapFactory, listFactory) { if (focusTrapFactory === void 0) { focusTrapFactory = __WEBPACK_IMPORTED_MODULE_4_focus_trap___default.a; } if (listFactory === void 0) { listFactory = function listFactory(el) { return new __WEBPACK_IMPORTED_MODULE_2__material_list_component__["a" /* MDCList */](el); }; } var listEl = this.root_.querySelector("." + __WEBPACK_IMPORTED_MODULE_3__material_list_foundation__["a" /* MDCListFoundation */].cssClasses.ROOT); if (listEl) { this.list_ = listFactory(listEl); this.list_.wrapFocus = true; } this.focusTrapFactory_ = focusTrapFactory; }; MDCDrawer.prototype.initialSyncWithDOM = function () { var _this = this; var MODAL = cssClasses.MODAL; var SCRIM_SELECTOR = strings.SCRIM_SELECTOR; this.scrim_ = this.root_.parentNode.querySelector(SCRIM_SELECTOR); if (this.scrim_ && this.root_.classList.contains(MODAL)) { this.handleScrimClick_ = function () { return _this.foundation_.handleScrimClick(); }; this.scrim_.addEventListener('click', this.handleScrimClick_); this.focusTrap_ = __WEBPACK_IMPORTED_MODULE_7__util__["a" /* createFocusTrapInstance */](this.root_, this.focusTrapFactory_); } this.handleKeydown_ = function (evt) { return _this.foundation_.handleKeydown(evt); }; this.handleTransitionEnd_ = function (evt) { return _this.foundation_.handleTransitionEnd(evt); }; this.listen('keydown', this.handleKeydown_); this.listen('transitionend', this.handleTransitionEnd_); }; MDCDrawer.prototype.destroy = function () { this.unlisten('keydown', this.handleKeydown_); this.unlisten('transitionend', this.handleTransitionEnd_); if (this.list_) { this.list_.destroy(); } var MODAL = cssClasses.MODAL; if (this.scrim_ && this.handleScrimClick_ && this.root_.classList.contains(MODAL)) { this.scrim_.removeEventListener('click', this.handleScrimClick_); // Ensure drawer is closed to hide scrim and release focus this.open = false; } }; MDCDrawer.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. var adapter = { addClass: function addClass(className) { return _this.root_.classList.add(className); }, removeClass: function removeClass(className) { return _this.root_.classList.remove(className); }, hasClass: function hasClass(className) { return _this.root_.classList.contains(className); }, elementHasClass: function elementHasClass(element, className) { return element.classList.contains(className); }, saveFocus: function saveFocus() { return _this.previousFocus_ = document.activeElement; }, restoreFocus: function restoreFocus() { var previousFocus = _this.previousFocus_; if (previousFocus && previousFocus.focus && _this.root_.contains(document.activeElement)) { previousFocus.focus(); } }, focusActiveNavigationItem: function focusActiveNavigationItem() { var activeNavItemEl = _this.root_.querySelector("." + __WEBPACK_IMPORTED_MODULE_3__material_list_foundation__["a" /* MDCListFoundation */].cssClasses.LIST_ITEM_ACTIVATED_CLASS); if (activeNavItemEl) { activeNavItemEl.focus(); } }, notifyClose: function notifyClose() { return _this.emit(strings.CLOSE_EVENT, {}, true /* shouldBubble */); }, notifyOpen: function notifyOpen() { return _this.emit(strings.OPEN_EVENT, {}, true /* shouldBubble */); }, trapFocus: function trapFocus() { return _this.focusTrap_.activate(); }, releaseFocus: function releaseFocus() { return _this.focusTrap_.deactivate(); } }; // tslint:enable:object-literal-sort-keys var DISMISSIBLE = cssClasses.DISMISSIBLE, MODAL = cssClasses.MODAL; if (this.root_.classList.contains(DISMISSIBLE)) { return new __WEBPACK_IMPORTED_MODULE_5__dismissible_foundation__["a" /* MDCDismissibleDrawerFoundation */](adapter); } else if (this.root_.classList.contains(MODAL)) { return new __WEBPACK_IMPORTED_MODULE_6__modal_foundation__["a" /* MDCModalDrawerFoundation */](adapter); } else { throw new Error("MDCDrawer: Failed to instantiate component. Supported variants are " + DISMISSIBLE + " and " + MODAL + "."); } }; return MDCDrawer; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 220 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initHeader; /* unused harmony export VHeader */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_top_app_bar_index__ = __webpack_require__(221); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__base_component__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__mixins_event_handler__ = __webpack_require__(4); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function initHeader(e) { console.debug('\tHeader'); Object(__WEBPACK_IMPORTED_MODULE_1__base_component__["c" /* hookupComponents */])(e, '.v-header', VHeader, __WEBPACK_IMPORTED_MODULE_0__material_top_app_bar_index__["a" /* MDCTopAppBar */]); } var VHeader = function (_eventHandlerMixin) { _inherits(VHeader, _eventHandlerMixin); function VHeader(element, mdcComponent, root) { _classCallCheck(this, VHeader); var _this = _possibleConstructorReturn(this, (VHeader.__proto__ || Object.getPrototypeOf(VHeader)).call(this, element, mdcComponent)); element.addEventListener('MDCTopAppBar:nav', function () { var event = new Event('v:header:item-click', { bubbles: true, composed: true }); // Dispatch the event. element.dispatchEvent(event); }); return _this; } return VHeader; }(Object(__WEBPACK_IMPORTED_MODULE_2__mixins_event_handler__["a" /* eventHandlerMixin */])(__WEBPACK_IMPORTED_MODULE_1__base_component__["a" /* VBaseComponent */])); /***/ }), /* 221 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__component__ = __webpack_require__(222); /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__component__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(13); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(51); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__fixed_foundation__ = __webpack_require__(112); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__short_foundation__ = __webpack_require__(113); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__standard_foundation__ = __webpack_require__(50); /* unused harmony namespace reexport */ /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ //# sourceMappingURL=index.js.map /***/ }), /* 222 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTopAppBar; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_ripple_component__ = __webpack_require__(6); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(13); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__fixed_foundation__ = __webpack_require__(112); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__short_foundation__ = __webpack_require__(113); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__standard_foundation__ = __webpack_require__(50); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCTopAppBar = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCTopAppBar, _super); function MDCTopAppBar() { return _super !== null && _super.apply(this, arguments) || this; } MDCTopAppBar.attachTo = function (root) { return new MDCTopAppBar(root); }; MDCTopAppBar.prototype.initialize = function (rippleFactory) { if (rippleFactory === void 0) { rippleFactory = function rippleFactory(el) { return __WEBPACK_IMPORTED_MODULE_2__material_ripple_component__["a" /* MDCRipple */].attachTo(el); }; } this.navIcon_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].NAVIGATION_ICON_SELECTOR); // Get all icons in the toolbar and instantiate the ripples var icons = [].slice.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ACTION_ITEM_SELECTOR)); if (this.navIcon_) { icons.push(this.navIcon_); } this.iconRipples_ = icons.map(function (icon) { var ripple = rippleFactory(icon); ripple.unbounded = true; return ripple; }); this.scrollTarget_ = window; }; MDCTopAppBar.prototype.initialSyncWithDOM = function () { this.handleNavigationClick_ = this.foundation_.handleNavigationClick.bind(this.foundation_); this.handleWindowResize_ = this.foundation_.handleWindowResize.bind(this.foundation_); this.handleTargetScroll_ = this.foundation_.handleTargetScroll.bind(this.foundation_); this.scrollTarget_.addEventListener('scroll', this.handleTargetScroll_); if (this.navIcon_) { this.navIcon_.addEventListener('click', this.handleNavigationClick_); } var isFixed = this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].FIXED_CLASS); var isShort = this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].SHORT_CLASS); if (!isShort && !isFixed) { window.addEventListener('resize', this.handleWindowResize_); } }; MDCTopAppBar.prototype.destroy = function () { this.iconRipples_.forEach(function (iconRipple) { return iconRipple.destroy(); }); this.scrollTarget_.removeEventListener('scroll', this.handleTargetScroll_); if (this.navIcon_) { this.navIcon_.removeEventListener('click', this.handleNavigationClick_); } var isFixed = this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].FIXED_CLASS); var isShort = this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].SHORT_CLASS); if (!isShort && !isFixed) { window.removeEventListener('resize', this.handleWindowResize_); } _super.prototype.destroy.call(this); }; MDCTopAppBar.prototype.setScrollTarget = function (target) { // Remove scroll handler from the previous scroll target this.scrollTarget_.removeEventListener('scroll', this.handleTargetScroll_); this.scrollTarget_ = target; // Initialize scroll handler on the new scroll target this.handleTargetScroll_ = this.foundation_.handleTargetScroll.bind(this.foundation_); this.scrollTarget_.addEventListener('scroll', this.handleTargetScroll_); }; MDCTopAppBar.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. var adapter = { hasClass: function hasClass(className) { return _this.root_.classList.contains(className); }, addClass: function addClass(className) { return _this.root_.classList.add(className); }, removeClass: function removeClass(className) { return _this.root_.classList.remove(className); }, setStyle: function setStyle(property, value) { return _this.root_.style.setProperty(property, value); }, getTopAppBarHeight: function getTopAppBarHeight() { return _this.root_.clientHeight; }, notifyNavigationIconClicked: function notifyNavigationIconClicked() { return _this.emit(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].NAVIGATION_EVENT, {}); }, getViewportScrollY: function getViewportScrollY() { var win = _this.scrollTarget_; var el = _this.scrollTarget_; return win.pageYOffset !== undefined ? win.pageYOffset : el.scrollTop; }, getTotalActionItems: function getTotalActionItems() { return _this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ACTION_ITEM_SELECTOR).length; } }; // tslint:enable:object-literal-sort-keys var foundation; if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].SHORT_CLASS)) { foundation = new __WEBPACK_IMPORTED_MODULE_5__short_foundation__["a" /* MDCShortTopAppBarFoundation */](adapter); } else if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].FIXED_CLASS)) { foundation = new __WEBPACK_IMPORTED_MODULE_4__fixed_foundation__["a" /* MDCFixedTopAppBarFoundation */](adapter); } else { foundation = new __WEBPACK_IMPORTED_MODULE_6__standard_foundation__["a" /* MDCTopAppBarFoundation */](adapter); } return foundation; }; return MDCTopAppBar; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 223 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initIconToggles; /* unused harmony export VIconToggle */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__base_component__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__base_toggle__ = __webpack_require__(27); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_icon_button__ = __webpack_require__(224); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function initIconToggles(e) { console.debug('\tIcon Buttons'); Object(__WEBPACK_IMPORTED_MODULE_0__base_component__["c" /* hookupComponents */])(e, '.v-icon-toggle', VIconToggle, __WEBPACK_IMPORTED_MODULE_2__material_icon_button__["a" /* MDCIconButtonToggle */]); } var VIconToggle = function (_VBaseToggle) { _inherits(VIconToggle, _VBaseToggle); function VIconToggle(element, mdcComponent) { _classCallCheck(this, VIconToggle); return _possibleConstructorReturn(this, (VIconToggle.__proto__ || Object.getPrototypeOf(VIconToggle)).call(this, element, mdcComponent)); } return VIconToggle; }(__WEBPACK_IMPORTED_MODULE_1__base_toggle__["a" /* VBaseToggle */]); /***/ }), /* 224 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__component__ = __webpack_require__(225); /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__component__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(115); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(114); /* unused harmony namespace reexport */ /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ //# sourceMappingURL=index.js.map /***/ }), /* 225 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCIconButtonToggle; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_ripple_component__ = __webpack_require__(6); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation__ = __webpack_require__(114); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var strings = __WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* MDCIconButtonToggleFoundation */].strings; var MDCIconButtonToggle = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCIconButtonToggle, _super); function MDCIconButtonToggle() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.ripple_ = _this.createRipple_(); return _this; } MDCIconButtonToggle.attachTo = function (root) { return new MDCIconButtonToggle(root); }; MDCIconButtonToggle.prototype.initialSyncWithDOM = function () { var _this = this; this.handleClick_ = function () { return _this.foundation_.handleClick(); }; this.listen('click', this.handleClick_); }; MDCIconButtonToggle.prototype.destroy = function () { this.unlisten('click', this.handleClick_); this.ripple_.destroy(); _super.prototype.destroy.call(this); }; MDCIconButtonToggle.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. var adapter = { addClass: function addClass(className) { return _this.root_.classList.add(className); }, hasClass: function hasClass(className) { return _this.root_.classList.contains(className); }, notifyChange: function notifyChange(evtData) { return _this.emit(strings.CHANGE_EVENT, evtData); }, removeClass: function removeClass(className) { return _this.root_.classList.remove(className); }, setAttr: function setAttr(attrName, attrValue) { return _this.root_.setAttribute(attrName, attrValue); } }; return new __WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* MDCIconButtonToggleFoundation */](adapter); }; Object.defineProperty(MDCIconButtonToggle.prototype, "ripple", { get: function get() { return this.ripple_; }, enumerable: true, configurable: true }); Object.defineProperty(MDCIconButtonToggle.prototype, "on", { get: function get() { return this.foundation_.isOn(); }, set: function set(isOn) { this.foundation_.toggle(isOn); }, enumerable: true, configurable: true }); MDCIconButtonToggle.prototype.createRipple_ = function () { var ripple = new __WEBPACK_IMPORTED_MODULE_2__material_ripple_component__["a" /* MDCRipple */](this.root_); ripple.unbounded = true; return ripple; }; return MDCIconButtonToggle; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 226 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initSelects; /* unused harmony export VSelect */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_select__ = __webpack_require__(227); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__base_component__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__mixins_visibility_observer__ = __webpack_require__(44); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__mixins_dirtyable__ = __webpack_require__(11); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function initSelects(e) { console.debug('\tSelects'); Object(__WEBPACK_IMPORTED_MODULE_1__base_component__["c" /* hookupComponents */])(e, '.v-select', VSelect, __WEBPACK_IMPORTED_MODULE_0__material_select__["a" /* MDCSelect */]); } var VSelect = function (_dirtyableMixin) { _inherits(VSelect, _dirtyableMixin); function VSelect(element, mdcComponent) { _classCallCheck(this, VSelect); var _this = _possibleConstructorReturn(this, (VSelect.__proto__ || Object.getPrototypeOf(VSelect)).call(this, element, mdcComponent)); _this.select = element.querySelector('select'); _this.select.vComponent = _this; _this.recalcWhenVisible(_this); _this.originalValue = _this.value(); return _this; } _createClass(VSelect, [{ key: 'prepareSubmit', value: function prepareSubmit(params) { params.push([this.name(), this.value()]); } }, { key: 'name', value: function name() { return this.select.name; } }, { key: 'value', value: function value() { return this.select.options.length === 0 || this.select.selectedIndex === -1 ? null : this.select.options[this.select.selectedIndex].value; } }, { key: 'clear', value: function clear() { var before = this.select.selectedIndex; this.select.selectedIndex = 0; if (before !== 0) { var event = new InputEvent('input', { view: window, bubbles: true, cancelable: true }); this.select.dispatchEvent(event); } } }, { key: 'reset', value: function reset() { this.select.value = this.originalValue; } }, { key: 'setValue', value: function setValue(value) { this.select.value = value; } }, { key: 'isDirty', value: function isDirty() { return this.dirtyable && this.value() !== this.originalValue; } }]); return VSelect; }(Object(__WEBPACK_IMPORTED_MODULE_3__mixins_dirtyable__["a" /* dirtyableMixin */])(Object(__WEBPACK_IMPORTED_MODULE_2__mixins_visibility_observer__["a" /* visibilityObserverMixin */])(__WEBPACK_IMPORTED_MODULE_1__base_component__["a" /* VBaseComponent */]))); /***/ }), /* 227 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__component__ = __webpack_require__(228); /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__component__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(52); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(116); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__helper_text_index__ = __webpack_require__(229); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__icon_index__ = __webpack_require__(230); /* unused harmony namespace reexport */ /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ //# sourceMappingURL=index.js.map /***/ }), /* 228 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCSelect; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_floating_label_component__ = __webpack_require__(88); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_line_ripple_component__ = __webpack_require__(90); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_menu_surface_constants__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__material_menu_component__ = __webpack_require__(104); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__material_menu_constants__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__material_notched_outline_component__ = __webpack_require__(39); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__material_ripple_component__ = __webpack_require__(6); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__material_ripple_foundation__ = __webpack_require__(9); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__constants__ = __webpack_require__(52); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__foundation__ = __webpack_require__(116); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__helper_text_component__ = __webpack_require__(117); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__icon_component__ = __webpack_require__(120); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var VALIDATION_ATTR_WHITELIST = ['required', 'aria-required']; var MDCSelect = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCSelect, _super); function MDCSelect() { return _super !== null && _super.apply(this, arguments) || this; } MDCSelect.attachTo = function (root) { return new MDCSelect(root); }; MDCSelect.prototype.initialize = function (labelFactory, lineRippleFactory, outlineFactory, menuFactory, iconFactory, helperTextFactory) { if (labelFactory === void 0) { labelFactory = function labelFactory(el) { return new __WEBPACK_IMPORTED_MODULE_2__material_floating_label_component__["a" /* MDCFloatingLabel */](el); }; } if (lineRippleFactory === void 0) { lineRippleFactory = function lineRippleFactory(el) { return new __WEBPACK_IMPORTED_MODULE_3__material_line_ripple_component__["a" /* MDCLineRipple */](el); }; } if (outlineFactory === void 0) { outlineFactory = function outlineFactory(el) { return new __WEBPACK_IMPORTED_MODULE_7__material_notched_outline_component__["a" /* MDCNotchedOutline */](el); }; } if (menuFactory === void 0) { menuFactory = function menuFactory(el) { return new __WEBPACK_IMPORTED_MODULE_5__material_menu_component__["a" /* MDCMenu */](el); }; } if (iconFactory === void 0) { iconFactory = function iconFactory(el) { return new __WEBPACK_IMPORTED_MODULE_13__icon_component__["a" /* MDCSelectIcon */](el); }; } if (helperTextFactory === void 0) { helperTextFactory = function helperTextFactory(el) { return new __WEBPACK_IMPORTED_MODULE_12__helper_text_component__["a" /* MDCSelectHelperText */](el); }; } this.isMenuOpen_ = false; this.nativeControl_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_10__constants__["c" /* strings */].NATIVE_CONTROL_SELECTOR); this.selectedText_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_10__constants__["c" /* strings */].SELECTED_TEXT_SELECTOR); var targetElement = this.nativeControl_ || this.selectedText_; if (!targetElement) { throw new Error('MDCSelect: Missing required element: Exactly one of the following selectors must be present: ' + ("'" + __WEBPACK_IMPORTED_MODULE_10__constants__["c" /* strings */].NATIVE_CONTROL_SELECTOR + "' or '" + __WEBPACK_IMPORTED_MODULE_10__constants__["c" /* strings */].SELECTED_TEXT_SELECTOR + "'")); } this.targetElement_ = targetElement; if (this.targetElement_.hasAttribute(__WEBPACK_IMPORTED_MODULE_10__constants__["c" /* strings */].ARIA_CONTROLS)) { var helperTextElement = document.getElementById(this.targetElement_.getAttribute(__WEBPACK_IMPORTED_MODULE_10__constants__["c" /* strings */].ARIA_CONTROLS)); if (helperTextElement) { this.helperText_ = helperTextFactory(helperTextElement); } } if (this.selectedText_) { this.enhancedSelectSetup_(menuFactory); } var labelElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_10__constants__["c" /* strings */].LABEL_SELECTOR); this.label_ = labelElement ? labelFactory(labelElement) : null; var lineRippleElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_10__constants__["c" /* strings */].LINE_RIPPLE_SELECTOR); this.lineRipple_ = lineRippleElement ? lineRippleFactory(lineRippleElement) : null; var outlineElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_10__constants__["c" /* strings */].OUTLINE_SELECTOR); this.outline_ = outlineElement ? outlineFactory(outlineElement) : null; var leadingIcon = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_10__constants__["c" /* strings */].LEADING_ICON_SELECTOR); if (leadingIcon) { this.root_.classList.add(__WEBPACK_IMPORTED_MODULE_10__constants__["a" /* cssClasses */].WITH_LEADING_ICON); this.leadingIcon_ = iconFactory(leadingIcon); if (this.menuElement_) { this.menuElement_.classList.add(__WEBPACK_IMPORTED_MODULE_10__constants__["a" /* cssClasses */].WITH_LEADING_ICON); } } if (!this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_10__constants__["a" /* cssClasses */].OUTLINED)) { this.ripple = this.createRipple_(); } // The required state needs to be sync'd before the mutation observer is added. this.initialSyncRequiredState_(); this.addMutationObserverForRequired_(); }; /** * Initializes the select's event listeners and internal state based * on the environment's state. */ MDCSelect.prototype.initialSyncWithDOM = function () { var _this = this; this.handleChange_ = function () { return _this.foundation_.handleChange( /* didChange */true); }; this.handleFocus_ = function () { return _this.foundation_.handleFocus(); }; this.handleBlur_ = function () { return _this.foundation_.handleBlur(); }; this.handleClick_ = function (evt) { if (_this.selectedText_) { _this.selectedText_.focus(); } _this.foundation_.handleClick(_this.getNormalizedXCoordinate_(evt)); }; this.handleKeydown_ = function (evt) { return _this.foundation_.handleKeydown(evt); }; this.handleMenuSelected_ = function (evtData) { return _this.selectedIndex = evtData.detail.index; }; this.handleMenuOpened_ = function () { _this.foundation_.handleMenuOpened(); if (_this.menu_.items.length === 0) { return; } // Menu should open to the last selected element, should open to first menu item otherwise. var focusItemIndex = _this.selectedIndex >= 0 ? _this.selectedIndex : 0; var focusItemEl = _this.menu_.items[focusItemIndex]; focusItemEl.focus(); }; this.handleMenuClosed_ = function () { _this.foundation_.handleMenuClosed(); // isMenuOpen_ is used to track the state of the menu opening or closing since the menu.open function // will return false if the menu is still closing and this method listens to the closed event which // occurs after the menu is already closed. _this.isMenuOpen_ = false; _this.selectedText_.removeAttribute('aria-expanded'); if (document.activeElement !== _this.selectedText_) { _this.foundation_.handleBlur(); } }; this.targetElement_.addEventListener('change', this.handleChange_); this.targetElement_.addEventListener('focus', this.handleFocus_); this.targetElement_.addEventListener('blur', this.handleBlur_); this.targetElement_.addEventListener('click', this.handleClick_); if (this.menuElement_) { this.selectedText_.addEventListener('keydown', this.handleKeydown_); this.menu_.listen(__WEBPACK_IMPORTED_MODULE_4__material_menu_surface_constants__["e" /* strings */].CLOSED_EVENT, this.handleMenuClosed_); this.menu_.listen(__WEBPACK_IMPORTED_MODULE_4__material_menu_surface_constants__["e" /* strings */].OPENED_EVENT, this.handleMenuOpened_); this.menu_.listen(__WEBPACK_IMPORTED_MODULE_6__material_menu_constants__["d" /* strings */].SELECTED_EVENT, this.handleMenuSelected_); if (this.hiddenInput_ && this.hiddenInput_.value) { // If the hidden input already has a value, use it to restore the select's value. // This can happen e.g. if the user goes back or (in some browsers) refreshes the page. var enhancedAdapterMethods = this.getEnhancedSelectAdapterMethods_(); enhancedAdapterMethods.setValue(this.hiddenInput_.value); } else if (this.menuElement_.querySelector(__WEBPACK_IMPORTED_MODULE_10__constants__["c" /* strings */].SELECTED_ITEM_SELECTOR)) { // If an element is selected, the select should set the initial selected text. var enhancedAdapterMethods = this.getEnhancedSelectAdapterMethods_(); enhancedAdapterMethods.setValue(enhancedAdapterMethods.getValue()); } } // Initially sync floating label this.foundation_.handleChange( /* didChange */false); if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_10__constants__["a" /* cssClasses */].DISABLED) || this.nativeControl_ && this.nativeControl_.disabled) { this.disabled = true; } }; MDCSelect.prototype.destroy = function () { this.targetElement_.removeEventListener('change', this.handleChange_); this.targetElement_.removeEventListener('focus', this.handleFocus_); this.targetElement_.removeEventListener('blur', this.handleBlur_); this.targetElement_.removeEventListener('keydown', this.handleKeydown_); this.targetElement_.removeEventListener('click', this.handleClick_); if (this.menu_) { this.menu_.unlisten(__WEBPACK_IMPORTED_MODULE_4__material_menu_surface_constants__["e" /* strings */].CLOSED_EVENT, this.handleMenuClosed_); this.menu_.unlisten(__WEBPACK_IMPORTED_MODULE_4__material_menu_surface_constants__["e" /* strings */].OPENED_EVENT, this.handleMenuOpened_); this.menu_.unlisten(__WEBPACK_IMPORTED_MODULE_6__material_menu_constants__["d" /* strings */].SELECTED_EVENT, this.handleMenuSelected_); this.menu_.destroy(); } if (this.ripple) { this.ripple.destroy(); } if (this.outline_) { this.outline_.destroy(); } if (this.leadingIcon_) { this.leadingIcon_.destroy(); } if (this.helperText_) { this.helperText_.destroy(); } if (this.validationObserver_) { this.validationObserver_.disconnect(); } _super.prototype.destroy.call(this); }; Object.defineProperty(MDCSelect.prototype, "value", { get: function get() { return this.foundation_.getValue(); }, set: function set(value) { this.foundation_.setValue(value); }, enumerable: true, configurable: true }); Object.defineProperty(MDCSelect.prototype, "selectedIndex", { get: function get() { var selectedIndex = -1; if (this.menuElement_ && this.menu_) { var selectedEl = this.menuElement_.querySelector(__WEBPACK_IMPORTED_MODULE_10__constants__["c" /* strings */].SELECTED_ITEM_SELECTOR); selectedIndex = this.menu_.items.indexOf(selectedEl); } else if (this.nativeControl_) { selectedIndex = this.nativeControl_.selectedIndex; } return selectedIndex; }, set: function set(selectedIndex) { this.foundation_.setSelectedIndex(selectedIndex); }, enumerable: true, configurable: true }); Object.defineProperty(MDCSelect.prototype, "disabled", { get: function get() { return this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_10__constants__["a" /* cssClasses */].DISABLED) || (this.nativeControl_ ? this.nativeControl_.disabled : false); }, set: function set(disabled) { this.foundation_.setDisabled(disabled); }, enumerable: true, configurable: true }); Object.defineProperty(MDCSelect.prototype, "leadingIconAriaLabel", { set: function set(label) { this.foundation_.setLeadingIconAriaLabel(label); }, enumerable: true, configurable: true }); Object.defineProperty(MDCSelect.prototype, "leadingIconContent", { /** * Sets the text content of the leading icon. */ set: function set(content) { this.foundation_.setLeadingIconContent(content); }, enumerable: true, configurable: true }); Object.defineProperty(MDCSelect.prototype, "helperTextContent", { /** * Sets the text content of the helper text. */ set: function set(content) { this.foundation_.setHelperTextContent(content); }, enumerable: true, configurable: true }); Object.defineProperty(MDCSelect.prototype, "valid", { /** * Checks if the select is in a valid state. */ get: function get() { return this.foundation_.isValid(); }, /** * Sets the current invalid state of the select. */ set: function set(isValid) { this.foundation_.setValid(isValid); }, enumerable: true, configurable: true }); Object.defineProperty(MDCSelect.prototype, "required", { /** * Returns whether the select is required. */ get: function get() { if (this.nativeControl_) { return this.nativeControl_.required; } else { return this.selectedText_.getAttribute('aria-required') === 'true'; } }, /** * Sets the control to the required state. */ set: function set(isRequired) { if (this.nativeControl_) { this.nativeControl_.required = isRequired; } else { if (isRequired) { this.selectedText_.setAttribute('aria-required', isRequired.toString()); } else { this.selectedText_.removeAttribute('aria-required'); } } }, enumerable: true, configurable: true }); /** * Recomputes the outline SVG path for the outline element. */ MDCSelect.prototype.layout = function () { this.foundation_.layout(); }; MDCSelect.prototype.getDefaultFoundation = function () { // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. var adapter = __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, this.nativeControl_ ? this.getNativeSelectAdapterMethods_() : this.getEnhancedSelectAdapterMethods_(), this.getCommonAdapterMethods_(), this.getOutlineAdapterMethods_(), this.getLabelAdapterMethods_()); return new __WEBPACK_IMPORTED_MODULE_11__foundation__["a" /* MDCSelectFoundation */](adapter, this.getFoundationMap_()); }; /** * Handles setup for the enhanced menu. */ MDCSelect.prototype.enhancedSelectSetup_ = function (menuFactory) { var isDisabled = this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_10__constants__["a" /* cssClasses */].DISABLED); this.selectedText_.setAttribute('tabindex', isDisabled ? '-1' : '0'); this.hiddenInput_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_10__constants__["c" /* strings */].HIDDEN_INPUT_SELECTOR); this.menuElement_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_10__constants__["c" /* strings */].MENU_SELECTOR); this.menu_ = menuFactory(this.menuElement_); this.menu_.hoistMenuToBody(); this.menu_.setAnchorElement(this.root_); this.menu_.setAnchorCorner(__WEBPACK_IMPORTED_MODULE_4__material_menu_surface_constants__["a" /* Corner */].BOTTOM_START); this.menu_.wrapFocus = false; }; MDCSelect.prototype.createRipple_ = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. var adapter = __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, __WEBPACK_IMPORTED_MODULE_8__material_ripple_component__["a" /* MDCRipple */].createAdapter(this), { registerInteractionHandler: function registerInteractionHandler(evtType, handler) { return _this.targetElement_.addEventListener(evtType, handler); }, deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) { return _this.targetElement_.removeEventListener(evtType, handler); } }); // tslint:enable:object-literal-sort-keys return new __WEBPACK_IMPORTED_MODULE_8__material_ripple_component__["a" /* MDCRipple */](this.root_, new __WEBPACK_IMPORTED_MODULE_9__material_ripple_foundation__["a" /* MDCRippleFoundation */](adapter)); }; MDCSelect.prototype.getNativeSelectAdapterMethods_ = function () { var _this = this; // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { getValue: function getValue() { return _this.nativeControl_.value; }, setValue: function setValue(value) { _this.nativeControl_.value = value; }, openMenu: function openMenu() { return undefined; }, closeMenu: function closeMenu() { return undefined; }, isMenuOpen: function isMenuOpen() { return false; }, setSelectedIndex: function setSelectedIndex(index) { _this.nativeControl_.selectedIndex = index; }, setDisabled: function setDisabled(isDisabled) { _this.nativeControl_.disabled = isDisabled; }, setValid: function setValid(isValid) { if (isValid) { _this.root_.classList.remove(__WEBPACK_IMPORTED_MODULE_10__constants__["a" /* cssClasses */].INVALID); } else { _this.root_.classList.add(__WEBPACK_IMPORTED_MODULE_10__constants__["a" /* cssClasses */].INVALID); } }, checkValidity: function checkValidity() { return _this.nativeControl_.checkValidity(); } }; // tslint:enable:object-literal-sort-keys }; MDCSelect.prototype.getEnhancedSelectAdapterMethods_ = function () { var _this = this; // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { getValue: function getValue() { var listItem = _this.menuElement_.querySelector(__WEBPACK_IMPORTED_MODULE_10__constants__["c" /* strings */].SELECTED_ITEM_SELECTOR); if (listItem && listItem.hasAttribute(__WEBPACK_IMPORTED_MODULE_10__constants__["c" /* strings */].ENHANCED_VALUE_ATTR)) { return listItem.getAttribute(__WEBPACK_IMPORTED_MODULE_10__constants__["c" /* strings */].ENHANCED_VALUE_ATTR) || ''; } return ''; }, setValue: function setValue(value) { var element = _this.menuElement_.querySelector("[" + __WEBPACK_IMPORTED_MODULE_10__constants__["c" /* strings */].ENHANCED_VALUE_ATTR + "=\"" + value + "\"]"); _this.setEnhancedSelectedIndex_(element ? _this.menu_.items.indexOf(element) : -1); }, openMenu: function openMenu() { if (_this.menu_ && !_this.menu_.open) { _this.menu_.open = true; _this.isMenuOpen_ = true; _this.selectedText_.setAttribute('aria-expanded', 'true'); } }, closeMenu: function closeMenu() { if (_this.menu_ && _this.menu_.open) { _this.menu_.open = false; } }, isMenuOpen: function isMenuOpen() { return Boolean(_this.menu_) && _this.isMenuOpen_; }, setSelectedIndex: function setSelectedIndex(index) { return _this.setEnhancedSelectedIndex_(index); }, setDisabled: function setDisabled(isDisabled) { _this.selectedText_.setAttribute('tabindex', isDisabled ? '-1' : '0'); _this.selectedText_.setAttribute('aria-disabled', isDisabled.toString()); if (_this.hiddenInput_) { _this.hiddenInput_.disabled = isDisabled; } }, checkValidity: function checkValidity() { var classList = _this.root_.classList; if (classList.contains(__WEBPACK_IMPORTED_MODULE_10__constants__["a" /* cssClasses */].REQUIRED) && !classList.contains(__WEBPACK_IMPORTED_MODULE_10__constants__["a" /* cssClasses */].DISABLED)) { // See notes for required attribute under https://www.w3.org/TR/html52/sec-forms.html#the-select-element // TL;DR: Invalid if no index is selected, or if the first index is selected and has an empty value. return _this.selectedIndex !== -1 && (_this.selectedIndex !== 0 || Boolean(_this.value)); } else { return true; } }, setValid: function setValid(isValid) { _this.selectedText_.setAttribute('aria-invalid', (!isValid).toString()); if (isValid) { _this.root_.classList.remove(__WEBPACK_IMPORTED_MODULE_10__constants__["a" /* cssClasses */].INVALID); } else { _this.root_.classList.add(__WEBPACK_IMPORTED_MODULE_10__constants__["a" /* cssClasses */].INVALID); } } }; // tslint:enable:object-literal-sort-keys }; MDCSelect.prototype.getCommonAdapterMethods_ = function () { var _this = this; // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { addClass: function addClass(className) { return _this.root_.classList.add(className); }, removeClass: function removeClass(className) { return _this.root_.classList.remove(className); }, hasClass: function hasClass(className) { return _this.root_.classList.contains(className); }, setRippleCenter: function setRippleCenter(normalizedX) { return _this.lineRipple_ && _this.lineRipple_.setRippleCenter(normalizedX); }, activateBottomLine: function activateBottomLine() { return _this.lineRipple_ && _this.lineRipple_.activate(); }, deactivateBottomLine: function deactivateBottomLine() { return _this.lineRipple_ && _this.lineRipple_.deactivate(); }, notifyChange: function notifyChange(value) { var index = _this.selectedIndex; _this.emit(__WEBPACK_IMPORTED_MODULE_10__constants__["c" /* strings */].CHANGE_EVENT, { value: value, index: index }, true /* shouldBubble */); } }; // tslint:enable:object-literal-sort-keys }; MDCSelect.prototype.getOutlineAdapterMethods_ = function () { var _this = this; // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { hasOutline: function hasOutline() { return Boolean(_this.outline_); }, notchOutline: function notchOutline(labelWidth) { return _this.outline_ && _this.outline_.notch(labelWidth); }, closeOutline: function closeOutline() { return _this.outline_ && _this.outline_.closeNotch(); } }; // tslint:enable:object-literal-sort-keys }; MDCSelect.prototype.getLabelAdapterMethods_ = function () { var _this = this; return { floatLabel: function floatLabel(shouldFloat) { return _this.label_ && _this.label_.float(shouldFloat); }, getLabelWidth: function getLabelWidth() { return _this.label_ ? _this.label_.getWidth() : 0; } }; }; /** * Calculates where the line ripple should start based on the x coordinate within the component. */ MDCSelect.prototype.getNormalizedXCoordinate_ = function (evt) { var targetClientRect = evt.target.getBoundingClientRect(); var xCoordinate = this.isTouchEvent_(evt) ? evt.touches[0].clientX : evt.clientX; return xCoordinate - targetClientRect.left; }; MDCSelect.prototype.isTouchEvent_ = function (evt) { return Boolean(evt.touches); }; /** * Returns a map of all subcomponents to subfoundations. */ MDCSelect.prototype.getFoundationMap_ = function () { return { helperText: this.helperText_ ? this.helperText_.foundation : undefined, leadingIcon: this.leadingIcon_ ? this.leadingIcon_.foundation : undefined }; }; MDCSelect.prototype.setEnhancedSelectedIndex_ = function (index) { var selectedItem = this.menu_.items[index]; this.selectedText_.textContent = selectedItem ? selectedItem.textContent.trim() : ''; var previouslySelected = this.menuElement_.querySelector(__WEBPACK_IMPORTED_MODULE_10__constants__["c" /* strings */].SELECTED_ITEM_SELECTOR); if (previouslySelected) { previouslySelected.classList.remove(__WEBPACK_IMPORTED_MODULE_10__constants__["a" /* cssClasses */].SELECTED_ITEM_CLASS); previouslySelected.removeAttribute(__WEBPACK_IMPORTED_MODULE_10__constants__["c" /* strings */].ARIA_SELECTED_ATTR); } if (selectedItem) { selectedItem.classList.add(__WEBPACK_IMPORTED_MODULE_10__constants__["a" /* cssClasses */].SELECTED_ITEM_CLASS); selectedItem.setAttribute(__WEBPACK_IMPORTED_MODULE_10__constants__["c" /* strings */].ARIA_SELECTED_ATTR, 'true'); } // Synchronize hidden input's value with data-value attribute of selected item. // This code path is also followed when setting value directly, so this covers all cases. if (this.hiddenInput_) { this.hiddenInput_.value = selectedItem ? selectedItem.getAttribute(__WEBPACK_IMPORTED_MODULE_10__constants__["c" /* strings */].ENHANCED_VALUE_ATTR) || '' : ''; } this.layout(); }; MDCSelect.prototype.initialSyncRequiredState_ = function () { var isRequired = this.targetElement_.required || this.targetElement_.getAttribute('aria-required') === 'true' || this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_10__constants__["a" /* cssClasses */].REQUIRED); if (isRequired) { if (this.nativeControl_) { this.nativeControl_.required = true; } else { this.selectedText_.setAttribute('aria-required', 'true'); } this.root_.classList.add(__WEBPACK_IMPORTED_MODULE_10__constants__["a" /* cssClasses */].REQUIRED); } }; MDCSelect.prototype.addMutationObserverForRequired_ = function () { var _this = this; var observerHandler = function observerHandler(attributesList) { attributesList.some(function (attributeName) { if (VALIDATION_ATTR_WHITELIST.indexOf(attributeName) === -1) { return false; } if (_this.selectedText_) { if (_this.selectedText_.getAttribute('aria-required') === 'true') { _this.root_.classList.add(__WEBPACK_IMPORTED_MODULE_10__constants__["a" /* cssClasses */].REQUIRED); } else { _this.root_.classList.remove(__WEBPACK_IMPORTED_MODULE_10__constants__["a" /* cssClasses */].REQUIRED); } } else { if (_this.nativeControl_.required) { _this.root_.classList.add(__WEBPACK_IMPORTED_MODULE_10__constants__["a" /* cssClasses */].REQUIRED); } else { _this.root_.classList.remove(__WEBPACK_IMPORTED_MODULE_10__constants__["a" /* cssClasses */].REQUIRED); } } return true; }); }; var getAttributesList = function getAttributesList(mutationsList) { return mutationsList.map(function (mutation) { return mutation.attributeName; }).filter(function (attributeName) { return attributeName; }); }; var observer = new MutationObserver(function (mutationsList) { return observerHandler(getAttributesList(mutationsList)); }); observer.observe(this.targetElement_, { attributes: true }); this.validationObserver_ = observer; }; return MDCSelect; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 229 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__component__ = __webpack_require__(117); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(118); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(119); /* unused harmony reexport helperTextCssClasses */ /* unused harmony reexport helperTextStrings */ /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ //# sourceMappingURL=index.js.map /***/ }), /* 230 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__component__ = __webpack_require__(120); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(121); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(122); /* unused harmony reexport iconStrings */ /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ //# sourceMappingURL=index.js.map /***/ }), /* 231 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export EVENT_SELECT */ /* unused harmony export EVENT_DESELECT */ /* unused harmony export EVENT_TRAILING_ICON_CLICK */ /* harmony export (immutable) */ __webpack_exports__["a"] = initChips; /* unused harmony export VChip */ /* unused harmony export VChipSet */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_chips__ = __webpack_require__(123); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_event_handler__ = __webpack_require__(4); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__base_component__ = __webpack_require__(1); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var EVENT_SELECT = 'select'; var EVENT_DESELECT = 'deselect'; var EVENT_TRAILING_ICON_CLICK = 'trailing_icon_click'; var SELECTABLE_VARIANT_CLASS = 'v-chip-set--selectable-variant'; var CHIP_BEHAVIOR_AUTO_REMOVE = 'auto_remove'; var CHIP_BEHAVIOR_NO_AUTO_REMOVE = 'no_auto_remove'; function initChips(e) { console.debug('\tChips'); // The chip set > chips hierarchy is established differently than other // components: a chip set constructs and manages Chip components for its // chip elements. // // Because the chip set constructs chips on its own, a `hookupComponents` // call for chips is not needed. Object(__WEBPACK_IMPORTED_MODULE_2__base_component__["d" /* hookupComponentsManually */])(e, '.v-chip-set', function (element) { var chipFactory = voomChipFactoryFactory(CHIP_BEHAVIOR_NO_AUTO_REMOVE); var mdcComponent = new __WEBPACK_IMPORTED_MODULE_0__material_chips__["b" /* MDCChipSet */](element, undefined, chipFactory); return new VChipSet(element, mdcComponent); }); } var VChip = function (_eventHandlerMixin) { _inherits(VChip, _eventHandlerMixin); function VChip(element, mdcComponent) { _classCallCheck(this, VChip); var _this = _possibleConstructorReturn(this, (VChip.__proto__ || Object.getPrototypeOf(VChip)).call(this, element, mdcComponent)); _this.element.addEventListener('click', function (e) { if (_this.selectable) { _this.mdcComponent.selected = !_this.mdcComponent.selected; var eventType = _this.mdcComponent.selected ? EVENT_SELECT : EVENT_DESELECT; var selectionEvent = new Event(eventType, { bubbles: false }); _this.element.dispatchEvent(selectionEvent); } }); return _this; } _createClass(VChip, [{ key: 'prepareSubmit', // Called to collect data for submission value: function prepareSubmit(params) { if (this.shouldSubmitParams()) { params.push([this.name(), this.value()]); } } }, { key: 'name', value: function name() { return this.element.getAttribute('data-name'); } }, { key: 'value', value: function value() { return this.element.getAttribute('data-value'); } }, { key: 'clear', value: function clear() { console.debug('Chip clear is a no-op'); } }, { key: 'setValue', value: function setValue(value) { this.element.setAttribute('data-value', value); } }, { key: 'shouldSubmitParams', value: function shouldSubmitParams() { // Selectable chips (those within a :filter or :choice chipset) which // are not currently selected do not submit their value. return this.name() && this.value() && (!this.selectable || this.mdcComponent.selected); } }, { key: 'trailingIcon', get: function get() { return this.element.querySelector('.mdc-chip__icon.mdc-chip__icon--trailing'); } }, { key: 'selectable', get: function get() { return this.element.parentElement.classList.contains(SELECTABLE_VARIANT_CLASS); } }]); return VChip; }(Object(__WEBPACK_IMPORTED_MODULE_1__mixins_event_handler__["a" /* eventHandlerMixin */])(__WEBPACK_IMPORTED_MODULE_2__base_component__["a" /* VBaseComponent */])); // Returns a function which constructs VChip components. function voomChipFactoryFactory() { var behavior = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : CHIP_BEHAVIOR_AUTO_REMOVE; var autoRemove = behavior === CHIP_BEHAVIOR_AUTO_REMOVE; return function (element) { var mdcComponent = new __WEBPACK_IMPORTED_MODULE_0__material_chips__["a" /* MDCChip */](element); mdcComponent.shouldRemoveOnTrailingIconClick = autoRemove; return new VChip(element, mdcComponent); }; } var VChipSet = function (_eventHandlerMixin2) { _inherits(VChipSet, _eventHandlerMixin2); function VChipSet(element, mdcComponent) { _classCallCheck(this, VChipSet); return _possibleConstructorReturn(this, (VChipSet.__proto__ || Object.getPrototypeOf(VChipSet)).call(this, element, mdcComponent)); } return VChipSet; }(Object(__WEBPACK_IMPORTED_MODULE_1__mixins_event_handler__["a" /* eventHandlerMixin */])(__WEBPACK_IMPORTED_MODULE_2__base_component__["a" /* VBaseComponent */])); /***/ }), /* 232 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__component__ = __webpack_require__(124); /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__component__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(54); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(53); /* unused harmony reexport chipCssClasses */ /* unused harmony reexport chipStrings */ /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ //# sourceMappingURL=index.js.map /***/ }), /* 233 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__component__ = __webpack_require__(234); /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__component__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(125); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(126); /* unused harmony reexport chipSetCssClasses */ /* unused harmony reexport chipSetStrings */ /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ //# sourceMappingURL=index.js.map /***/ }), /* 234 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCChipSet; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__chip_component__ = __webpack_require__(124); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__chip_foundation__ = __webpack_require__(54); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation__ = __webpack_require__(125); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var _a = __WEBPACK_IMPORTED_MODULE_3__chip_foundation__["a" /* MDCChipFoundation */].strings, INTERACTION_EVENT = _a.INTERACTION_EVENT, SELECTION_EVENT = _a.SELECTION_EVENT, REMOVAL_EVENT = _a.REMOVAL_EVENT; var CHIP_SELECTOR = __WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* MDCChipSetFoundation */].strings.CHIP_SELECTOR; var idCounter = 0; var MDCChipSet = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCChipSet, _super); function MDCChipSet() { return _super !== null && _super.apply(this, arguments) || this; } MDCChipSet.attachTo = function (root) { return new MDCChipSet(root); }; Object.defineProperty(MDCChipSet.prototype, "chips", { get: function get() { return this.chips_.slice(); }, enumerable: true, configurable: true }); Object.defineProperty(MDCChipSet.prototype, "selectedChipIds", { /** * @return An array of the IDs of all selected chips. */ get: function get() { return this.foundation_.getSelectedChipIds(); }, enumerable: true, configurable: true }); /** * @param chipFactory A function which creates a new MDCChip. */ MDCChipSet.prototype.initialize = function (chipFactory) { if (chipFactory === void 0) { chipFactory = function chipFactory(el) { return new __WEBPACK_IMPORTED_MODULE_2__chip_component__["a" /* MDCChip */](el); }; } this.chipFactory_ = chipFactory; this.chips_ = this.instantiateChips_(this.chipFactory_); }; MDCChipSet.prototype.initialSyncWithDOM = function () { var _this = this; this.chips_.forEach(function (chip) { if (chip.id && chip.selected) { _this.foundation_.select(chip.id); } }); this.handleChipInteraction_ = function (evt) { return _this.foundation_.handleChipInteraction(evt.detail.chipId); }; this.handleChipSelection_ = function (evt) { return _this.foundation_.handleChipSelection(evt.detail.chipId, evt.detail.selected); }; this.handleChipRemoval_ = function (evt) { return _this.foundation_.handleChipRemoval(evt.detail.chipId); }; this.listen(INTERACTION_EVENT, this.handleChipInteraction_); this.listen(SELECTION_EVENT, this.handleChipSelection_); this.listen(REMOVAL_EVENT, this.handleChipRemoval_); }; MDCChipSet.prototype.destroy = function () { this.chips_.forEach(function (chip) { chip.destroy(); }); this.unlisten(INTERACTION_EVENT, this.handleChipInteraction_); this.unlisten(SELECTION_EVENT, this.handleChipSelection_); this.unlisten(REMOVAL_EVENT, this.handleChipRemoval_); _super.prototype.destroy.call(this); }; /** * Adds a new chip object to the chip set from the given chip element. */ MDCChipSet.prototype.addChip = function (chipEl) { chipEl.id = chipEl.id || "mdc-chip-" + ++idCounter; this.chips_.push(this.chipFactory_(chipEl)); }; MDCChipSet.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. var adapter = { hasClass: function hasClass(className) { return _this.root_.classList.contains(className); }, removeChip: function removeChip(chipId) { var index = _this.findChipIndex_(chipId); if (index >= 0) { _this.chips_[index].destroy(); _this.chips_.splice(index, 1); } }, setSelected: function setSelected(chipId, selected) { var index = _this.findChipIndex_(chipId); if (index >= 0) { _this.chips_[index].selected = selected; } } }; return new __WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* MDCChipSetFoundation */](adapter); }; /** * Instantiates chip components on all of the chip set's child chip elements. */ MDCChipSet.prototype.instantiateChips_ = function (chipFactory) { var chipElements = [].slice.call(this.root_.querySelectorAll(CHIP_SELECTOR)); return chipElements.map(function (el) { el.id = el.id || "mdc-chip-" + ++idCounter; return chipFactory(el); }); }; /** * Returns the index of the chip with the given id, or -1 if the chip does not exist. */ MDCChipSet.prototype.findChipIndex_ = function (chipId) { for (var i = 0; i < this.chips_.length; i++) { if (this.chips_[i].id === chipId) { return i; } } return -1; }; return MDCChipSet; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 235 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initCards; /* unused harmony export VCard */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__base_container__ = __webpack_require__(10); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__base_component__ = __webpack_require__(1); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function initCards(e) { console.debug('\tCards'); Object(__WEBPACK_IMPORTED_MODULE_1__base_component__["c" /* hookupComponents */])(e, '.v-card', VCard, null); } var VCard = function (_VBaseContainer) { _inherits(VCard, _VBaseContainer); function VCard(element, mdcComponent) { _classCallCheck(this, VCard); return _possibleConstructorReturn(this, (VCard.__proto__ || Object.getPrototypeOf(VCard)).call(this, element, mdcComponent)); } return VCard; }(__WEBPACK_IMPORTED_MODULE_0__base_container__["a" /* VBaseContainer */]); /***/ }), /* 236 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initForms; /* unused harmony export VForm */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__mixins_event_handler__ = __webpack_require__(4); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__base_container__ = __webpack_require__(10); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__base_component__ = __webpack_require__(1); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function initForms(e) { console.debug('\tForms'); Object(__WEBPACK_IMPORTED_MODULE_2__base_component__["c" /* hookupComponents */])(e, '.v-form', VForm, null); } var VForm = function (_eventHandlerMixin) { _inherits(VForm, _eventHandlerMixin); function VForm(element, mdcComponent) { _classCallCheck(this, VForm); return _possibleConstructorReturn(this, (VForm.__proto__ || Object.getPrototypeOf(VForm)).call(this, element, mdcComponent)); } return VForm; }(Object(__WEBPACK_IMPORTED_MODULE_0__mixins_event_handler__["a" /* eventHandlerMixin */])(__WEBPACK_IMPORTED_MODULE_1__base_container__["a" /* VBaseContainer */])); /***/ }), /* 237 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initSnackbar; /* unused harmony export VSnackbar */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_snackbar__ = __webpack_require__(238); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__base_component__ = __webpack_require__(1); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function initSnackbar(e) { console.debug('\tSnackbar'); Object(__WEBPACK_IMPORTED_MODULE_1__base_component__["c" /* hookupComponents */])(e, '.v-snackbar', VSnackbar, __WEBPACK_IMPORTED_MODULE_0__material_snackbar__["a" /* MDCSnackbar */]); } // This class displays a page level message var VSnackbar = function (_VBaseComponent) { _inherits(VSnackbar, _VBaseComponent); function VSnackbar(element, mdcComponent) { _classCallCheck(this, VSnackbar); var _this = _possibleConstructorReturn(this, (VSnackbar.__proto__ || Object.getPrototypeOf(VSnackbar)).call(this, element, mdcComponent)); element.classList.remove('v-hidden'); // defer causes default snackbar to flash without this return _this; } _createClass(VSnackbar, [{ key: 'display', value: function display(message) { // const dataObj = { // message: message, // }; // this.mdcComponent.show(dataObj); this.mdcComponent.labelText = message; this.mdcComponent.open(); } }]); return VSnackbar; }(__WEBPACK_IMPORTED_MODULE_1__base_component__["a" /* VBaseComponent */]); /***/ }), /* 238 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util__ = __webpack_require__(127); /* unused harmony reexport util */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__component__ = __webpack_require__(239); /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_1__component__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(28); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation__ = __webpack_require__(128); /* unused harmony namespace reexport */ /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ //# sourceMappingURL=index.js.map /***/ }), /* 239 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCSnackbar; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_dom_ponyfill__ = __webpack_require__(5); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(28); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation__ = __webpack_require__(128); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util__ = __webpack_require__(127); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var SURFACE_SELECTOR = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].SURFACE_SELECTOR, LABEL_SELECTOR = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].LABEL_SELECTOR, ACTION_SELECTOR = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ACTION_SELECTOR, DISMISS_SELECTOR = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].DISMISS_SELECTOR, OPENING_EVENT = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].OPENING_EVENT, OPENED_EVENT = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].OPENED_EVENT, CLOSING_EVENT = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].CLOSING_EVENT, CLOSED_EVENT = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].CLOSED_EVENT; var MDCSnackbar = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCSnackbar, _super); function MDCSnackbar() { return _super !== null && _super.apply(this, arguments) || this; } MDCSnackbar.attachTo = function (root) { return new MDCSnackbar(root); }; MDCSnackbar.prototype.initialize = function (announcerFactory) { if (announcerFactory === void 0) { announcerFactory = function announcerFactory() { return __WEBPACK_IMPORTED_MODULE_5__util__["a" /* announce */]; }; } this.announce_ = announcerFactory(); }; MDCSnackbar.prototype.initialSyncWithDOM = function () { var _this = this; this.surfaceEl_ = this.root_.querySelector(SURFACE_SELECTOR); this.labelEl_ = this.root_.querySelector(LABEL_SELECTOR); this.actionEl_ = this.root_.querySelector(ACTION_SELECTOR); this.handleKeyDown_ = function (evt) { return _this.foundation_.handleKeyDown(evt); }; this.handleSurfaceClick_ = function (evt) { var target = evt.target; if (_this.isActionButton_(target)) { _this.foundation_.handleActionButtonClick(evt); } else if (_this.isActionIcon_(target)) { _this.foundation_.handleActionIconClick(evt); } }; this.registerKeyDownHandler_(this.handleKeyDown_); this.registerSurfaceClickHandler_(this.handleSurfaceClick_); }; MDCSnackbar.prototype.destroy = function () { _super.prototype.destroy.call(this); this.deregisterKeyDownHandler_(this.handleKeyDown_); this.deregisterSurfaceClickHandler_(this.handleSurfaceClick_); }; MDCSnackbar.prototype.open = function () { this.foundation_.open(); }; /** * @param reason Why the snackbar was closed. Value will be passed to CLOSING_EVENT and CLOSED_EVENT via the * `event.detail.reason` property. Standard values are REASON_ACTION and REASON_DISMISS, but custom * client-specific values may also be used if desired. */ MDCSnackbar.prototype.close = function (reason) { if (reason === void 0) { reason = ''; } this.foundation_.close(reason); }; MDCSnackbar.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. var adapter = { addClass: function addClass(className) { return _this.root_.classList.add(className); }, announce: function announce() { return _this.announce_(_this.labelEl_); }, notifyClosed: function notifyClosed(reason) { return _this.emit(CLOSED_EVENT, reason ? { reason: reason } : {}); }, notifyClosing: function notifyClosing(reason) { return _this.emit(CLOSING_EVENT, reason ? { reason: reason } : {}); }, notifyOpened: function notifyOpened() { return _this.emit(OPENED_EVENT, {}); }, notifyOpening: function notifyOpening() { return _this.emit(OPENING_EVENT, {}); }, removeClass: function removeClass(className) { return _this.root_.classList.remove(className); } }; return new __WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* MDCSnackbarFoundation */](adapter); }; Object.defineProperty(MDCSnackbar.prototype, "timeoutMs", { get: function get() { return this.foundation_.getTimeoutMs(); }, set: function set(timeoutMs) { this.foundation_.setTimeoutMs(timeoutMs); }, enumerable: true, configurable: true }); Object.defineProperty(MDCSnackbar.prototype, "closeOnEscape", { get: function get() { return this.foundation_.getCloseOnEscape(); }, set: function set(closeOnEscape) { this.foundation_.setCloseOnEscape(closeOnEscape); }, enumerable: true, configurable: true }); Object.defineProperty(MDCSnackbar.prototype, "isOpen", { get: function get() { return this.foundation_.isOpen(); }, enumerable: true, configurable: true }); Object.defineProperty(MDCSnackbar.prototype, "labelText", { get: function get() { // This property only returns null if the node is a document, DOCTYPE, or notation. // On Element nodes, it always returns a string. return this.labelEl_.textContent; }, set: function set(labelText) { this.labelEl_.textContent = labelText; }, enumerable: true, configurable: true }); Object.defineProperty(MDCSnackbar.prototype, "actionButtonText", { get: function get() { return this.actionEl_.textContent; }, set: function set(actionButtonText) { this.actionEl_.textContent = actionButtonText; }, enumerable: true, configurable: true }); MDCSnackbar.prototype.registerKeyDownHandler_ = function (handler) { this.listen('keydown', handler); }; MDCSnackbar.prototype.deregisterKeyDownHandler_ = function (handler) { this.unlisten('keydown', handler); }; MDCSnackbar.prototype.registerSurfaceClickHandler_ = function (handler) { this.surfaceEl_.addEventListener('click', handler); }; MDCSnackbar.prototype.deregisterSurfaceClickHandler_ = function (handler) { this.surfaceEl_.removeEventListener('click', handler); }; MDCSnackbar.prototype.isActionButton_ = function (target) { return Boolean(Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_ponyfill__["a" /* closest */])(target, ACTION_SELECTOR)); }; MDCSnackbar.prototype.isActionIcon_ = function (target) { return Boolean(Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_ponyfill__["a" /* closest */])(target, DISMISS_SELECTOR)); }; return MDCSnackbar; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 240 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initCheckboxes; /* unused harmony export VCheckbox */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__base_component__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__base_toggle__ = __webpack_require__(27); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_checkbox__ = __webpack_require__(241); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function initCheckboxes(e) { console.debug('\tCheckboxes'); Object(__WEBPACK_IMPORTED_MODULE_0__base_component__["c" /* hookupComponents */])(e, '.v-checkbox', VCheckbox, __WEBPACK_IMPORTED_MODULE_2__material_checkbox__["a" /* MDCCheckbox */]); } var VCheckbox = function (_VBaseToggle) { _inherits(VCheckbox, _VBaseToggle); function VCheckbox(element, mdcComponent) { _classCallCheck(this, VCheckbox); var _this = _possibleConstructorReturn(this, (VCheckbox.__proto__ || Object.getPrototypeOf(VCheckbox)).call(this, element, mdcComponent)); _this.mdcComponent.indeterminate = _this.input.dataset.indeterminate === 'true'; return _this; } return VCheckbox; }(__WEBPACK_IMPORTED_MODULE_1__base_toggle__["a" /* VBaseToggle */]); /***/ }), /* 241 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__component__ = __webpack_require__(242); /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__component__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(130); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(129); /* unused harmony namespace reexport */ /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ //# sourceMappingURL=index.js.map /***/ }), /* 242 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCCheckbox; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_animation_util__ = __webpack_require__(29); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_dom_events__ = __webpack_require__(8); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_dom_ponyfill__ = __webpack_require__(5); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__material_ripple_component__ = __webpack_require__(6); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__material_ripple_foundation__ = __webpack_require__(9); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__foundation__ = __webpack_require__(129); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var CB_PROTO_PROPS = ['checked', 'indeterminate']; var MDCCheckbox = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCCheckbox, _super); function MDCCheckbox() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.ripple_ = _this.createRipple_(); return _this; } MDCCheckbox.attachTo = function (root) { return new MDCCheckbox(root); }; Object.defineProperty(MDCCheckbox.prototype, "ripple", { get: function get() { return this.ripple_; }, enumerable: true, configurable: true }); Object.defineProperty(MDCCheckbox.prototype, "checked", { get: function get() { return this.nativeControl_.checked; }, set: function set(checked) { this.nativeControl_.checked = checked; }, enumerable: true, configurable: true }); Object.defineProperty(MDCCheckbox.prototype, "indeterminate", { get: function get() { return this.nativeControl_.indeterminate; }, set: function set(indeterminate) { this.nativeControl_.indeterminate = indeterminate; }, enumerable: true, configurable: true }); Object.defineProperty(MDCCheckbox.prototype, "disabled", { get: function get() { return this.nativeControl_.disabled; }, set: function set(disabled) { this.foundation_.setDisabled(disabled); }, enumerable: true, configurable: true }); Object.defineProperty(MDCCheckbox.prototype, "value", { get: function get() { return this.nativeControl_.value; }, set: function set(value) { this.nativeControl_.value = value; }, enumerable: true, configurable: true }); MDCCheckbox.prototype.initialSyncWithDOM = function () { var _this = this; this.handleChange_ = function () { return _this.foundation_.handleChange(); }; this.handleAnimationEnd_ = function () { return _this.foundation_.handleAnimationEnd(); }; this.nativeControl_.addEventListener('change', this.handleChange_); this.listen(Object(__WEBPACK_IMPORTED_MODULE_1__material_animation_util__["a" /* getCorrectEventName */])(window, 'animationend'), this.handleAnimationEnd_); this.installPropertyChangeHooks_(); }; MDCCheckbox.prototype.destroy = function () { this.ripple_.destroy(); this.nativeControl_.removeEventListener('change', this.handleChange_); this.unlisten(Object(__WEBPACK_IMPORTED_MODULE_1__material_animation_util__["a" /* getCorrectEventName */])(window, 'animationend'), this.handleAnimationEnd_); this.uninstallPropertyChangeHooks_(); _super.prototype.destroy.call(this); }; MDCCheckbox.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. var adapter = { addClass: function addClass(className) { return _this.root_.classList.add(className); }, forceLayout: function forceLayout() { return _this.root_.offsetWidth; }, hasNativeControl: function hasNativeControl() { return !!_this.nativeControl_; }, isAttachedToDOM: function isAttachedToDOM() { return Boolean(_this.root_.parentNode); }, isChecked: function isChecked() { return _this.checked; }, isIndeterminate: function isIndeterminate() { return _this.indeterminate; }, removeClass: function removeClass(className) { return _this.root_.classList.remove(className); }, removeNativeControlAttr: function removeNativeControlAttr(attr) { return _this.nativeControl_.removeAttribute(attr); }, setNativeControlAttr: function setNativeControlAttr(attr, value) { return _this.nativeControl_.setAttribute(attr, value); }, setNativeControlDisabled: function setNativeControlDisabled(disabled) { return _this.nativeControl_.disabled = disabled; } }; return new __WEBPACK_IMPORTED_MODULE_7__foundation__["a" /* MDCCheckboxFoundation */](adapter); }; MDCCheckbox.prototype.createRipple_ = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. var adapter = __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, __WEBPACK_IMPORTED_MODULE_5__material_ripple_component__["a" /* MDCRipple */].createAdapter(this), { deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) { return _this.nativeControl_.removeEventListener(evtType, handler, Object(__WEBPACK_IMPORTED_MODULE_3__material_dom_events__["a" /* applyPassive */])()); }, isSurfaceActive: function isSurfaceActive() { return Object(__WEBPACK_IMPORTED_MODULE_4__material_dom_ponyfill__["b" /* matches */])(_this.nativeControl_, ':active'); }, isUnbounded: function isUnbounded() { return true; }, registerInteractionHandler: function registerInteractionHandler(evtType, handler) { return _this.nativeControl_.addEventListener(evtType, handler, Object(__WEBPACK_IMPORTED_MODULE_3__material_dom_events__["a" /* applyPassive */])()); } }); return new __WEBPACK_IMPORTED_MODULE_5__material_ripple_component__["a" /* MDCRipple */](this.root_, new __WEBPACK_IMPORTED_MODULE_6__material_ripple_foundation__["a" /* MDCRippleFoundation */](adapter)); }; MDCCheckbox.prototype.installPropertyChangeHooks_ = function () { var _this = this; var nativeCb = this.nativeControl_; var cbProto = Object.getPrototypeOf(nativeCb); CB_PROTO_PROPS.forEach(function (controlState) { var desc = Object.getOwnPropertyDescriptor(cbProto, controlState); // We have to check for this descriptor, since some browsers (Safari) don't support its return. // See: https://bugs.webkit.org/show_bug.cgi?id=49739 if (!validDescriptor(desc)) { return; } // Type cast is needed for compatibility with Closure Compiler. var nativeGetter = desc.get; var nativeCbDesc = { configurable: desc.configurable, enumerable: desc.enumerable, get: nativeGetter, set: function set(state) { desc.set.call(nativeCb, state); _this.foundation_.handleChange(); } }; Object.defineProperty(nativeCb, controlState, nativeCbDesc); }); }; MDCCheckbox.prototype.uninstallPropertyChangeHooks_ = function () { var nativeCb = this.nativeControl_; var cbProto = Object.getPrototypeOf(nativeCb); CB_PROTO_PROPS.forEach(function (controlState) { var desc = Object.getOwnPropertyDescriptor(cbProto, controlState); if (!validDescriptor(desc)) { return; } Object.defineProperty(nativeCb, controlState, desc); }); }; Object.defineProperty(MDCCheckbox.prototype, "nativeControl_", { get: function get() { var NATIVE_CONTROL_SELECTOR = __WEBPACK_IMPORTED_MODULE_7__foundation__["a" /* MDCCheckboxFoundation */].strings.NATIVE_CONTROL_SELECTOR; var el = this.root_.querySelector(NATIVE_CONTROL_SELECTOR); if (!el) { throw new Error("Checkbox component requires a " + NATIVE_CONTROL_SELECTOR + " element"); } return el; }, enumerable: true, configurable: true }); return MDCCheckbox; }(__WEBPACK_IMPORTED_MODULE_2__material_base_component__["a" /* MDCComponent */]); function validDescriptor(inputPropDesc) { return !!inputPropDesc && typeof inputPropDesc.set === 'function'; } //# sourceMappingURL=component.js.map /***/ }), /* 243 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initSwitches; /* unused harmony export VSwitch */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__base_component__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__base_toggle__ = __webpack_require__(27); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_switch__ = __webpack_require__(244); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function initSwitches(e) { console.debug('\tSwitches'); Object(__WEBPACK_IMPORTED_MODULE_0__base_component__["c" /* hookupComponents */])(e, '.v-switch', VSwitch, __WEBPACK_IMPORTED_MODULE_2__material_switch__["a" /* MDCSwitch */]); } var VSwitch = function (_VBaseToggle) { _inherits(VSwitch, _VBaseToggle); function VSwitch(element, mdcComponent) { _classCallCheck(this, VSwitch); return _possibleConstructorReturn(this, (VSwitch.__proto__ || Object.getPrototypeOf(VSwitch)).call(this, element, mdcComponent)); } return VSwitch; }(__WEBPACK_IMPORTED_MODULE_1__base_toggle__["a" /* VBaseToggle */]); /***/ }), /* 244 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__component__ = __webpack_require__(245); /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__component__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(132); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(131); /* unused harmony namespace reexport */ /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ //# sourceMappingURL=index.js.map /***/ }), /* 245 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCSwitch; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_dom_events__ = __webpack_require__(8); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_dom_ponyfill__ = __webpack_require__(5); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_ripple_component__ = __webpack_require__(6); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__material_ripple_foundation__ = __webpack_require__(9); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__foundation__ = __webpack_require__(131); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCSwitch = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCSwitch, _super); function MDCSwitch() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.ripple_ = _this.createRipple_(); return _this; } MDCSwitch.attachTo = function (root) { return new MDCSwitch(root); }; MDCSwitch.prototype.destroy = function () { _super.prototype.destroy.call(this); this.ripple_.destroy(); this.nativeControl_.removeEventListener('change', this.changeHandler_); }; MDCSwitch.prototype.initialSyncWithDOM = function () { var _this = this; this.changeHandler_ = function () { var _a; var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } return (_a = _this.foundation_).handleChange.apply(_a, __WEBPACK_IMPORTED_MODULE_0_tslib__["d" /* __spread */](args)); }; this.nativeControl_.addEventListener('change', this.changeHandler_); // Sometimes the checked state of the input element is saved in the history. // The switch styling should match the checked state of the input element. // Do an initial sync between the native control and the foundation. this.checked = this.checked; }; MDCSwitch.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. var adapter = { addClass: function addClass(className) { return _this.root_.classList.add(className); }, removeClass: function removeClass(className) { return _this.root_.classList.remove(className); }, setNativeControlChecked: function setNativeControlChecked(checked) { return _this.nativeControl_.checked = checked; }, setNativeControlDisabled: function setNativeControlDisabled(disabled) { return _this.nativeControl_.disabled = disabled; } }; return new __WEBPACK_IMPORTED_MODULE_6__foundation__["a" /* MDCSwitchFoundation */](adapter); }; Object.defineProperty(MDCSwitch.prototype, "ripple", { get: function get() { return this.ripple_; }, enumerable: true, configurable: true }); Object.defineProperty(MDCSwitch.prototype, "checked", { get: function get() { return this.nativeControl_.checked; }, set: function set(checked) { this.foundation_.setChecked(checked); }, enumerable: true, configurable: true }); Object.defineProperty(MDCSwitch.prototype, "disabled", { get: function get() { return this.nativeControl_.disabled; }, set: function set(disabled) { this.foundation_.setDisabled(disabled); }, enumerable: true, configurable: true }); MDCSwitch.prototype.createRipple_ = function () { var _this = this; var RIPPLE_SURFACE_SELECTOR = __WEBPACK_IMPORTED_MODULE_6__foundation__["a" /* MDCSwitchFoundation */].strings.RIPPLE_SURFACE_SELECTOR; var rippleSurface = this.root_.querySelector(RIPPLE_SURFACE_SELECTOR); // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. var adapter = __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, __WEBPACK_IMPORTED_MODULE_4__material_ripple_component__["a" /* MDCRipple */].createAdapter(this), { addClass: function addClass(className) { return rippleSurface.classList.add(className); }, computeBoundingRect: function computeBoundingRect() { return rippleSurface.getBoundingClientRect(); }, deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) { _this.nativeControl_.removeEventListener(evtType, handler, Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_events__["a" /* applyPassive */])()); }, isSurfaceActive: function isSurfaceActive() { return Object(__WEBPACK_IMPORTED_MODULE_3__material_dom_ponyfill__["b" /* matches */])(_this.nativeControl_, ':active'); }, isUnbounded: function isUnbounded() { return true; }, registerInteractionHandler: function registerInteractionHandler(evtType, handler) { _this.nativeControl_.addEventListener(evtType, handler, Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_events__["a" /* applyPassive */])()); }, removeClass: function removeClass(className) { return rippleSurface.classList.remove(className); }, updateCssVariable: function updateCssVariable(varName, value) { rippleSurface.style.setProperty(varName, value); } }); return new __WEBPACK_IMPORTED_MODULE_4__material_ripple_component__["a" /* MDCRipple */](this.root_, new __WEBPACK_IMPORTED_MODULE_5__material_ripple_foundation__["a" /* MDCRippleFoundation */](adapter)); }; Object.defineProperty(MDCSwitch.prototype, "nativeControl_", { get: function get() { var NATIVE_CONTROL_SELECTOR = __WEBPACK_IMPORTED_MODULE_6__foundation__["a" /* MDCSwitchFoundation */].strings.NATIVE_CONTROL_SELECTOR; return this.root_.querySelector(NATIVE_CONTROL_SELECTOR); }, enumerable: true, configurable: true }); return MDCSwitch; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 246 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initRichTextArea; /* unused harmony export VRichTextArea */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_quill__ = __webpack_require__(133); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_quill___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_quill__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__rich_text_area_horizontal_rule_blot__ = __webpack_require__(252); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__base_component__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__mixins_event_handler__ = __webpack_require__(4); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__mixins_dirtyable__ = __webpack_require__(11); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // These Blots will be registered with Quill. var blots = [__WEBPACK_IMPORTED_MODULE_1__rich_text_area_horizontal_rule_blot__["a" /* HorizontalRuleBlot */]]; var toolbarOptions = [['bold', 'italic', 'underline', 'strike'], [{ 'color': [] }], [{ 'align': [] }], ['blockquote', 'horizontal-rule'], [{ 'list': 'ordered' }, { 'list': 'bullet' }], [{ 'script': 'sub' }, { 'script': 'super' }], [{ 'direction': 'rtl' }], [{ 'header': [1, 2, 3, 4, 5, 6, false] }], [{ 'size': ['xx-small', false, 'large', 'x-large'] }], ['link', 'image', 'video'], ['clean']]; var EMPTY_VALUE = ''; function initRichTextArea(e) { console.debug('\tRich Text Area'); Object(__WEBPACK_IMPORTED_MODULE_2__base_component__["c" /* hookupComponents */])(e, '.v-rich-text-area-container', VRichTextArea, null); } var VRichTextArea = function (_dirtyableMixin) { _inherits(VRichTextArea, _dirtyableMixin); function VRichTextArea(element, mdcComponent) { _classCallCheck(this, VRichTextArea); var _this = _possibleConstructorReturn(this, (VRichTextArea.__proto__ || Object.getPrototypeOf(VRichTextArea)).call(this, element, mdcComponent)); configureQuill(); registerBlots(); _this.quillWrapper = element.querySelector('.v-rich-text-area'); _this.quill = new __WEBPACK_IMPORTED_MODULE_0_quill___default.a(_this.quillWrapper, { modules: { toolbar: toolbarOptions }, bounds: _this.quillWrapper, theme: 'snow', placeholder: _this.quillWrapper.dataset.placeholder }); _this.fixedUpContentElement = element.querySelector('.v-rich-text-area--fixed-up-content'); _this.quillEditor = _this.quillWrapper.querySelector('.ql-editor'); if (element.hasAttribute('disabled')) { _this.quill.enable(false); } hookupCustomToolbarButtons(_this); // Fix-ups: _this.updateFixedContentElement(); _this.quill.on('text-change', function () { return _this.updateFixedContentElement(); }); adjustEditorStyles(_this); _this.originalValue = _this.value(); return _this; } _createClass(VRichTextArea, [{ key: "prepareSubmit", value: function prepareSubmit(params) { params.push(['rich_text_payload', 'true']); params.push([this.name(), this.value()]); } }, { key: "name", value: function name() { return this.quillWrapper.dataset.name; } }, { key: "value", value: function value() { var document = this.fixedUpContentElement.innerHTML; return this.quill.editor.isBlank() ? EMPTY_VALUE : document; } }, { key: "clear", value: function clear() { if (this.value() !== EMPTY_VALUE) { this.setValue(EMPTY_VALUE); } } }, { key: "reset", value: function reset() { this.setValue(this.originalValue); } }, { key: "setValue", value: function setValue(value) { this.quill.root.innerHTML = value; } }, { key: "isDirty", value: function isDirty() { return this.dirtyable && this.value().localeCompare(this.originalValue) !== 0; } }, { key: "updateFixedContentElement", value: function updateFixedContentElement() { var rawDocument = this.quill.root.innerHTML; this.fixedUpContentElement.innerHTML = convertLists(rawDocument); } }]); return VRichTextArea; }(Object(__WEBPACK_IMPORTED_MODULE_4__mixins_dirtyable__["a" /* dirtyableMixin */])(Object(__WEBPACK_IMPORTED_MODULE_3__mixins_event_handler__["a" /* eventHandlerMixin */])(__WEBPACK_IMPORTED_MODULE_2__base_component__["a" /* VBaseComponent */]))); function adjustEditorStyles(richTextArea) { // The editor element is not created until Quill has been initialized, so // its styles must be adjusted dynamically post-construction. var initialHeight = richTextArea.element.dataset.initialHeight; richTextArea.quillEditor.style.height = initialHeight; richTextArea.quillEditor.style.minHeight = initialHeight; } var blotRegistry = new WeakSet(); function registerBlots() { var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = blots[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var blot = _step.value; if (blotRegistry.has(blot)) { continue; } // Set required Blot attributes: blot.blotName = blot.name; blot.tagName = blot.tag; __WEBPACK_IMPORTED_MODULE_0_quill___default.a.register(blot); blotRegistry.add(blot); } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } } function hookupCustomToolbarButtons(vRichTextArea) { var _loop = function _loop(blotClass) { var name = blotClass.name, action = blotClass.action; var buttons = vRichTextArea.element.querySelectorAll(".ql-" + name); var _iteratorNormalCompletion3 = true; var _didIteratorError3 = false; var _iteratorError3 = undefined; try { for (var _iterator3 = buttons[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { var button = _step3.value; // Invoke the Blot's action when button is clicked: button.addEventListener('click', function (event) { action(vRichTextArea.quill, event); }); } } catch (err) { _didIteratorError3 = true; _iteratorError3 = err; } finally { try { if (!_iteratorNormalCompletion3 && _iterator3.return) { _iterator3.return(); } } finally { if (_didIteratorError3) { throw _iteratorError3; } } } }; var _iteratorNormalCompletion2 = true; var _didIteratorError2 = false; var _iteratorError2 = undefined; try { for (var _iterator2 = blots[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { var blotClass = _step2.value; _loop(blotClass); } } catch (err) { _didIteratorError2 = true; _iteratorError2 = err; } finally { try { if (!_iteratorNormalCompletion2 && _iterator2.return) { _iterator2.return(); } } finally { if (_didIteratorError2) { throw _iteratorError2; } } } } function configureQuill() { // Inform Quill that it should decorate text objects with inline styles // instead of Quill CSS classes when modifying text: var sizeAttributor = __WEBPACK_IMPORTED_MODULE_0_quill___default.a.import('attributors/style/size'); sizeAttributor.whitelist = ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', false]; var styleAttributors = [sizeAttributor, __WEBPACK_IMPORTED_MODULE_0_quill___default.a.import('attributors/style/align'), __WEBPACK_IMPORTED_MODULE_0_quill___default.a.import('attributors/style/direction')]; var _iteratorNormalCompletion4 = true; var _didIteratorError4 = false; var _iteratorError4 = undefined; try { for (var _iterator4 = styleAttributors[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { var attributor = _step4.value; __WEBPACK_IMPORTED_MODULE_0_quill___default.a.register(attributor, true); } } catch (err) { _didIteratorError4 = true; _iteratorError4 = err; } finally { try { if (!_iteratorNormalCompletion4 && _iterator4.return) { _iterator4.return(); } } finally { if (_didIteratorError4) { throw _iteratorError4; } } } } // Quill 1 is not capable of generating structurally-sound nested lists. Instead // of generated nested list elements, all list items are generated at the same // level. Indentation and list item numbers are handled by various `indent` CSS // classes and CSS counters. Eugh. // see https://github.com/quilljs/quill/issues/979 // from https://github.com/quilljs/quill/issues/979#issuecomment-381151479. function convertLists(richtext) { var tempEl = window.document.createElement('div'); tempEl.setAttribute('style', 'display: none;'); tempEl.innerHTML = richtext; ['ul', 'ol'].forEach(function (type) { var startTag = "::start" + type + "::::/start" + type + "::"; var endTag = "::end" + type + "::::/end" + type + "::"; // Grab each list, and work on it in turn Array.from(tempEl.querySelectorAll(type)).forEach(function (outerListEl) { var listChildren = Array.from(outerListEl.children).filter(function (el) { return el.tagName === 'LI'; }); // Account for the fact that the first li might not be at level 0 var firstLi = listChildren[0]; firstLi.before(startTag.repeat(getListLevel(firstLi))); // Now work through each li in this list listChildren.forEach(function (listEl, index) { var currentLiLevel = getListLevel(listEl); if (index < listChildren.length - 1) { var difference = getListLevel(listChildren[index + 1]) - currentLiLevel; // we only need to add tags if the level is changing if (difference > 0) { listChildren[index + 1].before(startTag.repeat(difference)); } else if (difference < 0) { listEl.after(endTag.repeat(-difference)); } } else { listEl.after(endTag); } }); outerListEl.after(endTag); }); }); // Get the content in the element and replace the temporary tags with new ones var newContent = tempEl.innerHTML; newContent = newContent.replace(/::startul::::\/startul::/g, '<ul>'); newContent = newContent.replace(/::endul::::\/endul::/g, '</ul>'); newContent = newContent.replace(/::startol::::\/startol::/g, '<ol>'); newContent = newContent.replace(/::endol::::\/endol::/g, '</ol>'); tempEl.remove(); return newContent; } function getListLevel(el) { var className = el.className || '0'; return +className.replace(/[^\d]/g, ''); } /***/ }), /* 247 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(global) {/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org> * @license MIT */ /* eslint-disable no-proto */ var base64 = __webpack_require__(248); var ieee754 = __webpack_require__(249); var isArray = __webpack_require__(250); exports.Buffer = Buffer; exports.SlowBuffer = SlowBuffer; exports.INSPECT_MAX_BYTES = 50; /** * If `Buffer.TYPED_ARRAY_SUPPORT`: * === true Use Uint8Array implementation (fastest) * === false Use Object implementation (most compatible, even IE6) * * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, * Opera 11.6+, iOS 4.2+. * * Due to various browser bugs, sometimes the Object implementation will be used even * when the browser supports typed arrays. * * Note: * * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. * * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. * * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of * incorrect length in some situations. * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they * get the Object implementation, which is slower but behaves correctly. */ Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined ? global.TYPED_ARRAY_SUPPORT : typedArraySupport(); /* * Export kMaxLength after typed array support is determined. */ exports.kMaxLength = kMaxLength(); function typedArraySupport() { try { var arr = new Uint8Array(1); arr.__proto__ = { __proto__: Uint8Array.prototype, foo: function foo() { return 42; } }; return arr.foo() === 42 && // typed array instances can be augmented typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` arr.subarray(1, 1).byteLength === 0; // ie10 has broken `subarray` } catch (e) { return false; } } function kMaxLength() { return Buffer.TYPED_ARRAY_SUPPORT ? 0x7fffffff : 0x3fffffff; } function createBuffer(that, length) { if (kMaxLength() < length) { throw new RangeError('Invalid typed array length'); } if (Buffer.TYPED_ARRAY_SUPPORT) { // Return an augmented `Uint8Array` instance, for best performance that = new Uint8Array(length); that.__proto__ = Buffer.prototype; } else { // Fallback: Return an object instance of the Buffer class if (that === null) { that = new Buffer(length); } that.length = length; } return that; } /** * The Buffer constructor returns instances of `Uint8Array` that have their * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of * `Uint8Array`, so the returned instances will have all the node `Buffer` methods * and the `Uint8Array` methods. Square bracket notation works as expected -- it * returns a single octet. * * The `Uint8Array` prototype remains unmodified. */ function Buffer(arg, encodingOrOffset, length) { if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { return new Buffer(arg, encodingOrOffset, length); } // Common case. if (typeof arg === 'number') { if (typeof encodingOrOffset === 'string') { throw new Error('If encoding is specified then the first argument must be a string'); } return allocUnsafe(this, arg); } return from(this, arg, encodingOrOffset, length); } Buffer.poolSize = 8192; // not used by this implementation // TODO: Legacy, not needed anymore. Remove in next major version. Buffer._augment = function (arr) { arr.__proto__ = Buffer.prototype; return arr; }; function from(that, value, encodingOrOffset, length) { if (typeof value === 'number') { throw new TypeError('"value" argument must not be a number'); } if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { return fromArrayBuffer(that, value, encodingOrOffset, length); } if (typeof value === 'string') { return fromString(that, value, encodingOrOffset); } return fromObject(that, value); } /** * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError * if value is a number. * Buffer.from(str[, encoding]) * Buffer.from(array) * Buffer.from(buffer) * Buffer.from(arrayBuffer[, byteOffset[, length]]) **/ Buffer.from = function (value, encodingOrOffset, length) { return from(null, value, encodingOrOffset, length); }; if (Buffer.TYPED_ARRAY_SUPPORT) { Buffer.prototype.__proto__ = Uint8Array.prototype; Buffer.__proto__ = Uint8Array; if (typeof Symbol !== 'undefined' && Symbol.species && Buffer[Symbol.species] === Buffer) { // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 Object.defineProperty(Buffer, Symbol.species, { value: null, configurable: true }); } } function assertSize(size) { if (typeof size !== 'number') { throw new TypeError('"size" argument must be a number'); } else if (size < 0) { throw new RangeError('"size" argument must not be negative'); } } function alloc(that, size, fill, encoding) { assertSize(size); if (size <= 0) { return createBuffer(that, size); } if (fill !== undefined) { // Only pay attention to encoding if it's a string. This // prevents accidentally sending in a number that would // be interpretted as a start offset. return typeof encoding === 'string' ? createBuffer(that, size).fill(fill, encoding) : createBuffer(that, size).fill(fill); } return createBuffer(that, size); } /** * Creates a new filled Buffer instance. * alloc(size[, fill[, encoding]]) **/ Buffer.alloc = function (size, fill, encoding) { return alloc(null, size, fill, encoding); }; function allocUnsafe(that, size) { assertSize(size); that = createBuffer(that, size < 0 ? 0 : checked(size) | 0); if (!Buffer.TYPED_ARRAY_SUPPORT) { for (var i = 0; i < size; ++i) { that[i] = 0; } } return that; } /** * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. * */ Buffer.allocUnsafe = function (size) { return allocUnsafe(null, size); }; /** * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. */ Buffer.allocUnsafeSlow = function (size) { return allocUnsafe(null, size); }; function fromString(that, string, encoding) { if (typeof encoding !== 'string' || encoding === '') { encoding = 'utf8'; } if (!Buffer.isEncoding(encoding)) { throw new TypeError('"encoding" must be a valid string encoding'); } var length = byteLength(string, encoding) | 0; that = createBuffer(that, length); var actual = that.write(string, encoding); if (actual !== length) { // Writing a hex string, for example, that contains invalid characters will // cause everything after the first invalid character to be ignored. (e.g. // 'abxxcd' will be treated as 'ab') that = that.slice(0, actual); } return that; } function fromArrayLike(that, array) { var length = array.length < 0 ? 0 : checked(array.length) | 0; that = createBuffer(that, length); for (var i = 0; i < length; i += 1) { that[i] = array[i] & 255; } return that; } function fromArrayBuffer(that, array, byteOffset, length) { array.byteLength; // this throws if `array` is not a valid ArrayBuffer if (byteOffset < 0 || array.byteLength < byteOffset) { throw new RangeError('\'offset\' is out of bounds'); } if (array.byteLength < byteOffset + (length || 0)) { throw new RangeError('\'length\' is out of bounds'); } if (byteOffset === undefined && length === undefined) { array = new Uint8Array(array); } else if (length === undefined) { array = new Uint8Array(array, byteOffset); } else { array = new Uint8Array(array, byteOffset, length); } if (Buffer.TYPED_ARRAY_SUPPORT) { // Return an augmented `Uint8Array` instance, for best performance that = array; that.__proto__ = Buffer.prototype; } else { // Fallback: Return an object instance of the Buffer class that = fromArrayLike(that, array); } return that; } function fromObject(that, obj) { if (Buffer.isBuffer(obj)) { var len = checked(obj.length) | 0; that = createBuffer(that, len); if (that.length === 0) { return that; } obj.copy(that, 0, 0, len); return that; } if (obj) { if (typeof ArrayBuffer !== 'undefined' && obj.buffer instanceof ArrayBuffer || 'length' in obj) { if (typeof obj.length !== 'number' || isnan(obj.length)) { return createBuffer(that, 0); } return fromArrayLike(that, obj); } if (obj.type === 'Buffer' && isArray(obj.data)) { return fromArrayLike(that, obj.data); } } throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.'); } function checked(length) { // Note: cannot use `length < kMaxLength()` here because that fails when // length is NaN (which is otherwise coerced to zero.) if (length >= kMaxLength()) { throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + kMaxLength().toString(16) + ' bytes'); } return length | 0; } function SlowBuffer(length) { if (+length != length) { // eslint-disable-line eqeqeq length = 0; } return Buffer.alloc(+length); } Buffer.isBuffer = function isBuffer(b) { return !!(b != null && b._isBuffer); }; Buffer.compare = function compare(a, b) { if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { throw new TypeError('Arguments must be Buffers'); } if (a === b) return 0; var x = a.length; var y = b.length; for (var i = 0, len = Math.min(x, y); i < len; ++i) { if (a[i] !== b[i]) { x = a[i]; y = b[i]; break; } } if (x < y) return -1; if (y < x) return 1; return 0; }; Buffer.isEncoding = function isEncoding(encoding) { switch (String(encoding).toLowerCase()) { case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'latin1': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return true; default: return false; } }; Buffer.concat = function concat(list, length) { if (!isArray(list)) { throw new TypeError('"list" argument must be an Array of Buffers'); } if (list.length === 0) { return Buffer.alloc(0); } var i; if (length === undefined) { length = 0; for (i = 0; i < list.length; ++i) { length += list[i].length; } } var buffer = Buffer.allocUnsafe(length); var pos = 0; for (i = 0; i < list.length; ++i) { var buf = list[i]; if (!Buffer.isBuffer(buf)) { throw new TypeError('"list" argument must be an Array of Buffers'); } buf.copy(buffer, pos); pos += buf.length; } return buffer; }; function byteLength(string, encoding) { if (Buffer.isBuffer(string)) { return string.length; } if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) { return string.byteLength; } if (typeof string !== 'string') { string = '' + string; } var len = string.length; if (len === 0) return 0; // Use a for loop to avoid recursion var loweredCase = false; for (;;) { switch (encoding) { case 'ascii': case 'latin1': case 'binary': return len; case 'utf8': case 'utf-8': case undefined: return utf8ToBytes(string).length; case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return len * 2; case 'hex': return len >>> 1; case 'base64': return base64ToBytes(string).length; default: if (loweredCase) return utf8ToBytes(string).length; // assume utf8 encoding = ('' + encoding).toLowerCase(); loweredCase = true; } } } Buffer.byteLength = byteLength; function slowToString(encoding, start, end) { var loweredCase = false; // No need to verify that "this.length <= MAX_UINT32" since it's a read-only // property of a typed array. // This behaves neither like String nor Uint8Array in that we set start/end // to their upper/lower bounds if the value passed is out of range. // undefined is handled specially as per ECMA-262 6th Edition, // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. if (start === undefined || start < 0) { start = 0; } // Return early if start > this.length. Done here to prevent potential uint32 // coercion fail below. if (start > this.length) { return ''; } if (end === undefined || end > this.length) { end = this.length; } if (end <= 0) { return ''; } // Force coersion to uint32. This will also coerce falsey/NaN values to 0. end >>>= 0; start >>>= 0; if (end <= start) { return ''; } if (!encoding) encoding = 'utf8'; while (true) { switch (encoding) { case 'hex': return hexSlice(this, start, end); case 'utf8': case 'utf-8': return utf8Slice(this, start, end); case 'ascii': return asciiSlice(this, start, end); case 'latin1': case 'binary': return latin1Slice(this, start, end); case 'base64': return base64Slice(this, start, end); case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return utf16leSlice(this, start, end); default: if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding); encoding = (encoding + '').toLowerCase(); loweredCase = true; } } } // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect // Buffer instances. Buffer.prototype._isBuffer = true; function swap(b, n, m) { var i = b[n]; b[n] = b[m]; b[m] = i; } Buffer.prototype.swap16 = function swap16() { var len = this.length; if (len % 2 !== 0) { throw new RangeError('Buffer size must be a multiple of 16-bits'); } for (var i = 0; i < len; i += 2) { swap(this, i, i + 1); } return this; }; Buffer.prototype.swap32 = function swap32() { var len = this.length; if (len % 4 !== 0) { throw new RangeError('Buffer size must be a multiple of 32-bits'); } for (var i = 0; i < len; i += 4) { swap(this, i, i + 3); swap(this, i + 1, i + 2); } return this; }; Buffer.prototype.swap64 = function swap64() { var len = this.length; if (len % 8 !== 0) { throw new RangeError('Buffer size must be a multiple of 64-bits'); } for (var i = 0; i < len; i += 8) { swap(this, i, i + 7); swap(this, i + 1, i + 6); swap(this, i + 2, i + 5); swap(this, i + 3, i + 4); } return this; }; Buffer.prototype.toString = function toString() { var length = this.length | 0; if (length === 0) return ''; if (arguments.length === 0) return utf8Slice(this, 0, length); return slowToString.apply(this, arguments); }; Buffer.prototype.equals = function equals(b) { if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer'); if (this === b) return true; return Buffer.compare(this, b) === 0; }; Buffer.prototype.inspect = function inspect() { var str = ''; var max = exports.INSPECT_MAX_BYTES; if (this.length > 0) { str = this.toString('hex', 0, max).match(/.{2}/g).join(' '); if (this.length > max) str += ' ... '; } return '<Buffer ' + str + '>'; }; Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) { if (!Buffer.isBuffer(target)) { throw new TypeError('Argument must be a Buffer'); } if (start === undefined) { start = 0; } if (end === undefined) { end = target ? target.length : 0; } if (thisStart === undefined) { thisStart = 0; } if (thisEnd === undefined) { thisEnd = this.length; } if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { throw new RangeError('out of range index'); } if (thisStart >= thisEnd && start >= end) { return 0; } if (thisStart >= thisEnd) { return -1; } if (start >= end) { return 1; } start >>>= 0; end >>>= 0; thisStart >>>= 0; thisEnd >>>= 0; if (this === target) return 0; var x = thisEnd - thisStart; var y = end - start; var len = Math.min(x, y); var thisCopy = this.slice(thisStart, thisEnd); var targetCopy = target.slice(start, end); for (var i = 0; i < len; ++i) { if (thisCopy[i] !== targetCopy[i]) { x = thisCopy[i]; y = targetCopy[i]; break; } } if (x < y) return -1; if (y < x) return 1; return 0; }; // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, // OR the last index of `val` in `buffer` at offset <= `byteOffset`. // // Arguments: // - buffer - a Buffer to search // - val - a string, Buffer, or number // - byteOffset - an index into `buffer`; will be clamped to an int32 // - encoding - an optional encoding, relevant is val is a string // - dir - true for indexOf, false for lastIndexOf function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) { // Empty buffer means no match if (buffer.length === 0) return -1; // Normalize byteOffset if (typeof byteOffset === 'string') { encoding = byteOffset; byteOffset = 0; } else if (byteOffset > 0x7fffffff) { byteOffset = 0x7fffffff; } else if (byteOffset < -0x80000000) { byteOffset = -0x80000000; } byteOffset = +byteOffset; // Coerce to Number. if (isNaN(byteOffset)) { // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer byteOffset = dir ? 0 : buffer.length - 1; } // Normalize byteOffset: negative offsets start from the end of the buffer if (byteOffset < 0) byteOffset = buffer.length + byteOffset; if (byteOffset >= buffer.length) { if (dir) return -1;else byteOffset = buffer.length - 1; } else if (byteOffset < 0) { if (dir) byteOffset = 0;else return -1; } // Normalize val if (typeof val === 'string') { val = Buffer.from(val, encoding); } // Finally, search either indexOf (if dir is true) or lastIndexOf if (Buffer.isBuffer(val)) { // Special case: looking for empty string/buffer always fails if (val.length === 0) { return -1; } return arrayIndexOf(buffer, val, byteOffset, encoding, dir); } else if (typeof val === 'number') { val = val & 0xFF; // Search for a byte value [0-255] if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') { if (dir) { return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset); } else { return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset); } } return arrayIndexOf(buffer, [val], byteOffset, encoding, dir); } throw new TypeError('val must be string, number or Buffer'); } function arrayIndexOf(arr, val, byteOffset, encoding, dir) { var indexSize = 1; var arrLength = arr.length; var valLength = val.length; if (encoding !== undefined) { encoding = String(encoding).toLowerCase(); if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') { if (arr.length < 2 || val.length < 2) { return -1; } indexSize = 2; arrLength /= 2; valLength /= 2; byteOffset /= 2; } } function read(buf, i) { if (indexSize === 1) { return buf[i]; } else { return buf.readUInt16BE(i * indexSize); } } var i; if (dir) { var foundIndex = -1; for (i = byteOffset; i < arrLength; i++) { if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { if (foundIndex === -1) foundIndex = i; if (i - foundIndex + 1 === valLength) return foundIndex * indexSize; } else { if (foundIndex !== -1) i -= i - foundIndex; foundIndex = -1; } } } else { if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength; for (i = byteOffset; i >= 0; i--) { var found = true; for (var j = 0; j < valLength; j++) { if (read(arr, i + j) !== read(val, j)) { found = false; break; } } if (found) return i; } } return -1; } Buffer.prototype.includes = function includes(val, byteOffset, encoding) { return this.indexOf(val, byteOffset, encoding) !== -1; }; Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) { return bidirectionalIndexOf(this, val, byteOffset, encoding, true); }; Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) { return bidirectionalIndexOf(this, val, byteOffset, encoding, false); }; function hexWrite(buf, string, offset, length) { offset = Number(offset) || 0; var remaining = buf.length - offset; if (!length) { length = remaining; } else { length = Number(length); if (length > remaining) { length = remaining; } } // must be an even number of digits var strLen = string.length; if (strLen % 2 !== 0) throw new TypeError('Invalid hex string'); if (length > strLen / 2) { length = strLen / 2; } for (var i = 0; i < length; ++i) { var parsed = parseInt(string.substr(i * 2, 2), 16); if (isNaN(parsed)) return i; buf[offset + i] = parsed; } return i; } function utf8Write(buf, string, offset, length) { return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length); } function asciiWrite(buf, string, offset, length) { return blitBuffer(asciiToBytes(string), buf, offset, length); } function latin1Write(buf, string, offset, length) { return asciiWrite(buf, string, offset, length); } function base64Write(buf, string, offset, length) { return blitBuffer(base64ToBytes(string), buf, offset, length); } function ucs2Write(buf, string, offset, length) { return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length); } Buffer.prototype.write = function write(string, offset, length, encoding) { // Buffer#write(string) if (offset === undefined) { encoding = 'utf8'; length = this.length; offset = 0; // Buffer#write(string, encoding) } else if (length === undefined && typeof offset === 'string') { encoding = offset; length = this.length; offset = 0; // Buffer#write(string, offset[, length][, encoding]) } else if (isFinite(offset)) { offset = offset | 0; if (isFinite(length)) { length = length | 0; if (encoding === undefined) encoding = 'utf8'; } else { encoding = length; length = undefined; } // legacy write(string, encoding, offset, length) - remove in v0.13 } else { throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported'); } var remaining = this.length - offset; if (length === undefined || length > remaining) length = remaining; if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) { throw new RangeError('Attempt to write outside buffer bounds'); } if (!encoding) encoding = 'utf8'; var loweredCase = false; for (;;) { switch (encoding) { case 'hex': return hexWrite(this, string, offset, length); case 'utf8': case 'utf-8': return utf8Write(this, string, offset, length); case 'ascii': return asciiWrite(this, string, offset, length); case 'latin1': case 'binary': return latin1Write(this, string, offset, length); case 'base64': // Warning: maxLength not taken into account in base64Write return base64Write(this, string, offset, length); case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return ucs2Write(this, string, offset, length); default: if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding); encoding = ('' + encoding).toLowerCase(); loweredCase = true; } } }; Buffer.prototype.toJSON = function toJSON() { return { type: 'Buffer', data: Array.prototype.slice.call(this._arr || this, 0) }; }; function base64Slice(buf, start, end) { if (start === 0 && end === buf.length) { return base64.fromByteArray(buf); } else { return base64.fromByteArray(buf.slice(start, end)); } } function utf8Slice(buf, start, end) { end = Math.min(buf.length, end); var res = []; var i = start; while (i < end) { var firstByte = buf[i]; var codePoint = null; var bytesPerSequence = firstByte > 0xEF ? 4 : firstByte > 0xDF ? 3 : firstByte > 0xBF ? 2 : 1; if (i + bytesPerSequence <= end) { var secondByte, thirdByte, fourthByte, tempCodePoint; switch (bytesPerSequence) { case 1: if (firstByte < 0x80) { codePoint = firstByte; } break; case 2: secondByte = buf[i + 1]; if ((secondByte & 0xC0) === 0x80) { tempCodePoint = (firstByte & 0x1F) << 0x6 | secondByte & 0x3F; if (tempCodePoint > 0x7F) { codePoint = tempCodePoint; } } break; case 3: secondByte = buf[i + 1]; thirdByte = buf[i + 2]; if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | thirdByte & 0x3F; if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { codePoint = tempCodePoint; } } break; case 4: secondByte = buf[i + 1]; thirdByte = buf[i + 2]; fourthByte = buf[i + 3]; if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | fourthByte & 0x3F; if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { codePoint = tempCodePoint; } } } } if (codePoint === null) { // we did not generate a valid codePoint so insert a // replacement char (U+FFFD) and advance only 1 byte codePoint = 0xFFFD; bytesPerSequence = 1; } else if (codePoint > 0xFFFF) { // encode to utf16 (surrogate pair dance) codePoint -= 0x10000; res.push(codePoint >>> 10 & 0x3FF | 0xD800); codePoint = 0xDC00 | codePoint & 0x3FF; } res.push(codePoint); i += bytesPerSequence; } return decodeCodePointsArray(res); } // Based on http://stackoverflow.com/a/22747272/680742, the browser with // the lowest limit is Chrome, with 0x10000 args. // We go 1 magnitude less, for safety var MAX_ARGUMENTS_LENGTH = 0x1000; function decodeCodePointsArray(codePoints) { var len = codePoints.length; if (len <= MAX_ARGUMENTS_LENGTH) { return String.fromCharCode.apply(String, codePoints); // avoid extra slice() } // Decode in chunks to avoid "call stack size exceeded". var res = ''; var i = 0; while (i < len) { res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)); } return res; } function asciiSlice(buf, start, end) { var ret = ''; end = Math.min(buf.length, end); for (var i = start; i < end; ++i) { ret += String.fromCharCode(buf[i] & 0x7F); } return ret; } function latin1Slice(buf, start, end) { var ret = ''; end = Math.min(buf.length, end); for (var i = start; i < end; ++i) { ret += String.fromCharCode(buf[i]); } return ret; } function hexSlice(buf, start, end) { var len = buf.length; if (!start || start < 0) start = 0; if (!end || end < 0 || end > len) end = len; var out = ''; for (var i = start; i < end; ++i) { out += toHex(buf[i]); } return out; } function utf16leSlice(buf, start, end) { var bytes = buf.slice(start, end); var res = ''; for (var i = 0; i < bytes.length; i += 2) { res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); } return res; } Buffer.prototype.slice = function slice(start, end) { var len = this.length; start = ~~start; end = end === undefined ? len : ~~end; if (start < 0) { start += len; if (start < 0) start = 0; } else if (start > len) { start = len; } if (end < 0) { end += len; if (end < 0) end = 0; } else if (end > len) { end = len; } if (end < start) end = start; var newBuf; if (Buffer.TYPED_ARRAY_SUPPORT) { newBuf = this.subarray(start, end); newBuf.__proto__ = Buffer.prototype; } else { var sliceLen = end - start; newBuf = new Buffer(sliceLen, undefined); for (var i = 0; i < sliceLen; ++i) { newBuf[i] = this[i + start]; } } return newBuf; }; /* * Need to make sure that buffer isn't trying to write out of bounds. */ function checkOffset(offset, ext, length) { if (offset % 1 !== 0 || offset < 0) throw new RangeError('offset is not uint'); if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length'); } Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) { offset = offset | 0; byteLength = byteLength | 0; if (!noAssert) checkOffset(offset, byteLength, this.length); var val = this[offset]; var mul = 1; var i = 0; while (++i < byteLength && (mul *= 0x100)) { val += this[offset + i] * mul; } return val; }; Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) { offset = offset | 0; byteLength = byteLength | 0; if (!noAssert) { checkOffset(offset, byteLength, this.length); } var val = this[offset + --byteLength]; var mul = 1; while (byteLength > 0 && (mul *= 0x100)) { val += this[offset + --byteLength] * mul; } return val; }; Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) { if (!noAssert) checkOffset(offset, 1, this.length); return this[offset]; }; Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) { if (!noAssert) checkOffset(offset, 2, this.length); return this[offset] | this[offset + 1] << 8; }; Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) { if (!noAssert) checkOffset(offset, 2, this.length); return this[offset] << 8 | this[offset + 1]; }; Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length); return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 0x1000000; }; Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length); return this[offset] * 0x1000000 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]); }; Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) { offset = offset | 0; byteLength = byteLength | 0; if (!noAssert) checkOffset(offset, byteLength, this.length); var val = this[offset]; var mul = 1; var i = 0; while (++i < byteLength && (mul *= 0x100)) { val += this[offset + i] * mul; } mul *= 0x80; if (val >= mul) val -= Math.pow(2, 8 * byteLength); return val; }; Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) { offset = offset | 0; byteLength = byteLength | 0; if (!noAssert) checkOffset(offset, byteLength, this.length); var i = byteLength; var mul = 1; var val = this[offset + --i]; while (i > 0 && (mul *= 0x100)) { val += this[offset + --i] * mul; } mul *= 0x80; if (val >= mul) val -= Math.pow(2, 8 * byteLength); return val; }; Buffer.prototype.readInt8 = function readInt8(offset, noAssert) { if (!noAssert) checkOffset(offset, 1, this.length); if (!(this[offset] & 0x80)) return this[offset]; return (0xff - this[offset] + 1) * -1; }; Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) { if (!noAssert) checkOffset(offset, 2, this.length); var val = this[offset] | this[offset + 1] << 8; return val & 0x8000 ? val | 0xFFFF0000 : val; }; Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) { if (!noAssert) checkOffset(offset, 2, this.length); var val = this[offset + 1] | this[offset] << 8; return val & 0x8000 ? val | 0xFFFF0000 : val; }; Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length); return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24; }; Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length); return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]; }; Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length); return ieee754.read(this, offset, true, 23, 4); }; Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length); return ieee754.read(this, offset, false, 23, 4); }; Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) { if (!noAssert) checkOffset(offset, 8, this.length); return ieee754.read(this, offset, true, 52, 8); }; Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) { if (!noAssert) checkOffset(offset, 8, this.length); return ieee754.read(this, offset, false, 52, 8); }; function checkInt(buf, value, offset, ext, max, min) { if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance'); if (value > max || value < min) throw new RangeError('"value" argument is out of bounds'); if (offset + ext > buf.length) throw new RangeError('Index out of range'); } Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) { value = +value; offset = offset | 0; byteLength = byteLength | 0; if (!noAssert) { var maxBytes = Math.pow(2, 8 * byteLength) - 1; checkInt(this, value, offset, byteLength, maxBytes, 0); } var mul = 1; var i = 0; this[offset] = value & 0xFF; while (++i < byteLength && (mul *= 0x100)) { this[offset + i] = value / mul & 0xFF; } return offset + byteLength; }; Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) { value = +value; offset = offset | 0; byteLength = byteLength | 0; if (!noAssert) { var maxBytes = Math.pow(2, 8 * byteLength) - 1; checkInt(this, value, offset, byteLength, maxBytes, 0); } var i = byteLength - 1; var mul = 1; this[offset + i] = value & 0xFF; while (--i >= 0 && (mul *= 0x100)) { this[offset + i] = value / mul & 0xFF; } return offset + byteLength; }; Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) { value = +value; offset = offset | 0; if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0); if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value); this[offset] = value & 0xff; return offset + 1; }; function objectWriteUInt16(buf, value, offset, littleEndian) { if (value < 0) value = 0xffff + value + 1; for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) { buf[offset + i] = (value & 0xff << 8 * (littleEndian ? i : 1 - i)) >>> (littleEndian ? i : 1 - i) * 8; } } Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) { value = +value; offset = offset | 0; if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = value & 0xff; this[offset + 1] = value >>> 8; } else { objectWriteUInt16(this, value, offset, true); } return offset + 2; }; Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) { value = +value; offset = offset | 0; if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = value >>> 8; this[offset + 1] = value & 0xff; } else { objectWriteUInt16(this, value, offset, false); } return offset + 2; }; function objectWriteUInt32(buf, value, offset, littleEndian) { if (value < 0) value = 0xffffffff + value + 1; for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) { buf[offset + i] = value >>> (littleEndian ? i : 3 - i) * 8 & 0xff; } } Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) { value = +value; offset = offset | 0; if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset + 3] = value >>> 24; this[offset + 2] = value >>> 16; this[offset + 1] = value >>> 8; this[offset] = value & 0xff; } else { objectWriteUInt32(this, value, offset, true); } return offset + 4; }; Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) { value = +value; offset = offset | 0; if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = value >>> 24; this[offset + 1] = value >>> 16; this[offset + 2] = value >>> 8; this[offset + 3] = value & 0xff; } else { objectWriteUInt32(this, value, offset, false); } return offset + 4; }; Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) { value = +value; offset = offset | 0; if (!noAssert) { var limit = Math.pow(2, 8 * byteLength - 1); checkInt(this, value, offset, byteLength, limit - 1, -limit); } var i = 0; var mul = 1; var sub = 0; this[offset] = value & 0xFF; while (++i < byteLength && (mul *= 0x100)) { if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { sub = 1; } this[offset + i] = (value / mul >> 0) - sub & 0xFF; } return offset + byteLength; }; Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) { value = +value; offset = offset | 0; if (!noAssert) { var limit = Math.pow(2, 8 * byteLength - 1); checkInt(this, value, offset, byteLength, limit - 1, -limit); } var i = byteLength - 1; var mul = 1; var sub = 0; this[offset + i] = value & 0xFF; while (--i >= 0 && (mul *= 0x100)) { if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { sub = 1; } this[offset + i] = (value / mul >> 0) - sub & 0xFF; } return offset + byteLength; }; Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) { value = +value; offset = offset | 0; if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80); if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value); if (value < 0) value = 0xff + value + 1; this[offset] = value & 0xff; return offset + 1; }; Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) { value = +value; offset = offset | 0; if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000); if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = value & 0xff; this[offset + 1] = value >>> 8; } else { objectWriteUInt16(this, value, offset, true); } return offset + 2; }; Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) { value = +value; offset = offset | 0; if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000); if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = value >>> 8; this[offset + 1] = value & 0xff; } else { objectWriteUInt16(this, value, offset, false); } return offset + 2; }; Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) { value = +value; offset = offset | 0; if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = value & 0xff; this[offset + 1] = value >>> 8; this[offset + 2] = value >>> 16; this[offset + 3] = value >>> 24; } else { objectWriteUInt32(this, value, offset, true); } return offset + 4; }; Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) { value = +value; offset = offset | 0; if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); if (value < 0) value = 0xffffffff + value + 1; if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = value >>> 24; this[offset + 1] = value >>> 16; this[offset + 2] = value >>> 8; this[offset + 3] = value & 0xff; } else { objectWriteUInt32(this, value, offset, false); } return offset + 4; }; function checkIEEE754(buf, value, offset, ext, max, min) { if (offset + ext > buf.length) throw new RangeError('Index out of range'); if (offset < 0) throw new RangeError('Index out of range'); } function writeFloat(buf, value, offset, littleEndian, noAssert) { if (!noAssert) { checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38); } ieee754.write(buf, value, offset, littleEndian, 23, 4); return offset + 4; } Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) { return writeFloat(this, value, offset, true, noAssert); }; Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) { return writeFloat(this, value, offset, false, noAssert); }; function writeDouble(buf, value, offset, littleEndian, noAssert) { if (!noAssert) { checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308); } ieee754.write(buf, value, offset, littleEndian, 52, 8); return offset + 8; } Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) { return writeDouble(this, value, offset, true, noAssert); }; Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) { return writeDouble(this, value, offset, false, noAssert); }; // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) Buffer.prototype.copy = function copy(target, targetStart, start, end) { if (!start) start = 0; if (!end && end !== 0) end = this.length; if (targetStart >= target.length) targetStart = target.length; if (!targetStart) targetStart = 0; if (end > 0 && end < start) end = start; // Copy 0 bytes; we're done if (end === start) return 0; if (target.length === 0 || this.length === 0) return 0; // Fatal error conditions if (targetStart < 0) { throw new RangeError('targetStart out of bounds'); } if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds'); if (end < 0) throw new RangeError('sourceEnd out of bounds'); // Are we oob? if (end > this.length) end = this.length; if (target.length - targetStart < end - start) { end = target.length - targetStart + start; } var len = end - start; var i; if (this === target && start < targetStart && targetStart < end) { // descending copy from end for (i = len - 1; i >= 0; --i) { target[i + targetStart] = this[i + start]; } } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { // ascending copy from start for (i = 0; i < len; ++i) { target[i + targetStart] = this[i + start]; } } else { Uint8Array.prototype.set.call(target, this.subarray(start, start + len), targetStart); } return len; }; // Usage: // buffer.fill(number[, offset[, end]]) // buffer.fill(buffer[, offset[, end]]) // buffer.fill(string[, offset[, end]][, encoding]) Buffer.prototype.fill = function fill(val, start, end, encoding) { // Handle string cases: if (typeof val === 'string') { if (typeof start === 'string') { encoding = start; start = 0; end = this.length; } else if (typeof end === 'string') { encoding = end; end = this.length; } if (val.length === 1) { var code = val.charCodeAt(0); if (code < 256) { val = code; } } if (encoding !== undefined && typeof encoding !== 'string') { throw new TypeError('encoding must be a string'); } if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { throw new TypeError('Unknown encoding: ' + encoding); } } else if (typeof val === 'number') { val = val & 255; } // Invalid ranges are not set to a default, so can range check early. if (start < 0 || this.length < start || this.length < end) { throw new RangeError('Out of range index'); } if (end <= start) { return this; } start = start >>> 0; end = end === undefined ? this.length : end >>> 0; if (!val) val = 0; var i; if (typeof val === 'number') { for (i = start; i < end; ++i) { this[i] = val; } } else { var bytes = Buffer.isBuffer(val) ? val : utf8ToBytes(new Buffer(val, encoding).toString()); var len = bytes.length; for (i = 0; i < end - start; ++i) { this[i + start] = bytes[i % len]; } } return this; }; // HELPER FUNCTIONS // ================ var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g; function base64clean(str) { // Node strips out invalid characters like \n and \t from the string, base64-js does not str = stringtrim(str).replace(INVALID_BASE64_RE, ''); // Node converts strings with length < 2 to '' if (str.length < 2) return ''; // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not while (str.length % 4 !== 0) { str = str + '='; } return str; } function stringtrim(str) { if (str.trim) return str.trim(); return str.replace(/^\s+|\s+$/g, ''); } function toHex(n) { if (n < 16) return '0' + n.toString(16); return n.toString(16); } function utf8ToBytes(string, units) { units = units || Infinity; var codePoint; var length = string.length; var leadSurrogate = null; var bytes = []; for (var i = 0; i < length; ++i) { codePoint = string.charCodeAt(i); // is surrogate component if (codePoint > 0xD7FF && codePoint < 0xE000) { // last char was a lead if (!leadSurrogate) { // no lead yet if (codePoint > 0xDBFF) { // unexpected trail if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); continue; } else if (i + 1 === length) { // unpaired lead if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); continue; } // valid lead leadSurrogate = codePoint; continue; } // 2 leads in a row if (codePoint < 0xDC00) { if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); leadSurrogate = codePoint; continue; } // valid surrogate pair codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000; } else if (leadSurrogate) { // valid bmp char, but last char was a lead if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); } leadSurrogate = null; // encode utf8 if (codePoint < 0x80) { if ((units -= 1) < 0) break; bytes.push(codePoint); } else if (codePoint < 0x800) { if ((units -= 2) < 0) break; bytes.push(codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80); } else if (codePoint < 0x10000) { if ((units -= 3) < 0) break; bytes.push(codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80); } else if (codePoint < 0x110000) { if ((units -= 4) < 0) break; bytes.push(codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80); } else { throw new Error('Invalid code point'); } } return bytes; } function asciiToBytes(str) { var byteArray = []; for (var i = 0; i < str.length; ++i) { // Node's code seems to be doing this and not & 0x7F.. byteArray.push(str.charCodeAt(i) & 0xFF); } return byteArray; } function utf16leToBytes(str, units) { var c, hi, lo; var byteArray = []; for (var i = 0; i < str.length; ++i) { if ((units -= 2) < 0) break; c = str.charCodeAt(i); hi = c >> 8; lo = c % 256; byteArray.push(lo); byteArray.push(hi); } return byteArray; } function base64ToBytes(str) { return base64.toByteArray(base64clean(str)); } function blitBuffer(src, dst, offset, length) { for (var i = 0; i < length; ++i) { if (i + offset >= dst.length || i >= src.length) break; dst[i + offset] = src[i]; } return i; } function isnan(val) { return val !== val; // eslint-disable-line no-self-compare } /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(15))) /***/ }), /* 248 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.byteLength = byteLength; exports.toByteArray = toByteArray; exports.fromByteArray = fromByteArray; var lookup = []; var revLookup = []; var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; for (var i = 0, len = code.length; i < len; ++i) { lookup[i] = code[i]; revLookup[code.charCodeAt(i)] = i; } // Support decoding URL-safe base64 strings, as Node.js does. // See: https://en.wikipedia.org/wiki/Base64#URL_applications revLookup['-'.charCodeAt(0)] = 62; revLookup['_'.charCodeAt(0)] = 63; function getLens(b64) { var len = b64.length; if (len % 4 > 0) { throw new Error('Invalid string. Length must be a multiple of 4'); } // Trim off extra bytes after placeholder bytes are found // See: https://github.com/beatgammit/base64-js/issues/42 var validLen = b64.indexOf('='); if (validLen === -1) validLen = len; var placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4; return [validLen, placeHoldersLen]; } // base64 is 4/3 + up to two characters of the original data function byteLength(b64) { var lens = getLens(b64); var validLen = lens[0]; var placeHoldersLen = lens[1]; return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; } function _byteLength(b64, validLen, placeHoldersLen) { return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; } function toByteArray(b64) { var tmp; var lens = getLens(b64); var validLen = lens[0]; var placeHoldersLen = lens[1]; var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); var curByte = 0; // if there are placeholders, only get up to the last complete 4 chars var len = placeHoldersLen > 0 ? validLen - 4 : validLen; for (var i = 0; i < len; i += 4) { tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)]; arr[curByte++] = tmp >> 16 & 0xFF; arr[curByte++] = tmp >> 8 & 0xFF; arr[curByte++] = tmp & 0xFF; } if (placeHoldersLen === 2) { tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4; arr[curByte++] = tmp & 0xFF; } if (placeHoldersLen === 1) { tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2; arr[curByte++] = tmp >> 8 & 0xFF; arr[curByte++] = tmp & 0xFF; } return arr; } function tripletToBase64(num) { return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]; } function encodeChunk(uint8, start, end) { var tmp; var output = []; for (var i = start; i < end; i += 3) { tmp = (uint8[i] << 16 & 0xFF0000) + (uint8[i + 1] << 8 & 0xFF00) + (uint8[i + 2] & 0xFF); output.push(tripletToBase64(tmp)); } return output.join(''); } function fromByteArray(uint8) { var tmp; var len = uint8.length; var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes var parts = []; var maxChunkLength = 16383; // must be multiple of 3 // go through the array every three bytes, we'll deal with trailing stuff later for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength)); } // pad the end with zeros, but make sure to not forget the extra bytes if (extraBytes === 1) { tmp = uint8[len - 1]; parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 0x3F] + '=='); } else if (extraBytes === 2) { tmp = (uint8[len - 2] << 8) + uint8[len - 1]; parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 0x3F] + lookup[tmp << 2 & 0x3F] + '='); } return parts.join(''); } /***/ }), /* 249 */ /***/ (function(module, exports) { exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m; var eLen = nBytes * 8 - mLen - 1; var eMax = (1 << eLen) - 1; var eBias = eMax >> 1; var nBits = -7; var i = isLE ? nBytes - 1 : 0; var d = isLE ? -1 : 1; var s = buffer[offset + i]; i += d; e = s & (1 << -nBits) - 1; s >>= -nBits; nBits += eLen; for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} m = e & (1 << -nBits) - 1; e >>= -nBits; nBits += mLen; for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} if (e === 0) { e = 1 - eBias; } else if (e === eMax) { return m ? NaN : (s ? -1 : 1) * Infinity; } else { m = m + Math.pow(2, mLen); e = e - eBias; } return (s ? -1 : 1) * m * Math.pow(2, e - mLen); }; exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { var e, m, c; var eLen = nBytes * 8 - mLen - 1; var eMax = (1 << eLen) - 1; var eBias = eMax >> 1; var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; var i = isLE ? 0 : nBytes - 1; var d = isLE ? 1 : -1; var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; value = Math.abs(value); if (isNaN(value) || value === Infinity) { m = isNaN(value) ? 1 : 0; e = eMax; } else { e = Math.floor(Math.log(value) / Math.LN2); if (value * (c = Math.pow(2, -e)) < 1) { e--; c *= 2; } if (e + eBias >= 1) { value += rt / c; } else { value += rt * Math.pow(2, 1 - eBias); } if (value * c >= 2) { e++; c /= 2; } if (e + eBias >= eMax) { m = 0; e = eMax; } else if (e + eBias >= 1) { m = (value * c - 1) * Math.pow(2, mLen); e = e + eBias; } else { m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); e = 0; } } for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} e = e << mLen | m; eLen += mLen; for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} buffer[offset + i - d] |= s * 128; }; /***/ }), /* 250 */ /***/ (function(module, exports) { var toString = {}.toString; module.exports = Array.isArray || function (arr) { return toString.call(arr) == '[object Array]'; }; /***/ }), /* 251 */ /***/ (function(module, exports) { module.exports = function (module) { if (!module.webpackPolyfill) { module.deprecate = function () {}; module.paths = []; // module.parent = undefined by default if (!module.children) module.children = []; Object.defineProperty(module, "loaded", { enumerable: true, get: function get() { return module.l; } }); Object.defineProperty(module, "id", { enumerable: true, get: function get() { return module.i; } }); module.webpackPolyfill = 1; } return module; }; /***/ }), /* 252 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return HorizontalRuleBlot; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_quill__ = __webpack_require__(133); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_quill___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_quill__); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // For more information on writing custom Blots: // https://github.com/quilljs/quill/issues/2371#issuecomment-454819412 var Embed = __WEBPACK_IMPORTED_MODULE_0_quill___default.a.import('blots/embed'); var HorizontalRuleBlot = function (_Embed) { _inherits(HorizontalRuleBlot, _Embed); function HorizontalRuleBlot() { _classCallCheck(this, HorizontalRuleBlot); return _possibleConstructorReturn(this, (HorizontalRuleBlot.__proto__ || Object.getPrototypeOf(HorizontalRuleBlot)).apply(this, arguments)); } _createClass(HorizontalRuleBlot, null, [{ key: 'action', value: function action(quill, event) { var range = quill.getSelection(true); quill.insertText(range.index, '\n', __WEBPACK_IMPORTED_MODULE_0_quill___default.a.sources.USER); quill.insertEmbed(range.index + 1, HorizontalRuleBlot.name, true, __WEBPACK_IMPORTED_MODULE_0_quill___default.a.sources.USER); quill.setSelection(range.index + 2, __WEBPACK_IMPORTED_MODULE_0_quill___default.a.sources.SILENT); } }, { key: 'name', get: function get() { return 'horizontal-rule'; } }, { key: 'tag', get: function get() { return 'hr'; } }]); return HorizontalRuleBlot; }(Embed);; /***/ }), /* 253 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initSteppers; /* unused harmony export VStepper */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__mixins_event_handler__ = __webpack_require__(4); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__base_container__ = __webpack_require__(10); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__base_component__ = __webpack_require__(1); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function initSteppers(e) { console.debug('\tStepper'); Object(__WEBPACK_IMPORTED_MODULE_2__base_component__["c" /* hookupComponents */])(e, '.v-stepper', VStepper, null); } var VStepper = function (_eventHandlerMixin) { _inherits(VStepper, _eventHandlerMixin); function VStepper(element, mdcComponent) { _classCallCheck(this, VStepper); var _this = _possibleConstructorReturn(this, (VStepper.__proto__ || Object.getPrototypeOf(VStepper)).call(this, element, mdcComponent)); if (typeof componentHandler !== 'undefined') { // MDL is loaded? componentHandler.upgradeElement(element); _this.stepper = element.MaterialStepper; } return _this; } _createClass(VStepper, [{ key: "inputs", value: function inputs() { // A stepper content area does not live within the stepper element so let's get it from the right place return document.querySelectorAll('#' + this.element.id + '-content .v-input'); } }, { key: "navigate", value: function navigate(nav_action) { if (nav_action === 'continue' || nav_action === 'next') { this.next_step(); } else if (nav_action === 'back') { this.back_step(); } else if (nav_action === 'skip') { this.skip_step(); } } }, { key: "next_step", value: function next_step() { this.stepper.next(); } }, { key: "back_step", value: function back_step() { this.stepper.back(); } }, { key: "skip_step", value: function skip_step() { this.stepper.skip(); } }]); return VStepper; }(Object(__WEBPACK_IMPORTED_MODULE_0__mixins_event_handler__["a" /* eventHandlerMixin */])(__WEBPACK_IMPORTED_MODULE_1__base_container__["a" /* VBaseContainer */])); /***/ }), /* 254 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initRadios; /* unused harmony export VRadio */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__base_component__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__base_toggle__ = __webpack_require__(27); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_radio__ = __webpack_require__(255); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function initRadios(e) { console.debug('\tRadios'); Object(__WEBPACK_IMPORTED_MODULE_0__base_component__["c" /* hookupComponents */])(e, '.v-radio', VRadio, __WEBPACK_IMPORTED_MODULE_2__material_radio__["a" /* MDCRadio */]); } var VRadio = function (_VBaseToggle) { _inherits(VRadio, _VBaseToggle); function VRadio(element, mdcComponent) { _classCallCheck(this, VRadio); return _possibleConstructorReturn(this, (VRadio.__proto__ || Object.getPrototypeOf(VRadio)).call(this, element, mdcComponent)); } return VRadio; }(__WEBPACK_IMPORTED_MODULE_1__base_toggle__["a" /* VBaseToggle */]); /***/ }), /* 255 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__component__ = __webpack_require__(256); /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__component__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(135); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(134); /* unused harmony namespace reexport */ /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ //# sourceMappingURL=index.js.map /***/ }), /* 256 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCRadio; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_dom_events__ = __webpack_require__(8); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_ripple_component__ = __webpack_require__(6); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_ripple_foundation__ = __webpack_require__(9); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation__ = __webpack_require__(134); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCRadio = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCRadio, _super); function MDCRadio() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.ripple_ = _this.createRipple_(); return _this; } MDCRadio.attachTo = function (root) { return new MDCRadio(root); }; Object.defineProperty(MDCRadio.prototype, "checked", { get: function get() { return this.nativeControl_.checked; }, set: function set(checked) { this.nativeControl_.checked = checked; }, enumerable: true, configurable: true }); Object.defineProperty(MDCRadio.prototype, "disabled", { get: function get() { return this.nativeControl_.disabled; }, set: function set(disabled) { this.foundation_.setDisabled(disabled); }, enumerable: true, configurable: true }); Object.defineProperty(MDCRadio.prototype, "value", { get: function get() { return this.nativeControl_.value; }, set: function set(value) { this.nativeControl_.value = value; }, enumerable: true, configurable: true }); Object.defineProperty(MDCRadio.prototype, "ripple", { get: function get() { return this.ripple_; }, enumerable: true, configurable: true }); MDCRadio.prototype.destroy = function () { this.ripple_.destroy(); _super.prototype.destroy.call(this); }; MDCRadio.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. var adapter = { addClass: function addClass(className) { return _this.root_.classList.add(className); }, removeClass: function removeClass(className) { return _this.root_.classList.remove(className); }, setNativeControlDisabled: function setNativeControlDisabled(disabled) { return _this.nativeControl_.disabled = disabled; } }; return new __WEBPACK_IMPORTED_MODULE_5__foundation__["a" /* MDCRadioFoundation */](adapter); }; MDCRadio.prototype.createRipple_ = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. var adapter = __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, __WEBPACK_IMPORTED_MODULE_3__material_ripple_component__["a" /* MDCRipple */].createAdapter(this), { registerInteractionHandler: function registerInteractionHandler(evtType, handler) { return _this.nativeControl_.addEventListener(evtType, handler, Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_events__["a" /* applyPassive */])()); }, deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) { return _this.nativeControl_.removeEventListener(evtType, handler, Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_events__["a" /* applyPassive */])()); }, // Radio buttons technically go "active" whenever there is *any* keyboard interaction. // This is not the UI we desire. isSurfaceActive: function isSurfaceActive() { return false; }, isUnbounded: function isUnbounded() { return true; } }); // tslint:enable:object-literal-sort-keys return new __WEBPACK_IMPORTED_MODULE_3__material_ripple_component__["a" /* MDCRipple */](this.root_, new __WEBPACK_IMPORTED_MODULE_4__material_ripple_foundation__["a" /* MDCRippleFoundation */](adapter)); }; Object.defineProperty(MDCRadio.prototype, "nativeControl_", { get: function get() { var NATIVE_CONTROL_SELECTOR = __WEBPACK_IMPORTED_MODULE_5__foundation__["a" /* MDCRadioFoundation */].strings.NATIVE_CONTROL_SELECTOR; var el = this.root_.querySelector(NATIVE_CONTROL_SELECTOR); if (!el) { throw new Error("Radio component requires a " + NATIVE_CONTROL_SELECTOR + " element"); } return el; }, enumerable: true, configurable: true }); return MDCRadio; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 257 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initSliders; /* unused harmony export VSlider */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__base_component__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_event_handler__ = __webpack_require__(4); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_slider__ = __webpack_require__(258); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__mixins_visibility_observer__ = __webpack_require__(44); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__events__ = __webpack_require__(45); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__mixins_dirtyable__ = __webpack_require__(11); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function initSliders(e) { console.debug('\tSliders'); Object(__WEBPACK_IMPORTED_MODULE_0__base_component__["c" /* hookupComponents */])(e, '.v-slider', VSlider, __WEBPACK_IMPORTED_MODULE_2__material_slider__["a" /* MDCSlider */]); } var VSlider = function (_dirtyableMixin) { _inherits(VSlider, _dirtyableMixin); function VSlider(element, mdcComponent) { _classCallCheck(this, VSlider); var _this = _possibleConstructorReturn(this, (VSlider.__proto__ || Object.getPrototypeOf(VSlider)).call(this, element, mdcComponent)); _this.recalcWhenVisible(_this); _this.originalValue = _this.value(); return _this; } _createClass(VSlider, [{ key: 'prepareSubmit', value: function prepareSubmit(params) { params.push([this.name(), this.value()]); } }, { key: 'name', value: function name() { return this.element.getAttribute('data-name'); } }, { key: 'value', value: function value() { return this.mdcComponent.value; } }, { key: 'clear', value: function clear() { this.setValue(0); } }, { key: 'reset', value: function reset() { this.setValue(this.originalValue); } }, { key: 'setValue', value: function setValue(value) { this.mdcComponent.value = value; } }, { key: 'isDirty', value: function isDirty() { return this.dirtyable && this.value() !== this.originalValue; } }, { key: 'initEventListener', value: function initEventListener(eventName, eventHandler) { if (eventName === 'change') { eventName = 'MDCSlider:change'; } _get(VSlider.prototype.__proto__ || Object.getPrototypeOf(VSlider.prototype), 'initEventListener', this).call(this, eventName, eventHandler); } }, { key: 'createEventHandler', value: function createEventHandler(actionsData, root) { return function (event) { // The MDC slider was firing duplicate change events - this prevents that if (!this.lastEvent || event.timeStamp - this.lastEvent.timeStamp > 10.0) { new __WEBPACK_IMPORTED_MODULE_4__events__["a" /* VEvents */](actionsData, event, root).call(); } this.lastEvent = event; }; } }]); return VSlider; }(Object(__WEBPACK_IMPORTED_MODULE_5__mixins_dirtyable__["a" /* dirtyableMixin */])(Object(__WEBPACK_IMPORTED_MODULE_3__mixins_visibility_observer__["a" /* visibilityObserverMixin */])(Object(__WEBPACK_IMPORTED_MODULE_1__mixins_event_handler__["a" /* eventHandlerMixin */])(__WEBPACK_IMPORTED_MODULE_0__base_component__["a" /* VBaseComponent */])))); /***/ }), /* 258 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__component__ = __webpack_require__(259); /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__component__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(55); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(136); /* unused harmony namespace reexport */ /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ //# sourceMappingURL=index.js.map /***/ }), /* 259 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCSlider; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_dom_events__ = __webpack_require__(8); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(55); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation__ = __webpack_require__(136); /** * @license * Copyright 2017 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCSlider = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCSlider, _super); function MDCSlider() { return _super !== null && _super.apply(this, arguments) || this; } MDCSlider.attachTo = function (root) { return new MDCSlider(root); }; Object.defineProperty(MDCSlider.prototype, "value", { get: function get() { return this.foundation_.getValue(); }, set: function set(value) { this.foundation_.setValue(value); }, enumerable: true, configurable: true }); Object.defineProperty(MDCSlider.prototype, "min", { get: function get() { return this.foundation_.getMin(); }, set: function set(min) { this.foundation_.setMin(min); }, enumerable: true, configurable: true }); Object.defineProperty(MDCSlider.prototype, "max", { get: function get() { return this.foundation_.getMax(); }, set: function set(max) { this.foundation_.setMax(max); }, enumerable: true, configurable: true }); Object.defineProperty(MDCSlider.prototype, "step", { get: function get() { return this.foundation_.getStep(); }, set: function set(step) { this.foundation_.setStep(step); }, enumerable: true, configurable: true }); Object.defineProperty(MDCSlider.prototype, "disabled", { get: function get() { return this.foundation_.isDisabled(); }, set: function set(disabled) { this.foundation_.setDisabled(disabled); }, enumerable: true, configurable: true }); MDCSlider.prototype.initialize = function () { this.thumbContainer_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].THUMB_CONTAINER_SELECTOR); this.track_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRACK_SELECTOR); this.pinValueMarker_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].PIN_VALUE_MARKER_SELECTOR); this.trackMarkerContainer_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRACK_MARKER_CONTAINER_SELECTOR); }; MDCSlider.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. var adapter = { hasClass: function hasClass(className) { return _this.root_.classList.contains(className); }, addClass: function addClass(className) { return _this.root_.classList.add(className); }, removeClass: function removeClass(className) { return _this.root_.classList.remove(className); }, getAttribute: function getAttribute(name) { return _this.root_.getAttribute(name); }, setAttribute: function setAttribute(name, value) { return _this.root_.setAttribute(name, value); }, removeAttribute: function removeAttribute(name) { return _this.root_.removeAttribute(name); }, computeBoundingRect: function computeBoundingRect() { return _this.root_.getBoundingClientRect(); }, getTabIndex: function getTabIndex() { return _this.root_.tabIndex; }, registerInteractionHandler: function registerInteractionHandler(evtType, handler) { return _this.listen(evtType, handler, Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_events__["a" /* applyPassive */])()); }, deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) { return _this.unlisten(evtType, handler, Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_events__["a" /* applyPassive */])()); }, registerThumbContainerInteractionHandler: function registerThumbContainerInteractionHandler(evtType, handler) { _this.thumbContainer_.addEventListener(evtType, handler, Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_events__["a" /* applyPassive */])()); }, deregisterThumbContainerInteractionHandler: function deregisterThumbContainerInteractionHandler(evtType, handler) { _this.thumbContainer_.removeEventListener(evtType, handler, Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_events__["a" /* applyPassive */])()); }, registerBodyInteractionHandler: function registerBodyInteractionHandler(evtType, handler) { return document.body.addEventListener(evtType, handler); }, deregisterBodyInteractionHandler: function deregisterBodyInteractionHandler(evtType, handler) { return document.body.removeEventListener(evtType, handler); }, registerResizeHandler: function registerResizeHandler(handler) { return window.addEventListener('resize', handler); }, deregisterResizeHandler: function deregisterResizeHandler(handler) { return window.removeEventListener('resize', handler); }, notifyInput: function notifyInput() { return _this.emit(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].INPUT_EVENT, _this); }, notifyChange: function notifyChange() { return _this.emit(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].CHANGE_EVENT, _this); }, setThumbContainerStyleProperty: function setThumbContainerStyleProperty(propertyName, value) { _this.thumbContainer_.style.setProperty(propertyName, value); }, setTrackStyleProperty: function setTrackStyleProperty(propertyName, value) { return _this.track_.style.setProperty(propertyName, value); }, setMarkerValue: function setMarkerValue(value) { return _this.pinValueMarker_.innerText = value.toLocaleString(); }, appendTrackMarkers: function appendTrackMarkers(numMarkers) { var frag = document.createDocumentFragment(); for (var i = 0; i < numMarkers; i++) { var marker = document.createElement('div'); marker.classList.add('mdc-slider__track-marker'); frag.appendChild(marker); } _this.trackMarkerContainer_.appendChild(frag); }, removeTrackMarkers: function removeTrackMarkers() { while (_this.trackMarkerContainer_.firstChild) { _this.trackMarkerContainer_.removeChild(_this.trackMarkerContainer_.firstChild); } }, setLastTrackMarkersStyleProperty: function setLastTrackMarkersStyleProperty(propertyName, value) { // We remove and append new nodes, thus, the last track marker must be dynamically found. var lastTrackMarker = _this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].LAST_TRACK_MARKER_SELECTOR); lastTrackMarker.style.setProperty(propertyName, value); }, isRTL: function isRTL() { return getComputedStyle(_this.root_).direction === 'rtl'; } }; // tslint:enable:object-literal-sort-keys return new __WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* MDCSliderFoundation */](adapter); }; MDCSlider.prototype.initialSyncWithDOM = function () { var origValueNow = this.parseFloat_(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ARIA_VALUENOW), this.value); var min = this.parseFloat_(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ARIA_VALUEMIN), this.min); var max = this.parseFloat_(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ARIA_VALUEMAX), this.max); // min and max need to be set in the right order to avoid throwing an error // when the new min is greater than the default max. if (min >= this.max) { this.max = max; this.min = min; } else { this.min = min; this.max = max; } this.step = this.parseFloat_(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].STEP_DATA_ATTR), this.step); this.value = origValueNow; this.disabled = this.root_.hasAttribute(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ARIA_DISABLED) && this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ARIA_DISABLED) !== 'false'; this.foundation_.setupTrackMarker(); }; MDCSlider.prototype.layout = function () { this.foundation_.layout(); }; MDCSlider.prototype.stepUp = function (amount) { if (amount === void 0) { amount = this.step || 1; } this.value += amount; }; MDCSlider.prototype.stepDown = function (amount) { if (amount === void 0) { amount = this.step || 1; } this.value -= amount; }; MDCSlider.prototype.parseFloat_ = function (str, defaultValue) { var num = parseFloat(str); // tslint:disable-line:ban var isNumeric = typeof num === 'number' && isFinite(num); return isNumeric ? num : defaultValue; }; return MDCSlider; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 260 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initHiddenFields; /* unused harmony export VHiddenField */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__base_component__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_dirtyable__ = __webpack_require__(11); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function initHiddenFields(e) { console.debug('\tHiddenFields'); Object(__WEBPACK_IMPORTED_MODULE_0__base_component__["c" /* hookupComponents */])(e, '.v-hidden-field', VHiddenField, null); } var VHiddenField = function (_dirtyableMixin) { _inherits(VHiddenField, _dirtyableMixin); function VHiddenField(element, mdcComponent) { _classCallCheck(this, VHiddenField); var _this = _possibleConstructorReturn(this, (VHiddenField.__proto__ || Object.getPrototypeOf(VHiddenField)).call(this, element, mdcComponent)); _this.originalValue = _this.value(); return _this; } // Called to collect data for submission _createClass(VHiddenField, [{ key: 'prepareSubmit', value: function prepareSubmit(params) { params.push([this.name(), this.value()]); } }, { key: 'name', value: function name() { return this.element.name; } }, { key: 'value', value: function value() { return this.element.value; } }, { key: 'clear', value: function clear() { this.setValue(''); } }, { key: 'reset', value: function reset() { this.element.value = this.originalValue; } }, { key: 'setValue', value: function setValue(value) { this.element.value = value; } }, { key: 'isDirty', value: function isDirty() { return this.dirtyable && this.value() !== this.originalValue; } }]); return VHiddenField; }(Object(__WEBPACK_IMPORTED_MODULE_1__mixins_dirtyable__["a" /* dirtyableMixin */])(__WEBPACK_IMPORTED_MODULE_0__base_component__["a" /* VBaseComponent */])); /***/ }), /* 261 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initContent; /* unused harmony export VContent */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__base_container__ = __webpack_require__(10); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__base_component__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__mixins_event_handler__ = __webpack_require__(4); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function initContent(e) { console.debug('\tContent'); Object(__WEBPACK_IMPORTED_MODULE_1__base_component__["c" /* hookupComponents */])(e, '.v-content', VContent, null); } var VContent = function (_eventHandlerMixin) { _inherits(VContent, _eventHandlerMixin); function VContent(element, mdcComponent) { _classCallCheck(this, VContent); return _possibleConstructorReturn(this, (VContent.__proto__ || Object.getPrototypeOf(VContent)).call(this, element, mdcComponent)); } return VContent; }(Object(__WEBPACK_IMPORTED_MODULE_2__mixins_event_handler__["a" /* eventHandlerMixin */])(__WEBPACK_IMPORTED_MODULE_0__base_container__["a" /* VBaseContainer */])); /***/ }), /* 262 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initGrid; /* unused harmony export VGrid */ /* unused harmony export VColumn */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__base_container__ = __webpack_require__(10); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__base_component__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__mixins_event_handler__ = __webpack_require__(4); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function initGrid(e) { console.debug('\tGrid'); Object(__WEBPACK_IMPORTED_MODULE_1__base_component__["c" /* hookupComponents */])(e, '.v-grid', VGrid, null); Object(__WEBPACK_IMPORTED_MODULE_1__base_component__["c" /* hookupComponents */])(e, '.v-column', VColumn, null); } var VGrid = function (_eventHandlerMixin) { _inherits(VGrid, _eventHandlerMixin); function VGrid(element, mdcComponent) { _classCallCheck(this, VGrid); return _possibleConstructorReturn(this, (VGrid.__proto__ || Object.getPrototypeOf(VGrid)).call(this, element, mdcComponent)); } return VGrid; }(Object(__WEBPACK_IMPORTED_MODULE_2__mixins_event_handler__["a" /* eventHandlerMixin */])(__WEBPACK_IMPORTED_MODULE_0__base_container__["a" /* VBaseContainer */])); var VColumn = function (_eventHandlerMixin2) { _inherits(VColumn, _eventHandlerMixin2); function VColumn(element, mdcComponent) { _classCallCheck(this, VColumn); return _possibleConstructorReturn(this, (VColumn.__proto__ || Object.getPrototypeOf(VColumn)).call(this, element, mdcComponent)); } return VColumn; }(Object(__WEBPACK_IMPORTED_MODULE_2__mixins_event_handler__["a" /* eventHandlerMixin */])(__WEBPACK_IMPORTED_MODULE_0__base_container__["a" /* VBaseContainer */])); /***/ }), /* 263 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initTabBars; /* unused harmony export VTabBar */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__base_component__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_event_handler__ = __webpack_require__(4); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_tab_bar__ = __webpack_require__(264); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function initTabBars(e) { console.debug('\tTab Bars'); Object(__WEBPACK_IMPORTED_MODULE_0__base_component__["c" /* hookupComponents */])(e, '.v-tab-bar', VTabBar, __WEBPACK_IMPORTED_MODULE_2__material_tab_bar__["a" /* MDCTabBar */]); } var VTabBar = function (_eventHandlerMixin) { _inherits(VTabBar, _eventHandlerMixin); function VTabBar(element, mdcComponent) { _classCallCheck(this, VTabBar); var _this = _possibleConstructorReturn(this, (VTabBar.__proto__ || Object.getPrototypeOf(VTabBar)).call(this, element, mdcComponent)); mdcComponent.listen('MDCTabBar:activated', function (event) { var tabs = element.parentElement.querySelectorAll('.v-tab-content'); var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = tabs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var _element = _step.value; if (Number(_element.dataset.tabId) == event.detail.index) { _element.classList.remove('v-hidden'); } else { _element.classList.add('v-hidden'); } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } }); return _this; } return VTabBar; }(Object(__WEBPACK_IMPORTED_MODULE_1__mixins_event_handler__["a" /* eventHandlerMixin */])(__WEBPACK_IMPORTED_MODULE_0__base_component__["a" /* VBaseComponent */])); /***/ }), /* 264 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__component__ = __webpack_require__(265); /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__component__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(140); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(139); /* unused harmony namespace reexport */ /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ //# sourceMappingURL=index.js.map /***/ }), /* 265 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTabBar; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_tab_scroller_component__ = __webpack_require__(266); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_tab_component__ = __webpack_require__(272); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_tab_foundation__ = __webpack_require__(138); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation__ = __webpack_require__(139); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var strings = __WEBPACK_IMPORTED_MODULE_5__foundation__["a" /* MDCTabBarFoundation */].strings; var tabIdCounter = 0; var MDCTabBar = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCTabBar, _super); function MDCTabBar() { return _super !== null && _super.apply(this, arguments) || this; } MDCTabBar.attachTo = function (root) { return new MDCTabBar(root); }; Object.defineProperty(MDCTabBar.prototype, "focusOnActivate", { set: function set(focusOnActivate) { this.tabList_.forEach(function (tab) { return tab.focusOnActivate = focusOnActivate; }); }, enumerable: true, configurable: true }); Object.defineProperty(MDCTabBar.prototype, "useAutomaticActivation", { set: function set(useAutomaticActivation) { this.foundation_.setUseAutomaticActivation(useAutomaticActivation); }, enumerable: true, configurable: true }); MDCTabBar.prototype.initialize = function (tabFactory, tabScrollerFactory) { if (tabFactory === void 0) { tabFactory = function tabFactory(el) { return new __WEBPACK_IMPORTED_MODULE_3__material_tab_component__["a" /* MDCTab */](el); }; } if (tabScrollerFactory === void 0) { tabScrollerFactory = function tabScrollerFactory(el) { return new __WEBPACK_IMPORTED_MODULE_2__material_tab_scroller_component__["a" /* MDCTabScroller */](el); }; } this.tabList_ = this.instantiateTabs_(tabFactory); this.tabScroller_ = this.instantiateTabScroller_(tabScrollerFactory); }; MDCTabBar.prototype.initialSyncWithDOM = function () { var _this = this; this.handleTabInteraction_ = function (evt) { return _this.foundation_.handleTabInteraction(evt); }; this.handleKeyDown_ = function (evt) { return _this.foundation_.handleKeyDown(evt); }; this.listen(__WEBPACK_IMPORTED_MODULE_4__material_tab_foundation__["a" /* MDCTabFoundation */].strings.INTERACTED_EVENT, this.handleTabInteraction_); this.listen('keydown', this.handleKeyDown_); for (var i = 0; i < this.tabList_.length; i++) { if (this.tabList_[i].active) { this.scrollIntoView(i); break; } } }; MDCTabBar.prototype.destroy = function () { _super.prototype.destroy.call(this); this.unlisten(__WEBPACK_IMPORTED_MODULE_4__material_tab_foundation__["a" /* MDCTabFoundation */].strings.INTERACTED_EVENT, this.handleTabInteraction_); this.unlisten('keydown', this.handleKeyDown_); this.tabList_.forEach(function (tab) { return tab.destroy(); }); if (this.tabScroller_) { this.tabScroller_.destroy(); } }; MDCTabBar.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. var adapter = { scrollTo: function scrollTo(scrollX) { return _this.tabScroller_.scrollTo(scrollX); }, incrementScroll: function incrementScroll(scrollXIncrement) { return _this.tabScroller_.incrementScroll(scrollXIncrement); }, getScrollPosition: function getScrollPosition() { return _this.tabScroller_.getScrollPosition(); }, getScrollContentWidth: function getScrollContentWidth() { return _this.tabScroller_.getScrollContentWidth(); }, getOffsetWidth: function getOffsetWidth() { return _this.root_.offsetWidth; }, isRTL: function isRTL() { return window.getComputedStyle(_this.root_).getPropertyValue('direction') === 'rtl'; }, setActiveTab: function setActiveTab(index) { return _this.foundation_.activateTab(index); }, activateTabAtIndex: function activateTabAtIndex(index, clientRect) { return _this.tabList_[index].activate(clientRect); }, deactivateTabAtIndex: function deactivateTabAtIndex(index) { return _this.tabList_[index].deactivate(); }, focusTabAtIndex: function focusTabAtIndex(index) { return _this.tabList_[index].focus(); }, getTabIndicatorClientRectAtIndex: function getTabIndicatorClientRectAtIndex(index) { return _this.tabList_[index].computeIndicatorClientRect(); }, getTabDimensionsAtIndex: function getTabDimensionsAtIndex(index) { return _this.tabList_[index].computeDimensions(); }, getPreviousActiveTabIndex: function getPreviousActiveTabIndex() { for (var i = 0; i < _this.tabList_.length; i++) { if (_this.tabList_[i].active) { return i; } } return -1; }, getFocusedTabIndex: function getFocusedTabIndex() { var tabElements = _this.getTabElements_(); var activeElement = document.activeElement; return tabElements.indexOf(activeElement); }, getIndexOfTabById: function getIndexOfTabById(id) { for (var i = 0; i < _this.tabList_.length; i++) { if (_this.tabList_[i].id === id) { return i; } } return -1; }, getTabListLength: function getTabListLength() { return _this.tabList_.length; }, notifyTabActivated: function notifyTabActivated(index) { return _this.emit(strings.TAB_ACTIVATED_EVENT, { index: index }, true); } }; // tslint:enable:object-literal-sort-keys return new __WEBPACK_IMPORTED_MODULE_5__foundation__["a" /* MDCTabBarFoundation */](adapter); }; /** * Activates the tab at the given index * @param index The index of the tab */ MDCTabBar.prototype.activateTab = function (index) { this.foundation_.activateTab(index); }; /** * Scrolls the tab at the given index into view * @param index THe index of the tab */ MDCTabBar.prototype.scrollIntoView = function (index) { this.foundation_.scrollIntoView(index); }; /** * Returns all the tab elements in a nice clean array */ MDCTabBar.prototype.getTabElements_ = function () { return [].slice.call(this.root_.querySelectorAll(strings.TAB_SELECTOR)); }; /** * Instantiates tab components on all child tab elements */ MDCTabBar.prototype.instantiateTabs_ = function (tabFactory) { return this.getTabElements_().map(function (el) { el.id = el.id || "mdc-tab-" + ++tabIdCounter; return tabFactory(el); }); }; /** * Instantiates tab scroller component on the child tab scroller element */ MDCTabBar.prototype.instantiateTabScroller_ = function (tabScrollerFactory) { var tabScrollerElement = this.root_.querySelector(strings.TAB_SCROLLER_SELECTOR); if (tabScrollerElement) { return tabScrollerFactory(tabScrollerElement); } return null; }; return MDCTabBar; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 266 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTabScroller; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_dom_events__ = __webpack_require__(8); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_dom_ponyfill__ = __webpack_require__(5); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation__ = __webpack_require__(267); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util__ = __webpack_require__(271); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCTabScroller = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCTabScroller, _super); function MDCTabScroller() { return _super !== null && _super.apply(this, arguments) || this; } MDCTabScroller.attachTo = function (root) { return new MDCTabScroller(root); }; MDCTabScroller.prototype.initialize = function () { this.area_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* MDCTabScrollerFoundation */].strings.AREA_SELECTOR); this.content_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* MDCTabScrollerFoundation */].strings.CONTENT_SELECTOR); }; MDCTabScroller.prototype.initialSyncWithDOM = function () { var _this = this; this.handleInteraction_ = function () { return _this.foundation_.handleInteraction(); }; this.handleTransitionEnd_ = function (evt) { return _this.foundation_.handleTransitionEnd(evt); }; this.area_.addEventListener('wheel', this.handleInteraction_, Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_events__["a" /* applyPassive */])()); this.area_.addEventListener('touchstart', this.handleInteraction_, Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_events__["a" /* applyPassive */])()); this.area_.addEventListener('pointerdown', this.handleInteraction_, Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_events__["a" /* applyPassive */])()); this.area_.addEventListener('mousedown', this.handleInteraction_, Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_events__["a" /* applyPassive */])()); this.area_.addEventListener('keydown', this.handleInteraction_, Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_events__["a" /* applyPassive */])()); this.content_.addEventListener('transitionend', this.handleTransitionEnd_); }; MDCTabScroller.prototype.destroy = function () { _super.prototype.destroy.call(this); this.area_.removeEventListener('wheel', this.handleInteraction_, Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_events__["a" /* applyPassive */])()); this.area_.removeEventListener('touchstart', this.handleInteraction_, Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_events__["a" /* applyPassive */])()); this.area_.removeEventListener('pointerdown', this.handleInteraction_, Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_events__["a" /* applyPassive */])()); this.area_.removeEventListener('mousedown', this.handleInteraction_, Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_events__["a" /* applyPassive */])()); this.area_.removeEventListener('keydown', this.handleInteraction_, Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_events__["a" /* applyPassive */])()); this.content_.removeEventListener('transitionend', this.handleTransitionEnd_); }; MDCTabScroller.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. var adapter = { eventTargetMatchesSelector: function eventTargetMatchesSelector(evtTarget, selector) { return Object(__WEBPACK_IMPORTED_MODULE_3__material_dom_ponyfill__["b" /* matches */])(evtTarget, selector); }, addClass: function addClass(className) { return _this.root_.classList.add(className); }, removeClass: function removeClass(className) { return _this.root_.classList.remove(className); }, addScrollAreaClass: function addScrollAreaClass(className) { return _this.area_.classList.add(className); }, setScrollAreaStyleProperty: function setScrollAreaStyleProperty(prop, value) { return _this.area_.style.setProperty(prop, value); }, setScrollContentStyleProperty: function setScrollContentStyleProperty(prop, value) { return _this.content_.style.setProperty(prop, value); }, getScrollContentStyleValue: function getScrollContentStyleValue(propName) { return window.getComputedStyle(_this.content_).getPropertyValue(propName); }, setScrollAreaScrollLeft: function setScrollAreaScrollLeft(scrollX) { return _this.area_.scrollLeft = scrollX; }, getScrollAreaScrollLeft: function getScrollAreaScrollLeft() { return _this.area_.scrollLeft; }, getScrollContentOffsetWidth: function getScrollContentOffsetWidth() { return _this.content_.offsetWidth; }, getScrollAreaOffsetWidth: function getScrollAreaOffsetWidth() { return _this.area_.offsetWidth; }, computeScrollAreaClientRect: function computeScrollAreaClientRect() { return _this.area_.getBoundingClientRect(); }, computeScrollContentClientRect: function computeScrollContentClientRect() { return _this.content_.getBoundingClientRect(); }, computeHorizontalScrollbarHeight: function computeHorizontalScrollbarHeight() { return __WEBPACK_IMPORTED_MODULE_5__util__["a" /* computeHorizontalScrollbarHeight */](document); } }; // tslint:enable:object-literal-sort-keys return new __WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* MDCTabScrollerFoundation */](adapter); }; /** * Returns the current visual scroll position */ MDCTabScroller.prototype.getScrollPosition = function () { return this.foundation_.getScrollPosition(); }; /** * Returns the width of the scroll content */ MDCTabScroller.prototype.getScrollContentWidth = function () { return this.content_.offsetWidth; }; /** * Increments the scroll value by the given amount * @param scrollXIncrement The pixel value by which to increment the scroll value */ MDCTabScroller.prototype.incrementScroll = function (scrollXIncrement) { this.foundation_.incrementScroll(scrollXIncrement); }; /** * Scrolls to the given pixel position * @param scrollX The pixel value to scroll to */ MDCTabScroller.prototype.scrollTo = function (scrollX) { this.foundation_.scrollTo(scrollX); }; return MDCTabScroller; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 267 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTabScrollerFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(137); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__rtl_default_scroller__ = __webpack_require__(268); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__rtl_negative_scroller__ = __webpack_require__(269); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__rtl_reverse_scroller__ = __webpack_require__(270); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCTabScrollerFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCTabScrollerFoundation, _super); function MDCTabScrollerFoundation(adapter) { var _this = _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCTabScrollerFoundation.defaultAdapter, adapter)) || this; /** * Controls whether we should handle the transitionend and interaction events during the animation. */ _this.isAnimating_ = false; return _this; } Object.defineProperty(MDCTabScrollerFoundation, "cssClasses", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCTabScrollerFoundation, "strings", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCTabScrollerFoundation, "defaultAdapter", { get: function get() { // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { eventTargetMatchesSelector: function eventTargetMatchesSelector() { return false; }, addClass: function addClass() { return undefined; }, removeClass: function removeClass() { return undefined; }, addScrollAreaClass: function addScrollAreaClass() { return undefined; }, setScrollAreaStyleProperty: function setScrollAreaStyleProperty() { return undefined; }, setScrollContentStyleProperty: function setScrollContentStyleProperty() { return undefined; }, getScrollContentStyleValue: function getScrollContentStyleValue() { return ''; }, setScrollAreaScrollLeft: function setScrollAreaScrollLeft() { return undefined; }, getScrollAreaScrollLeft: function getScrollAreaScrollLeft() { return 0; }, getScrollContentOffsetWidth: function getScrollContentOffsetWidth() { return 0; }, getScrollAreaOffsetWidth: function getScrollAreaOffsetWidth() { return 0; }, computeScrollAreaClientRect: function computeScrollAreaClientRect() { return { top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0 }; }, computeScrollContentClientRect: function computeScrollContentClientRect() { return { top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0 }; }, computeHorizontalScrollbarHeight: function computeHorizontalScrollbarHeight() { return 0; } }; // tslint:enable:object-literal-sort-keys }, enumerable: true, configurable: true }); MDCTabScrollerFoundation.prototype.init = function () { // Compute horizontal scrollbar height on scroller with overflow initially hidden, then update overflow to scroll // and immediately adjust bottom margin to avoid the scrollbar initially appearing before JS runs. var horizontalScrollbarHeight = this.adapter_.computeHorizontalScrollbarHeight(); this.adapter_.setScrollAreaStyleProperty('margin-bottom', -horizontalScrollbarHeight + 'px'); this.adapter_.addScrollAreaClass(MDCTabScrollerFoundation.cssClasses.SCROLL_AREA_SCROLL); }; /** * Computes the current visual scroll position */ MDCTabScrollerFoundation.prototype.getScrollPosition = function () { if (this.isRTL_()) { return this.computeCurrentScrollPositionRTL_(); } var currentTranslateX = this.calculateCurrentTranslateX_(); var scrollLeft = this.adapter_.getScrollAreaScrollLeft(); return scrollLeft - currentTranslateX; }; /** * Handles interaction events that occur during transition */ MDCTabScrollerFoundation.prototype.handleInteraction = function () { // Early exit if we aren't animating if (!this.isAnimating_) { return; } // Prevent other event listeners from handling this event this.stopScrollAnimation_(); }; /** * Handles the transitionend event */ MDCTabScrollerFoundation.prototype.handleTransitionEnd = function (evt) { // Early exit if we aren't animating or the event was triggered by a different element. var evtTarget = evt.target; if (!this.isAnimating_ || !this.adapter_.eventTargetMatchesSelector(evtTarget, MDCTabScrollerFoundation.strings.CONTENT_SELECTOR)) { return; } this.isAnimating_ = false; this.adapter_.removeClass(MDCTabScrollerFoundation.cssClasses.ANIMATING); }; /** * Increment the scroll value by the scrollXIncrement * @param scrollXIncrement The value by which to increment the scroll position */ MDCTabScrollerFoundation.prototype.incrementScroll = function (scrollXIncrement) { // Early exit for non-operational increment values if (scrollXIncrement === 0) { return; } if (this.isRTL_()) { return this.incrementScrollRTL_(scrollXIncrement); } this.incrementScroll_(scrollXIncrement); }; /** * Scrolls to the given scrollX value */ MDCTabScrollerFoundation.prototype.scrollTo = function (scrollX) { if (this.isRTL_()) { return this.scrollToRTL_(scrollX); } this.scrollTo_(scrollX); }; /** * @return Browser-specific {@link MDCTabScrollerRTL} instance. */ MDCTabScrollerFoundation.prototype.getRTLScroller = function () { if (!this.rtlScrollerInstance_) { this.rtlScrollerInstance_ = this.rtlScrollerFactory_(); } return this.rtlScrollerInstance_; }; /** * @return translateX value from a CSS matrix transform function string. */ MDCTabScrollerFoundation.prototype.calculateCurrentTranslateX_ = function () { var transformValue = this.adapter_.getScrollContentStyleValue('transform'); // Early exit if no transform is present if (transformValue === 'none') { return 0; } // The transform value comes back as a matrix transformation in the form // of `matrix(a, b, c, d, tx, ty)`. We only care about tx (translateX) so // we're going to grab all the parenthesized values, strip out tx, and // parse it. var match = /\((.+?)\)/.exec(transformValue); if (!match) { return 0; } var matrixParams = match[1]; // tslint:disable-next-line:ban-ts-ignore "Unused vars" should be a linter warning, not a compiler error. // @ts-ignore These unused variables should retain their semantic names for clarity. var _a = __WEBPACK_IMPORTED_MODULE_0_tslib__["c" /* __read */](matrixParams.split(','), 6), a = _a[0], b = _a[1], c = _a[2], d = _a[3], tx = _a[4], ty = _a[5]; return parseFloat(tx); // tslint:disable-line:ban }; /** * Calculates a safe scroll value that is > 0 and < the max scroll value * @param scrollX The distance to scroll */ MDCTabScrollerFoundation.prototype.clampScrollValue_ = function (scrollX) { var edges = this.calculateScrollEdges_(); return Math.min(Math.max(edges.left, scrollX), edges.right); }; MDCTabScrollerFoundation.prototype.computeCurrentScrollPositionRTL_ = function () { var translateX = this.calculateCurrentTranslateX_(); return this.getRTLScroller().getScrollPositionRTL(translateX); }; MDCTabScrollerFoundation.prototype.calculateScrollEdges_ = function () { var contentWidth = this.adapter_.getScrollContentOffsetWidth(); var rootWidth = this.adapter_.getScrollAreaOffsetWidth(); return { left: 0, right: contentWidth - rootWidth }; }; /** * Internal scroll method * @param scrollX The new scroll position */ MDCTabScrollerFoundation.prototype.scrollTo_ = function (scrollX) { var currentScrollX = this.getScrollPosition(); var safeScrollX = this.clampScrollValue_(scrollX); var scrollDelta = safeScrollX - currentScrollX; this.animate_({ finalScrollPosition: safeScrollX, scrollDelta: scrollDelta }); }; /** * Internal RTL scroll method * @param scrollX The new scroll position */ MDCTabScrollerFoundation.prototype.scrollToRTL_ = function (scrollX) { var animation = this.getRTLScroller().scrollToRTL(scrollX); this.animate_(animation); }; /** * Internal increment scroll method * @param scrollX The new scroll position increment */ MDCTabScrollerFoundation.prototype.incrementScroll_ = function (scrollX) { var currentScrollX = this.getScrollPosition(); var targetScrollX = scrollX + currentScrollX; var safeScrollX = this.clampScrollValue_(targetScrollX); var scrollDelta = safeScrollX - currentScrollX; this.animate_({ finalScrollPosition: safeScrollX, scrollDelta: scrollDelta }); }; /** * Internal increment scroll RTL method * @param scrollX The new scroll position RTL increment */ MDCTabScrollerFoundation.prototype.incrementScrollRTL_ = function (scrollX) { var animation = this.getRTLScroller().incrementScrollRTL(scrollX); this.animate_(animation); }; /** * Animates the tab scrolling * @param animation The animation to apply */ MDCTabScrollerFoundation.prototype.animate_ = function (animation) { var _this = this; // Early exit if translateX is 0, which means there's no animation to perform if (animation.scrollDelta === 0) { return; } this.stopScrollAnimation_(); // This animation uses the FLIP approach. // Read more here: https://aerotwist.com/blog/flip-your-animations/ this.adapter_.setScrollAreaScrollLeft(animation.finalScrollPosition); this.adapter_.setScrollContentStyleProperty('transform', "translateX(" + animation.scrollDelta + "px)"); // Force repaint this.adapter_.computeScrollAreaClientRect(); requestAnimationFrame(function () { _this.adapter_.addClass(MDCTabScrollerFoundation.cssClasses.ANIMATING); _this.adapter_.setScrollContentStyleProperty('transform', 'none'); }); this.isAnimating_ = true; }; /** * Stops scroll animation */ MDCTabScrollerFoundation.prototype.stopScrollAnimation_ = function () { this.isAnimating_ = false; var currentScrollPosition = this.getAnimatingScrollPosition_(); this.adapter_.removeClass(MDCTabScrollerFoundation.cssClasses.ANIMATING); this.adapter_.setScrollContentStyleProperty('transform', 'translateX(0px)'); this.adapter_.setScrollAreaScrollLeft(currentScrollPosition); }; /** * Gets the current scroll position during animation */ MDCTabScrollerFoundation.prototype.getAnimatingScrollPosition_ = function () { var currentTranslateX = this.calculateCurrentTranslateX_(); var scrollLeft = this.adapter_.getScrollAreaScrollLeft(); if (this.isRTL_()) { return this.getRTLScroller().getAnimatingScrollPosition(scrollLeft, currentTranslateX); } return scrollLeft - currentTranslateX; }; /** * Determines the RTL Scroller to use */ MDCTabScrollerFoundation.prototype.rtlScrollerFactory_ = function () { // Browsers have three different implementations of scrollLeft in RTL mode, // dependent on the browser. The behavior is based off the max LTR // scrollLeft value and 0. // // * Default scrolling in RTL * // - Left-most value: 0 // - Right-most value: Max LTR scrollLeft value // // * Negative scrolling in RTL * // - Left-most value: Negated max LTR scrollLeft value // - Right-most value: 0 // // * Reverse scrolling in RTL * // - Left-most value: Max LTR scrollLeft value // - Right-most value: 0 // // We use those principles below to determine which RTL scrollLeft // behavior is implemented in the current browser. var initialScrollLeft = this.adapter_.getScrollAreaScrollLeft(); this.adapter_.setScrollAreaScrollLeft(initialScrollLeft - 1); var newScrollLeft = this.adapter_.getScrollAreaScrollLeft(); // If the newScrollLeft value is negative,then we know that the browser has // implemented negative RTL scrolling, since all other implementations have // only positive values. if (newScrollLeft < 0) { // Undo the scrollLeft test check this.adapter_.setScrollAreaScrollLeft(initialScrollLeft); return new __WEBPACK_IMPORTED_MODULE_4__rtl_negative_scroller__["a" /* MDCTabScrollerRTLNegative */](this.adapter_); } var rootClientRect = this.adapter_.computeScrollAreaClientRect(); var contentClientRect = this.adapter_.computeScrollContentClientRect(); var rightEdgeDelta = Math.round(contentClientRect.right - rootClientRect.right); // Undo the scrollLeft test check this.adapter_.setScrollAreaScrollLeft(initialScrollLeft); // By calculating the clientRect of the root element and the clientRect of // the content element, we can determine how much the scroll value changed // when we performed the scrollLeft subtraction above. if (rightEdgeDelta === newScrollLeft) { return new __WEBPACK_IMPORTED_MODULE_5__rtl_reverse_scroller__["a" /* MDCTabScrollerRTLReverse */](this.adapter_); } return new __WEBPACK_IMPORTED_MODULE_3__rtl_default_scroller__["a" /* MDCTabScrollerRTLDefault */](this.adapter_); }; MDCTabScrollerFoundation.prototype.isRTL_ = function () { return this.adapter_.getScrollContentStyleValue('direction') === 'rtl'; }; return MDCTabScrollerFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTabScrollerFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 268 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTabScrollerRTLDefault; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__rtl_scroller__ = __webpack_require__(56); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCTabScrollerRTLDefault = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCTabScrollerRTLDefault, _super); function MDCTabScrollerRTLDefault() { return _super !== null && _super.apply(this, arguments) || this; } MDCTabScrollerRTLDefault.prototype.getScrollPositionRTL = function () { var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft(); var right = this.calculateScrollEdges_().right; // Scroll values on most browsers are ints instead of floats so we round return Math.round(right - currentScrollLeft); }; MDCTabScrollerRTLDefault.prototype.scrollToRTL = function (scrollX) { var edges = this.calculateScrollEdges_(); var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft(); var clampedScrollLeft = this.clampScrollValue_(edges.right - scrollX); return { finalScrollPosition: clampedScrollLeft, scrollDelta: clampedScrollLeft - currentScrollLeft }; }; MDCTabScrollerRTLDefault.prototype.incrementScrollRTL = function (scrollX) { var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft(); var clampedScrollLeft = this.clampScrollValue_(currentScrollLeft - scrollX); return { finalScrollPosition: clampedScrollLeft, scrollDelta: clampedScrollLeft - currentScrollLeft }; }; MDCTabScrollerRTLDefault.prototype.getAnimatingScrollPosition = function (scrollX) { return scrollX; }; MDCTabScrollerRTLDefault.prototype.calculateScrollEdges_ = function () { var contentWidth = this.adapter_.getScrollContentOffsetWidth(); var rootWidth = this.adapter_.getScrollAreaOffsetWidth(); return { left: 0, right: contentWidth - rootWidth }; }; MDCTabScrollerRTLDefault.prototype.clampScrollValue_ = function (scrollX) { var edges = this.calculateScrollEdges_(); return Math.min(Math.max(edges.left, scrollX), edges.right); }; return MDCTabScrollerRTLDefault; }(__WEBPACK_IMPORTED_MODULE_1__rtl_scroller__["a" /* MDCTabScrollerRTL */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTabScrollerRTLDefault); //# sourceMappingURL=rtl-default-scroller.js.map /***/ }), /* 269 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTabScrollerRTLNegative; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__rtl_scroller__ = __webpack_require__(56); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCTabScrollerRTLNegative = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCTabScrollerRTLNegative, _super); function MDCTabScrollerRTLNegative() { return _super !== null && _super.apply(this, arguments) || this; } MDCTabScrollerRTLNegative.prototype.getScrollPositionRTL = function (translateX) { var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft(); return Math.round(translateX - currentScrollLeft); }; MDCTabScrollerRTLNegative.prototype.scrollToRTL = function (scrollX) { var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft(); var clampedScrollLeft = this.clampScrollValue_(-scrollX); return { finalScrollPosition: clampedScrollLeft, scrollDelta: clampedScrollLeft - currentScrollLeft }; }; MDCTabScrollerRTLNegative.prototype.incrementScrollRTL = function (scrollX) { var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft(); var clampedScrollLeft = this.clampScrollValue_(currentScrollLeft - scrollX); return { finalScrollPosition: clampedScrollLeft, scrollDelta: clampedScrollLeft - currentScrollLeft }; }; MDCTabScrollerRTLNegative.prototype.getAnimatingScrollPosition = function (scrollX, translateX) { return scrollX - translateX; }; MDCTabScrollerRTLNegative.prototype.calculateScrollEdges_ = function () { var contentWidth = this.adapter_.getScrollContentOffsetWidth(); var rootWidth = this.adapter_.getScrollAreaOffsetWidth(); return { left: rootWidth - contentWidth, right: 0 }; }; MDCTabScrollerRTLNegative.prototype.clampScrollValue_ = function (scrollX) { var edges = this.calculateScrollEdges_(); return Math.max(Math.min(edges.right, scrollX), edges.left); }; return MDCTabScrollerRTLNegative; }(__WEBPACK_IMPORTED_MODULE_1__rtl_scroller__["a" /* MDCTabScrollerRTL */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTabScrollerRTLNegative); //# sourceMappingURL=rtl-negative-scroller.js.map /***/ }), /* 270 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTabScrollerRTLReverse; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__rtl_scroller__ = __webpack_require__(56); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCTabScrollerRTLReverse = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCTabScrollerRTLReverse, _super); function MDCTabScrollerRTLReverse() { return _super !== null && _super.apply(this, arguments) || this; } MDCTabScrollerRTLReverse.prototype.getScrollPositionRTL = function (translateX) { var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft(); // Scroll values on most browsers are ints instead of floats so we round return Math.round(currentScrollLeft - translateX); }; MDCTabScrollerRTLReverse.prototype.scrollToRTL = function (scrollX) { var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft(); var clampedScrollLeft = this.clampScrollValue_(scrollX); return { finalScrollPosition: clampedScrollLeft, scrollDelta: currentScrollLeft - clampedScrollLeft }; }; MDCTabScrollerRTLReverse.prototype.incrementScrollRTL = function (scrollX) { var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft(); var clampedScrollLeft = this.clampScrollValue_(currentScrollLeft + scrollX); return { finalScrollPosition: clampedScrollLeft, scrollDelta: currentScrollLeft - clampedScrollLeft }; }; MDCTabScrollerRTLReverse.prototype.getAnimatingScrollPosition = function (scrollX, translateX) { return scrollX + translateX; }; MDCTabScrollerRTLReverse.prototype.calculateScrollEdges_ = function () { var contentWidth = this.adapter_.getScrollContentOffsetWidth(); var rootWidth = this.adapter_.getScrollAreaOffsetWidth(); return { left: contentWidth - rootWidth, right: 0 }; }; MDCTabScrollerRTLReverse.prototype.clampScrollValue_ = function (scrollX) { var edges = this.calculateScrollEdges_(); return Math.min(Math.max(edges.right, scrollX), edges.left); }; return MDCTabScrollerRTLReverse; }(__WEBPACK_IMPORTED_MODULE_1__rtl_scroller__["a" /* MDCTabScrollerRTL */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTabScrollerRTLReverse); //# sourceMappingURL=rtl-reverse-scroller.js.map /***/ }), /* 271 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = computeHorizontalScrollbarHeight; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(137); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ /** * Stores result from computeHorizontalScrollbarHeight to avoid redundant processing. */ var horizontalScrollbarHeight_; /** * Computes the height of browser-rendered horizontal scrollbars using a self-created test element. * May return 0 (e.g. on OS X browsers under default configuration). */ function computeHorizontalScrollbarHeight(documentObj, shouldCacheResult) { if (shouldCacheResult === void 0) { shouldCacheResult = true; } if (shouldCacheResult && typeof horizontalScrollbarHeight_ !== 'undefined') { return horizontalScrollbarHeight_; } var el = documentObj.createElement('div'); el.classList.add(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].SCROLL_TEST); documentObj.body.appendChild(el); var horizontalScrollbarHeight = el.offsetHeight - el.clientHeight; documentObj.body.removeChild(el); if (shouldCacheResult) { horizontalScrollbarHeight_ = horizontalScrollbarHeight; } return horizontalScrollbarHeight; } //# sourceMappingURL=util.js.map /***/ }), /* 272 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTab; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_ripple_component__ = __webpack_require__(6); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_ripple_foundation__ = __webpack_require__(9); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_tab_indicator_component__ = __webpack_require__(273); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation__ = __webpack_require__(138); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCTab = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCTab, _super); function MDCTab() { return _super !== null && _super.apply(this, arguments) || this; } MDCTab.attachTo = function (root) { return new MDCTab(root); }; MDCTab.prototype.initialize = function (rippleFactory, tabIndicatorFactory) { if (rippleFactory === void 0) { rippleFactory = function rippleFactory(el, foundation) { return new __WEBPACK_IMPORTED_MODULE_2__material_ripple_component__["a" /* MDCRipple */](el, foundation); }; } if (tabIndicatorFactory === void 0) { tabIndicatorFactory = function tabIndicatorFactory(el) { return new __WEBPACK_IMPORTED_MODULE_4__material_tab_indicator_component__["a" /* MDCTabIndicator */](el); }; } this.id = this.root_.id; var rippleSurface = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_5__foundation__["a" /* MDCTabFoundation */].strings.RIPPLE_SELECTOR); var rippleAdapter = __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, __WEBPACK_IMPORTED_MODULE_2__material_ripple_component__["a" /* MDCRipple */].createAdapter(this), { addClass: function addClass(className) { return rippleSurface.classList.add(className); }, removeClass: function removeClass(className) { return rippleSurface.classList.remove(className); }, updateCssVariable: function updateCssVariable(varName, value) { return rippleSurface.style.setProperty(varName, value); } }); var rippleFoundation = new __WEBPACK_IMPORTED_MODULE_3__material_ripple_foundation__["a" /* MDCRippleFoundation */](rippleAdapter); this.ripple_ = rippleFactory(this.root_, rippleFoundation); var tabIndicatorElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_5__foundation__["a" /* MDCTabFoundation */].strings.TAB_INDICATOR_SELECTOR); this.tabIndicator_ = tabIndicatorFactory(tabIndicatorElement); this.content_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_5__foundation__["a" /* MDCTabFoundation */].strings.CONTENT_SELECTOR); }; MDCTab.prototype.initialSyncWithDOM = function () { var _this = this; this.handleClick_ = function () { return _this.foundation_.handleClick(); }; this.listen('click', this.handleClick_); }; MDCTab.prototype.destroy = function () { this.unlisten('click', this.handleClick_); this.ripple_.destroy(); _super.prototype.destroy.call(this); }; MDCTab.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. var adapter = { setAttr: function setAttr(attr, value) { return _this.root_.setAttribute(attr, value); }, addClass: function addClass(className) { return _this.root_.classList.add(className); }, removeClass: function removeClass(className) { return _this.root_.classList.remove(className); }, hasClass: function hasClass(className) { return _this.root_.classList.contains(className); }, activateIndicator: function activateIndicator(previousIndicatorClientRect) { return _this.tabIndicator_.activate(previousIndicatorClientRect); }, deactivateIndicator: function deactivateIndicator() { return _this.tabIndicator_.deactivate(); }, notifyInteracted: function notifyInteracted() { return _this.emit(__WEBPACK_IMPORTED_MODULE_5__foundation__["a" /* MDCTabFoundation */].strings.INTERACTED_EVENT, { tabId: _this.id }, true /* bubble */); }, getOffsetLeft: function getOffsetLeft() { return _this.root_.offsetLeft; }, getOffsetWidth: function getOffsetWidth() { return _this.root_.offsetWidth; }, getContentOffsetLeft: function getContentOffsetLeft() { return _this.content_.offsetLeft; }, getContentOffsetWidth: function getContentOffsetWidth() { return _this.content_.offsetWidth; }, focus: function focus() { return _this.root_.focus(); } }; // tslint:enable:object-literal-sort-keys return new __WEBPACK_IMPORTED_MODULE_5__foundation__["a" /* MDCTabFoundation */](adapter); }; Object.defineProperty(MDCTab.prototype, "active", { /** * Getter for the active state of the tab */ get: function get() { return this.foundation_.isActive(); }, enumerable: true, configurable: true }); Object.defineProperty(MDCTab.prototype, "focusOnActivate", { set: function set(focusOnActivate) { this.foundation_.setFocusOnActivate(focusOnActivate); }, enumerable: true, configurable: true }); /** * Activates the tab */ MDCTab.prototype.activate = function (computeIndicatorClientRect) { this.foundation_.activate(computeIndicatorClientRect); }; /** * Deactivates the tab */ MDCTab.prototype.deactivate = function () { this.foundation_.deactivate(); }; /** * Returns the indicator's client rect */ MDCTab.prototype.computeIndicatorClientRect = function () { return this.tabIndicator_.computeContentClientRect(); }; MDCTab.prototype.computeDimensions = function () { return this.foundation_.computeDimensions(); }; /** * Focuses the tab */ MDCTab.prototype.focus = function () { this.root_.focus(); }; return MDCTab; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 273 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTabIndicator; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__fading_foundation__ = __webpack_require__(274); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation__ = __webpack_require__(57); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__sliding_foundation__ = __webpack_require__(276); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCTabIndicator = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCTabIndicator, _super); function MDCTabIndicator() { return _super !== null && _super.apply(this, arguments) || this; } MDCTabIndicator.attachTo = function (root) { return new MDCTabIndicator(root); }; MDCTabIndicator.prototype.initialize = function () { this.content_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* MDCTabIndicatorFoundation */].strings.CONTENT_SELECTOR); }; MDCTabIndicator.prototype.computeContentClientRect = function () { return this.foundation_.computeContentClientRect(); }; MDCTabIndicator.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. var adapter = { addClass: function addClass(className) { return _this.root_.classList.add(className); }, removeClass: function removeClass(className) { return _this.root_.classList.remove(className); }, computeContentClientRect: function computeContentClientRect() { return _this.content_.getBoundingClientRect(); }, setContentStyleProperty: function setContentStyleProperty(prop, value) { return _this.content_.style.setProperty(prop, value); } }; // tslint:enable:object-literal-sort-keys if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* MDCTabIndicatorFoundation */].cssClasses.FADE)) { return new __WEBPACK_IMPORTED_MODULE_2__fading_foundation__["a" /* MDCFadingTabIndicatorFoundation */](adapter); } // Default to the sliding indicator return new __WEBPACK_IMPORTED_MODULE_4__sliding_foundation__["a" /* MDCSlidingTabIndicatorFoundation */](adapter); }; MDCTabIndicator.prototype.activate = function (previousIndicatorClientRect) { this.foundation_.activate(previousIndicatorClientRect); }; MDCTabIndicator.prototype.deactivate = function () { this.foundation_.deactivate(); }; return MDCTabIndicator; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 274 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCFadingTabIndicatorFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(57); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ /* istanbul ignore next: subclass is not a branch statement */ var MDCFadingTabIndicatorFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCFadingTabIndicatorFoundation, _super); function MDCFadingTabIndicatorFoundation() { return _super !== null && _super.apply(this, arguments) || this; } MDCFadingTabIndicatorFoundation.prototype.activate = function () { this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* MDCTabIndicatorFoundation */].cssClasses.ACTIVE); }; MDCFadingTabIndicatorFoundation.prototype.deactivate = function () { this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* MDCTabIndicatorFoundation */].cssClasses.ACTIVE); }; return MDCFadingTabIndicatorFoundation; }(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* MDCTabIndicatorFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCFadingTabIndicatorFoundation); //# sourceMappingURL=fading-foundation.js.map /***/ }), /* 275 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; }); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var cssClasses = { ACTIVE: 'mdc-tab-indicator--active', FADE: 'mdc-tab-indicator--fade', NO_TRANSITION: 'mdc-tab-indicator--no-transition' }; var strings = { CONTENT_SELECTOR: '.mdc-tab-indicator__content' }; //# sourceMappingURL=constants.js.map /***/ }), /* 276 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCSlidingTabIndicatorFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(57); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ /* istanbul ignore next: subclass is not a branch statement */ var MDCSlidingTabIndicatorFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCSlidingTabIndicatorFoundation, _super); function MDCSlidingTabIndicatorFoundation() { return _super !== null && _super.apply(this, arguments) || this; } MDCSlidingTabIndicatorFoundation.prototype.activate = function (previousIndicatorClientRect) { // Early exit if no indicator is present to handle cases where an indicator // may be activated without a prior indicator state if (!previousIndicatorClientRect) { this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* MDCTabIndicatorFoundation */].cssClasses.ACTIVE); return; } // This animation uses the FLIP approach. You can read more about it at the link below: // https://aerotwist.com/blog/flip-your-animations/ // Calculate the dimensions based on the dimensions of the previous indicator var currentClientRect = this.computeContentClientRect(); var widthDelta = previousIndicatorClientRect.width / currentClientRect.width; var xPosition = previousIndicatorClientRect.left - currentClientRect.left; this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* MDCTabIndicatorFoundation */].cssClasses.NO_TRANSITION); this.adapter_.setContentStyleProperty('transform', "translateX(" + xPosition + "px) scaleX(" + widthDelta + ")"); // Force repaint before updating classes and transform to ensure the transform properly takes effect this.computeContentClientRect(); this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* MDCTabIndicatorFoundation */].cssClasses.NO_TRANSITION); this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* MDCTabIndicatorFoundation */].cssClasses.ACTIVE); this.adapter_.setContentStyleProperty('transform', ''); }; MDCSlidingTabIndicatorFoundation.prototype.deactivate = function () { this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* MDCTabIndicatorFoundation */].cssClasses.ACTIVE); }; return MDCSlidingTabIndicatorFoundation; }(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* MDCTabIndicatorFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCSlidingTabIndicatorFoundation); //# sourceMappingURL=sliding-foundation.js.map /***/ }), /* 277 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; }); /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var cssClasses = { ACTIVE: 'mdc-tab--active' }; var strings = { ARIA_SELECTED: 'aria-selected', CONTENT_SELECTOR: '.mdc-tab__content', INTERACTED_EVENT: 'MDCTab:interacted', RIPPLE_SELECTOR: '.mdc-tab__ripple', TABINDEX: 'tabIndex', TAB_INDICATOR_SELECTOR: '.mdc-tab-indicator' }; //# sourceMappingURL=constants.js.map /***/ }), /* 278 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initTables; /* unused harmony export VDataTable */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_data_table__ = __webpack_require__(279); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__base_component__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__mixins_event_handler__ = __webpack_require__(4); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__base_container__ = __webpack_require__(10); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function initTables(e) { console.debug('\tTables'); Object(__WEBPACK_IMPORTED_MODULE_1__base_component__["c" /* hookupComponents */])(e, '.v-data-table', VDataTable, __WEBPACK_IMPORTED_MODULE_0__material_data_table__["a" /* MDCDataTable */]); } var VDataTable = function (_eventHandlerMixin) { _inherits(VDataTable, _eventHandlerMixin); function VDataTable(element, mdcComponent) { _classCallCheck(this, VDataTable); return _possibleConstructorReturn(this, (VDataTable.__proto__ || Object.getPrototypeOf(VDataTable)).call(this, element, mdcComponent)); } return VDataTable; }(Object(__WEBPACK_IMPORTED_MODULE_2__mixins_event_handler__["a" /* eventHandlerMixin */])(__WEBPACK_IMPORTED_MODULE_3__base_container__["a" /* VBaseContainer */])); /***/ }), /* 279 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__component__ = __webpack_require__(280); /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__component__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(143); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(58); /* unused harmony namespace reexport */ /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ //# sourceMappingURL=index.js.map /***/ }), /* 280 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCDataTable; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(14); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_checkbox_component__ = __webpack_require__(281); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_dom_ponyfill__ = __webpack_require__(5); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__(58); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation__ = __webpack_require__(143); /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCDataTable = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["c" /* __extends */](MDCDataTable, _super); function MDCDataTable() { return _super !== null && _super.apply(this, arguments) || this; } MDCDataTable.attachTo = function (root) { return new MDCDataTable(root); }; MDCDataTable.prototype.initialize = function (checkboxFactory) { if (checkboxFactory === void 0) { checkboxFactory = function checkboxFactory(el) { return new __WEBPACK_IMPORTED_MODULE_2__material_checkbox_component__["a" /* MDCCheckbox */](el); }; } this.checkboxFactory_ = checkboxFactory; }; MDCDataTable.prototype.initialSyncWithDOM = function () { var _this = this; this.headerRow_ = this.root_.querySelector("." + __WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].HEADER_ROW); this.handleHeaderRowCheckboxChange_ = function () { return _this.foundation_.handleHeaderRowCheckboxChange(); }; this.headerRow_.addEventListener('change', this.handleHeaderRowCheckboxChange_); this.content_ = this.root_.querySelector("." + __WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].CONTENT); this.handleRowCheckboxChange_ = function (event) { return _this.foundation_.handleRowCheckboxChange(event); }; this.content_.addEventListener('change', this.handleRowCheckboxChange_); this.layout(); }; /** * Re-initializes header row checkbox and row checkboxes when selectable rows are added or removed from table. */ MDCDataTable.prototype.layout = function () { this.foundation_.layout(); }; /** * @return Returns array of row elements. */ MDCDataTable.prototype.getRows = function () { return this.foundation_.getRows(); }; /** * @return Returns array of selected row ids. */ MDCDataTable.prototype.getSelectedRowIds = function () { return this.foundation_.getSelectedRowIds(); }; /** * Sets selected row ids. Overwrites previously selected rows. * @param rowIds Array of row ids that needs to be selected. */ MDCDataTable.prototype.setSelectedRowIds = function (rowIds) { this.foundation_.setSelectedRowIds(rowIds); }; MDCDataTable.prototype.destroy = function () { this.headerRow_.removeEventListener('change', this.handleHeaderRowCheckboxChange_); this.content_.removeEventListener('change', this.handleRowCheckboxChange_); this.headerRowCheckbox_.destroy(); this.rowCheckboxList_.forEach(function (checkbox) { return checkbox.destroy(); }); }; MDCDataTable.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. var adapter = { addClassAtRowIndex: function addClassAtRowIndex(rowIndex, className) { return _this.getRows()[rowIndex].classList.add(className); }, getRowCount: function getRowCount() { return _this.getRows().length; }, getRowElements: function getRowElements() { return [].slice.call(_this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_4__constants__["c" /* strings */].ROW_SELECTOR)); }, getRowIdAtIndex: function getRowIdAtIndex(rowIndex) { return _this.getRows()[rowIndex].getAttribute(__WEBPACK_IMPORTED_MODULE_4__constants__["c" /* strings */].DATA_ROW_ID_ATTR); }, getRowIndexByChildElement: function getRowIndexByChildElement(el) { return _this.getRows().indexOf(Object(__WEBPACK_IMPORTED_MODULE_3__material_dom_ponyfill__["a" /* closest */])(el, __WEBPACK_IMPORTED_MODULE_4__constants__["c" /* strings */].ROW_SELECTOR)); }, getSelectedRowCount: function getSelectedRowCount() { return _this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_4__constants__["c" /* strings */].ROW_SELECTED_SELECTOR).length; }, isCheckboxAtRowIndexChecked: function isCheckboxAtRowIndexChecked(rowIndex) { return _this.rowCheckboxList_[rowIndex].checked; }, isHeaderRowCheckboxChecked: function isHeaderRowCheckboxChecked() { return _this.headerRowCheckbox_.checked; }, isRowsSelectable: function isRowsSelectable() { return !!_this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["c" /* strings */].ROW_CHECKBOX_SELECTOR); }, notifyRowSelectionChanged: function notifyRowSelectionChanged(data) { _this.emit(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* events */].ROW_SELECTION_CHANGED, { row: _this.getRowByIndex_(data.rowIndex), rowId: _this.getRowIdByIndex_(data.rowIndex), rowIndex: data.rowIndex, selected: data.selected }, /** shouldBubble */true); }, notifySelectedAll: function notifySelectedAll() { return _this.emit(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* events */].SELECTED_ALL, {}, /** shouldBubble */true); }, notifyUnselectedAll: function notifyUnselectedAll() { return _this.emit(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* events */].UNSELECTED_ALL, {}, /** shouldBubble */true); }, registerHeaderRowCheckbox: function registerHeaderRowCheckbox() { if (_this.headerRowCheckbox_) { _this.headerRowCheckbox_.destroy(); } var checkboxEl = _this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["c" /* strings */].HEADER_ROW_CHECKBOX_SELECTOR); _this.headerRowCheckbox_ = _this.checkboxFactory_(checkboxEl); }, registerRowCheckboxes: function registerRowCheckboxes() { if (_this.rowCheckboxList_) { _this.rowCheckboxList_.forEach(function (checkbox) { return checkbox.destroy(); }); } _this.rowCheckboxList_ = []; _this.getRows().forEach(function (rowEl) { var checkbox = _this.checkboxFactory_(rowEl.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["c" /* strings */].ROW_CHECKBOX_SELECTOR)); _this.rowCheckboxList_.push(checkbox); }); }, removeClassAtRowIndex: function removeClassAtRowIndex(rowIndex, className) { _this.getRows()[rowIndex].classList.remove(className); }, setAttributeAtRowIndex: function setAttributeAtRowIndex(rowIndex, attr, value) { _this.getRows()[rowIndex].setAttribute(attr, value); }, setHeaderRowCheckboxChecked: function setHeaderRowCheckboxChecked(checked) { _this.headerRowCheckbox_.checked = checked; }, setHeaderRowCheckboxIndeterminate: function setHeaderRowCheckboxIndeterminate(indeterminate) { _this.headerRowCheckbox_.indeterminate = indeterminate; }, setRowCheckboxCheckedAtIndex: function setRowCheckboxCheckedAtIndex(rowIndex, checked) { _this.rowCheckboxList_[rowIndex].checked = checked; } }; return new __WEBPACK_IMPORTED_MODULE_5__foundation__["a" /* MDCDataTableFoundation */](adapter); }; MDCDataTable.prototype.getRowByIndex_ = function (index) { return this.getRows()[index]; }; MDCDataTable.prototype.getRowIdByIndex_ = function (index) { return this.getRowByIndex_(index).getAttribute(__WEBPACK_IMPORTED_MODULE_4__constants__["c" /* strings */].DATA_ROW_ID_ATTR); }; return MDCDataTable; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 281 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCCheckbox; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(14); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_animation_util__ = __webpack_require__(29); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_dom_events__ = __webpack_require__(8); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_dom_ponyfill__ = __webpack_require__(5); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__material_ripple_component__ = __webpack_require__(282); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__material_ripple_foundation__ = __webpack_require__(141); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__foundation__ = __webpack_require__(284); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var CB_PROTO_PROPS = ['checked', 'indeterminate']; var MDCCheckbox = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["c" /* __extends */](MDCCheckbox, _super); function MDCCheckbox() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.ripple_ = _this.createRipple_(); return _this; } MDCCheckbox.attachTo = function (root) { return new MDCCheckbox(root); }; Object.defineProperty(MDCCheckbox.prototype, "ripple", { get: function get() { return this.ripple_; }, enumerable: true, configurable: true }); Object.defineProperty(MDCCheckbox.prototype, "checked", { get: function get() { return this.nativeControl_.checked; }, set: function set(checked) { this.nativeControl_.checked = checked; }, enumerable: true, configurable: true }); Object.defineProperty(MDCCheckbox.prototype, "indeterminate", { get: function get() { return this.nativeControl_.indeterminate; }, set: function set(indeterminate) { this.nativeControl_.indeterminate = indeterminate; }, enumerable: true, configurable: true }); Object.defineProperty(MDCCheckbox.prototype, "disabled", { get: function get() { return this.nativeControl_.disabled; }, set: function set(disabled) { this.foundation_.setDisabled(disabled); }, enumerable: true, configurable: true }); Object.defineProperty(MDCCheckbox.prototype, "value", { get: function get() { return this.nativeControl_.value; }, set: function set(value) { this.nativeControl_.value = value; }, enumerable: true, configurable: true }); MDCCheckbox.prototype.initialSyncWithDOM = function () { var _this = this; this.handleChange_ = function () { return _this.foundation_.handleChange(); }; this.handleAnimationEnd_ = function () { return _this.foundation_.handleAnimationEnd(); }; this.nativeControl_.addEventListener('change', this.handleChange_); this.listen(Object(__WEBPACK_IMPORTED_MODULE_1__material_animation_util__["a" /* getCorrectEventName */])(window, 'animationend'), this.handleAnimationEnd_); this.installPropertyChangeHooks_(); }; MDCCheckbox.prototype.destroy = function () { this.ripple_.destroy(); this.nativeControl_.removeEventListener('change', this.handleChange_); this.unlisten(Object(__WEBPACK_IMPORTED_MODULE_1__material_animation_util__["a" /* getCorrectEventName */])(window, 'animationend'), this.handleAnimationEnd_); this.uninstallPropertyChangeHooks_(); _super.prototype.destroy.call(this); }; MDCCheckbox.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. var adapter = { addClass: function addClass(className) { return _this.root_.classList.add(className); }, forceLayout: function forceLayout() { return _this.root_.offsetWidth; }, hasNativeControl: function hasNativeControl() { return !!_this.nativeControl_; }, isAttachedToDOM: function isAttachedToDOM() { return Boolean(_this.root_.parentNode); }, isChecked: function isChecked() { return _this.checked; }, isIndeterminate: function isIndeterminate() { return _this.indeterminate; }, removeClass: function removeClass(className) { return _this.root_.classList.remove(className); }, removeNativeControlAttr: function removeNativeControlAttr(attr) { return _this.nativeControl_.removeAttribute(attr); }, setNativeControlAttr: function setNativeControlAttr(attr, value) { return _this.nativeControl_.setAttribute(attr, value); }, setNativeControlDisabled: function setNativeControlDisabled(disabled) { return _this.nativeControl_.disabled = disabled; } }; return new __WEBPACK_IMPORTED_MODULE_7__foundation__["a" /* MDCCheckboxFoundation */](adapter); }; MDCCheckbox.prototype.createRipple_ = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. var adapter = __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, __WEBPACK_IMPORTED_MODULE_5__material_ripple_component__["a" /* MDCRipple */].createAdapter(this), { deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) { return _this.nativeControl_.removeEventListener(evtType, handler, Object(__WEBPACK_IMPORTED_MODULE_3__material_dom_events__["a" /* applyPassive */])()); }, isSurfaceActive: function isSurfaceActive() { return Object(__WEBPACK_IMPORTED_MODULE_4__material_dom_ponyfill__["b" /* matches */])(_this.nativeControl_, ':active'); }, isUnbounded: function isUnbounded() { return true; }, registerInteractionHandler: function registerInteractionHandler(evtType, handler) { return _this.nativeControl_.addEventListener(evtType, handler, Object(__WEBPACK_IMPORTED_MODULE_3__material_dom_events__["a" /* applyPassive */])()); } }); return new __WEBPACK_IMPORTED_MODULE_5__material_ripple_component__["a" /* MDCRipple */](this.root_, new __WEBPACK_IMPORTED_MODULE_6__material_ripple_foundation__["a" /* MDCRippleFoundation */](adapter)); }; MDCCheckbox.prototype.installPropertyChangeHooks_ = function () { var _this = this; var nativeCb = this.nativeControl_; var cbProto = Object.getPrototypeOf(nativeCb); CB_PROTO_PROPS.forEach(function (controlState) { var desc = Object.getOwnPropertyDescriptor(cbProto, controlState); // We have to check for this descriptor, since some browsers (Safari) don't support its return. // See: https://bugs.webkit.org/show_bug.cgi?id=49739 if (!validDescriptor(desc)) { return; } // Type cast is needed for compatibility with Closure Compiler. var nativeGetter = desc.get; var nativeCbDesc = { configurable: desc.configurable, enumerable: desc.enumerable, get: nativeGetter, set: function set(state) { desc.set.call(nativeCb, state); _this.foundation_.handleChange(); } }; Object.defineProperty(nativeCb, controlState, nativeCbDesc); }); }; MDCCheckbox.prototype.uninstallPropertyChangeHooks_ = function () { var nativeCb = this.nativeControl_; var cbProto = Object.getPrototypeOf(nativeCb); CB_PROTO_PROPS.forEach(function (controlState) { var desc = Object.getOwnPropertyDescriptor(cbProto, controlState); if (!validDescriptor(desc)) { return; } Object.defineProperty(nativeCb, controlState, desc); }); }; Object.defineProperty(MDCCheckbox.prototype, "nativeControl_", { get: function get() { var NATIVE_CONTROL_SELECTOR = __WEBPACK_IMPORTED_MODULE_7__foundation__["a" /* MDCCheckboxFoundation */].strings.NATIVE_CONTROL_SELECTOR; var el = this.root_.querySelector(NATIVE_CONTROL_SELECTOR); if (!el) { throw new Error("Checkbox component requires a " + NATIVE_CONTROL_SELECTOR + " element"); } return el; }, enumerable: true, configurable: true }); return MDCCheckbox; }(__WEBPACK_IMPORTED_MODULE_2__material_base_component__["a" /* MDCComponent */]); function validDescriptor(inputPropDesc) { return !!inputPropDesc && typeof inputPropDesc.set === 'function'; } //# sourceMappingURL=component.js.map /***/ }), /* 282 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCRipple; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(14); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_dom_events__ = __webpack_require__(8); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_dom_ponyfill__ = __webpack_require__(5); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation__ = __webpack_require__(141); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util__ = __webpack_require__(142); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCRipple = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["c" /* __extends */](MDCRipple, _super); function MDCRipple() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.disabled = false; return _this; } MDCRipple.attachTo = function (root, opts) { if (opts === void 0) { opts = { isUnbounded: undefined }; } var ripple = new MDCRipple(root); // Only override unbounded behavior if option is explicitly specified if (opts.isUnbounded !== undefined) { ripple.unbounded = opts.isUnbounded; } return ripple; }; MDCRipple.createAdapter = function (instance) { return { addClass: function addClass(className) { return instance.root_.classList.add(className); }, browserSupportsCssVars: function browserSupportsCssVars() { return __WEBPACK_IMPORTED_MODULE_5__util__["b" /* supportsCssVariables */](window); }, computeBoundingRect: function computeBoundingRect() { return instance.root_.getBoundingClientRect(); }, containsEventTarget: function containsEventTarget(target) { return instance.root_.contains(target); }, deregisterDocumentInteractionHandler: function deregisterDocumentInteractionHandler(evtType, handler) { return document.documentElement.removeEventListener(evtType, handler, Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_events__["a" /* applyPassive */])()); }, deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) { return instance.root_.removeEventListener(evtType, handler, Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_events__["a" /* applyPassive */])()); }, deregisterResizeHandler: function deregisterResizeHandler(handler) { return window.removeEventListener('resize', handler); }, getWindowPageOffset: function getWindowPageOffset() { return { x: window.pageXOffset, y: window.pageYOffset }; }, isSurfaceActive: function isSurfaceActive() { return Object(__WEBPACK_IMPORTED_MODULE_3__material_dom_ponyfill__["b" /* matches */])(instance.root_, ':active'); }, isSurfaceDisabled: function isSurfaceDisabled() { return Boolean(instance.disabled); }, isUnbounded: function isUnbounded() { return Boolean(instance.unbounded); }, registerDocumentInteractionHandler: function registerDocumentInteractionHandler(evtType, handler) { return document.documentElement.addEventListener(evtType, handler, Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_events__["a" /* applyPassive */])()); }, registerInteractionHandler: function registerInteractionHandler(evtType, handler) { return instance.root_.addEventListener(evtType, handler, Object(__WEBPACK_IMPORTED_MODULE_2__material_dom_events__["a" /* applyPassive */])()); }, registerResizeHandler: function registerResizeHandler(handler) { return window.addEventListener('resize', handler); }, removeClass: function removeClass(className) { return instance.root_.classList.remove(className); }, updateCssVariable: function updateCssVariable(varName, value) { return instance.root_.style.setProperty(varName, value); } }; }; Object.defineProperty(MDCRipple.prototype, "unbounded", { get: function get() { return Boolean(this.unbounded_); }, set: function set(unbounded) { this.unbounded_ = Boolean(unbounded); this.setUnbounded_(); }, enumerable: true, configurable: true }); MDCRipple.prototype.activate = function () { this.foundation_.activate(); }; MDCRipple.prototype.deactivate = function () { this.foundation_.deactivate(); }; MDCRipple.prototype.layout = function () { this.foundation_.layout(); }; MDCRipple.prototype.getDefaultFoundation = function () { return new __WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* MDCRippleFoundation */](MDCRipple.createAdapter(this)); }; MDCRipple.prototype.initialSyncWithDOM = function () { var root = this.root_; this.unbounded = 'mdcRippleIsUnbounded' in root.dataset; }; /** * Closure Compiler throws an access control error when directly accessing a * protected or private property inside a getter/setter, like unbounded above. * By accessing the protected property inside a method, we solve that problem. * That's why this function exists. */ MDCRipple.prototype.setUnbounded_ = function () { this.foundation_.setUnbounded(Boolean(this.unbounded_)); }; return MDCRipple; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 283 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; }); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var cssClasses = { // Ripple is a special case where the "root" component is really a "mixin" of sorts, // given that it's an 'upgrade' to an existing component. That being said it is the root // CSS class that all other CSS classes derive from. BG_FOCUSED: 'mdc-ripple-upgraded--background-focused', FG_ACTIVATION: 'mdc-ripple-upgraded--foreground-activation', FG_DEACTIVATION: 'mdc-ripple-upgraded--foreground-deactivation', ROOT: 'mdc-ripple-upgraded', UNBOUNDED: 'mdc-ripple-upgraded--unbounded' }; var strings = { VAR_FG_SCALE: '--mdc-ripple-fg-scale', VAR_FG_SIZE: '--mdc-ripple-fg-size', VAR_FG_TRANSLATE_END: '--mdc-ripple-fg-translate-end', VAR_FG_TRANSLATE_START: '--mdc-ripple-fg-translate-start', VAR_LEFT: '--mdc-ripple-left', VAR_TOP: '--mdc-ripple-top' }; var numbers = { DEACTIVATION_TIMEOUT_MS: 225, FG_DEACTIVATION_MS: 150, INITIAL_ORIGIN_SCALE: 0.6, PADDING: 10, TAP_DELAY_MS: 300 }; //# sourceMappingURL=constants.js.map /***/ }), /* 284 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCCheckboxFoundation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(14); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(285); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCCheckboxFoundation = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["c" /* __extends */](MDCCheckboxFoundation, _super); function MDCCheckboxFoundation(adapter) { var _this = _super.call(this, __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */]({}, MDCCheckboxFoundation.defaultAdapter, adapter)) || this; _this.currentCheckState_ = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].TRANSITION_STATE_INIT; _this.currentAnimationClass_ = ''; _this.animEndLatchTimer_ = 0; _this.enableAnimationEndHandler_ = false; return _this; } Object.defineProperty(MDCCheckboxFoundation, "cssClasses", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCCheckboxFoundation, "strings", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCCheckboxFoundation, "numbers", { get: function get() { return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */]; }, enumerable: true, configurable: true }); Object.defineProperty(MDCCheckboxFoundation, "defaultAdapter", { get: function get() { return { addClass: function addClass() { return undefined; }, forceLayout: function forceLayout() { return undefined; }, hasNativeControl: function hasNativeControl() { return false; }, isAttachedToDOM: function isAttachedToDOM() { return false; }, isChecked: function isChecked() { return false; }, isIndeterminate: function isIndeterminate() { return false; }, removeClass: function removeClass() { return undefined; }, removeNativeControlAttr: function removeNativeControlAttr() { return undefined; }, setNativeControlAttr: function setNativeControlAttr() { return undefined; }, setNativeControlDisabled: function setNativeControlDisabled() { return undefined; } }; }, enumerable: true, configurable: true }); MDCCheckboxFoundation.prototype.init = function () { this.currentCheckState_ = this.determineCheckState_(); this.updateAriaChecked_(); this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].UPGRADED); }; MDCCheckboxFoundation.prototype.destroy = function () { clearTimeout(this.animEndLatchTimer_); }; MDCCheckboxFoundation.prototype.setDisabled = function (disabled) { this.adapter_.setNativeControlDisabled(disabled); if (disabled) { this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].DISABLED); } else { this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].DISABLED); } }; /** * Handles the animationend event for the checkbox */ MDCCheckboxFoundation.prototype.handleAnimationEnd = function () { var _this = this; if (!this.enableAnimationEndHandler_) { return; } clearTimeout(this.animEndLatchTimer_); this.animEndLatchTimer_ = setTimeout(function () { _this.adapter_.removeClass(_this.currentAnimationClass_); _this.enableAnimationEndHandler_ = false; }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].ANIM_END_LATCH_MS); }; /** * Handles the change event for the checkbox */ MDCCheckboxFoundation.prototype.handleChange = function () { this.transitionCheckState_(); }; MDCCheckboxFoundation.prototype.transitionCheckState_ = function () { if (!this.adapter_.hasNativeControl()) { return; } var oldState = this.currentCheckState_; var newState = this.determineCheckState_(); if (oldState === newState) { return; } this.updateAriaChecked_(); var TRANSITION_STATE_UNCHECKED = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].TRANSITION_STATE_UNCHECKED; var SELECTED = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SELECTED; if (newState === TRANSITION_STATE_UNCHECKED) { this.adapter_.removeClass(SELECTED); } else { this.adapter_.addClass(SELECTED); } // Check to ensure that there isn't a previously existing animation class, in case for example // the user interacted with the checkbox before the animation was finished. if (this.currentAnimationClass_.length > 0) { clearTimeout(this.animEndLatchTimer_); this.adapter_.forceLayout(); this.adapter_.removeClass(this.currentAnimationClass_); } this.currentAnimationClass_ = this.getTransitionAnimationClass_(oldState, newState); this.currentCheckState_ = newState; // Check for parentNode so that animations are only run when the element is attached // to the DOM. if (this.adapter_.isAttachedToDOM() && this.currentAnimationClass_.length > 0) { this.adapter_.addClass(this.currentAnimationClass_); this.enableAnimationEndHandler_ = true; } }; MDCCheckboxFoundation.prototype.determineCheckState_ = function () { var TRANSITION_STATE_INDETERMINATE = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].TRANSITION_STATE_INDETERMINATE, TRANSITION_STATE_CHECKED = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].TRANSITION_STATE_CHECKED, TRANSITION_STATE_UNCHECKED = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].TRANSITION_STATE_UNCHECKED; if (this.adapter_.isIndeterminate()) { return TRANSITION_STATE_INDETERMINATE; } return this.adapter_.isChecked() ? TRANSITION_STATE_CHECKED : TRANSITION_STATE_UNCHECKED; }; MDCCheckboxFoundation.prototype.getTransitionAnimationClass_ = function (oldState, newState) { var TRANSITION_STATE_INIT = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].TRANSITION_STATE_INIT, TRANSITION_STATE_CHECKED = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].TRANSITION_STATE_CHECKED, TRANSITION_STATE_UNCHECKED = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].TRANSITION_STATE_UNCHECKED; var _a = MDCCheckboxFoundation.cssClasses, ANIM_UNCHECKED_CHECKED = _a.ANIM_UNCHECKED_CHECKED, ANIM_UNCHECKED_INDETERMINATE = _a.ANIM_UNCHECKED_INDETERMINATE, ANIM_CHECKED_UNCHECKED = _a.ANIM_CHECKED_UNCHECKED, ANIM_CHECKED_INDETERMINATE = _a.ANIM_CHECKED_INDETERMINATE, ANIM_INDETERMINATE_CHECKED = _a.ANIM_INDETERMINATE_CHECKED, ANIM_INDETERMINATE_UNCHECKED = _a.ANIM_INDETERMINATE_UNCHECKED; switch (oldState) { case TRANSITION_STATE_INIT: if (newState === TRANSITION_STATE_UNCHECKED) { return ''; } return newState === TRANSITION_STATE_CHECKED ? ANIM_INDETERMINATE_CHECKED : ANIM_INDETERMINATE_UNCHECKED; case TRANSITION_STATE_UNCHECKED: return newState === TRANSITION_STATE_CHECKED ? ANIM_UNCHECKED_CHECKED : ANIM_UNCHECKED_INDETERMINATE; case TRANSITION_STATE_CHECKED: return newState === TRANSITION_STATE_UNCHECKED ? ANIM_CHECKED_UNCHECKED : ANIM_CHECKED_INDETERMINATE; default: // TRANSITION_STATE_INDETERMINATE return newState === TRANSITION_STATE_CHECKED ? ANIM_INDETERMINATE_CHECKED : ANIM_INDETERMINATE_UNCHECKED; } }; MDCCheckboxFoundation.prototype.updateAriaChecked_ = function () { // Ensure aria-checked is set to mixed if checkbox is in indeterminate state. if (this.adapter_.isIndeterminate()) { this.adapter_.setNativeControlAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].ARIA_CHECKED_ATTR, __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].ARIA_CHECKED_INDETERMINATE_VALUE); } else { // The on/off state does not need to keep track of aria-checked, since // the screenreader uses the checked property on the checkbox element. this.adapter_.removeNativeControlAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].ARIA_CHECKED_ATTR); } }; return MDCCheckboxFoundation; }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* MDCFoundation */]); // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. /* unused harmony default export */ var _unused_webpack_default_export = (MDCCheckboxFoundation); //# sourceMappingURL=foundation.js.map /***/ }), /* 285 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; }); /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var cssClasses = { ANIM_CHECKED_INDETERMINATE: 'mdc-checkbox--anim-checked-indeterminate', ANIM_CHECKED_UNCHECKED: 'mdc-checkbox--anim-checked-unchecked', ANIM_INDETERMINATE_CHECKED: 'mdc-checkbox--anim-indeterminate-checked', ANIM_INDETERMINATE_UNCHECKED: 'mdc-checkbox--anim-indeterminate-unchecked', ANIM_UNCHECKED_CHECKED: 'mdc-checkbox--anim-unchecked-checked', ANIM_UNCHECKED_INDETERMINATE: 'mdc-checkbox--anim-unchecked-indeterminate', BACKGROUND: 'mdc-checkbox__background', CHECKED: 'mdc-checkbox--checked', CHECKMARK: 'mdc-checkbox__checkmark', CHECKMARK_PATH: 'mdc-checkbox__checkmark-path', DISABLED: 'mdc-checkbox--disabled', INDETERMINATE: 'mdc-checkbox--indeterminate', MIXEDMARK: 'mdc-checkbox__mixedmark', NATIVE_CONTROL: 'mdc-checkbox__native-control', ROOT: 'mdc-checkbox', SELECTED: 'mdc-checkbox--selected', UPGRADED: 'mdc-checkbox--upgraded' }; var strings = { ARIA_CHECKED_ATTR: 'aria-checked', ARIA_CHECKED_INDETERMINATE_VALUE: 'mixed', NATIVE_CONTROL_SELECTOR: '.mdc-checkbox__native-control', TRANSITION_STATE_CHECKED: 'checked', TRANSITION_STATE_INDETERMINATE: 'indeterminate', TRANSITION_STATE_INIT: 'init', TRANSITION_STATE_UNCHECKED: 'unchecked' }; var numbers = { ANIM_END_LATCH_MS: 250 }; //# sourceMappingURL=constants.js.map /***/ }), /* 286 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initFileInputs; /* unused harmony export VFileInput */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__base_component__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_event_handler__ = __webpack_require__(4); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__mixins_dirtyable__ = __webpack_require__(11); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function initFileInputs(e) { console.debug('\tFile Inputs'); Object(__WEBPACK_IMPORTED_MODULE_0__base_component__["c" /* hookupComponents */])(e, '.v-file-input', VFileInput, null); } var VFileInput = function (_dirtyableMixin) { _inherits(VFileInput, _dirtyableMixin); function VFileInput(element, mdcComponent) { _classCallCheck(this, VFileInput); var _this = _possibleConstructorReturn(this, (VFileInput.__proto__ || Object.getPrototypeOf(VFileInput)).call(this, element, mdcComponent)); _this.input = element.querySelector('input[type=file]'); _this.accept = element.dataset.accept; _this.preview = JSON.parse(element.dataset.preview); ['change'].forEach(function (e) { element.addEventListener(e, function (e) { return _this.handleFileSelection(e); }, false); }); _this.originalValue = _this.input.value; return _this; } _createClass(VFileInput, [{ key: 'prepareSubmit', value: function prepareSubmit(params) { params.push([this.name(), this.value()]); } }, { key: 'name', value: function name() { return this.input.name; } }, { key: 'value', value: function value() { return this.input.files[0]; } }, { key: 'previewComponent', value: function previewComponent(e) { var _this2 = this; if (!this.preview) return null; var _loop = function _loop(previewId) { var elem = _this2.root.querySelector('#' + previewId); if (elem && elem.vComponent && elem.vComponent.preview) { _this2.file = e.target.files[0]; var fr = new FileReader(); fr.onload = function (e) { _this2.previewSelection(e, elem.vComponent); }; if (_this2.accept.startsWith('text')) { fr.readAsText(_this2.file); } else { fr.readAsDataURL(_this2.file); } } else { console.warn('WARNING: Unable to find previewable element with id: ' + previewId + '\n1) Make sure you have an element with that id on your page\n2) Make sure the Componenet or Plugin supports the preview option for the request mime type'); } }; var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = this.preview[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var previewId = _step.value; _loop(previewId); } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } } }, { key: 'previewSelection', value: function previewSelection(e, previewComp) { previewComp.preview(e.target.result, this.accepts, this.file); } }, { key: 'isDirty', value: function isDirty() { return this.dirtyable && this.input.value !== this.originalValue; } // From an example based on: https://www.quirksmode.org/dom/inputfile.html }, { key: 'handleFileSelection', value: function handleFileSelection(e) { this.previewComponent(e); } }]); return VFileInput; }(Object(__WEBPACK_IMPORTED_MODULE_2__mixins_dirtyable__["a" /* dirtyableMixin */])(Object(__WEBPACK_IMPORTED_MODULE_1__mixins_event_handler__["a" /* eventHandlerMixin */])(__WEBPACK_IMPORTED_MODULE_0__base_component__["a" /* VBaseComponent */]))); /***/ }), /* 287 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initFormFields; /* unused harmony export VFormField */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__base_container__ = __webpack_require__(10); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__base_component__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_form_field__ = __webpack_require__(288); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // This is used to get a proper binding of the actionData // https://stackoverflow.com/questions/750486/javascript-closure-inside-loops-simple-practical-example function initFormFields(e) { console.debug('\tForm Fields'); Object(__WEBPACK_IMPORTED_MODULE_1__base_component__["c" /* hookupComponents */])(e, '.v-form-field', VFormField, __WEBPACK_IMPORTED_MODULE_2__material_form_field__["a" /* MDCFormField */]); } var VFormField = function (_VBaseContainer) { _inherits(VFormField, _VBaseContainer); function VFormField(element, mdcComponent) { _classCallCheck(this, VFormField); return _possibleConstructorReturn(this, (VFormField.__proto__ || Object.getPrototypeOf(VFormField)).call(this, element, mdcComponent)); } return VFormField; }(__WEBPACK_IMPORTED_MODULE_0__base_container__["a" /* VBaseContainer */]); /***/ }), /* 288 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__component__ = __webpack_require__(289); /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__component__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(145); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(144); /* unused harmony namespace reexport */ /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ //# sourceMappingURL=index.js.map /***/ }), /* 289 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCFormField; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(144); /** * @license * Copyright 2017 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCFormField = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCFormField, _super); function MDCFormField() { return _super !== null && _super.apply(this, arguments) || this; } MDCFormField.attachTo = function (root) { return new MDCFormField(root); }; Object.defineProperty(MDCFormField.prototype, "input", { get: function get() { return this.input_; }, set: function set(input) { this.input_ = input; }, enumerable: true, configurable: true }); Object.defineProperty(MDCFormField.prototype, "label_", { get: function get() { var LABEL_SELECTOR = __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* MDCFormFieldFoundation */].strings.LABEL_SELECTOR; return this.root_.querySelector(LABEL_SELECTOR); }, enumerable: true, configurable: true }); MDCFormField.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. var adapter = { activateInputRipple: function activateInputRipple() { if (_this.input_ && _this.input_.ripple) { _this.input_.ripple.activate(); } }, deactivateInputRipple: function deactivateInputRipple() { if (_this.input_ && _this.input_.ripple) { _this.input_.ripple.deactivate(); } }, deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) { if (_this.label_) { _this.label_.removeEventListener(evtType, handler); } }, registerInteractionHandler: function registerInteractionHandler(evtType, handler) { if (_this.label_) { _this.label_.addEventListener(evtType, handler); } } }; return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* MDCFormFieldFoundation */](adapter); }; return MDCFormField; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 290 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initImages; /* unused harmony export VImage */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__base_component__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_event_handler__ = __webpack_require__(4); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function initImages(e) { console.debug('\tImages'); Object(__WEBPACK_IMPORTED_MODULE_0__base_component__["c" /* hookupComponents */])(e, '.v-image', VImage); } var VImage = function (_eventHandlerMixin) { _inherits(VImage, _eventHandlerMixin); function VImage(element) { _classCallCheck(this, VImage); return _possibleConstructorReturn(this, (VImage.__proto__ || Object.getPrototypeOf(VImage)).call(this, element)); } _createClass(VImage, [{ key: 'preview', value: function preview(result, acceptsMimeTypes, file) { this.element.src = result; } }]); return VImage; }(Object(__WEBPACK_IMPORTED_MODULE_1__mixins_event_handler__["a" /* eventHandlerMixin */])(__WEBPACK_IMPORTED_MODULE_0__base_component__["a" /* VBaseComponent */])); /***/ }), /* 291 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initTypography; /* unused harmony export VTypography */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__base_component__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_event_handler__ = __webpack_require__(4); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function initTypography(e) { console.debug('\tTypography'); Object(__WEBPACK_IMPORTED_MODULE_0__base_component__["c" /* hookupComponents */])(e, '.v-typography', VTypography); } var VTypography = function (_eventHandlerMixin) { _inherits(VTypography, _eventHandlerMixin); function VTypography(element) { _classCallCheck(this, VTypography); return _possibleConstructorReturn(this, (VTypography.__proto__ || Object.getPrototypeOf(VTypography)).call(this, element)); } _createClass(VTypography, [{ key: 'preview', value: function preview(result, acceptsMimeTypes, file) { this.element.innerText = file.name; } }, { key: 'clear', value: function clear() { this.element.innerText = ''; } }, { key: 'value', value: function value() { return this.element.innerText; } }]); return VTypography; }(Object(__WEBPACK_IMPORTED_MODULE_1__mixins_event_handler__["a" /* eventHandlerMixin */])(__WEBPACK_IMPORTED_MODULE_0__base_component__["a" /* VBaseComponent */])); /***/ }), /* 292 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initTooltips; /* unused harmony export VTooltip */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__base_component__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_event_handler__ = __webpack_require__(4); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* global MaterialTooltip */ function initTooltips(e) { console.debug('\tTooltips'); Object(__WEBPACK_IMPORTED_MODULE_0__base_component__["c" /* hookupComponents */])(e, '.v-tooltip', VTooltip, MaterialTooltip); } var VTooltip = function (_eventHandlerMixin) { _inherits(VTooltip, _eventHandlerMixin); function VTooltip(element, mdcComponent) { _classCallCheck(this, VTooltip); return _possibleConstructorReturn(this, (VTooltip.__proto__ || Object.getPrototypeOf(VTooltip)).call(this, element, mdcComponent)); } return VTooltip; }(Object(__WEBPACK_IMPORTED_MODULE_1__mixins_event_handler__["a" /* eventHandlerMixin */])(__WEBPACK_IMPORTED_MODULE_0__base_component__["a" /* VBaseComponent */])); /***/ }), /* 293 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initPlugins; /* unused harmony export VPluginComponent */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__base_component__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_event_handler__ = __webpack_require__(4); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function initPlugins(e) { console.debug('\tPlugins'); Object(__WEBPACK_IMPORTED_MODULE_0__base_component__["c" /* hookupComponents */])(e, '.v-plugin', VPluginComponent); } // Delegating plugin class. Allows a plugin to define a class-name as a data // element, then constructs that class and delegates component lifecycle // events to the class. var VPluginComponent = function (_eventHandlerMixin) { _inherits(VPluginComponent, _eventHandlerMixin); function VPluginComponent(element) { _classCallCheck(this, VPluginComponent); var _this = _possibleConstructorReturn(this, (VPluginComponent.__proto__ || Object.getPrototypeOf(VPluginComponent)).call(this, element)); var pluginClassName = _this.element.dataset.pluginCallback; if (pluginClassName) { var PluginClass = null; if (!/^[$_a-z][$_a-z0-9.]*$/i.test(pluginClassName)) { console.error('Invalid class name: $(pluginClassName)'); } else { PluginClass = eval(pluginClassName); } if (PluginClass) { _this.element.vPlugin = new PluginClass(element); } else { console.error('Unable to find a plugin class with name ' + pluginClassName); } } return _this; } _createClass(VPluginComponent, [{ key: 'prepareSubmit', value: function prepareSubmit(params) { if (this.element.vPlugin && this.element.vPlugin.prepareSubmit) { this.element.vPlugin.prepareSubmit(params); } } }, { key: 'validate', value: function validate(formData) { if (this.element.vPlugin && this.element.vPlugin.validate) { return this.element.vPlugin.validate(formData); } return _get(VPluginComponent.prototype.__proto__ || Object.getPrototypeOf(VPluginComponent.prototype), 'validate', this).call(this, formData); } }, { key: 'clear', value: function clear() { if (this.element.vPlugin && this.element.vPlugin.clear) { return this.element.vPlugin.clear(); } } }, { key: 'reset', value: function reset() { if (this.element.vPlugin && this.element.vPlugin.reset) { return this.element.vPlugin.reset(); } } }, { key: 'onShow', value: function onShow() { if (this.element.vPlugin && this.element.vPlugin.onShow) { return this.element.vPlugin.onShow(); } } }, { key: 'initEventListener', value: function initEventListener(eventName, eventHandler) { if (this.element.vPlugin && this.element.vPlugin.initEventListener) { this.element.vPlugin.initEventListener(eventName, eventHandler); } else { _get(VPluginComponent.prototype.__proto__ || Object.getPrototypeOf(VPluginComponent.prototype), 'initEventListener', this).call(this, eventName, eventHandler); } } }, { key: 'preview', value: function preview(result, acceptsMimeTypes, e) { if (this.canPreview()) { this.element.vPlugin.preview(result, acceptsMimeTypes, e); } } }, { key: 'canPreview', value: function canPreview() { return this.element.vPlugin && this.element.vPlugin.preview; } }]); return VPluginComponent; }(Object(__WEBPACK_IMPORTED_MODULE_1__mixins_event_handler__["a" /* eventHandlerMixin */])(__WEBPACK_IMPORTED_MODULE_0__base_component__["a" /* VBaseComponent */])); /***/ }), /* 294 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initProgress; /* unused harmony export VProgress */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__base_component__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_linear_progress__ = __webpack_require__(295); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function initProgress(e) { console.debug('\tProgress'); Object(__WEBPACK_IMPORTED_MODULE_0__base_component__["c" /* hookupComponents */])(e, '.v-progress', VProgress, __WEBPACK_IMPORTED_MODULE_1__material_linear_progress__["a" /* MDCLinearProgress */]); } var VProgress = function (_VBaseComponent) { _inherits(VProgress, _VBaseComponent); function VProgress(element, mdcComponent) { _classCallCheck(this, VProgress); var _this = _possibleConstructorReturn(this, (VProgress.__proto__ || Object.getPrototypeOf(VProgress)).call(this, element, mdcComponent)); element.dataset.hidden === 'true' ? _this.hide() : _this.show(); _this.root.addEventListener('V:postStarted', function (e) { _this.show(); }); _this.root.addEventListener('V:postFinished', function (e) { _this.hide(); }); _this.root.addEventListener('V:eventsHalted', function (e) { _this.hide(); }); return _this; } _createClass(VProgress, [{ key: 'show', value: function show() { this.mdcComponent.open(); } }, { key: 'hide', value: function hide() { this.mdcComponent.close(); } }]); return VProgress; }(__WEBPACK_IMPORTED_MODULE_0__base_component__["a" /* VBaseComponent */]); /***/ }), /* 295 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__component__ = __webpack_require__(296); /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__component__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(147); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(146); /* unused harmony namespace reexport */ /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ //# sourceMappingURL=index.js.map /***/ }), /* 296 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCLinearProgress; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(146); /** * @license * Copyright 2017 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var MDCLinearProgress = /** @class */function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](MDCLinearProgress, _super); function MDCLinearProgress() { return _super !== null && _super.apply(this, arguments) || this; } MDCLinearProgress.attachTo = function (root) { return new MDCLinearProgress(root); }; Object.defineProperty(MDCLinearProgress.prototype, "determinate", { set: function set(value) { this.foundation_.setDeterminate(value); }, enumerable: true, configurable: true }); Object.defineProperty(MDCLinearProgress.prototype, "progress", { set: function set(value) { this.foundation_.setProgress(value); }, enumerable: true, configurable: true }); Object.defineProperty(MDCLinearProgress.prototype, "buffer", { set: function set(value) { this.foundation_.setBuffer(value); }, enumerable: true, configurable: true }); Object.defineProperty(MDCLinearProgress.prototype, "reverse", { set: function set(value) { this.foundation_.setReverse(value); }, enumerable: true, configurable: true }); MDCLinearProgress.prototype.open = function () { this.foundation_.open(); }; MDCLinearProgress.prototype.close = function () { this.foundation_.close(); }; MDCLinearProgress.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. var adapter = { addClass: function addClass(className) { return _this.root_.classList.add(className); }, getBuffer: function getBuffer() { return _this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* MDCLinearProgressFoundation */].strings.BUFFER_SELECTOR); }, getPrimaryBar: function getPrimaryBar() { return _this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* MDCLinearProgressFoundation */].strings.PRIMARY_BAR_SELECTOR); }, hasClass: function hasClass(className) { return _this.root_.classList.contains(className); }, removeClass: function removeClass(className) { return _this.root_.classList.remove(className); }, setStyle: function setStyle(el, styleProperty, value) { return el.style.setProperty(styleProperty, value); } }; return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* MDCLinearProgressFoundation */](adapter); }; return MDCLinearProgress; }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* MDCComponent */]); //# sourceMappingURL=component.js.map /***/ }), /* 297 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = initMultiSelects; /* unused harmony export VMultiSelect */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_notched_outline__ = __webpack_require__(298); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__base_component__ = __webpack_require__(1); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function initMultiSelects(root) { console.debug('\tMultiSelects'); Object(__WEBPACK_IMPORTED_MODULE_1__base_component__["d" /* hookupComponentsManually */])(root, '.v-multi-select-container', function (element) { return new VMultiSelect(root, element); }); } var VMultiSelect = function () { function VMultiSelect(root, element) { _classCallCheck(this, VMultiSelect); this.vComponent = root.vComponent; this.element = element; this.setEventListeners(); this.setLabelHandlers(); } _createClass(VMultiSelect, [{ key: 'setEventListeners', value: function setEventListeners() { this.element.addEventListener('click', createToggleHandler(this.element)); document.addEventListener('click', createCloseHandler(this.element)); } }, { key: 'setLabelHandlers', value: function setLabelHandlers() { createValueDescriptionHandler(this.element); setCurrentValueDescription(this.element); setLabelNotch(this.element); } }]); return VMultiSelect; }(); function createToggleHandler(component) { return function (event) { if (!event.target.classList.contains('v-multi-select--option')) { component.querySelector('.v-multi-select--options-list').classList.toggle('v-hidden'); component.classList.toggle('mdc-select--focused'); } }; } function createCloseHandler(component) { return function (event) { if (!event.target.className.match(/[\w-]*v-multi-select[\w-]*/g)) { component.querySelector('.v-multi-select--options-list').classList.add('v-hidden'); component.classList.remove('mdc-select--focused'); } }; } function createValueDescriptionHandler(component) { var listElements = component.querySelectorAll('.v-multi-select--option'); var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = listElements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var element = _step.value; element.addEventListener('change', function (e) { setCurrentValueDescription(component); }); } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } } function setCurrentValueDescription(component) { var selectedElements = Array.from(component.querySelectorAll('.v-multi-select--option')).filter(function (e) { return e.checked; }); var msg = selectedElements.length + ' selected'; if (selectedElements.length === 1 && selectedElements[0].labels.length === 1) { msg = selectedElements[0].labels[0].innerText; } component.querySelector('.v-multi-select--current-values').innerText = msg; } function setLabelNotch(component) { var labelWidth = component.querySelector('.mdc-floating-label').offsetWidth * .75; var notchedOutline = new __WEBPACK_IMPORTED_MODULE_0__material_notched_outline__["a" /* MDCNotchedOutline */](component.querySelector('.mdc-notched-outline')); notchedOutline.notch(labelWidth); } /***/ }), /* 298 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__component__ = __webpack_require__(39); /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__component__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(40); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(91); /* unused harmony namespace reexport */ /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ //# sourceMappingURL=index.js.map /***/ }), /* 299 */ /***/ (function(module, exports) { /** @license @nocompile Copyright (c) 2018 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ (function () { 'use strict'; (function () { if (void 0 === window.Reflect || void 0 === window.customElements || window.customElements.polyfillWrapFlushCallback) return;var a = HTMLElement;window.HTMLElement = { HTMLElement: function HTMLElement() { return Reflect.construct(a, [], this.constructor); } }.HTMLElement, HTMLElement.prototype = a.prototype, HTMLElement.prototype.constructor = HTMLElement, Object.setPrototypeOf(HTMLElement, a); })(); })(); /***/ }), /* 300 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global, setImmediate) {var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /** @license @nocompile Copyright (c) 2018 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ (function () { /* Copyright (c) 2016 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ 'use strict'; var w;function ba(a) { var b = 0;return function () { return b < a.length ? { done: !1, value: a[b++] } : { done: !0 }; }; }function ca(a) { var b = "undefined" != typeof Symbol && Symbol.iterator && a[Symbol.iterator];return b ? b.call(a) : { next: ba(a) }; }function da(a) { if (!(a instanceof Array)) { a = ca(a);for (var b, c = []; !(b = a.next()).done;) { c.push(b.value); }a = c; }return a; } var ea = "undefined" != typeof window && window === this ? this : "undefined" != typeof global && null != global ? global : this, ha = "function" == typeof Object.defineProperties ? Object.defineProperty : function (a, b, c) { a != Array.prototype && a != Object.prototype && (a[b] = c.value); };function ia() { ia = function ia() {};ea.Symbol || (ea.Symbol = la); }function ma(a, b) { this.a = a;ha(this, "description", { configurable: !0, writable: !0, value: b }); }ma.prototype.toString = function () { return this.a; }; var la = function () { function a(c) { if (this instanceof a) throw new TypeError("Symbol is not a constructor");return new ma("jscomp_symbol_" + (c || "") + "_" + b++, c); }var b = 0;return a; }();function na() { ia();var a = ea.Symbol.iterator;a || (a = ea.Symbol.iterator = ea.Symbol("Symbol.iterator"));"function" != typeof Array.prototype[a] && ha(Array.prototype, a, { configurable: !0, writable: !0, value: function value() { return ra(ba(this)); } });na = function na() {}; } function ra(a) { na();a = { next: a };a[ea.Symbol.iterator] = function () { return this; };return a; }var sa;if ("function" == typeof Object.setPrototypeOf) sa = Object.setPrototypeOf;else { var ua;a: { var va = { Ga: !0 }, wa = {};try { wa.__proto__ = va;ua = wa.Ga;break a; } catch (a) {}ua = !1; }sa = ua ? function (a, b) { a.__proto__ = b;if (a.__proto__ !== b) throw new TypeError(a + " is not extensible");return a; } : null; }var xa = sa;function ya() { this.f = !1;this.b = null;this.U = void 0;this.a = 1;this.D = 0;this.c = null; } function za(a) { if (a.f) throw new TypeError("Generator is already running");a.f = !0; }ya.prototype.u = function (a) { this.U = a; };function Aa(a, b) { a.c = { Ja: b, Na: !0 };a.a = a.D; }ya.prototype.return = function (a) { this.c = { return: a };this.a = this.D; };function Ba(a, b) { a.a = 3;return { value: b }; }function Ca(a) { this.a = new ya();this.b = a; }function Da(a, b) { za(a.a);var c = a.a.b;if (c) return Ea(a, "return" in c ? c["return"] : function (d) { return { value: d, done: !0 }; }, b, a.a.return);a.a.return(b);return Fa(a); } function Ea(a, b, c, d) { try { var e = b.call(a.a.b, c);if (!(e instanceof Object)) throw new TypeError("Iterator result " + e + " is not an object");if (!e.done) return a.a.f = !1, e;var f = e.value; } catch (g) { return a.a.b = null, Aa(a.a, g), Fa(a); }a.a.b = null;d.call(a.a, f);return Fa(a); }function Fa(a) { for (; a.a.a;) { try { var b = a.b(a.a);if (b) return a.a.f = !1, { value: b.value, done: !1 }; } catch (c) { a.a.U = void 0, Aa(a.a, c); } }a.a.f = !1;if (a.a.c) { b = a.a.c;a.a.c = null;if (b.Na) throw b.Ja;return { value: b.return, done: !0 }; }return { value: void 0, done: !0 }; } function Ga(a) { this.next = function (b) { za(a.a);a.a.b ? b = Ea(a, a.a.b.next, b, a.a.u) : (a.a.u(b), b = Fa(a));return b; };this.throw = function (b) { za(a.a);a.a.b ? b = Ea(a, a.a.b["throw"], b, a.a.u) : (Aa(a.a, b), b = Fa(a));return b; };this.return = function (b) { return Da(a, b); };na();this[Symbol.iterator] = function () { return this; }; }function Ha(a, b) { b = new Ga(new Ca(b));xa && xa(b, a.prototype);return b; }Array.from || (Array.from = function (a) { return [].slice.call(a); }); Object.assign || (Object.assign = function (a) { for (var b = [].slice.call(arguments, 1), c = 0, d; c < b.length; c++) { if (d = b[c]) for (var e = a, f = d, g = Object.getOwnPropertyNames(f), h = 0; h < g.length; h++) { d = g[h], e[d] = f[d]; } }return a; });(function () { if (!function () { var f = document.createEvent("Event");f.initEvent("foo", !0, !0);f.preventDefault();return f.defaultPrevented; }()) { var a = Event.prototype.preventDefault;Event.prototype.preventDefault = function () { this.cancelable && (a.call(this), Object.defineProperty(this, "defaultPrevented", { get: function get() { return !0; }, configurable: !0 })); }; }var b = /Trident/.test(navigator.userAgent);if (!window.Event || b && "function" !== typeof window.Event) { var c = window.Event;window.Event = function (f, g) { g = g || {};var h = document.createEvent("Event"); h.initEvent(f, !!g.bubbles, !!g.cancelable);return h; };if (c) { for (var d in c) { window.Event[d] = c[d]; }window.Event.prototype = c.prototype; } }if (!window.CustomEvent || b && "function" !== typeof window.CustomEvent) window.CustomEvent = function (f, g) { g = g || {};var h = document.createEvent("CustomEvent");h.initCustomEvent(f, !!g.bubbles, !!g.cancelable, g.detail);return h; }, window.CustomEvent.prototype = window.Event.prototype;if (!window.MouseEvent || b && "function" !== typeof window.MouseEvent) { b = window.MouseEvent;window.MouseEvent = function (f, g) { g = g || {};var h = document.createEvent("MouseEvent");h.initMouseEvent(f, !!g.bubbles, !!g.cancelable, g.view || window, g.detail, g.screenX, g.screenY, g.clientX, g.clientY, g.ctrlKey, g.altKey, g.shiftKey, g.metaKey, g.button, g.relatedTarget);return h; };if (b) for (var e in b) { window.MouseEvent[e] = b[e]; }window.MouseEvent.prototype = b.prototype; } })();(function () { function a() {}function b(p, t) { if (!p.childNodes.length) return [];switch (p.nodeType) {case Node.DOCUMENT_NODE: return F.call(p, t);case Node.DOCUMENT_FRAGMENT_NODE: return C.call(p, t);default: return r.call(p, t);} }var c = "undefined" === typeof HTMLTemplateElement, d = !(document.createDocumentFragment().cloneNode() instanceof DocumentFragment), e = !1;/Trident/.test(navigator.userAgent) && function () { function p(y, R) { if (y instanceof DocumentFragment) for (var $a; $a = y.firstChild;) { D.call(this, $a, R); } else D.call(this, y, R);return y; }e = !0;var t = Node.prototype.cloneNode;Node.prototype.cloneNode = function (y) { y = t.call(this, y);this instanceof DocumentFragment && (y.__proto__ = DocumentFragment.prototype);return y; };DocumentFragment.prototype.querySelectorAll = HTMLElement.prototype.querySelectorAll;DocumentFragment.prototype.querySelector = HTMLElement.prototype.querySelector;Object.defineProperties(DocumentFragment.prototype, { nodeType: { get: function get() { return Node.DOCUMENT_FRAGMENT_NODE; }, configurable: !0 }, localName: { get: function get() {}, configurable: !0 }, nodeName: { get: function get() { return "#document-fragment"; }, configurable: !0 } });var D = Node.prototype.insertBefore;Node.prototype.insertBefore = p;var K = Node.prototype.appendChild;Node.prototype.appendChild = function (y) { y instanceof DocumentFragment ? p.call(this, y, null) : K.call(this, y);return y; };var aa = Node.prototype.removeChild, ja = Node.prototype.replaceChild;Node.prototype.replaceChild = function (y, R) { y instanceof DocumentFragment ? (p.call(this, y, R), aa.call(this, R)) : ja.call(this, y, R);return R; };Document.prototype.createDocumentFragment = function () { var y = this.createElement("df");y.__proto__ = DocumentFragment.prototype;return y; };var oa = Document.prototype.importNode;Document.prototype.importNode = function (y, R) { R = oa.call(this, y, R || !1);y instanceof DocumentFragment && (R.__proto__ = DocumentFragment.prototype);return R; }; }();var f = Node.prototype.cloneNode, g = Document.prototype.createElement, h = Document.prototype.importNode, k = Node.prototype.removeChild, l = Node.prototype.appendChild, m = Node.prototype.replaceChild, q = DOMParser.prototype.parseFromString, H = Object.getOwnPropertyDescriptor(window.HTMLElement.prototype, "innerHTML") || { get: function get() { return this.innerHTML; }, set: function set(p) { this.innerHTML = p; } }, E = Object.getOwnPropertyDescriptor(window.Node.prototype, "childNodes") || { get: function get() { return this.childNodes; } }, r = Element.prototype.querySelectorAll, F = Document.prototype.querySelectorAll, C = DocumentFragment.prototype.querySelectorAll, N = function () { if (!c) { var p = document.createElement("template"), t = document.createElement("template");t.content.appendChild(document.createElement("div")); p.content.appendChild(t);p = p.cloneNode(!0);return 0 === p.content.childNodes.length || 0 === p.content.firstChild.content.childNodes.length || d; } }();if (c) { var x = document.implementation.createHTMLDocument("template"), X = !0, v = document.createElement("style");v.textContent = "template{display:none;}";var pa = document.head;pa.insertBefore(v, pa.firstElementChild);a.prototype = Object.create(HTMLElement.prototype);var fa = !document.createElement("div").hasOwnProperty("innerHTML");a.S = function (p) { if (!p.content && p.namespaceURI === document.documentElement.namespaceURI) { p.content = x.createDocumentFragment();for (var t; t = p.firstChild;) { l.call(p.content, t); }if (fa) p.__proto__ = a.prototype;else if (p.cloneNode = function (D) { return a.b(this, D); }, X) try { n(p), I(p); } catch (D) { X = !1; }a.a(p.content); } };var qa = { option: ["select"], thead: ["table"], col: ["colgroup", "table"], tr: ["tbody", "table"], th: ["tr", "tbody", "table"], td: ["tr", "tbody", "table"] }, n = function n(p) { Object.defineProperty(p, "innerHTML", { get: function get() { return ta(this); }, set: function set(t) { var D = qa[(/<([a-z][^/\0>\x20\t\r\n\f]+)/i.exec(t) || ["", ""])[1].toLowerCase()];if (D) for (var K = 0; K < D.length; K++) { t = "<" + D[K] + ">" + t + "</" + D[K] + ">"; }x.body.innerHTML = t;for (a.a(x); this.content.firstChild;) { k.call(this.content, this.content.firstChild); }t = x.body;if (D) for (K = 0; K < D.length; K++) { t = t.lastChild; }for (; t.firstChild;) { l.call(this.content, t.firstChild); } }, configurable: !0 }); }, I = function I(p) { Object.defineProperty(p, "outerHTML", { get: function get() { return "<template>" + this.innerHTML + "</template>"; }, set: function set(t) { if (this.parentNode) { x.body.innerHTML = t;for (t = this.ownerDocument.createDocumentFragment(); x.body.firstChild;) { l.call(t, x.body.firstChild); }m.call(this.parentNode, t, this); } else throw Error("Failed to set the 'outerHTML' property on 'Element': This element has no parent node."); }, configurable: !0 }); };n(a.prototype);I(a.prototype);a.a = function (p) { p = b(p, "template");for (var t = 0, D = p.length, K; t < D && (K = p[t]); t++) { a.S(K); } };document.addEventListener("DOMContentLoaded", function () { a.a(document); });Document.prototype.createElement = function () { var p = g.apply(this, arguments);"template" === p.localName && a.S(p);return p; };DOMParser.prototype.parseFromString = function () { var p = q.apply(this, arguments);a.a(p);return p; };Object.defineProperty(HTMLElement.prototype, "innerHTML", { get: function get() { return ta(this); }, set: function set(p) { H.set.call(this, p);a.a(this); }, configurable: !0, enumerable: !0 });var ka = /[&\u00A0"]/g, Tb = /[&\u00A0<>]/g, ab = function ab(p) { switch (p) {case "&": return "&";case "<": return "<";case ">": return ">";case '"': return """;case "\xA0": return " ";} };v = function v(p) { for (var t = {}, D = 0; D < p.length; D++) { t[p[D]] = !0; }return t; };var Pa = v("area base br col command embed hr img input keygen link meta param source track wbr".split(" ")), bb = v("style script xmp iframe noembed noframes plaintext noscript".split(" ")), ta = function ta(p, t) { "template" === p.localName && (p = p.content);for (var D = "", K = t ? t(p) : E.get.call(p), aa = 0, ja = K.length, oa; aa < ja && (oa = K[aa]); aa++) { a: { var y = oa;var R = p;var $a = t;switch (y.nodeType) {case Node.ELEMENT_NODE: for (var Ub = y.localName, cb = "<" + Ub, Uf = y.attributes, qd = 0; R = Uf[qd]; qd++) { cb += " " + R.name + '="' + R.value.replace(ka, ab) + '"'; }cb += ">";y = Pa[Ub] ? cb : cb + ta(y, $a) + "</" + Ub + ">";break a;case Node.TEXT_NODE: y = y.data;y = R && bb[R.localName] ? y : y.replace(Tb, ab);break a;case Node.COMMENT_NODE: y = "\x3c!--" + y.data + "--\x3e";break a;default: throw window.console.error(y), Error("not implemented");} }D += y; }return D; }; }if (c || N) { a.b = function (p, t) { var D = f.call(p, !1);this.S && this.S(D);t && (l.call(D.content, f.call(p.content, !0)), u(D.content, p.content));return D; };var u = function u(p, t) { if (t.querySelectorAll && (t = b(t, "template"), 0 !== t.length)) { p = b(p, "template");for (var D = 0, K = p.length, aa, ja; D < K; D++) { ja = t[D], aa = p[D], a && a.S && a.S(ja), m.call(aa.parentNode, G.call(ja, !0), aa); } } }, G = Node.prototype.cloneNode = function (p) { if (!e && d && this instanceof DocumentFragment) { if (p) var t = J.call(this.ownerDocument, this, !0);else return this.ownerDocument.createDocumentFragment(); } else this.nodeType === Node.ELEMENT_NODE && "template" === this.localName && this.namespaceURI == document.documentElement.namespaceURI ? t = a.b(this, p) : t = f.call(this, p);p && u(t, this);return t; }, J = Document.prototype.importNode = function (p, t) { t = t || !1;if ("template" === p.localName) return a.b(p, t);var D = h.call(this, p, t);if (t) { u(D, p);p = b(D, 'script:not([type]),script[type="application/javascript"],script[type="text/javascript"]');for (var K, aa = 0; aa < p.length; aa++) { K = p[aa];t = g.call(document, "script");t.textContent = K.textContent;for (var ja = K.attributes, oa = 0, y; oa < ja.length; oa++) { y = ja[oa], t.setAttribute(y.name, y.value); }m.call(K.parentNode, t, K); } }return D; }; }c && (window.HTMLTemplateElement = a); })();var Ia = setTimeout;function Ja() {}function Ka(a, b) { return function () { a.apply(b, arguments); }; }function z(a) { if (!(this instanceof z)) throw new TypeError("Promises must be constructed via new");if ("function" !== typeof a) throw new TypeError("not a function");this.J = 0;this.oa = !1;this.w = void 0;this.V = [];La(a, this); } function Ma(a, b) { for (; 3 === a.J;) { a = a.w; }0 === a.J ? a.V.push(b) : (a.oa = !0, Na(function () { var c = 1 === a.J ? b.Pa : b.Qa;if (null === c) (1 === a.J ? Oa : Qa)(b.ma, a.w);else { try { var d = c(a.w); } catch (e) { Qa(b.ma, e);return; }Oa(b.ma, d); } })); }function Oa(a, b) { try { if (b === a) throw new TypeError("A promise cannot be resolved with itself.");if (b && ("object" === (typeof b === "undefined" ? "undefined" : _typeof(b)) || "function" === typeof b)) { var c = b.then;if (b instanceof z) { a.J = 3;a.w = b;Ra(a);return; }if ("function" === typeof c) { La(Ka(c, b), a);return; } }a.J = 1;a.w = b;Ra(a); } catch (d) { Qa(a, d); } } function Qa(a, b) { a.J = 2;a.w = b;Ra(a); }function Ra(a) { 2 === a.J && 0 === a.V.length && Na(function () { a.oa || "undefined" !== typeof console && console && console.warn("Possible Unhandled Promise Rejection:", a.w); });for (var b = 0, c = a.V.length; b < c; b++) { Ma(a, a.V[b]); }a.V = null; }function Sa(a, b, c) { this.Pa = "function" === typeof a ? a : null;this.Qa = "function" === typeof b ? b : null;this.ma = c; }function La(a, b) { var c = !1;try { a(function (d) { c || (c = !0, Oa(b, d)); }, function (d) { c || (c = !0, Qa(b, d)); }); } catch (d) { c || (c = !0, Qa(b, d)); } } z.prototype["catch"] = function (a) { return this.then(null, a); };z.prototype.then = function (a, b) { var c = new this.constructor(Ja);Ma(this, new Sa(a, b, c));return c; };z.prototype["finally"] = function (a) { var b = this.constructor;return this.then(function (c) { return b.resolve(a()).then(function () { return c; }); }, function (c) { return b.resolve(a()).then(function () { return b.reject(c); }); }); }; function Ta(a) { return new z(function (b, c) { function d(h, k) { try { if (k && ("object" === (typeof k === "undefined" ? "undefined" : _typeof(k)) || "function" === typeof k)) { var l = k.then;if ("function" === typeof l) { l.call(k, function (m) { d(h, m); }, c);return; } }e[h] = k;0 === --f && b(e); } catch (m) { c(m); } }if (!a || "undefined" === typeof a.length) throw new TypeError("Promise.all accepts an array");var e = Array.prototype.slice.call(a);if (0 === e.length) return b([]);for (var f = e.length, g = 0; g < e.length; g++) { d(g, e[g]); } }); } function Ua(a) { return a && "object" === (typeof a === "undefined" ? "undefined" : _typeof(a)) && a.constructor === z ? a : new z(function (b) { b(a); }); }function Va(a) { return new z(function (b, c) { c(a); }); }function Wa(a) { return new z(function (b, c) { for (var d = 0, e = a.length; d < e; d++) { a[d].then(b, c); } }); }var Na = "function" === typeof setImmediate && function (a) { setImmediate(a); } || function (a) { Ia(a, 0); }; /* Copyright (c) 2017 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ if (!window.Promise) { window.Promise = z;z.prototype.then = z.prototype.then;z.all = Ta;z.race = Wa;z.resolve = Ua;z.reject = Va;var Xa = document.createTextNode(""), Ya = [];new MutationObserver(function () { for (var a = Ya.length, b = 0; b < a; b++) { Ya[b](); }Ya.splice(0, a); }).observe(Xa, { characterData: !0 });Na = function Na(a) { Ya.push(a);Xa.textContent = 0 < Xa.textContent.length ? "" : "a"; }; }; /* Copyright (C) 2015 by WebReflection Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ (function (a, b) { if (!(b in a)) { var c = (typeof global === "undefined" ? "undefined" : _typeof(global)) === (typeof c === "undefined" ? "undefined" : _typeof(c)) ? window : global, d = 0, e = "" + Math.random(), f = "__\x01symbol@@" + e, g = a.getOwnPropertyNames, h = a.getOwnPropertyDescriptor, k = a.create, l = a.keys, m = a.freeze || a, q = a.defineProperty, H = a.defineProperties, E = h(a, "getOwnPropertyNames"), r = a.prototype, F = r.hasOwnProperty, C = r.propertyIsEnumerable, N = r.toString, x = function x(u, G, J) { F.call(u, f) || q(u, f, { enumerable: !1, configurable: !1, writable: !1, value: {} });u[f]["@@" + G] = J; }, X = function X(u, G) { var J = k(u);g(G).forEach(function (p) { qa.call(G, p) && Pa(J, p, G[p]); });return J; }, v = function v() {}, pa = function pa(u) { return u != f && !F.call(ka, u); }, fa = function fa(u) { return u != f && F.call(ka, u); }, qa = function qa(u) { var G = "" + u;return fa(G) ? F.call(this, G) && this[f]["@@" + G] : C.call(this, u); }, n = function n(u) { q(r, u, { enumerable: !1, configurable: !0, get: v, set: function set(G) { ta(this, u, { enumerable: !1, configurable: !0, writable: !0, value: G });x(this, u, !0); } });return m(ka[u] = q(a(u), "constructor", Tb)); }, I = function I(u) { if (this && this !== c) throw new TypeError("Symbol is not a constructor");return n("__\x01symbol:".concat(u || "", e, ++d)); }, ka = k(null), Tb = { value: I }, ab = function ab(u) { return ka[u]; }, Pa = function Pa(u, G, J) { var p = "" + G;if (fa(p)) { G = ta;if (J.enumerable) { var t = k(J);t.enumerable = !1; } else t = J;G(u, p, t);x(u, p, !!J.enumerable); } else q(u, G, J);return u; }, bb = function bb(u) { return g(u).filter(fa).map(ab); };E.value = Pa;q(a, "defineProperty", E);E.value = bb;q(a, b, E);E.value = function (u) { return g(u).filter(pa); };q(a, "getOwnPropertyNames", E);E.value = function (u, G) { var J = bb(G);J.length ? l(G).concat(J).forEach(function (p) { qa.call(G, p) && Pa(u, p, G[p]); }) : H(u, G);return u; };q(a, "defineProperties", E);E.value = qa;q(r, "propertyIsEnumerable", E);E.value = I;q(c, "Symbol", E);E.value = function (u) { u = "__\x01symbol:".concat("__\x01symbol:", u, e);return u in r ? ka[u] : n(u); };q(I, "for", E);E.value = function (u) { if (pa(u)) throw new TypeError(u + " is not a symbol");return F.call(ka, u) ? u.slice(20, -e.length) : void 0; };q(I, "keyFor", E);E.value = function (u, G) { var J = h(u, G);J && fa(G) && (J.enumerable = qa.call(u, G));return J; };q(a, "getOwnPropertyDescriptor", E);E.value = function (u, G) { return 1 === arguments.length ? k(u) : X(u, G); };q(a, "create", E);E.value = function () { var u = N.call(this);return "[object String]" === u && fa(this) ? "[object Symbol]" : u; };q(r, "toString", E);try { var ta = k(q({}, "__\x01symbol:", { get: function get() { return q(this, "__\x01symbol:", { value: !1 })["__\x01symbol:"]; } }))["__\x01symbol:"] || q; } catch (u) { ta = function ta(G, J, p) { var t = h(r, J);delete r[J];q(G, J, p);q(r, J, t); }; } } })(Object, "getOwnPropertySymbols"); (function (a) { var b = a.defineProperty, c = a.prototype, d = c.toString, e;"iterator match replace search split hasInstance isConcatSpreadable unscopables species toPrimitive toStringTag".split(" ").forEach(function (f) { if (!(f in Symbol)) switch (b(Symbol, f, { value: Symbol(f) }), f) {case "toStringTag": e = a.getOwnPropertyDescriptor(c, "toString"), e.value = function () { var g = d.call(this), h = this[Symbol.toStringTag];return "undefined" === typeof h ? g : "[object " + h + "]"; }, b(c, "toString", e);} }); })(Object, Symbol); (function (a, b, c) { function d() { return this; }b[a] || (b[a] = function () { var e = 0, f = this, g = { next: function next() { var h = f.length <= e;return h ? { done: h } : { done: h, value: f[e++] }; } };g[a] = d;return g; });c[a] || (c[a] = function () { var e = String.fromCodePoint, f = this, g = 0, h = f.length, k = { next: function next() { var l = h <= g, m = l ? "" : e(f.codePointAt(g));g += m.length;return l ? { done: l } : { done: l, value: m }; } };k[a] = d;return k; }); })(Symbol.iterator, Array.prototype, String.prototype); /* Copyright (c) 2018 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ var Za = Object.prototype.toString;Object.prototype.toString = function () { return void 0 === this ? "[object Undefined]" : null === this ? "[object Null]" : Za.call(this); };Object.keys = function (a) { return Object.getOwnPropertyNames(a).filter(function (b) { return (b = Object.getOwnPropertyDescriptor(a, b)) && b.enumerable; }); };var db = window.Symbol.iterator; String.prototype[db] && String.prototype.codePointAt || (String.prototype[db] = function eb() { var b, c = this;return Ha(eb, function (d) { 1 == d.a && (b = 0);if (3 != d.a) return b < c.length ? d = Ba(d, c[b]) : (d.a = 0, d = void 0), d;b++;d.a = 2; }); });Set.prototype[db] || (Set.prototype[db] = function fb() { var b, c = this, d;return Ha(fb, function (e) { 1 == e.a && (b = [], c.forEach(function (f) { b.push(f); }), d = 0);if (3 != e.a) return d < b.length ? e = Ba(e, b[d]) : (e.a = 0, e = void 0), e;d++;e.a = 2; }); }); Map.prototype[db] || (Map.prototype[db] = function gb() { var b, c = this, d;return Ha(gb, function (e) { 1 == e.a && (b = [], c.forEach(function (f, g) { b.push([g, f]); }), d = 0);if (3 != e.a) return d < b.length ? e = Ba(e, b[d]) : (e.a = 0, e = void 0), e;d++;e.a = 2; }); }); /* Copyright (c) 2014 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ window.WebComponents = window.WebComponents || { flags: {} };var hb = document.querySelector('script[src*="webcomponents-bundle"]'), ib = /wc-(.+)/, jb = {};if (!jb.noOpts) { location.search.slice(1).split("&").forEach(function (a) { a = a.split("=");var b;a[0] && (b = a[0].match(ib)) && (jb[b[1]] = a[1] || !0); });if (hb) for (var kb = 0, lb = void 0; lb = hb.attributes[kb]; kb++) { "src" !== lb.name && (jb[lb.name] = lb.value || !0); }if (jb.log && jb.log.split) { var mb = jb.log.split(",");jb.log = {};mb.forEach(function (a) { jb.log[a] = !0; }); } else jb.log = {}; } window.WebComponents.flags = jb;var nb = jb.shadydom;nb && (window.ShadyDOM = window.ShadyDOM || {}, window.ShadyDOM.force = nb);var ob = jb.register || jb.ce;ob && window.customElements && (window.customElements.forcePolyfill = ob); /* Copyright (c) 2016 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ function pb() {}pb.prototype.toJSON = function () { return {}; };function A(a) { a.__shady || (a.__shady = new pb());return a.__shady; }function B(a) { return a && a.__shady; };var L = window.ShadyDOM || {};L.La = !(!Element.prototype.attachShadow || !Node.prototype.getRootNode);var qb = Object.getOwnPropertyDescriptor(Node.prototype, "firstChild");L.F = !!(qb && qb.configurable && qb.get);L.ja = L.force || !L.La;L.M = L.noPatch || !1;L.va = L.preferPerformance;L.ya = navigator.userAgent.match("Trident");function rb(a) { return (a = B(a)) && void 0 !== a.firstChild; }function M(a) { return "ShadyRoot" === a.Da; }function sb(a) { return (a = (a = B(a)) && a.root) && tb(a); } var ub = Element.prototype, vb = ub.matches || ub.matchesSelector || ub.mozMatchesSelector || ub.msMatchesSelector || ub.oMatchesSelector || ub.webkitMatchesSelector, wb = document.createTextNode(""), xb = 0, yb = [];new MutationObserver(function () { for (; yb.length;) { try { yb.shift()(); } catch (a) { throw wb.textContent = xb++, a; } } }).observe(wb, { characterData: !0 });function zb(a) { yb.push(a);wb.textContent = xb++; }var Ab = !!document.contains;function Bb(a, b) { for (; b;) { if (b == a) return !0;b = b.__shady_parentNode; }return !1; } function Cb(a) { for (var b = a.length - 1; 0 <= b; b--) { var c = a[b], d = c.getAttribute("id") || c.getAttribute("name");d && "length" !== d && isNaN(d) && (a[d] = c); }a.item = function (e) { return a[e]; };a.namedItem = function (e) { if ("length" !== e && isNaN(e) && a[e]) return a[e];for (var f = ca(a), g = f.next(); !g.done; g = f.next()) { if (g = g.value, (g.getAttribute("id") || g.getAttribute("name")) == e) return g; }return null; };return a; }function Db(a) { var b = [];for (a = a.__shady_native_firstChild; a; a = a.__shady_native_nextSibling) { b.push(a); }return b; } function Eb(a) { var b = [];for (a = a.__shady_firstChild; a; a = a.__shady_nextSibling) { b.push(a); }return b; }function O(a, b, c, d) { c = void 0 === c ? "" : c;for (var e in b) { var f = b[e];if (!(d && 0 <= d.indexOf(e))) { f.configurable = !0;var g = c + e;if (f.value) a[g] = f.value;else try { Object.defineProperty(a, g, f); } catch (h) {} } } }function P(a) { var b = {};Object.getOwnPropertyNames(a).forEach(function (c) { b[c] = Object.getOwnPropertyDescriptor(a, c); });return b; };var Fb = [], Gb;function Hb(a) { Gb || (Gb = !0, zb(Ib));Fb.push(a); }function Ib() { Gb = !1;for (var a = !!Fb.length; Fb.length;) { Fb.shift()(); }return a; }Ib.list = Fb;function Jb() { this.a = !1;this.addedNodes = [];this.removedNodes = [];this.ca = new Set(); }function Kb(a) { a.a || (a.a = !0, zb(function () { a.flush(); })); }Jb.prototype.flush = function () { if (this.a) { this.a = !1;var a = this.takeRecords();a.length && this.ca.forEach(function (b) { b(a); }); } };Jb.prototype.takeRecords = function () { if (this.addedNodes.length || this.removedNodes.length) { var a = [{ addedNodes: this.addedNodes, removedNodes: this.removedNodes }];this.addedNodes = [];this.removedNodes = [];return a; }return []; }; function Lb(a, b) { var c = A(a);c.W || (c.W = new Jb());c.W.ca.add(b);var d = c.W;return { Ca: b, P: d, Ea: a, takeRecords: function takeRecords() { return d.takeRecords(); } }; }function Mb(a) { var b = a && a.P;b && (b.ca.delete(a.Ca), b.ca.size || (A(a.Ea).W = null)); } function Nb(a, b) { var c = b.getRootNode();return a.map(function (d) { var e = c === d.target.getRootNode();if (e && d.addedNodes) { if (e = Array.from(d.addedNodes).filter(function (f) { return c === f.getRootNode(); }), e.length) return d = Object.create(d), Object.defineProperty(d, "addedNodes", { value: e, configurable: !0 }), d; } else if (e) return d; }).filter(function (d) { return d; }); };var Ob = /[&\u00A0"]/g, Pb = /[&\u00A0<>]/g;function Qb(a) { switch (a) {case "&": return "&";case "<": return "<";case ">": return ">";case '"': return """;case "\xA0": return " ";} }function Rb(a) { for (var b = {}, c = 0; c < a.length; c++) { b[a[c]] = !0; }return b; }var Sb = Rb("area base br col command embed hr img input keygen link meta param source track wbr".split(" ")), Vb = Rb("style script xmp iframe noembed noframes plaintext noscript".split(" ")); function Wb(a, b) { "template" === a.localName && (a = a.content);for (var c = "", d = b ? b(a) : a.childNodes, e = 0, f = d.length, g = void 0; e < f && (g = d[e]); e++) { a: { var h = g;var k = a, l = b;switch (h.nodeType) {case Node.ELEMENT_NODE: k = h.localName;for (var m = "<" + k, q = h.attributes, H = 0, E; E = q[H]; H++) { m += " " + E.name + '="' + E.value.replace(Ob, Qb) + '"'; }m += ">";h = Sb[k] ? m : m + Wb(h, l) + "</" + k + ">";break a;case Node.TEXT_NODE: h = h.data;h = k && Vb[k.localName] ? h : h.replace(Pb, Qb);break a;case Node.COMMENT_NODE: h = "\x3c!--" + h.data + "--\x3e";break a;default: throw window.console.error(h), Error("not implemented");} }c += h; }return c; };var Xb = L.F, Yb = { querySelector: function querySelector(a) { return this.__shady_native_querySelector(a); }, querySelectorAll: function querySelectorAll(a) { return this.__shady_native_querySelectorAll(a); } }, Zb = {};function $b(a) { Zb[a] = function (b) { return b["__shady_native_" + a]; }; }function ac(a, b) { O(a, b, "__shady_native_");for (var c in b) { $b(c); } }function Q(a, b) { b = void 0 === b ? [] : b;for (var c = 0; c < b.length; c++) { var d = b[c], e = Object.getOwnPropertyDescriptor(a, d);e && (Object.defineProperty(a, "__shady_native_" + d, e), e.value ? Yb[d] || (Yb[d] = e.value) : $b(d)); } } var bc = document.createTreeWalker(document, NodeFilter.SHOW_ALL, null, !1), cc = document.createTreeWalker(document, NodeFilter.SHOW_ELEMENT, null, !1), dc = document.implementation.createHTMLDocument("inert");function ec(a) { for (var b; b = a.__shady_native_firstChild;) { a.__shady_native_removeChild(b); } }var fc = ["firstElementChild", "lastElementChild", "children", "childElementCount"], gc = ["querySelector", "querySelectorAll"]; function hc() { var a = ["dispatchEvent", "addEventListener", "removeEventListener"];window.EventTarget ? Q(window.EventTarget.prototype, a) : (Q(Node.prototype, a), Q(Window.prototype, a));Xb ? Q(Node.prototype, "parentNode firstChild lastChild previousSibling nextSibling childNodes parentElement textContent".split(" ")) : ac(Node.prototype, { parentNode: { get: function get() { bc.currentNode = this;return bc.parentNode(); } }, firstChild: { get: function get() { bc.currentNode = this;return bc.firstChild(); } }, lastChild: { get: function get() { bc.currentNode = this;return bc.lastChild(); } }, previousSibling: { get: function get() { bc.currentNode = this;return bc.previousSibling(); } }, nextSibling: { get: function get() { bc.currentNode = this;return bc.nextSibling(); } }, childNodes: { get: function get() { var b = [];bc.currentNode = this;for (var c = bc.firstChild(); c;) { b.push(c), c = bc.nextSibling(); }return b; } }, parentElement: { get: function get() { cc.currentNode = this;return cc.parentNode(); } }, textContent: { get: function get() { switch (this.nodeType) {case Node.ELEMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE: for (var b = document.createTreeWalker(this, NodeFilter.SHOW_TEXT, null, !1), c = "", d; d = b.nextNode();) { c += d.nodeValue; }return c;default: return this.nodeValue;} }, set: function set(b) { if ("undefined" === typeof b || null === b) b = "";switch (this.nodeType) {case Node.ELEMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE: ec(this);(0 < b.length || this.nodeType === Node.ELEMENT_NODE) && this.__shady_native_insertBefore(document.createTextNode(b), void 0);break;default: this.nodeValue = b;} } } });Q(Node.prototype, "appendChild insertBefore removeChild replaceChild cloneNode contains".split(" ")); Q(HTMLElement.prototype, ["parentElement", "contains"]);a = { firstElementChild: { get: function get() { cc.currentNode = this;return cc.firstChild(); } }, lastElementChild: { get: function get() { cc.currentNode = this;return cc.lastChild(); } }, children: { get: function get() { var b = [];cc.currentNode = this;for (var c = cc.firstChild(); c;) { b.push(c), c = cc.nextSibling(); }return Cb(b); } }, childElementCount: { get: function get() { return this.children ? this.children.length : 0; } } };Xb ? (Q(Element.prototype, fc), Q(Element.prototype, ["previousElementSibling", "nextElementSibling", "innerHTML", "className"]), Q(HTMLElement.prototype, ["children", "innerHTML", "className"])) : (ac(Element.prototype, a), ac(Element.prototype, { previousElementSibling: { get: function get() { cc.currentNode = this;return cc.previousSibling(); } }, nextElementSibling: { get: function get() { cc.currentNode = this;return cc.nextSibling(); } }, innerHTML: { get: function get() { return Wb(this, Db); }, set: function set(b) { var c = "template" === this.localName ? this.content : this;ec(c);var d = this.localName || "div";d = this.namespaceURI && this.namespaceURI !== dc.namespaceURI ? dc.createElementNS(this.namespaceURI, d) : dc.createElement(d);d.innerHTML = b;for (b = "template" === this.localName ? d.content : d; d = b.__shady_native_firstChild;) { c.__shady_native_insertBefore(d, void 0); } } }, className: { get: function get() { return this.getAttribute("class") || ""; }, set: function set(b) { this.setAttribute("class", b); } } }));Q(Element.prototype, "setAttribute getAttribute hasAttribute removeAttribute focus blur".split(" "));Q(Element.prototype, gc);Q(HTMLElement.prototype, ["focus", "blur"]);window.HTMLTemplateElement && Q(window.HTMLTemplateElement.prototype, ["innerHTML"]);Xb ? Q(DocumentFragment.prototype, fc) : ac(DocumentFragment.prototype, a);Q(DocumentFragment.prototype, gc);Xb ? (Q(Document.prototype, fc), Q(Document.prototype, ["activeElement"])) : ac(Document.prototype, a);Q(Document.prototype, ["importNode", "getElementById"]);Q(Document.prototype, gc); };var ic = P({ get childNodes() { return this.__shady_childNodes; }, get firstChild() { return this.__shady_firstChild; }, get lastChild() { return this.__shady_lastChild; }, get childElementCount() { return this.__shady_childElementCount; }, get children() { return this.__shady_children; }, get firstElementChild() { return this.__shady_firstElementChild; }, get lastElementChild() { return this.__shady_lastElementChild; }, get shadowRoot() { return this.__shady_shadowRoot; } }), jc = P({ get textContent() { return this.__shady_textContent; }, set textContent(a) { this.__shady_textContent = a; }, get innerHTML() { return this.__shady_innerHTML; }, set innerHTML(a) { return this.__shady_innerHTML = a; } }), kc = P({ get parentElement() { return this.__shady_parentElement; }, get parentNode() { return this.__shady_parentNode; }, get nextSibling() { return this.__shady_nextSibling; }, get previousSibling() { return this.__shady_previousSibling; }, get nextElementSibling() { return this.__shady_nextElementSibling; }, get previousElementSibling() { return this.__shady_previousElementSibling; }, get className() { return this.__shady_className; }, set className(a) { return this.__shady_className = a; } });function lc(a) { for (var b in a) { var c = a[b];c && (c.enumerable = !1); } }lc(ic);lc(jc);lc(kc);var mc = L.F || L.M, nc = mc ? function () {} : function (a) { var b = A(a);b.Aa || (b.Aa = !0, O(a, kc)); }, oc = mc ? function () {} : function (a) { var b = A(a);b.za || (b.za = !0, O(a, ic), window.customElements && !L.M || O(a, jc)); };var pc = "__eventWrappers" + Date.now(), qc = function () { var a = Object.getOwnPropertyDescriptor(Event.prototype, "composed");return a ? function (b) { return a.get.call(b); } : null; }(), rc = function () { function a() {}var b = !1, c = { get capture() { b = !0;return !1; } };window.addEventListener("test", a, c);window.removeEventListener("test", a, c);return b; }();function sc(a) { if (a && "object" === (typeof a === "undefined" ? "undefined" : _typeof(a))) { var b = !!a.capture;var c = !!a.once;var d = !!a.passive;var e = a.O; } else b = !!a, d = c = !1;return { wa: e, capture: b, once: c, passive: d, ta: rc ? a : b }; } var tc = { blur: !0, focus: !0, focusin: !0, focusout: !0, click: !0, dblclick: !0, mousedown: !0, mouseenter: !0, mouseleave: !0, mousemove: !0, mouseout: !0, mouseover: !0, mouseup: !0, wheel: !0, beforeinput: !0, input: !0, keydown: !0, keyup: !0, compositionstart: !0, compositionupdate: !0, compositionend: !0, touchstart: !0, touchend: !0, touchmove: !0, touchcancel: !0, pointerover: !0, pointerenter: !0, pointerdown: !0, pointermove: !0, pointerup: !0, pointercancel: !0, pointerout: !0, pointerleave: !0, gotpointercapture: !0, lostpointercapture: !0, dragstart: !0, drag: !0, dragenter: !0, dragleave: !0, dragover: !0, drop: !0, dragend: !0, DOMActivate: !0, DOMFocusIn: !0, DOMFocusOut: !0, keypress: !0 }, uc = { DOMAttrModified: !0, DOMAttributeNameChanged: !0, DOMCharacterDataModified: !0, DOMElementNameChanged: !0, DOMNodeInserted: !0, DOMNodeInsertedIntoDocument: !0, DOMNodeRemoved: !0, DOMNodeRemovedFromDocument: !0, DOMSubtreeModified: !0 };function vc(a) { return a instanceof Node ? a.__shady_getRootNode() : a; } function wc(a, b) { var c = [], d = a;for (a = vc(a); d;) { c.push(d), d.__shady_assignedSlot ? d = d.__shady_assignedSlot : d.nodeType === Node.DOCUMENT_FRAGMENT_NODE && d.host && (b || d !== a) ? d = d.host : d = d.__shady_parentNode; }c[c.length - 1] === document && c.push(window);return c; }function xc(a) { a.__composedPath || (a.__composedPath = wc(a.target, !0));return a.__composedPath; }function yc(a, b) { if (!M) return a;a = wc(a, !0);for (var c = 0, d, e = void 0, f, g = void 0; c < b.length; c++) { if (d = b[c], f = vc(d), f !== e && (g = a.indexOf(f), e = f), !M(f) || -1 < g) return d; } } function zc(a) { function b(c, d) { c = new a(c, d);c.__composed = d && !!d.composed;return c; }b.__proto__ = a;b.prototype = a.prototype;return b; }var Ac = { focus: !0, blur: !0 };function Bc(a) { return a.__target !== a.target || a.__relatedTarget !== a.relatedTarget; }function Cc(a, b, c) { if (c = b.__handlers && b.__handlers[a.type] && b.__handlers[a.type][c]) for (var d = 0, e; (e = c[d]) && (!Bc(a) || a.target !== a.relatedTarget) && (e.call(b, a), !a.__immediatePropagationStopped); d++) {} } function Dc(a) { var b = a.composedPath();Object.defineProperty(a, "currentTarget", { get: function get() { return d; }, configurable: !0 });for (var c = b.length - 1; 0 <= c; c--) { var d = b[c];Cc(a, d, "capture");if (a.fa) return; }Object.defineProperty(a, "eventPhase", { get: function get() { return Event.AT_TARGET; } });var e;for (c = 0; c < b.length; c++) { d = b[c];var f = B(d);f = f && f.root;if (0 === c || f && f === e) if (Cc(a, d, "bubble"), d !== window && (e = d.__shady_getRootNode()), a.fa) break; } } function Ec(a, b, c, d, e, f) { for (var g = 0; g < a.length; g++) { var h = a[g], k = h.type, l = h.capture, m = h.once, q = h.passive;if (b === h.node && c === k && d === l && e === m && f === q) return g; }return -1; }function Fc(a) { Ib();return this.__shady_native_dispatchEvent(a); } function Gc(a, b, c) { var d = sc(c), e = d.capture, f = d.once, g = d.passive, h = d.wa;d = d.ta;if (b) { var k = typeof b === "undefined" ? "undefined" : _typeof(b);if ("function" === k || "object" === k) if ("object" !== k || b.handleEvent && "function" === typeof b.handleEvent) { if (uc[a]) return this.__shady_native_addEventListener(a, b, d);var l = h || this;if (h = b[pc]) { if (-1 < Ec(h, l, a, e, f, g)) return; } else b[pc] = [];h = function h(m) { f && this.__shady_removeEventListener(a, b, c);m.__target || Hc(m);if (l !== this) { var q = Object.getOwnPropertyDescriptor(m, "currentTarget");Object.defineProperty(m, "currentTarget", { get: function get() { return l; }, configurable: !0 }); }m.__previousCurrentTarget = m.currentTarget;if (!M(l) && "slot" !== l.localName || -1 != m.composedPath().indexOf(l)) if (m.composed || -1 < m.composedPath().indexOf(l)) if (Bc(m) && m.target === m.relatedTarget) m.eventPhase === Event.BUBBLING_PHASE && m.stopImmediatePropagation();else if (m.eventPhase === Event.CAPTURING_PHASE || m.bubbles || m.target === l || l instanceof Window) { var H = "function" === k ? b.call(l, m) : b.handleEvent && b.handleEvent(m);l !== this && (q ? (Object.defineProperty(m, "currentTarget", q), q = null) : delete m.currentTarget);return H; } };b[pc].push({ node: l, type: a, capture: e, once: f, passive: g, ab: h });Ac[a] ? (this.__handlers = this.__handlers || {}, this.__handlers[a] = this.__handlers[a] || { capture: [], bubble: [] }, this.__handlers[a][e ? "capture" : "bubble"].push(h)) : this.__shady_native_addEventListener(a, h, d); } } } function Ic(a, b, c) { if (b) { var d = sc(c);c = d.capture;var e = d.once, f = d.passive, g = d.wa;d = d.ta;if (uc[a]) return this.__shady_native_removeEventListener(a, b, d);var h = g || this;g = void 0;var k = null;try { k = b[pc]; } catch (l) {}k && (e = Ec(k, h, a, c, e, f), -1 < e && (g = k.splice(e, 1)[0].ab, k.length || (b[pc] = void 0)));this.__shady_native_removeEventListener(a, g || b, d);g && Ac[a] && this.__handlers && this.__handlers[a] && (a = this.__handlers[a][c ? "capture" : "bubble"], b = a.indexOf(g), -1 < b && a.splice(b, 1)); } } function Jc() { for (var a in Ac) { window.__shady_native_addEventListener(a, function (b) { b.__target || (Hc(b), Dc(b)); }, !0); } } var Kc = P({ get composed() { void 0 === this.__composed && (qc ? this.__composed = "focusin" === this.type || "focusout" === this.type || qc(this) : !1 !== this.isTrusted && (this.__composed = tc[this.type]));return this.__composed || !1; }, composedPath: function composedPath() { this.__composedPath || (this.__composedPath = wc(this.__target, this.composed));return this.__composedPath; }, get target() { return yc(this.currentTarget || this.__previousCurrentTarget, this.composedPath()); }, get relatedTarget() { if (!this.__relatedTarget) return null;this.__relatedTargetComposedPath || (this.__relatedTargetComposedPath = wc(this.__relatedTarget, !0));return yc(this.currentTarget || this.__previousCurrentTarget, this.__relatedTargetComposedPath); }, stopPropagation: function stopPropagation() { Event.prototype.stopPropagation.call(this);this.fa = !0; }, stopImmediatePropagation: function stopImmediatePropagation() { Event.prototype.stopImmediatePropagation.call(this);this.fa = this.__immediatePropagationStopped = !0; } }); function Hc(a) { a.__target = a.target;a.__relatedTarget = a.relatedTarget;if (L.F) { var b = Object.getPrototypeOf(a);if (!Object.hasOwnProperty(b, "__shady_patchedProto")) { var c = Object.create(b);c.__shady_sourceProto = b;O(c, Kc);b.__shady_patchedProto = c; }a.__proto__ = b.__shady_patchedProto; } else O(a, Kc); }var Lc = zc(Event), Mc = zc(CustomEvent), Nc = zc(MouseEvent); function Oc() { if (!qc && Object.getOwnPropertyDescriptor(Event.prototype, "isTrusted")) { var a = function a() { var b = new MouseEvent("click", { bubbles: !0, cancelable: !0, composed: !0 });this.__shady_dispatchEvent(b); };Element.prototype.click ? Element.prototype.click = a : HTMLElement.prototype.click && (HTMLElement.prototype.click = a); } }var Pc = Object.getOwnPropertyNames(Document.prototype).filter(function (a) { return "on" === a.substring(0, 2); });function Qc(a, b) { return { index: a, X: [], ba: b }; } function Rc(a, b, c, d) { var e = 0, f = 0, g = 0, h = 0, k = Math.min(b - e, d - f);if (0 == e && 0 == f) a: { for (g = 0; g < k; g++) { if (a[g] !== c[g]) break a; }g = k; }if (b == a.length && d == c.length) { h = a.length;for (var l = c.length, m = 0; m < k - g && Sc(a[--h], c[--l]);) { m++; }h = m; }e += g;f += g;b -= h;d -= h;if (0 == b - e && 0 == d - f) return [];if (e == b) { for (b = Qc(e, 0); f < d;) { b.X.push(c[f++]); }return [b]; }if (f == d) return [Qc(e, b - e)];k = e;g = f;d = d - g + 1;h = b - k + 1;b = Array(d);for (l = 0; l < d; l++) { b[l] = Array(h), b[l][0] = l; }for (l = 0; l < h; l++) { b[0][l] = l; }for (l = 1; l < d; l++) { for (m = 1; m < h; m++) { if (a[k + m - 1] === c[g + l - 1]) b[l][m] = b[l - 1][m - 1];else { var q = b[l - 1][m] + 1, H = b[l][m - 1] + 1;b[l][m] = q < H ? q : H; } } }k = b.length - 1;g = b[0].length - 1;d = b[k][g];for (a = []; 0 < k || 0 < g;) { 0 == k ? (a.push(2), g--) : 0 == g ? (a.push(3), k--) : (h = b[k - 1][g - 1], l = b[k - 1][g], m = b[k][g - 1], q = l < m ? l < h ? l : h : m < h ? m : h, q == h ? (h == d ? a.push(0) : (a.push(1), d = h), k--, g--) : q == l ? (a.push(3), k--, d = l) : (a.push(2), g--, d = m)); }a.reverse();b = void 0;k = [];for (g = 0; g < a.length; g++) { switch (a[g]) {case 0: b && (k.push(b), b = void 0);e++;f++;break;case 1: b || (b = Qc(e, 0));b.ba++;e++;b.X.push(c[f]);f++;break;case 2: b || (b = Qc(e, 0));b.ba++;e++;break;case 3: b || (b = Qc(e, 0)), b.X.push(c[f]), f++;} }b && k.push(b);return k; }function Sc(a, b) { return a === b; };function Tc(a, b, c, d) { nc(a);d = d || null;var e = A(a), f = d ? A(d) : null;e.previousSibling = d ? f.previousSibling : b.__shady_lastChild;if (f = B(e.previousSibling)) f.nextSibling = a;if (f = B(e.nextSibling = d)) f.previousSibling = a;e.parentNode = b;d ? d === c.firstChild && (c.firstChild = a) : (c.lastChild = a, c.firstChild || (c.firstChild = a));c.childNodes = null; } function Uc(a, b, c) { oc(b);var d = A(b);void 0 !== d.firstChild && (d.childNodes = null);if (a.nodeType === Node.DOCUMENT_FRAGMENT_NODE) for (a = a.__shady_native_firstChild; a; a = a.__shady_native_nextSibling) { Tc(a, b, d, c); } else Tc(a, b, d, c); } function Vc(a, b) { var c = A(a);b = A(b);a === b.firstChild && (b.firstChild = c.nextSibling);a === b.lastChild && (b.lastChild = c.previousSibling);a = c.previousSibling;var d = c.nextSibling;a && (A(a).nextSibling = d);d && (A(d).previousSibling = a);c.parentNode = c.previousSibling = c.nextSibling = void 0;void 0 !== b.childNodes && (b.childNodes = null); } function Wc(a, b) { var c = A(a);if (b || void 0 === c.firstChild) { c.childNodes = null;var d = c.firstChild = a.__shady_native_firstChild;c.lastChild = a.__shady_native_lastChild;oc(a);c = d;for (d = void 0; c; c = c.__shady_native_nextSibling) { var e = A(c);e.parentNode = b || a;e.nextSibling = c.__shady_native_nextSibling;e.previousSibling = d || null;d = c;nc(c); } } };var Xc = null;function Yc() { Xc || (Xc = window.ShadyCSS && window.ShadyCSS.ScopingShim);return Xc || null; }function Zc(a, b, c) { var d = Yc();return d && "class" === b ? (d.setElementClass(a, c), !0) : !1; }function $c(a, b) { var c = Yc();c && c.unscopeNode(a, b); }function ad(a, b) { var c = Yc();if (!c) return !0;if (a.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { c = !0;for (a = a.__shady_firstChild; a; a = a.__shady_nextSibling) { c = c && ad(a, b); }return c; }return a.nodeType !== Node.ELEMENT_NODE ? !0 : c.currentScopeForNode(a) === b; } function bd(a) { if (a.nodeType !== Node.ELEMENT_NODE) return "";var b = Yc();return b ? b.currentScopeForNode(a) : ""; }function cd(a, b) { if (a) for (a.nodeType === Node.ELEMENT_NODE && b(a), a = a.__shady_firstChild; a; a = a.__shady_nextSibling) { a.nodeType === Node.ELEMENT_NODE && cd(a, b); } };var dd = window.document, ed = L.va, fd = Object.getOwnPropertyDescriptor(Node.prototype, "isConnected"), gd = fd && fd.get;function hd(a) { for (var b; b = a.__shady_firstChild;) { a.__shady_removeChild(b); } }function id(a) { var b = B(a);if (b && void 0 !== b.ea) for (b = a.__shady_firstChild; b; b = b.__shady_nextSibling) { id(b); }if (a = B(a)) a.ea = void 0; }function jd(a) { var b = a;a && "slot" === a.localName && (b = (b = (b = B(a)) && b.T) && b.length ? b[0] : jd(a.__shady_nextSibling));return b; } function kd(a, b, c) { if (a = (a = B(a)) && a.W) b && (b.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? a.addedNodes.push.apply(a.addedNodes, da(b.childNodes)) : a.addedNodes.push(b)), c && a.removedNodes.push(c), Kb(a); } var pd = P({ get parentNode() { var a = B(this);a = a && a.parentNode;return void 0 !== a ? a : this.__shady_native_parentNode; }, get firstChild() { var a = B(this);a = a && a.firstChild;return void 0 !== a ? a : this.__shady_native_firstChild; }, get lastChild() { var a = B(this);a = a && a.lastChild;return void 0 !== a ? a : this.__shady_native_lastChild; }, get nextSibling() { var a = B(this);a = a && a.nextSibling;return void 0 !== a ? a : this.__shady_native_nextSibling; }, get previousSibling() { var a = B(this);a = a && a.previousSibling;return void 0 !== a ? a : this.__shady_native_previousSibling; }, get childNodes() { if (rb(this)) { var a = B(this);if (!a.childNodes) { a.childNodes = [];for (var b = this.__shady_firstChild; b; b = b.__shady_nextSibling) { a.childNodes.push(b); } }var c = a.childNodes; } else c = this.__shady_native_childNodes;c.item = function (d) { return c[d]; };return c; }, get parentElement() { var a = B(this);(a = a && a.parentNode) && a.nodeType !== Node.ELEMENT_NODE && (a = null);return void 0 !== a ? a : this.__shady_native_parentElement; }, get isConnected() { if (gd && gd.call(this)) return !0;if (this.nodeType == Node.DOCUMENT_FRAGMENT_NODE) return !1; var a = this.ownerDocument;if (Ab) { if (a.__shady_native_contains(this)) return !0; } else if (a.documentElement && a.documentElement.__shady_native_contains(this)) return !0;for (a = this; a && !(a instanceof Document);) { a = a.__shady_parentNode || (M(a) ? a.host : void 0); }return !!(a && a instanceof Document); }, get textContent() { if (rb(this)) { for (var a = [], b = this.__shady_firstChild; b; b = b.__shady_nextSibling) { b.nodeType !== Node.COMMENT_NODE && a.push(b.__shady_textContent); }return a.join(""); }return this.__shady_native_textContent; }, set textContent(a) { if ("undefined" === typeof a || null === a) a = "";switch (this.nodeType) {case Node.ELEMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE: if (!rb(this) && L.F) { var b = this.__shady_firstChild;(b != this.__shady_lastChild || b && b.nodeType != Node.TEXT_NODE) && hd(this);this.__shady_native_textContent = a; } else hd(this), (0 < a.length || this.nodeType === Node.ELEMENT_NODE) && this.__shady_insertBefore(document.createTextNode(a));break;default: this.nodeValue = a;} }, insertBefore: function insertBefore(a, b) { if (this.ownerDocument !== dd && a.ownerDocument !== dd) return this.__shady_native_insertBefore(a, b), a;if (a === this) throw Error("Failed to execute 'appendChild' on 'Node': The new child element contains the parent.");if (b) { var c = B(b);c = c && c.parentNode;if (void 0 !== c && c !== this || void 0 === c && b.__shady_native_parentNode !== this) throw Error("Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node."); }if (b === a) return a;kd(this, a);var d = [], e = (c = ld(this)) ? c.host.localName : bd(this), f = a.__shady_parentNode;if (f) { var g = bd(a);var h = !!c || !ld(a) || ed && void 0 !== this.__noInsertionPoint;f.__shady_removeChild(a, h); }f = !0;var k = (!ed || void 0 === a.__noInsertionPoint && void 0 === this.__noInsertionPoint) && !ad(a, e), l = c && !a.__noInsertionPoint && (!ed || a.nodeType === Node.DOCUMENT_FRAGMENT_NODE);if (l || k) k && (g = g || bd(a)), cd(a, function (m) { l && "slot" === m.localName && d.push(m);if (k) { var q = g;Yc() && (q && $c(m, q), (q = Yc()) && q.scopeNode(m, e)); } });d.length && (md(c), c.c.push.apply(c.c, da(d)), nd(c));rb(this) && (Uc(a, this, b), c = B(this), sb(this) ? (nd(c.root), f = !1) : c.root && (f = !1));f ? (c = M(this) ? this.host : this, b ? (b = jd(b), c.__shady_native_insertBefore(a, b)) : c.__shady_native_appendChild(a)) : a.ownerDocument !== this.ownerDocument && this.ownerDocument.adoptNode(a);return a; }, appendChild: function appendChild(a) { if (this != a || !M(a)) return this.__shady_insertBefore(a); }, removeChild: function removeChild(a, b) { b = void 0 === b ? !1 : b;if (this.ownerDocument !== dd) return this.__shady_native_removeChild(a);if (a.__shady_parentNode !== this) throw Error("The node to be removed is not a child of this node: " + a);kd(this, null, a);var c = ld(a), d = c && od(c, a), e = B(this);if (rb(this) && (Vc(a, this), sb(this))) { nd(e.root);var f = !0; }if (Yc() && !b && c && a.nodeType !== Node.TEXT_NODE) { var g = bd(a);cd(a, function (h) { $c(h, g); }); }id(a);c && ((b = this && "slot" === this.localName) && (f = !0), (d || b) && nd(c));f || (f = M(this) ? this.host : this, (!e.root && "slot" !== a.localName || f === a.__shady_native_parentNode) && f.__shady_native_removeChild(a));return a; }, replaceChild: function replaceChild(a, b) { this.__shady_insertBefore(a, b);this.__shady_removeChild(b);return a; }, cloneNode: function cloneNode(a) { if ("template" == this.localName) return this.__shady_native_cloneNode(a);var b = this.__shady_native_cloneNode(!1);if (a && b.nodeType !== Node.ATTRIBUTE_NODE) { a = this.__shady_firstChild;for (var c; a; a = a.__shady_nextSibling) { c = a.__shady_cloneNode(!0), b.__shady_appendChild(c); } }return b; }, getRootNode: function getRootNode(a) { if (this && this.nodeType) { var b = A(this), c = b.ea;void 0 === c && (M(this) ? (c = this, b.ea = c) : (c = (c = this.__shady_parentNode) ? c.__shady_getRootNode(a) : this, document.documentElement.__shady_native_contains(this) && (b.ea = c)));return c; } }, contains: function contains(a) { return Bb(this, a); } });function rd(a, b, c) { var d = [];sd(a, b, c, d);return d; }function sd(a, b, c, d) { for (a = a.__shady_firstChild; a; a = a.__shady_nextSibling) { var e;if (e = a.nodeType === Node.ELEMENT_NODE) { e = a;var f = b, g = c, h = d, k = f(e);k && h.push(e);g && g(k) ? e = k : (sd(e, f, g, h), e = void 0); }if (e) break; } } var td = P({ get firstElementChild() { var a = B(this);if (a && void 0 !== a.firstChild) { for (a = this.__shady_firstChild; a && a.nodeType !== Node.ELEMENT_NODE;) { a = a.__shady_nextSibling; }return a; }return this.__shady_native_firstElementChild; }, get lastElementChild() { var a = B(this);if (a && void 0 !== a.lastChild) { for (a = this.__shady_lastChild; a && a.nodeType !== Node.ELEMENT_NODE;) { a = a.__shady_previousSibling; }return a; }return this.__shady_native_lastElementChild; }, get children() { return rb(this) ? Cb(Array.prototype.filter.call(Eb(this), function (a) { return a.nodeType === Node.ELEMENT_NODE; })) : this.__shady_native_children; }, get childElementCount() { var a = this.__shady_children;return a ? a.length : 0; } }), ud = P({ querySelector: function querySelector(a) { return rd(this, function (b) { return vb.call(b, a); }, function (b) { return !!b; })[0] || null; }, querySelectorAll: function querySelectorAll(a, b) { if (b) { b = Array.prototype.slice.call(this.__shady_native_querySelectorAll(a));var c = this.__shady_getRootNode();return Cb(b.filter(function (d) { return d.__shady_getRootNode() == c; })); }return Cb(rd(this, function (d) { return vb.call(d, a); })); } }), vd = L.va && !L.M ? Object.assign({}, td) : td;Object.assign(td, ud);var wd = P({ getElementById: function getElementById(a) { return "" === a ? null : rd(this, function (b) { return b.id == a; }, function (b) { return !!b; })[0] || null; } });var xd = P({ get activeElement() { var a = L.F ? document.__shady_native_activeElement : document.activeElement;if (!a || !a.nodeType) return null;var b = !!M(this);if (!(this === document || b && this.host !== a && this.host.__shady_native_contains(a))) return null;for (b = ld(a); b && b !== this;) { a = b.host, b = ld(a); }return this === document ? b ? null : a : b === this ? a : null; } });var yd = document.implementation.createHTMLDocument("inert"), zd = P({ get innerHTML() { return rb(this) ? Wb("template" === this.localName ? this.content : this, Eb) : this.__shady_native_innerHTML; }, set innerHTML(a) { if ("template" === this.localName) this.__shady_native_innerHTML = a;else { hd(this);var b = this.localName || "div";b = this.namespaceURI && this.namespaceURI !== yd.namespaceURI ? yd.createElementNS(this.namespaceURI, b) : yd.createElement(b);for (L.F ? b.__shady_native_innerHTML = a : b.innerHTML = a; a = b.__shady_firstChild;) { this.__shady_insertBefore(a); } } } });var Ad = P({ addEventListener: function addEventListener(a, b, c) { "object" !== (typeof c === "undefined" ? "undefined" : _typeof(c)) && (c = { capture: !!c });c.O = c.O || this;this.host.__shady_addEventListener(a, b, c); }, removeEventListener: function removeEventListener(a, b, c) { "object" !== (typeof c === "undefined" ? "undefined" : _typeof(c)) && (c = { capture: !!c });c.O = c.O || this;this.host.__shady_removeEventListener(a, b, c); } });function Bd(a, b) { O(a, Ad, b);O(a, xd, b);O(a, zd, b);O(a, td, b);L.M && !b ? (O(a, pd, b), O(a, wd, b)) : L.F || (O(a, kc), O(a, ic), O(a, jc)); };var Cd = {}, Dd = L.deferConnectionCallbacks && "loading" === document.readyState, Ed;function Fd(a) { var b = [];do { b.unshift(a); } while (a = a.__shady_parentNode);return b; }function Gd(a, b, c) { if (a !== Cd) throw new TypeError("Illegal constructor");this.a = null;Hd(this, b, c); } function Hd(a, b, c) { a.Da = "ShadyRoot";a.host = b;a.mode = c && c.mode;Wc(a.host);b = A(a.host);b.root = a;b.Ta = "closed" !== a.mode ? a : null;b = A(a);b.firstChild = b.lastChild = b.parentNode = b.nextSibling = b.previousSibling = null;if (L.preferPerformance) for (; b = a.host.__shady_native_firstChild;) { a.host.__shady_native_removeChild(b); } else nd(a); }function nd(a) { a.R || (a.R = !0, Hb(function () { return Id(a); })); } function Id(a) { var b;if (b = a.R) { for (var c; a;) { a: { a.R && (c = a), b = a;a = b.host.__shady_getRootNode();if (M(a) && (b = B(b.host)) && 0 < b.aa) break a;a = void 0; } }b = c; }(c = b) && c._renderSelf(); } Gd.prototype._renderSelf = function () { var a = Dd;Dd = !0;this.R = !1;if (this.a) { Jd(this);for (var b = 0, c; b < this.a.length; b++) { c = this.a[b];var d = B(c), e = d.assignedNodes;d.assignedNodes = [];d.T = [];if (d.qa = e) for (d = 0; d < e.length; d++) { var f = B(e[d]);f.ga = f.assignedSlot;f.assignedSlot === c && (f.assignedSlot = null); } }for (b = this.host.__shady_firstChild; b; b = b.__shady_nextSibling) { Kd(this, b); }for (b = 0; b < this.a.length; b++) { c = this.a[b];e = B(c);if (!e.assignedNodes.length) for (d = c.__shady_firstChild; d; d = d.__shady_nextSibling) { Kd(this, d, c); }(d = (d = B(c.__shady_parentNode)) && d.root) && (tb(d) || d.R) && d._renderSelf();Ld(this, e.T, e.assignedNodes);if (d = e.qa) { for (f = 0; f < d.length; f++) { B(d[f]).ga = null; }e.qa = null;d.length > e.assignedNodes.length && (e.ia = !0); }e.ia && (e.ia = !1, Md(this, c)); }c = this.a;b = [];for (e = 0; e < c.length; e++) { d = c[e].__shady_parentNode, (f = B(d)) && f.root || !(0 > b.indexOf(d)) || b.push(d); }for (c = 0; c < b.length; c++) { f = b[c];e = f === this ? this.host : f;d = [];for (f = f.__shady_firstChild; f; f = f.__shady_nextSibling) { if ("slot" == f.localName) for (var g = B(f).T, h = 0; h < g.length; h++) { d.push(g[h]); } else d.push(f); }f = Db(e);g = Rc(d, d.length, f, f.length);for (var k = h = 0, l = void 0; h < g.length && (l = g[h]); h++) { for (var m = 0, q = void 0; m < l.X.length && (q = l.X[m]); m++) { q.__shady_native_parentNode === e && e.__shady_native_removeChild(q), f.splice(l.index + k, 1); }k -= l.ba; }k = 0;for (l = void 0; k < g.length && (l = g[k]); k++) { for (h = f[l.index], m = l.index; m < l.index + l.ba; m++) { q = d[m], e.__shady_native_insertBefore(q, h), f.splice(m, 0, q); } } } }if (!L.preferPerformance && !this.pa) for (b = this.host.__shady_firstChild; b; b = b.__shady_nextSibling) { c = B(b), b.__shady_native_parentNode !== this.host || "slot" !== b.localName && c.assignedSlot || this.host.__shady_native_removeChild(b); }this.pa = !0;Dd = a;Ed && Ed(); };function Kd(a, b, c) { var d = A(b), e = d.ga;d.ga = null;c || (c = (a = a.b[b.__shady_slot || "__catchall"]) && a[0]);c ? (A(c).assignedNodes.push(b), d.assignedSlot = c) : d.assignedSlot = void 0;e !== d.assignedSlot && d.assignedSlot && (A(d.assignedSlot).ia = !0); } function Ld(a, b, c) { for (var d = 0, e = void 0; d < c.length && (e = c[d]); d++) { if ("slot" == e.localName) { var f = B(e).assignedNodes;f && f.length && Ld(a, b, f); } else b.push(c[d]); } }function Md(a, b) { b.__shady_native_dispatchEvent(new Event("slotchange"));b = B(b);b.assignedSlot && Md(a, b.assignedSlot); }function md(a) { a.c = a.c || [];a.a = a.a || [];a.b = a.b || {}; } function Jd(a) { if (a.c && a.c.length) { for (var b = a.c, c, d = 0; d < b.length; d++) { var e = b[d];Wc(e);var f = e.__shady_parentNode;Wc(f);f = B(f);f.aa = (f.aa || 0) + 1;f = Nd(e);a.b[f] ? (c = c || {}, c[f] = !0, a.b[f].push(e)) : a.b[f] = [e];a.a.push(e); }if (c) for (var g in c) { a.b[g] = Od(a.b[g]); }a.c = []; } }function Nd(a) { var b = a.name || a.getAttribute("name") || "__catchall";return a.Ba = b; } function Od(a) { return a.sort(function (b, c) { b = Fd(b);for (var d = Fd(c), e = 0; e < b.length; e++) { c = b[e];var f = d[e];if (c !== f) return b = Eb(c.__shady_parentNode), b.indexOf(c) - b.indexOf(f); } }); } function od(a, b) { if (a.a) { Jd(a);var c = a.b, d;for (d in c) { for (var e = c[d], f = 0; f < e.length; f++) { var g = e[f];if (Bb(b, g)) { e.splice(f, 1);var h = a.a.indexOf(g);0 <= h && (a.a.splice(h, 1), (h = B(g.__shady_parentNode)) && h.aa && h.aa--);f--;g = B(g);if (h = g.T) for (var k = 0; k < h.length; k++) { var l = h[k], m = l.__shady_native_parentNode;m && m.__shady_native_removeChild(l); }g.T = [];g.assignedNodes = [];h = !0; } } }return h; } }function tb(a) { Jd(a);return !(!a.a || !a.a.length); } (function (a) { a.__proto__ = DocumentFragment.prototype;Bd(a, "__shady_");Bd(a);Object.defineProperties(a, { nodeType: { value: Node.DOCUMENT_FRAGMENT_NODE, configurable: !0 }, nodeName: { value: "#document-fragment", configurable: !0 }, nodeValue: { value: null, configurable: !0 } });["localName", "namespaceURI", "prefix"].forEach(function (b) { Object.defineProperty(a, b, { value: void 0, configurable: !0 }); });["ownerDocument", "baseURI", "isConnected"].forEach(function (b) { Object.defineProperty(a, b, { get: function get() { return this.host[b]; }, configurable: !0 }); }); })(Gd.prototype); if (window.customElements && L.ja && !L.preferPerformance) { var Pd = new Map();Ed = function Ed() { var a = [];Pd.forEach(function (d, e) { a.push([e, d]); });Pd.clear();for (var b = 0; b < a.length; b++) { var c = a[b][0];a[b][1] ? c.__shadydom_connectedCallback() : c.__shadydom_disconnectedCallback(); } };Dd && document.addEventListener("readystatechange", function () { Dd = !1;Ed(); }, { once: !0 });var Qd = function Qd(a, b, c) { var d = 0, e = "__isConnected" + d++;if (b || c) a.prototype.connectedCallback = a.prototype.__shadydom_connectedCallback = function () { Dd ? Pd.set(this, !0) : this[e] || (this[e] = !0, b && b.call(this)); }, a.prototype.disconnectedCallback = a.prototype.__shadydom_disconnectedCallback = function () { Dd ? this.isConnected || Pd.set(this, !1) : this[e] && (this[e] = !1, c && c.call(this)); };return a; }, Rd = window.customElements.define, define = function define(a, b) { var c = b.prototype.connectedCallback, d = b.prototype.disconnectedCallback;Rd.call(window.customElements, a, Qd(b, c, d));b.prototype.connectedCallback = c;b.prototype.disconnectedCallback = d; };window.customElements.define = define;Object.defineProperty(window.CustomElementRegistry.prototype, "define", { value: define, configurable: !0 }); }function ld(a) { a = a.__shady_getRootNode();if (M(a)) return a; };function Sd(a) { this.node = a; }w = Sd.prototype;w.addEventListener = function (a, b, c) { return this.node.__shady_addEventListener(a, b, c); };w.removeEventListener = function (a, b, c) { return this.node.__shady_removeEventListener(a, b, c); };w.appendChild = function (a) { return this.node.__shady_appendChild(a); };w.insertBefore = function (a, b) { return this.node.__shady_insertBefore(a, b); };w.removeChild = function (a) { return this.node.__shady_removeChild(a); };w.replaceChild = function (a, b) { return this.node.__shady_replaceChild(a, b); }; w.cloneNode = function (a) { return this.node.__shady_cloneNode(a); };w.getRootNode = function (a) { return this.node.__shady_getRootNode(a); };w.contains = function (a) { return this.node.__shady_contains(a); };w.dispatchEvent = function (a) { return this.node.__shady_dispatchEvent(a); };w.setAttribute = function (a, b) { this.node.__shady_setAttribute(a, b); };w.getAttribute = function (a) { return this.node.__shady_native_getAttribute(a); };w.hasAttribute = function (a) { return this.node.__shady_native_hasAttribute(a); };w.removeAttribute = function (a) { this.node.__shady_removeAttribute(a); }; w.attachShadow = function (a) { return this.node.__shady_attachShadow(a); };w.focus = function () { this.node.__shady_native_focus(); };w.blur = function () { this.node.__shady_blur(); };w.importNode = function (a, b) { if (this.node.nodeType === Node.DOCUMENT_NODE) return this.node.__shady_importNode(a, b); };w.getElementById = function (a) { if (this.node.nodeType === Node.DOCUMENT_NODE) return this.node.__shady_getElementById(a); };w.querySelector = function (a) { return this.node.__shady_querySelector(a); }; w.querySelectorAll = function (a, b) { return this.node.__shady_querySelectorAll(a, b); };w.assignedNodes = function (a) { if ("slot" === this.node.localName) return this.node.__shady_assignedNodes(a); }; ea.Object.defineProperties(Sd.prototype, { activeElement: { configurable: !0, enumerable: !0, get: function get() { if (M(this.node) || this.node.nodeType === Node.DOCUMENT_NODE) return this.node.__shady_activeElement; } }, _activeElement: { configurable: !0, enumerable: !0, get: function get() { return this.activeElement; } }, host: { configurable: !0, enumerable: !0, get: function get() { if (M(this.node)) return this.node.host; } }, parentNode: { configurable: !0, enumerable: !0, get: function get() { return this.node.__shady_parentNode; } }, firstChild: { configurable: !0, enumerable: !0, get: function get() { return this.node.__shady_firstChild; } }, lastChild: { configurable: !0, enumerable: !0, get: function get() { return this.node.__shady_lastChild; } }, nextSibling: { configurable: !0, enumerable: !0, get: function get() { return this.node.__shady_nextSibling; } }, previousSibling: { configurable: !0, enumerable: !0, get: function get() { return this.node.__shady_previousSibling; } }, childNodes: { configurable: !0, enumerable: !0, get: function get() { return this.node.__shady_childNodes; } }, parentElement: { configurable: !0, enumerable: !0, get: function get() { return this.node.__shady_parentElement; } }, firstElementChild: { configurable: !0, enumerable: !0, get: function get() { return this.node.__shady_firstElementChild; } }, lastElementChild: { configurable: !0, enumerable: !0, get: function get() { return this.node.__shady_lastElementChild; } }, nextElementSibling: { configurable: !0, enumerable: !0, get: function get() { return this.node.__shady_nextElementSibling; } }, previousElementSibling: { configurable: !0, enumerable: !0, get: function get() { return this.node.__shady_previousElementSibling; } }, children: { configurable: !0, enumerable: !0, get: function get() { return this.node.__shady_children; } }, childElementCount: { configurable: !0, enumerable: !0, get: function get() { return this.node.__shady_childElementCount; } }, shadowRoot: { configurable: !0, enumerable: !0, get: function get() { return this.node.__shady_shadowRoot; } }, assignedSlot: { configurable: !0, enumerable: !0, get: function get() { return this.node.__shady_assignedSlot; } }, isConnected: { configurable: !0, enumerable: !0, get: function get() { return this.node.__shady_isConnected; } }, innerHTML: { configurable: !0, enumerable: !0, get: function get() { return this.node.__shady_innerHTML; }, set: function set(a) { this.node.__shady_innerHTML = a; } }, textContent: { configurable: !0, enumerable: !0, get: function get() { return this.node.__shady_textContent; }, set: function set(a) { this.node.__shady_textContent = a; } }, slot: { configurable: !0, enumerable: !0, get: function get() { return this.node.__shady_slot; }, set: function set(a) { this.node.__shady_slot = a; } }, className: { configurable: !0, enumerable: !0, get: function get() { return this.node.__shady_className; }, set: function set(a) { return this.node.__shady_className = a; } } });Pc.forEach(function (a) { Object.defineProperty(Sd.prototype, a, { get: function get() { return this.node["__shady_" + a]; }, set: function set(b) { this.node["__shady_" + a] = b; }, configurable: !0 }); });var Td = new WeakMap();function Ud(a) { if (M(a) || a instanceof Sd) return a;var b = Td.get(a);b || (b = new Sd(a), Td.set(a, b));return b; };var Vd = P({ dispatchEvent: Fc, addEventListener: Gc, removeEventListener: Ic });var Wd = P({ get assignedSlot() { var a = this.__shady_parentNode;(a = a && a.__shady_shadowRoot) && Id(a);return (a = B(this)) && a.assignedSlot || null; } });var Xd = window.document;function Yd(a, b) { if ("slot" === b) a = a.__shady_parentNode, sb(a) && nd(B(a).root);else if ("slot" === a.localName && "name" === b && (b = ld(a))) { if (b.a) { Jd(b);var c = a.Ba, d = Nd(a);if (d !== c) { c = b.b[c];var e = c.indexOf(a);0 <= e && c.splice(e, 1);c = b.b[d] || (b.b[d] = []);c.push(a);1 < c.length && (b.b[d] = Od(c)); } }nd(b); } } var Zd = P({ get previousElementSibling() { var a = B(this);if (a && void 0 !== a.previousSibling) { for (a = this.__shady_previousSibling; a && a.nodeType !== Node.ELEMENT_NODE;) { a = a.__shady_previousSibling; }return a; }return this.__shady_native_previousElementSibling; }, get nextElementSibling() { var a = B(this);if (a && void 0 !== a.nextSibling) { for (a = this.__shady_nextSibling; a && a.nodeType !== Node.ELEMENT_NODE;) { a = a.__shady_nextSibling; }return a; }return this.__shady_native_nextElementSibling; }, get slot() { return this.getAttribute("slot"); }, set slot(a) { this.__shady_setAttribute("slot", a); }, get shadowRoot() { var a = B(this);return a && a.Ta || null; }, get className() { return this.getAttribute("class") || ""; }, set className(a) { this.__shady_setAttribute("class", a); }, setAttribute: function setAttribute(a, b) { this.ownerDocument !== Xd ? this.__shady_native_setAttribute(a, b) : Zc(this, a, b) || (this.__shady_native_setAttribute(a, b), Yd(this, a)); }, removeAttribute: function removeAttribute(a) { this.ownerDocument !== Xd ? this.__shady_native_removeAttribute(a) : Zc(this, a, "") ? "" === this.getAttribute(a) && this.__shady_native_removeAttribute(a) : (this.__shady_native_removeAttribute(a), Yd(this, a)); }, attachShadow: function attachShadow(a) { if (!this) throw Error("Must provide a host.");if (!a) throw Error("Not enough arguments.");if (a.shadyUpgradeFragment && !L.ya) { var b = a.shadyUpgradeFragment;b.__proto__ = ShadowRoot.prototype;Hd(b, this, a);Wc(b, b);a = b.__noInsertionPoint ? null : b.querySelectorAll("slot");b.__noInsertionPoint = void 0;if (a && a.length) { var c = b;md(c);c.c.push.apply(c.c, da(a));nd(b); }b.host.__shady_native_appendChild(b); } else b = new Gd(Cd, this, a);return b; } });var $d = P({ blur: function blur() { var a = B(this);(a = (a = a && a.root) && a.activeElement) ? a.__shady_blur() : this.__shady_native_blur(); } });Pc.forEach(function (a) { $d[a] = { set: function set(b) { var c = A(this), d = a.substring(2);c.N || (c.N = {});c.N[a] && this.removeEventListener(d, c.N[a]);this.__shady_addEventListener(d, b);c.N[a] = b; }, get: function get() { var b = B(this);return b && b.N && b.N[a]; }, configurable: !0 }; });var ae = P({ assignedNodes: function assignedNodes(a) { if ("slot" === this.localName) { var b = this.__shady_getRootNode();b && M(b) && Id(b);return (b = B(this)) ? (a && a.flatten ? b.T : b.assignedNodes) || [] : []; } }, addEventListener: function addEventListener(a, b, c) { if ("slot" !== this.localName || "slotchange" === a) Gc.call(this, a, b, c);else { "object" !== (typeof c === "undefined" ? "undefined" : _typeof(c)) && (c = { capture: !!c });var d = this.__shady_parentNode;if (!d) throw Error("ShadyDOM cannot attach event to slot unless it has a `parentNode`");c.O = this;d.__shady_addEventListener(a, b, c); } }, removeEventListener: function removeEventListener(a, b, c) { if ("slot" !== this.localName || "slotchange" === a) Ic.call(this, a, b, c);else { "object" !== (typeof c === "undefined" ? "undefined" : _typeof(c)) && (c = { capture: !!c });var d = this.__shady_parentNode;if (!d) throw Error("ShadyDOM cannot attach event to slot unless it has a `parentNode`");c.O = this;d.__shady_removeEventListener(a, b, c); } } });var be = window.document, ce = P({ importNode: function importNode(a, b) { if (a.ownerDocument !== be || "template" === a.localName) return this.__shady_native_importNode(a, b);var c = this.__shady_native_importNode(a, !1);if (b) for (a = a.__shady_firstChild; a; a = a.__shady_nextSibling) { b = this.__shady_importNode(a, !0), c.__shady_appendChild(b); }return c; } });var de = P({ dispatchEvent: Fc, addEventListener: Gc.bind(window), removeEventListener: Ic.bind(window) });var ee = {};Object.getOwnPropertyDescriptor(HTMLElement.prototype, "parentElement") && (ee.parentElement = pd.parentElement);Object.getOwnPropertyDescriptor(HTMLElement.prototype, "contains") && (ee.contains = pd.contains);Object.getOwnPropertyDescriptor(HTMLElement.prototype, "children") && (ee.children = td.children);Object.getOwnPropertyDescriptor(HTMLElement.prototype, "innerHTML") && (ee.innerHTML = zd.innerHTML);Object.getOwnPropertyDescriptor(HTMLElement.prototype, "className") && (ee.className = Zd.className); var fe = { EventTarget: [Vd], Node: [pd, window.EventTarget ? null : Vd], Text: [Wd], Element: [Zd, td, Wd, !L.F || "innerHTML" in Element.prototype ? zd : null, window.HTMLSlotElement ? null : ae], HTMLElement: [$d, ee], HTMLSlotElement: [ae], DocumentFragment: [vd, wd], Document: [ce, vd, wd, xd], Window: [de] }, ge = L.F ? null : ["innerHTML", "textContent"];function he(a) { var b = a ? null : ge, c = {}, d;for (d in fe) { c.Z = window[d] && window[d].prototype, fe[d].forEach(function (e) { return function (f) { return e.Z && f && O(e.Z, f, a, b); }; }(c)), c = { Z: c.Z }; } };if (L.ja) { var ShadyDOM = { inUse: L.ja, patch: function patch(a) { oc(a);nc(a);return a; }, isShadyRoot: M, enqueue: Hb, flush: Ib, flushInitial: function flushInitial(a) { !a.pa && a.R && Id(a); }, settings: L, filterMutations: Nb, observeChildren: Lb, unobserveChildren: Mb, deferConnectionCallbacks: L.deferConnectionCallbacks, preferPerformance: L.preferPerformance, handlesDynamicScoping: !0, wrap: L.M ? Ud : function (a) { return a; }, Wrapper: Sd, composedPath: xc, noPatch: L.M, nativeMethods: Yb, nativeTree: Zb };window.ShadyDOM = ShadyDOM;hc();he("__shady_");Object.defineProperty(document, "_activeElement", xd.activeElement);O(Window.prototype, de, "__shady_");L.M || (he(), Oc());Jc();window.Event = Lc;window.CustomEvent = Mc;window.MouseEvent = Nc;window.ShadowRoot = Gd; };var ie = window.Document.prototype.createElement, je = window.Document.prototype.createElementNS, ke = window.Document.prototype.importNode, le = window.Document.prototype.prepend, me = window.Document.prototype.append, ne = window.DocumentFragment.prototype.prepend, oe = window.DocumentFragment.prototype.append, pe = window.Node.prototype.cloneNode, qe = window.Node.prototype.appendChild, re = window.Node.prototype.insertBefore, se = window.Node.prototype.removeChild, te = window.Node.prototype.replaceChild, ue = Object.getOwnPropertyDescriptor(window.Node.prototype, "textContent"), ve = window.Element.prototype.attachShadow, we = Object.getOwnPropertyDescriptor(window.Element.prototype, "innerHTML"), xe = window.Element.prototype.getAttribute, ye = window.Element.prototype.setAttribute, ze = window.Element.prototype.removeAttribute, Ae = window.Element.prototype.getAttributeNS, Be = window.Element.prototype.setAttributeNS, Ce = window.Element.prototype.removeAttributeNS, De = window.Element.prototype.insertAdjacentElement, Ee = window.Element.prototype.insertAdjacentHTML, Fe = window.Element.prototype.prepend, Ge = window.Element.prototype.append, He = window.Element.prototype.before, Ie = window.Element.prototype.after, Je = window.Element.prototype.replaceWith, Ke = window.Element.prototype.remove, Le = window.HTMLElement, Me = Object.getOwnPropertyDescriptor(window.HTMLElement.prototype, "innerHTML"), Ne = window.HTMLElement.prototype.insertAdjacentElement, Oe = window.HTMLElement.prototype.insertAdjacentHTML;var Pe = new Set();"annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" ").forEach(function (a) { return Pe.add(a); });function Qe(a) { var b = Pe.has(a);a = /^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(a);return !b && a; }var Re = document.contains ? document.contains.bind(document) : document.documentElement.contains.bind(document.documentElement); function S(a) { var b = a.isConnected;if (void 0 !== b) return b;if (Re(a)) return !0;for (; a && !(a.__CE_isImportDocument || a instanceof Document);) { a = a.parentNode || (window.ShadowRoot && a instanceof ShadowRoot ? a.host : void 0); }return !(!a || !(a.__CE_isImportDocument || a instanceof Document)); }function Se(a) { var b = a.children;if (b) return Array.prototype.slice.call(b);b = [];for (a = a.firstChild; a; a = a.nextSibling) { a.nodeType === Node.ELEMENT_NODE && b.push(a); }return b; } function Te(a, b) { for (; b && b !== a && !b.nextSibling;) { b = b.parentNode; }return b && b !== a ? b.nextSibling : null; } function Ue(a, b, c) { for (var d = a; d;) { if (d.nodeType === Node.ELEMENT_NODE) { var e = d;b(e);var f = e.localName;if ("link" === f && "import" === e.getAttribute("rel")) { d = e.import;void 0 === c && (c = new Set());if (d instanceof Node && !c.has(d)) for (c.add(d), d = d.firstChild; d; d = d.nextSibling) { Ue(d, b, c); }d = Te(a, e);continue; } else if ("template" === f) { d = Te(a, e);continue; }if (e = e.__CE_shadowRoot) for (e = e.firstChild; e; e = e.nextSibling) { Ue(e, b, c); } }d = d.firstChild ? d.firstChild : Te(a, d); } }function T(a, b, c) { a[b] = c; };function Ve(a) { var b = document;this.b = a;this.a = b;this.P = void 0;We(this.b, this.a);"loading" === this.a.readyState && (this.P = new MutationObserver(this.c.bind(this)), this.P.observe(this.a, { childList: !0, subtree: !0 })); }function Xe(a) { a.P && a.P.disconnect(); }Ve.prototype.c = function (a) { var b = this.a.readyState;"interactive" !== b && "complete" !== b || Xe(this);for (b = 0; b < a.length; b++) { for (var c = a[b].addedNodes, d = 0; d < c.length; d++) { We(this.b, c[d]); } } };function Ye() { var a = this;this.a = this.w = void 0;this.b = new Promise(function (b) { a.a = b;a.w && b(a.w); }); }Ye.prototype.resolve = function (a) { if (this.w) throw Error("Already resolved.");this.w = a;this.a && this.a(a); };function U(a) { this.f = new Map();this.u = new Map();this.sa = new Map();this.U = !1;this.b = a;this.ka = new Map();this.c = function (b) { return b(); };this.a = !1;this.D = [];this.ua = a.f ? new Ve(a) : void 0; }w = U.prototype;w.Ra = function (a, b) { var c = this;if (!(b instanceof Function)) throw new TypeError("Custom element constructor getters must be functions.");Ze(this, a);this.f.set(a, b);this.D.push(a);this.a || (this.a = !0, this.c(function () { return $e(c); })); }; w.define = function (a, b) { var c = this;if (!(b instanceof Function)) throw new TypeError("Custom element constructors must be functions.");Ze(this, a);af(this, a, b);this.D.push(a);this.a || (this.a = !0, this.c(function () { return $e(c); })); };function Ze(a, b) { if (!Qe(b)) throw new SyntaxError("The element name '" + b + "' is not valid.");if (bf(a, b)) throw Error("A custom element with name '" + b + "' has already been defined.");if (a.U) throw Error("A custom element is already being defined."); } function af(a, b, c) { a.U = !0;var d;try { var e = function e(m) { var q = f[m];if (void 0 !== q && !(q instanceof Function)) throw Error("The '" + m + "' callback must be a function.");return q; }, f = c.prototype;if (!(f instanceof Object)) throw new TypeError("The custom element constructor's prototype is not an object.");var g = e("connectedCallback");var h = e("disconnectedCallback");var k = e("adoptedCallback");var l = (d = e("attributeChangedCallback")) && c.observedAttributes || []; } catch (m) { throw m; } finally { a.U = !1; }c = { localName: b, constructorFunction: c, connectedCallback: g, disconnectedCallback: h, adoptedCallback: k, attributeChangedCallback: d, observedAttributes: l, constructionStack: [] };a.u.set(b, c);a.sa.set(c.constructorFunction, c);return c; }w.upgrade = function (a) { We(this.b, a); }; function $e(a) { if (!1 !== a.a) { a.a = !1;for (var b = [], c = a.D, d = new Map(), e = 0; e < c.length; e++) { d.set(c[e], []); }We(a.b, document, { upgrade: function upgrade(k) { if (void 0 === k.__CE_state) { var l = k.localName, m = d.get(l);m ? m.push(k) : a.u.has(l) && b.push(k); } } });for (e = 0; e < b.length; e++) { cf(a.b, b[e]); }for (e = 0; e < c.length; e++) { for (var f = c[e], g = d.get(f), h = 0; h < g.length; h++) { cf(a.b, g[h]); }(f = a.ka.get(f)) && f.resolve(void 0); }c.length = 0; } }w.get = function (a) { if (a = bf(this, a)) return a.constructorFunction; }; w.whenDefined = function (a) { if (!Qe(a)) return Promise.reject(new SyntaxError("'" + a + "' is not a valid custom element name."));var b = this.ka.get(a);if (b) return b.b;b = new Ye();this.ka.set(a, b);var c = this.u.has(a) || this.f.has(a);a = -1 === this.D.indexOf(a);c && a && b.resolve(void 0);return b.b; };w.polyfillWrapFlushCallback = function (a) { this.ua && Xe(this.ua);var b = this.c;this.c = function (c) { return a(function () { return b(c); }); }; }; function bf(a, b) { var c = a.u.get(b);if (c) return c;if (c = a.f.get(b)) { a.f.delete(b);try { return af(a, b, c()); } catch (d) { df(d); } } }window.CustomElementRegistry = U;U.prototype.define = U.prototype.define;U.prototype.upgrade = U.prototype.upgrade;U.prototype.get = U.prototype.get;U.prototype.whenDefined = U.prototype.whenDefined;U.prototype.polyfillDefineLazy = U.prototype.Ra;U.prototype.polyfillWrapFlushCallback = U.prototype.polyfillWrapFlushCallback;function ef() { var a = ff && ff.noDocumentConstructionObserver, b = ff && ff.shadyDomFastWalk;this.b = [];this.c = [];this.a = !1;this.shadyDomFastWalk = b;this.f = !a; }function gf(a, b, c, d) { var e = window.ShadyDOM;if (a.shadyDomFastWalk && e && e.inUse) { if (b.nodeType === Node.ELEMENT_NODE && c(b), b.querySelectorAll) for (a = e.nativeMethods.querySelectorAll.call(b, "*"), b = 0; b < a.length; b++) { c(a[b]); } } else Ue(b, c, d); }function hf(a, b) { a.a = !0;a.b.push(b); }function jf(a, b) { a.a = !0;a.c.push(b); } function kf(a, b) { a.a && gf(a, b, function (c) { return lf(a, c); }); }function lf(a, b) { if (a.a && !b.__CE_patched) { b.__CE_patched = !0;for (var c = 0; c < a.b.length; c++) { a.b[c](b); }for (c = 0; c < a.c.length; c++) { a.c[c](b); } } }function mf(a, b) { var c = [];gf(a, b, function (e) { return c.push(e); });for (b = 0; b < c.length; b++) { var d = c[b];1 === d.__CE_state ? a.connectedCallback(d) : cf(a, d); } }function nf(a, b) { var c = [];gf(a, b, function (e) { return c.push(e); });for (b = 0; b < c.length; b++) { var d = c[b];1 === d.__CE_state && a.disconnectedCallback(d); } } function We(a, b, c) { c = void 0 === c ? {} : c;var d = c.$a, e = c.upgrade || function (g) { return cf(a, g); }, f = [];gf(a, b, function (g) { a.a && lf(a, g);if ("link" === g.localName && "import" === g.getAttribute("rel")) { var h = g.import;h instanceof Node && (h.__CE_isImportDocument = !0, h.__CE_registry = document.__CE_registry);h && "complete" === h.readyState ? h.__CE_documentLoadHandled = !0 : g.addEventListener("load", function () { var k = g.import;if (!k.__CE_documentLoadHandled) { k.__CE_documentLoadHandled = !0;var l = new Set();d && (d.forEach(function (m) { return l.add(m); }), l.delete(k));We(a, k, { $a: l, upgrade: e }); } }); } else f.push(g); }, d);for (b = 0; b < f.length; b++) { e(f[b]); } } function cf(a, b) { try { var c = b.ownerDocument, d = c.__CE_registry;var e = d && (c.defaultView || c.__CE_isImportDocument) ? bf(d, b.localName) : void 0;if (e && void 0 === b.__CE_state) { e.constructionStack.push(b);try { try { if (new e.constructorFunction() !== b) throw Error("The custom element constructor did not produce the element being upgraded."); } finally { e.constructionStack.pop(); } } catch (k) { throw b.__CE_state = 2, k; }b.__CE_state = 1;b.__CE_definition = e;if (e.attributeChangedCallback && b.hasAttributes()) { var f = e.observedAttributes; for (e = 0; e < f.length; e++) { var g = f[e], h = b.getAttribute(g);null !== h && a.attributeChangedCallback(b, g, null, h, null); } }S(b) && a.connectedCallback(b); } } catch (k) { df(k); } }ef.prototype.connectedCallback = function (a) { var b = a.__CE_definition;if (b.connectedCallback) try { b.connectedCallback.call(a); } catch (c) { df(c); } };ef.prototype.disconnectedCallback = function (a) { var b = a.__CE_definition;if (b.disconnectedCallback) try { b.disconnectedCallback.call(a); } catch (c) { df(c); } }; ef.prototype.attributeChangedCallback = function (a, b, c, d, e) { var f = a.__CE_definition;if (f.attributeChangedCallback && -1 < f.observedAttributes.indexOf(b)) try { f.attributeChangedCallback.call(a, b, c, d, e); } catch (g) { df(g); } }; function of(a, b, c, d) { var e = b.__CE_registry;if (e && (null === d || "http://www.w3.org/1999/xhtml" === d) && (e = bf(e, c))) try { var f = new e.constructorFunction();if (void 0 === f.__CE_state || void 0 === f.__CE_definition) throw Error("Failed to construct '" + c + "': The returned value was not constructed with the HTMLElement constructor.");if ("http://www.w3.org/1999/xhtml" !== f.namespaceURI) throw Error("Failed to construct '" + c + "': The constructed element's namespace must be the HTML namespace.");if (f.hasAttributes()) throw Error("Failed to construct '" + c + "': The constructed element must not have any attributes.");if (null !== f.firstChild) throw Error("Failed to construct '" + c + "': The constructed element must not have any children.");if (null !== f.parentNode) throw Error("Failed to construct '" + c + "': The constructed element must not have a parent node.");if (f.ownerDocument !== b) throw Error("Failed to construct '" + c + "': The constructed element's owner document is incorrect.");if (f.localName !== c) throw Error("Failed to construct '" + c + "': The constructed element's local name is incorrect."); return f; } catch (g) { return df(g), b = null === d ? ie.call(b, c) : je.call(b, d, c), Object.setPrototypeOf(b, HTMLUnknownElement.prototype), b.__CE_state = 2, b.__CE_definition = void 0, lf(a, b), b; }b = null === d ? ie.call(b, c) : je.call(b, d, c);lf(a, b);return b; } function df(a) { var b = a.message, c = a.sourceURL || a.fileName || "", d = a.line || a.lineNumber || 0, e = a.column || a.columnNumber || 0, f = void 0;void 0 === ErrorEvent.prototype.initErrorEvent ? f = new ErrorEvent("error", { cancelable: !0, message: b, filename: c, lineno: d, colno: e, error: a }) : (f = document.createEvent("ErrorEvent"), f.initErrorEvent("error", !1, !0, b, c, d), f.preventDefault = function () { Object.defineProperty(this, "defaultPrevented", { configurable: !0, get: function get() { return !0; } }); });void 0 === f.error && Object.defineProperty(f, "error", { configurable: !0, enumerable: !0, get: function get() { return a; } });window.dispatchEvent(f);f.defaultPrevented || console.error(a); };var pf = new function () {}();function qf(a) { window.HTMLElement = function () { function b() { var c = this.constructor;var d = document.__CE_registry.sa.get(c);if (!d) throw Error("Failed to construct a custom element: The constructor was not registered with `customElements`.");var e = d.constructionStack;if (0 === e.length) return e = ie.call(document, d.localName), Object.setPrototypeOf(e, c.prototype), e.__CE_state = 1, e.__CE_definition = d, lf(a, e), e;var f = e.length - 1, g = e[f];if (g === pf) throw Error("Failed to construct '" + d.localName + "': This element was already constructed."); e[f] = pf;Object.setPrototypeOf(g, c.prototype);lf(a, g);return g; }b.prototype = Le.prototype;Object.defineProperty(b.prototype, "constructor", { writable: !0, configurable: !0, enumerable: !1, value: b });return b; }(); };function rf(a, b, c) { function d(e) { return function (f) { for (var g = [], h = 0; h < arguments.length; ++h) { g[h] = arguments[h]; }h = [];for (var k = [], l = 0; l < g.length; l++) { var m = g[l];m instanceof Element && S(m) && k.push(m);if (m instanceof DocumentFragment) for (m = m.firstChild; m; m = m.nextSibling) { h.push(m); } else h.push(m); }e.apply(this, g);for (g = 0; g < k.length; g++) { nf(a, k[g]); }if (S(this)) for (g = 0; g < h.length; g++) { k = h[g], k instanceof Element && mf(a, k); } }; }void 0 !== c.prepend && T(b, "prepend", d(c.prepend));void 0 !== c.append && T(b, "append", d(c.append)); } ;function sf(a) { T(Document.prototype, "createElement", function (b) { return of(a, this, b, null); });T(Document.prototype, "importNode", function (b, c) { b = ke.call(this, b, !!c);this.__CE_registry ? We(a, b) : kf(a, b);return b; });T(Document.prototype, "createElementNS", function (b, c) { return of(a, this, c, b); });rf(a, Document.prototype, { prepend: le, append: me }); };function tf(a) { function b(c, d) { Object.defineProperty(c, "textContent", { enumerable: d.enumerable, configurable: !0, get: d.get, set: function set(e) { if (this.nodeType === Node.TEXT_NODE) d.set.call(this, e);else { var f = void 0;if (this.firstChild) { var g = this.childNodes, h = g.length;if (0 < h && S(this)) { f = Array(h);for (var k = 0; k < h; k++) { f[k] = g[k]; } } }d.set.call(this, e);if (f) for (e = 0; e < f.length; e++) { nf(a, f[e]); } } } }); }T(Node.prototype, "insertBefore", function (c, d) { if (c instanceof DocumentFragment) { var e = Se(c);c = re.call(this, c, d);if (S(this)) for (d = 0; d < e.length; d++) { mf(a, e[d]); }return c; }e = c instanceof Element && S(c);d = re.call(this, c, d);e && nf(a, c);S(this) && mf(a, c);return d; });T(Node.prototype, "appendChild", function (c) { if (c instanceof DocumentFragment) { var d = Se(c);c = qe.call(this, c);if (S(this)) for (var e = 0; e < d.length; e++) { mf(a, d[e]); }return c; }d = c instanceof Element && S(c);e = qe.call(this, c);d && nf(a, c);S(this) && mf(a, c);return e; });T(Node.prototype, "cloneNode", function (c) { c = pe.call(this, !!c);this.ownerDocument.__CE_registry ? We(a, c) : kf(a, c);return c; });T(Node.prototype, "removeChild", function (c) { var d = c instanceof Element && S(c), e = se.call(this, c);d && nf(a, c);return e; });T(Node.prototype, "replaceChild", function (c, d) { if (c instanceof DocumentFragment) { var e = Se(c);c = te.call(this, c, d);if (S(this)) for (nf(a, d), d = 0; d < e.length; d++) { mf(a, e[d]); }return c; }e = c instanceof Element && S(c);var f = te.call(this, c, d), g = S(this);g && nf(a, d);e && nf(a, c);g && mf(a, c);return f; });ue && ue.get ? b(Node.prototype, ue) : hf(a, function (c) { b(c, { enumerable: !0, configurable: !0, get: function get() { for (var d = [], e = this.firstChild; e; e = e.nextSibling) { e.nodeType !== Node.COMMENT_NODE && d.push(e.textContent); }return d.join(""); }, set: function set(d) { for (; this.firstChild;) { se.call(this, this.firstChild); }null != d && "" !== d && qe.call(this, document.createTextNode(d)); } }); }); };function uf(a) { function b(d) { return function (e) { for (var f = [], g = 0; g < arguments.length; ++g) { f[g] = arguments[g]; }g = [];for (var h = [], k = 0; k < f.length; k++) { var l = f[k];l instanceof Element && S(l) && h.push(l);if (l instanceof DocumentFragment) for (l = l.firstChild; l; l = l.nextSibling) { g.push(l); } else g.push(l); }d.apply(this, f);for (f = 0; f < h.length; f++) { nf(a, h[f]); }if (S(this)) for (f = 0; f < g.length; f++) { h = g[f], h instanceof Element && mf(a, h); } }; }var c = Element.prototype;void 0 !== He && T(c, "before", b(He));void 0 !== Ie && T(c, "after", b(Ie));void 0 !== Je && T(c, "replaceWith", function (d) { for (var e = [], f = 0; f < arguments.length; ++f) { e[f] = arguments[f]; }f = [];for (var g = [], h = 0; h < e.length; h++) { var k = e[h];k instanceof Element && S(k) && g.push(k);if (k instanceof DocumentFragment) for (k = k.firstChild; k; k = k.nextSibling) { f.push(k); } else f.push(k); }h = S(this);Je.apply(this, e);for (e = 0; e < g.length; e++) { nf(a, g[e]); }if (h) for (nf(a, this), e = 0; e < f.length; e++) { g = f[e], g instanceof Element && mf(a, g); } });void 0 !== Ke && T(c, "remove", function () { var d = S(this);Ke.call(this);d && nf(a, this); }); };function vf(a) { function b(e, f) { Object.defineProperty(e, "innerHTML", { enumerable: f.enumerable, configurable: !0, get: f.get, set: function set(g) { var h = this, k = void 0;S(this) && (k = [], gf(a, this, function (q) { q !== h && k.push(q); }));f.set.call(this, g);if (k) for (var l = 0; l < k.length; l++) { var m = k[l];1 === m.__CE_state && a.disconnectedCallback(m); }this.ownerDocument.__CE_registry ? We(a, this) : kf(a, this);return g; } }); }function c(e, f) { T(e, "insertAdjacentElement", function (g, h) { var k = S(h);g = f.call(this, g, h);k && nf(a, h);S(g) && mf(a, h);return g; }); } function d(e, f) { function g(h, k) { for (var l = []; h !== k; h = h.nextSibling) { l.push(h); }for (k = 0; k < l.length; k++) { We(a, l[k]); } }T(e, "insertAdjacentHTML", function (h, k) { h = h.toLowerCase();if ("beforebegin" === h) { var l = this.previousSibling;f.call(this, h, k);g(l || this.parentNode.firstChild, this); } else if ("afterbegin" === h) l = this.firstChild, f.call(this, h, k), g(this.firstChild, l);else if ("beforeend" === h) l = this.lastChild, f.call(this, h, k), g(l || this.firstChild, null);else if ("afterend" === h) l = this.nextSibling, f.call(this, h, k), g(this.nextSibling, l);else throw new SyntaxError("The value provided (" + String(h) + ") is not one of 'beforebegin', 'afterbegin', 'beforeend', or 'afterend'."); }); }ve && T(Element.prototype, "attachShadow", function (e) { e = ve.call(this, e);if (a.a && !e.__CE_patched) { e.__CE_patched = !0;for (var f = 0; f < a.b.length; f++) { a.b[f](e); } }return this.__CE_shadowRoot = e; });we && we.get ? b(Element.prototype, we) : Me && Me.get ? b(HTMLElement.prototype, Me) : jf(a, function (e) { b(e, { enumerable: !0, configurable: !0, get: function get() { return pe.call(this, !0).innerHTML; }, set: function set(f) { var g = "template" === this.localName, h = g ? this.content : this, k = je.call(document, this.namespaceURI, this.localName);for (k.innerHTML = f; 0 < h.childNodes.length;) { se.call(h, h.childNodes[0]); }for (f = g ? k.content : k; 0 < f.childNodes.length;) { qe.call(h, f.childNodes[0]); } } }); });T(Element.prototype, "setAttribute", function (e, f) { if (1 !== this.__CE_state) return ye.call(this, e, f);var g = xe.call(this, e);ye.call(this, e, f);f = xe.call(this, e);a.attributeChangedCallback(this, e, g, f, null); });T(Element.prototype, "setAttributeNS", function (e, f, g) { if (1 !== this.__CE_state) return Be.call(this, e, f, g);var h = Ae.call(this, e, f);Be.call(this, e, f, g);g = Ae.call(this, e, f);a.attributeChangedCallback(this, f, h, g, e); });T(Element.prototype, "removeAttribute", function (e) { if (1 !== this.__CE_state) return ze.call(this, e);var f = xe.call(this, e);ze.call(this, e);null !== f && a.attributeChangedCallback(this, e, f, null, null); });T(Element.prototype, "removeAttributeNS", function (e, f) { if (1 !== this.__CE_state) return Ce.call(this, e, f);var g = Ae.call(this, e, f);Ce.call(this, e, f);var h = Ae.call(this, e, f);g !== h && a.attributeChangedCallback(this, f, g, h, e); });Ne ? c(HTMLElement.prototype, Ne) : De ? c(Element.prototype, De) : console.warn("Custom Elements: `Element#insertAdjacentElement` was not patched.");Oe ? d(HTMLElement.prototype, Oe) : Ee ? d(Element.prototype, Ee) : console.warn("Custom Elements: `Element#insertAdjacentHTML` was not patched.");rf(a, Element.prototype, { prepend: Fe, append: Ge });uf(a); };var ff = window.customElements;function wf() { var a = new ef();qf(a);sf(a);rf(a, DocumentFragment.prototype, { prepend: ne, append: oe });tf(a);vf(a);a = new U(a);document.__CE_registry = a;Object.defineProperty(window, "customElements", { configurable: !0, enumerable: !0, value: a }); }ff && !ff.forcePolyfill && "function" == typeof ff.define && "function" == typeof ff.get || wf();window.__CE_installPolyfill = wf;function xf() { this.end = this.start = 0;this.rules = this.parent = this.previous = null;this.cssText = this.parsedCssText = "";this.atRule = !1;this.type = 0;this.parsedSelector = this.selector = this.keyframesName = ""; } function yf(a) { var b = a = a.replace(zf, "").replace(Af, ""), c = new xf();c.start = 0;c.end = b.length;for (var d = c, e = 0, f = b.length; e < f; e++) { if ("{" === b[e]) { d.rules || (d.rules = []);var g = d, h = g.rules[g.rules.length - 1] || null;d = new xf();d.start = e + 1;d.parent = g;d.previous = h;g.rules.push(d); } else "}" === b[e] && (d.end = e + 1, d = d.parent || c); }return Bf(c, a); } function Bf(a, b) { var c = b.substring(a.start, a.end - 1);a.parsedCssText = a.cssText = c.trim();a.parent && (c = b.substring(a.previous ? a.previous.end : a.parent.start, a.start - 1), c = Cf(c), c = c.replace(Df, " "), c = c.substring(c.lastIndexOf(";") + 1), c = a.parsedSelector = a.selector = c.trim(), a.atRule = 0 === c.indexOf("@"), a.atRule ? 0 === c.indexOf("@media") ? a.type = Ef : c.match(Ff) && (a.type = Gf, a.keyframesName = a.selector.split(Df).pop()) : a.type = 0 === c.indexOf("--") ? Hf : If);if (c = a.rules) for (var d = 0, e = c.length, f = void 0; d < e && (f = c[d]); d++) { Bf(f, b); }return a; }function Cf(a) { return a.replace(/\\([0-9a-f]{1,6})\s/gi, function (b, c) { b = c;for (c = 6 - b.length; c--;) { b = "0" + b; }return "\\" + b; }); } function Jf(a, b, c) { c = void 0 === c ? "" : c;var d = "";if (a.cssText || a.rules) { var e = a.rules, f;if (f = e) f = e[0], f = !(f && f.selector && 0 === f.selector.indexOf("--"));if (f) { f = 0;for (var g = e.length, h = void 0; f < g && (h = e[f]); f++) { d = Jf(h, b, d); } } else b ? b = a.cssText : (b = a.cssText, b = b.replace(Kf, "").replace(Lf, ""), b = b.replace(Mf, "").replace(Nf, "")), (d = b.trim()) && (d = " " + d + "\n"); }d && (a.selector && (c += a.selector + " {\n"), c += d, a.selector && (c += "}\n\n"));return c; } var If = 1, Gf = 7, Ef = 4, Hf = 1E3, zf = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim, Af = /@import[^;]*;/gim, Kf = /(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim, Lf = /(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim, Mf = /@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim, Nf = /[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim, Ff = /^@[^\s]*keyframes/, Df = /\s+/g;var V = !(window.ShadyDOM && window.ShadyDOM.inUse), Of;function Pf(a) { Of = a && a.shimcssproperties ? !1 : V || !(navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/) || !window.CSS || !CSS.supports || !CSS.supports("box-shadow", "0 0 0 var(--foo)")); }var Qf;window.ShadyCSS && void 0 !== window.ShadyCSS.cssBuild && (Qf = window.ShadyCSS.cssBuild);var Rf = !(!window.ShadyCSS || !window.ShadyCSS.disableRuntime); window.ShadyCSS && void 0 !== window.ShadyCSS.nativeCss ? Of = window.ShadyCSS.nativeCss : window.ShadyCSS ? (Pf(window.ShadyCSS), window.ShadyCSS = void 0) : Pf(window.WebComponents && window.WebComponents.flags);var W = Of;var Sf = /(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gi, Tf = /(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi, Vf = /(--[\w-]+)\s*([:,;)]|$)/gi, Wf = /(animation\s*:)|(animation-name\s*:)/, Xf = /@media\s(.*)/, Yf = /\{[^}]*\}/g;var Zf = new Set();function $f(a, b) { if (!a) return "";"string" === typeof a && (a = yf(a));b && ag(a, b);return Jf(a, W); }function bg(a) { !a.__cssRules && a.textContent && (a.__cssRules = yf(a.textContent));return a.__cssRules || null; }function cg(a) { return !!a.parent && a.parent.type === Gf; }function ag(a, b, c, d) { if (a) { var e = !1, f = a.type;if (d && f === Ef) { var g = a.selector.match(Xf);g && (window.matchMedia(g[1]).matches || (e = !0)); }f === If ? b(a) : c && f === Gf ? c(a) : f === Hf && (e = !0);if ((a = a.rules) && !e) for (e = 0, f = a.length, g = void 0; e < f && (g = a[e]); e++) { ag(g, b, c, d); } } } function dg(a, b, c, d) { var e = document.createElement("style");b && e.setAttribute("scope", b);e.textContent = a;eg(e, c, d);return e; }var fg = null;function gg(a) { a = document.createComment(" Shady DOM styles for " + a + " ");var b = document.head;b.insertBefore(a, (fg ? fg.nextSibling : null) || b.firstChild);return fg = a; }function eg(a, b, c) { b = b || document.head;b.insertBefore(a, c && c.nextSibling || b.firstChild);fg ? a.compareDocumentPosition(fg) === Node.DOCUMENT_POSITION_PRECEDING && (fg = a) : fg = a; } function hg(a, b) { for (var c = 0, d = a.length; b < d; b++) { if ("(" === a[b]) c++;else if (")" === a[b] && 0 === --c) return b; }return -1; }function ig(a, b) { var c = a.indexOf("var(");if (-1 === c) return b(a, "", "", "");var d = hg(a, c + 3), e = a.substring(c + 4, d);c = a.substring(0, c);a = ig(a.substring(d + 1), b);d = e.indexOf(",");return -1 === d ? b(c, e.trim(), "", a) : b(c, e.substring(0, d).trim(), e.substring(d + 1).trim(), a); }function jg(a, b) { V ? a.setAttribute("class", b) : window.ShadyDOM.nativeMethods.setAttribute.call(a, "class", b); } var kg = window.ShadyDOM && window.ShadyDOM.wrap || function (a) { return a; };function lg(a) { var b = a.localName, c = "";b ? -1 < b.indexOf("-") || (c = b, b = a.getAttribute && a.getAttribute("is") || "") : (b = a.is, c = a.extends);return { is: b, Y: c }; }function mg(a) { for (var b = [], c = "", d = 0; 0 <= d && d < a.length; d++) { if ("(" === a[d]) { var e = hg(a, d);c += a.slice(d, e + 1);d = e; } else "," === a[d] ? (b.push(c), c = "") : c += a[d]; }c && b.push(c);return b; } function ng(a) { if (void 0 !== Qf) return Qf;if (void 0 === a.__cssBuild) { var b = a.getAttribute("css-build");if (b) a.__cssBuild = b;else { a: { b = "template" === a.localName ? a.content.firstChild : a.firstChild;if (b instanceof Comment && (b = b.textContent.trim().split(":"), "css-build" === b[0])) { b = b[1];break a; }b = ""; }if ("" !== b) { var c = "template" === a.localName ? a.content.firstChild : a.firstChild;c.parentNode.removeChild(c); }a.__cssBuild = b; } }return a.__cssBuild || ""; } function og(a) { a = void 0 === a ? "" : a;return "" !== a && W ? V ? "shadow" === a : "shady" === a : !1; };function pg() {}function qg(a, b) { rg(sg, a, function (c) { tg(c, b || ""); }); }function rg(a, b, c) { b.nodeType === Node.ELEMENT_NODE && c(b);var d;"template" === b.localName ? d = (b.content || b._content || b).childNodes : d = b.children || b.childNodes;if (d) for (b = 0; b < d.length; b++) { rg(a, d[b], c); } } function tg(a, b, c) { if (b) if (a.classList) c ? (a.classList.remove("style-scope"), a.classList.remove(b)) : (a.classList.add("style-scope"), a.classList.add(b));else if (a.getAttribute) { var d = a.getAttribute("class");c ? d && (b = d.replace("style-scope", "").replace(b, ""), jg(a, b)) : jg(a, (d ? d + " " : "") + "style-scope " + b); } }function ug(a, b, c) { rg(sg, a, function (d) { tg(d, b, !0);tg(d, c); }); }function vg(a, b) { rg(sg, a, function (c) { tg(c, b || "", !0); }); } function wg(a, b, c, d, e) { var f = sg;e = void 0 === e ? "" : e;"" === e && (V || "shady" === (void 0 === d ? "" : d) ? e = $f(b, c) : (a = lg(a), e = xg(f, b, a.is, a.Y, c) + "\n\n"));return e.trim(); }function xg(a, b, c, d, e) { var f = yg(c, d);c = c ? "." + c : "";return $f(b, function (g) { g.c || (g.selector = g.B = zg(a, g, a.b, c, f), g.c = !0);e && e(g, c, f); }); }function yg(a, b) { return b ? "[is=" + a + "]" : a; } function zg(a, b, c, d, e) { var f = mg(b.selector);if (!cg(b)) { b = 0;for (var g = f.length, h = void 0; b < g && (h = f[b]); b++) { f[b] = c.call(a, h, d, e); } }return f.filter(function (k) { return !!k; }).join(","); }function Ag(a) { return a.replace(Bg, function (b, c, d) { -1 < d.indexOf("+") ? d = d.replace(/\+/g, "___") : -1 < d.indexOf("___") && (d = d.replace(/___/g, "+"));return ":" + c + "(" + d + ")"; }); } function Cg(a) { for (var b = [], c; c = a.match(Dg);) { var d = c.index, e = hg(a, d);if (-1 === e) throw Error(c.input + " selector missing ')'");c = a.slice(d, e + 1);a = a.replace(c, "\uE000");b.push(c); }return { na: a, matches: b }; }function Eg(a, b) { var c = a.split("\uE000");return b.reduce(function (d, e, f) { return d + e + c[f + 1]; }, c[0]); } pg.prototype.b = function (a, b, c) { var d = !1;a = a.trim();var e = Bg.test(a);e && (a = a.replace(Bg, function (h, k, l) { return ":" + k + "(" + l.replace(/\s/g, "") + ")"; }), a = Ag(a));var f = Dg.test(a);if (f) { var g = Cg(a);a = g.na;g = g.matches; }a = a.replace(Fg, ":host $1");a = a.replace(Gg, function (h, k, l) { d || (h = Hg(l, k, b, c), d = d || h.stop, k = h.Ha, l = h.value);return k + l; });f && (a = Eg(a, g));e && (a = Ag(a));return a = a.replace(Ig, function (h, k, l, m) { return '[dir="' + l + '"] ' + k + m + ", " + k + '[dir="' + l + '"]' + m; }); }; function Hg(a, b, c, d) { var e = a.indexOf("::slotted");0 <= a.indexOf(":host") ? a = Jg(a, d) : 0 !== e && (a = c ? Kg(a, c) : a);c = !1;0 <= e && (b = "", c = !0);if (c) { var f = !0;c && (a = a.replace(Lg, function (g, h) { return " > " + h; })); }return { value: a, Ha: b, stop: f }; }function Kg(a, b) { a = a.split(/(\[.+?\])/);for (var c = [], d = 0; d < a.length; d++) { if (1 === d % 2) c.push(a[d]);else { var e = a[d];if ("" !== e || d !== a.length - 1) e = e.split(":"), e[0] += b, c.push(e.join(":")); } }return c.join(""); } function Jg(a, b) { var c = a.match(Mg);return (c = c && c[2].trim() || "") ? c[0].match(Ng) ? a.replace(Mg, function (d, e, f) { return b + f; }) : c.split(Ng)[0] === b ? c : "should_not_match" : a.replace(":host", b); }function Og(a) { ":root" === a.selector && (a.selector = "html"); }pg.prototype.c = function (a) { return a.match(":host") ? "" : a.match("::slotted") ? this.b(a, ":not(.style-scope)") : Kg(a.trim(), ":not(.style-scope)"); };ea.Object.defineProperties(pg.prototype, { a: { configurable: !0, enumerable: !0, get: function get() { return "style-scope"; } } }); var Bg = /:(nth[-\w]+)\(([^)]+)\)/, Gg = /(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=[])+)/g, Ng = /[[.:#*]/, Fg = /^(::slotted)/, Mg = /(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/, Lg = /(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/, Ig = /(.*):dir\((?:(ltr|rtl))\)(.*)/, Dg = /:(?:matches|any|-(?:webkit|moz)-any)/, sg = new pg();function Pg(a, b, c, d, e) { this.I = a || null;this.b = b || null;this.la = c || [];this.G = null;this.cssBuild = e || "";this.Y = d || "";this.a = this.H = this.L = null; }function Qg(a) { return a ? a.__styleInfo : null; }function Rg(a, b) { return a.__styleInfo = b; }Pg.prototype.c = function () { return this.I; };Pg.prototype._getStyleRules = Pg.prototype.c;function Sg(a) { var b = this.matches || this.matchesSelector || this.mozMatchesSelector || this.msMatchesSelector || this.oMatchesSelector || this.webkitMatchesSelector;return b && b.call(this, a); }var Tg = /:host\s*>\s*/, Ug = navigator.userAgent.match("Trident");function Vg() {}function Wg(a) { var b = {}, c = [], d = 0;ag(a, function (f) { Xg(f);f.index = d++;f = f.A.cssText;for (var g; g = Vf.exec(f);) { var h = g[1];":" !== g[2] && (b[h] = !0); } }, function (f) { c.push(f); });a.b = c;a = [];for (var e in b) { a.push(e); }return a; } function Xg(a) { if (!a.A) { var b = {}, c = {};Yg(a, c) && (b.K = c, a.rules = null);b.cssText = a.parsedCssText.replace(Yf, "").replace(Sf, "");a.A = b; } }function Yg(a, b) { var c = a.A;if (c) { if (c.K) return Object.assign(b, c.K), !0; } else { c = a.parsedCssText;for (var d; a = Sf.exec(c);) { d = (a[2] || a[3]).trim();if ("inherit" !== d || "unset" !== d) b[a[1].trim()] = d;d = !0; }return d; } } function Zg(a, b, c) { b && (b = 0 <= b.indexOf(";") ? $g(a, b, c) : ig(b, function (d, e, f, g) { if (!e) return d + g;(e = Zg(a, c[e], c)) && "initial" !== e ? "apply-shim-inherit" === e && (e = "inherit") : e = Zg(a, c[f] || f, c) || f;return d + (e || "") + g; }));return b && b.trim() || ""; } function $g(a, b, c) { b = b.split(";");for (var d = 0, e, f; d < b.length; d++) { if (e = b[d]) { Tf.lastIndex = 0;if (f = Tf.exec(e)) e = Zg(a, c[f[1]], c);else if (f = e.indexOf(":"), -1 !== f) { var g = e.substring(f);g = g.trim();g = Zg(a, g, c) || g;e = e.substring(0, f) + g; }b[d] = e && e.lastIndexOf(";") === e.length - 1 ? e.slice(0, -1) : e || ""; } }return b.join(";"); } function ah(a, b) { var c = {}, d = [];ag(a, function (e) { e.A || Xg(e);var f = e.B || e.parsedSelector;b && e.A.K && f && Sg.call(b, f) && (Yg(e, c), e = e.index, f = parseInt(e / 32, 10), d[f] = (d[f] || 0) | 1 << e % 32); }, null, !0);return { K: c, key: d }; } function bh(a, b, c, d) { b.A || Xg(b);if (b.A.K) { var e = lg(a);a = e.is;e = e.Y;e = a ? yg(a, e) : "html";var f = b.parsedSelector;var g = !!f.match(Tg) || "html" === e && -1 < f.indexOf("html");var h = 0 === f.indexOf(":host") && !g;"shady" === c && (g = f === e + " > *." + e || -1 !== f.indexOf("html"), h = !g && 0 === f.indexOf(e));if (g || h) c = e, h && (b.B || (b.B = zg(sg, b, sg.b, a ? "." + a : "", e)), c = b.B || e), g && "html" === e && (c = b.B || b.u), d({ na: c, Oa: h, bb: g }); } } function ch(a, b, c) { var d = {}, e = {};ag(b, function (f) { bh(a, f, c, function (g) { Sg.call(a._element || a, g.na) && (g.Oa ? Yg(f, d) : Yg(f, e)); }); }, null, !0);return { Ua: e, Ma: d }; } function dh(a, b, c, d) { var e = lg(b), f = yg(e.is, e.Y), g = new RegExp("(?:^|[^.#[:])" + (b.extends ? "\\" + f.slice(0, -1) + "\\]" : f) + "($|[.:[\\s>+~])"), h = Qg(b);e = h.I;h = h.cssBuild;var k = eh(e, d);return wg(b, e, function (l) { var m = "";l.A || Xg(l);l.A.cssText && (m = $g(a, l.A.cssText, c));l.cssText = m;if (!V && !cg(l) && l.cssText) { var q = m = l.cssText;null == l.ra && (l.ra = Wf.test(m));if (l.ra) if (null == l.da) { l.da = [];for (var H in k) { q = k[H], q = q(m), m !== q && (m = q, l.da.push(H)); } } else { for (H = 0; H < l.da.length; ++H) { q = k[l.da[H]], m = q(m); }q = m; }l.cssText = q;l.B = l.B || l.selector;m = "." + d;H = mg(l.B);q = 0;for (var E = H.length, r = void 0; q < E && (r = H[q]); q++) { H[q] = r.match(g) ? r.replace(f, m) : m + " " + r; }l.selector = H.join(","); } }, h); }function eh(a, b) { a = a.b;var c = {};if (!V && a) for (var d = 0, e = a[d]; d < a.length; e = a[++d]) { var f = e, g = b;f.f = new RegExp("\\b" + f.keyframesName + "(?!\\B|-)", "g");f.a = f.keyframesName + "-" + g;f.B = f.B || f.selector;f.selector = f.B.replace(f.keyframesName, f.a);c[e.keyframesName] = fh(e); }return c; }function fh(a) { return function (b) { return b.replace(a.f, a.a); }; } function gh(a, b) { var c = hh, d = bg(a);a.textContent = $f(d, function (e) { var f = e.cssText = e.parsedCssText;e.A && e.A.cssText && (f = f.replace(Kf, "").replace(Lf, ""), e.cssText = $g(c, f, b)); }); }ea.Object.defineProperties(Vg.prototype, { a: { configurable: !0, enumerable: !0, get: function get() { return "x-scope"; } } });var hh = new Vg();var ih = {}, jh = window.customElements;if (jh && !V && !Rf) { var kh = jh.define;jh.define = function (a, b, c) { ih[a] || (ih[a] = gg(a));kh.call(jh, a, b, c); }; };function lh() { this.cache = {}; }lh.prototype.store = function (a, b, c, d) { var e = this.cache[a] || [];e.push({ K: b, styleElement: c, H: d });100 < e.length && e.shift();this.cache[a] = e; };function mh() {}var nh = new RegExp(sg.a + "\\s*([^\\s]*)");function oh(a) { return (a = (a.classList && a.classList.value ? a.classList.value : a.getAttribute("class") || "").match(nh)) ? a[1] : ""; }function ph(a) { var b = kg(a).getRootNode();return b === a || b === a.ownerDocument ? "" : (a = b.host) ? lg(a).is : ""; } function qh(a) { for (var b = 0; b < a.length; b++) { var c = a[b];if (c.target !== document.documentElement && c.target !== document.head) for (var d = 0; d < c.addedNodes.length; d++) { var e = c.addedNodes[d];if (e.nodeType === Node.ELEMENT_NODE) { var f = e.getRootNode(), g = oh(e);if (g && f === e.ownerDocument && ("style" !== e.localName && "template" !== e.localName || "" === ng(e))) vg(e, g);else if (f instanceof ShadowRoot) for (f = ph(e), f !== g && ug(e, g, f), e = window.ShadyDOM.nativeMethods.querySelectorAll.call(e, ":not(." + sg.a + ")"), g = 0; g < e.length; g++) { f = e[g]; var h = ph(f);h && tg(f, h); } } } } } if (!(V || window.ShadyDOM && window.ShadyDOM.handlesDynamicScoping)) { var rh = new MutationObserver(qh), sh = function sh(a) { rh.observe(a, { childList: !0, subtree: !0 }); };if (window.customElements && !window.customElements.polyfillWrapFlushCallback) sh(document);else { var th = function th() { sh(document.body); };window.HTMLImports ? window.HTMLImports.whenReady(th) : requestAnimationFrame(function () { if ("loading" === document.readyState) { var a = function a() { th();document.removeEventListener("readystatechange", a); };document.addEventListener("readystatechange", a); } else th(); }); }mh = function mh() { qh(rh.takeRecords()); }; };var uh = {};var vh = Promise.resolve();function wh(a) { if (a = uh[a]) a._applyShimCurrentVersion = a._applyShimCurrentVersion || 0, a._applyShimValidatingVersion = a._applyShimValidatingVersion || 0, a._applyShimNextVersion = (a._applyShimNextVersion || 0) + 1; }function xh(a) { return a._applyShimCurrentVersion === a._applyShimNextVersion; }function yh(a) { a._applyShimValidatingVersion = a._applyShimNextVersion;a._validating || (a._validating = !0, vh.then(function () { a._applyShimCurrentVersion = a._applyShimNextVersion;a._validating = !1; })); };var zh = {}, Ah = new lh();function Y() { this.D = {};this.c = document.documentElement;var a = new xf();a.rules = [];this.f = Rg(this.c, new Pg(a));this.u = !1;this.a = this.b = null; }w = Y.prototype;w.flush = function () { mh(); };w.Ka = function (a) { return bg(a); };w.Ya = function (a) { return $f(a); };w.prepareTemplate = function (a, b, c) { this.prepareTemplateDom(a, b);this.prepareTemplateStyles(a, b, c); }; w.prepareTemplateStyles = function (a, b, c) { if (!a._prepared && !Rf) { V || ih[b] || (ih[b] = gg(b));a._prepared = !0;a.name = b;a.extends = c;uh[b] = a;var d = ng(a), e = og(d);c = { is: b, extends: c };for (var f = [], g = a.content.querySelectorAll("style"), h = 0; h < g.length; h++) { var k = g[h];if (k.hasAttribute("shady-unscoped")) { if (!V) { var l = k.textContent;Zf.has(l) || (Zf.add(l), l = k.cloneNode(!0), document.head.appendChild(l));k.parentNode.removeChild(k); } } else f.push(k.textContent), k.parentNode.removeChild(k); }f = f.join("").trim() + (zh[b] || ""); Bh(this);if (!e) { if (g = !d) g = Tf.test(f) || Sf.test(f), Tf.lastIndex = 0, Sf.lastIndex = 0;h = yf(f);g && W && this.b && this.b.transformRules(h, b);a._styleAst = h; }g = [];W || (g = Wg(a._styleAst));if (!g.length || W) h = V ? a.content : null, b = ih[b] || null, d = wg(c, a._styleAst, null, d, e ? f : ""), d = d.length ? dg(d, c.is, h, b) : null, a._style = d;a.a = g; } };w.Sa = function (a, b) { zh[b] = a.join(" "); };w.prepareTemplateDom = function (a, b) { if (!Rf) { var c = ng(a);V || "shady" === c || a._domPrepared || (a._domPrepared = !0, qg(a.content, b)); } }; function Ch(a) { var b = lg(a), c = b.is;b = b.Y;var d = ih[c] || null, e = uh[c];if (e) { c = e._styleAst;var f = e.a;e = ng(e);b = new Pg(c, d, f, b, e);Rg(a, b);return b; } }function Dh(a) { !a.a && window.ShadyCSS && window.ShadyCSS.CustomStyleInterface && (a.a = window.ShadyCSS.CustomStyleInterface, a.a.transformCallback = function (b) { a.xa(b); }, a.a.validateCallback = function () { requestAnimationFrame(function () { (a.a.enqueued || a.u) && a.flushCustomStyles(); }); }); } function Bh(a) { !a.b && window.ShadyCSS && window.ShadyCSS.ApplyShim && (a.b = window.ShadyCSS.ApplyShim, a.b.invalidCallback = wh);Dh(a); } w.flushCustomStyles = function () { if (!Rf && (Bh(this), this.a)) { var a = this.a.processStyles();if (this.a.enqueued && !og(this.f.cssBuild)) { if (W) { if (!this.f.cssBuild) for (var b = 0; b < a.length; b++) { var c = this.a.getStyleForCustomStyle(a[b]);if (c && W && this.b) { var d = bg(c);Bh(this);this.b.transformRules(d);c.textContent = $f(d); } } } else { Eh(this, a);Fh(this, this.c, this.f);for (b = 0; b < a.length; b++) { (c = this.a.getStyleForCustomStyle(a[b])) && gh(c, this.f.L); }this.u && this.styleDocument(); }this.a.enqueued = !1; } } }; function Eh(a, b) { b = b.map(function (c) { return a.a.getStyleForCustomStyle(c); }).filter(function (c) { return !!c; });b.sort(function (c, d) { c = d.compareDocumentPosition(c);return c & Node.DOCUMENT_POSITION_FOLLOWING ? 1 : c & Node.DOCUMENT_POSITION_PRECEDING ? -1 : 0; });a.f.I.rules = b.map(function (c) { return bg(c); }); } w.styleElement = function (a, b) { if (Rf) { if (b) { Qg(a) || Rg(a, new Pg(null));var c = Qg(a);c.G = c.G || {};Object.assign(c.G, b);Gh(this, a, c); } } else if (c = Qg(a) || Ch(a)) if (a !== this.c && (this.u = !0), b && (c.G = c.G || {}, Object.assign(c.G, b)), W) Gh(this, a, c);else if (this.flush(), Fh(this, a, c), c.la && c.la.length) { b = lg(a).is;var d;a: { if (d = Ah.cache[b]) for (var e = d.length - 1; 0 <= e; e--) { var f = d[e];b: { var g = c.la;for (var h = 0; h < g.length; h++) { var k = g[h];if (f.K[k] !== c.L[k]) { g = !1;break b; } }g = !0; }if (g) { d = f;break a; } }d = void 0; }g = d ? d.styleElement : null;e = c.H;(f = d && d.H) || (f = this.D[b] = (this.D[b] || 0) + 1, f = b + "-" + f);c.H = f;f = c.H;h = hh;h = g ? g.textContent || "" : dh(h, a, c.L, f);k = Qg(a);var l = k.a;l && !V && l !== g && (l._useCount--, 0 >= l._useCount && l.parentNode && l.parentNode.removeChild(l));V ? k.a ? (k.a.textContent = h, g = k.a) : h && (g = dg(h, f, a.shadowRoot, k.b)) : g ? g.parentNode || (Ug && -1 < h.indexOf("@media") && (g.textContent = h), eg(g, null, k.b)) : h && (g = dg(h, f, null, k.b));g && (g._useCount = g._useCount || 0, k.a != g && g._useCount++, k.a = g);f = g;V || (g = c.H, k = h = a.getAttribute("class") || "", e && (k = h.replace(new RegExp("\\s*x-scope\\s*" + e + "\\s*", "g"), " ")), k += (k ? " " : "") + "x-scope " + g, h !== k && jg(a, k));d || Ah.store(b, c.L, f, c.H); } }; function Gh(a, b, c) { var d = lg(b).is;if (c.G) { var e = c.G, f;for (f in e) { null === f ? b.style.removeProperty(f) : b.style.setProperty(f, e[f]); } }e = uh[d];if (!(!e && b !== a.c || e && "" !== ng(e)) && e && e._style && !xh(e)) { if (xh(e) || e._applyShimValidatingVersion !== e._applyShimNextVersion) Bh(a), a.b && a.b.transformRules(e._styleAst, d), e._style.textContent = wg(b, c.I), yh(e);V && (a = b.shadowRoot) && (a = a.querySelector("style")) && (a.textContent = wg(b, c.I));c.I = e._styleAst; } } function Hh(a, b) { return (b = kg(b).getRootNode().host) ? Qg(b) || Ch(b) ? b : Hh(a, b) : a.c; }function Fh(a, b, c) { var d = Hh(a, b), e = Qg(d), f = e.L;d === a.c || f || (Fh(a, d, e), f = e.L);a = Object.create(f || null);d = ch(b, c.I, c.cssBuild);b = ah(e.I, b).K;Object.assign(a, d.Ma, b, d.Ua);b = c.G;for (var g in b) { if ((e = b[g]) || 0 === e) a[g] = e; }g = hh;b = Object.getOwnPropertyNames(a);for (e = 0; e < b.length; e++) { d = b[e], a[d] = Zg(g, a[d], a); }c.L = a; }w.styleDocument = function (a) { this.styleSubtree(this.c, a); }; w.styleSubtree = function (a, b) { var c = kg(a), d = c.shadowRoot, e = a === this.c;(d || e) && this.styleElement(a, b);if (a = e ? c : d) for (a = Array.from(a.querySelectorAll("*")).filter(function (f) { return kg(f).shadowRoot; }), b = 0; b < a.length; b++) { this.styleSubtree(a[b]); } }; w.xa = function (a) { var b = this, c = ng(a);c !== this.f.cssBuild && (this.f.cssBuild = c);if (!og(c)) { var d = bg(a);ag(d, function (e) { if (V) Og(e);else { var f = sg;e.selector = e.parsedSelector;Og(e);e.selector = e.B = zg(f, e, f.c, void 0, void 0); }W && "" === c && (Bh(b), b.b && b.b.transformRule(e)); });W ? a.textContent = $f(d) : this.f.I.rules.push(d); } };w.getComputedStyleValue = function (a, b) { var c;W || (c = (Qg(a) || Qg(Hh(this, a))).L[b]);return (c = c || window.getComputedStyle(a).getPropertyValue(b)) ? c.trim() : ""; }; w.Xa = function (a, b) { var c = kg(a).getRootNode(), d;b ? d = ("string" === typeof b ? b : String(b)).split(/\s/) : d = [];b = c.host && c.host.localName;if (!b && (c = a.getAttribute("class"))) { c = c.split(/\s/);for (var e = 0; e < c.length; e++) { if (c[e] === sg.a) { b = c[e + 1];break; } } }b && d.push(sg.a, b);W || (b = Qg(a)) && b.H && d.push(hh.a, b.H);jg(a, d.join(" ")); };w.Fa = function (a) { return Qg(a); };w.Wa = function (a, b) { tg(a, b); };w.Za = function (a, b) { tg(a, b, !0); };w.Va = function (a) { return ph(a); };w.Ia = function (a) { return oh(a); };Y.prototype.flush = Y.prototype.flush; Y.prototype.prepareTemplate = Y.prototype.prepareTemplate;Y.prototype.styleElement = Y.prototype.styleElement;Y.prototype.styleDocument = Y.prototype.styleDocument;Y.prototype.styleSubtree = Y.prototype.styleSubtree;Y.prototype.getComputedStyleValue = Y.prototype.getComputedStyleValue;Y.prototype.setElementClass = Y.prototype.Xa;Y.prototype._styleInfoForNode = Y.prototype.Fa;Y.prototype.transformCustomStyleForDocument = Y.prototype.xa;Y.prototype.getStyleAst = Y.prototype.Ka;Y.prototype.styleAstToString = Y.prototype.Ya; Y.prototype.flushCustomStyles = Y.prototype.flushCustomStyles;Y.prototype.scopeNode = Y.prototype.Wa;Y.prototype.unscopeNode = Y.prototype.Za;Y.prototype.scopeForNode = Y.prototype.Va;Y.prototype.currentScopeForNode = Y.prototype.Ia;Y.prototype.prepareAdoptedCssText = Y.prototype.Sa;Object.defineProperties(Y.prototype, { nativeShadow: { get: function get() { return V; } }, nativeCss: { get: function get() { return W; } } });var Z = new Y(), Ih, Jh;window.ShadyCSS && (Ih = window.ShadyCSS.ApplyShim, Jh = window.ShadyCSS.CustomStyleInterface); window.ShadyCSS = { ScopingShim: Z, prepareTemplate: function prepareTemplate(a, b, c) { Z.flushCustomStyles();Z.prepareTemplate(a, b, c); }, prepareTemplateDom: function prepareTemplateDom(a, b) { Z.prepareTemplateDom(a, b); }, prepareTemplateStyles: function prepareTemplateStyles(a, b, c) { Z.flushCustomStyles();Z.prepareTemplateStyles(a, b, c); }, styleSubtree: function styleSubtree(a, b) { Z.flushCustomStyles();Z.styleSubtree(a, b); }, styleElement: function styleElement(a) { Z.flushCustomStyles();Z.styleElement(a); }, styleDocument: function styleDocument(a) { Z.flushCustomStyles();Z.styleDocument(a); }, flushCustomStyles: function flushCustomStyles() { Z.flushCustomStyles(); }, getComputedStyleValue: function getComputedStyleValue(a, b) { return Z.getComputedStyleValue(a, b); }, nativeCss: W, nativeShadow: V, cssBuild: Qf, disableRuntime: Rf };Ih && (window.ShadyCSS.ApplyShim = Ih);Jh && (window.ShadyCSS.CustomStyleInterface = Jh);(function (a) { function b(r) { "" == r && (f.call(this), this.i = !0);return r.toLowerCase(); }function c(r) { var F = r.charCodeAt(0);return 32 < F && 127 > F && -1 == [34, 35, 60, 62, 63, 96].indexOf(F) ? r : encodeURIComponent(r); }function d(r) { var F = r.charCodeAt(0);return 32 < F && 127 > F && -1 == [34, 35, 60, 62, 96].indexOf(F) ? r : encodeURIComponent(r); }function e(r, F, C) { function N(ka) { qa.push(ka); }var x = F || "scheme start", X = 0, v = "", pa = !1, fa = !1, qa = [];a: for (; (void 0 != r[X - 1] || 0 == X) && !this.i;) { var n = r[X];switch (x) {case "scheme start": if (n && q.test(n)) v += n.toLowerCase(), x = "scheme";else if (F) { N("Invalid scheme.");break a; } else { v = "";x = "no scheme";continue; }break;case "scheme": if (n && H.test(n)) v += n.toLowerCase();else if (":" == n) { this.h = v;v = "";if (F) break a;void 0 !== l[this.h] && (this.C = !0);x = "file" == this.h ? "relative" : this.C && C && C.h == this.h ? "relative or authority" : this.C ? "authority first slash" : "scheme data"; } else if (F) { void 0 != n && N("Code point not allowed in scheme: " + n);break a; } else { v = "";X = 0;x = "no scheme";continue; }break;case "scheme data": "?" == n ? (this.o = "?", x = "query") : "#" == n ? (this.v = "#", x = "fragment") : void 0 != n && "\t" != n && "\n" != n && "\r" != n && (this.ha += c(n));break;case "no scheme": if (C && void 0 !== l[C.h]) { x = "relative";continue; } else N("Missing scheme."), f.call(this), this.i = !0;break;case "relative or authority": if ("/" == n && "/" == r[X + 1]) x = "authority ignore slashes";else { N("Expected /, got: " + n);x = "relative";continue; }break;case "relative": this.C = !0;"file" != this.h && (this.h = C.h);if (void 0 == n) { this.j = C.j;this.m = C.m;this.l = C.l.slice();this.o = C.o;this.s = C.s;this.g = C.g; break a; } else if ("/" == n || "\\" == n) "\\" == n && N("\\ is an invalid code point."), x = "relative slash";else if ("?" == n) this.j = C.j, this.m = C.m, this.l = C.l.slice(), this.o = "?", this.s = C.s, this.g = C.g, x = "query";else if ("#" == n) this.j = C.j, this.m = C.m, this.l = C.l.slice(), this.o = C.o, this.v = "#", this.s = C.s, this.g = C.g, x = "fragment";else { x = r[X + 1];var I = r[X + 2];if ("file" != this.h || !q.test(n) || ":" != x && "|" != x || void 0 != I && "/" != I && "\\" != I && "?" != I && "#" != I) this.j = C.j, this.m = C.m, this.s = C.s, this.g = C.g, this.l = C.l.slice(), this.l.pop();x = "relative path";continue; }break;case "relative slash": if ("/" == n || "\\" == n) "\\" == n && N("\\ is an invalid code point."), x = "file" == this.h ? "file host" : "authority ignore slashes";else { "file" != this.h && (this.j = C.j, this.m = C.m, this.s = C.s, this.g = C.g);x = "relative path";continue; }break;case "authority first slash": if ("/" == n) x = "authority second slash";else { N("Expected '/', got: " + n);x = "authority ignore slashes";continue; }break;case "authority second slash": x = "authority ignore slashes";if ("/" != n) { N("Expected '/', got: " + n);continue; }break;case "authority ignore slashes": if ("/" != n && "\\" != n) { x = "authority";continue; } else N("Expected authority, got: " + n);break;case "authority": if ("@" == n) { pa && (N("@ already seen."), v += "%40");pa = !0;for (n = 0; n < v.length; n++) { I = v[n], "\t" == I || "\n" == I || "\r" == I ? N("Invalid whitespace in authority.") : ":" == I && null === this.g ? this.g = "" : (I = c(I), null !== this.g ? this.g += I : this.s += I); }v = ""; } else if (void 0 == n || "/" == n || "\\" == n || "?" == n || "#" == n) { X -= v.length;v = "";x = "host";continue; } else v += n;break;case "file host": if (void 0 == n || "/" == n || "\\" == n || "?" == n || "#" == n) { 2 != v.length || !q.test(v[0]) || ":" != v[1] && "|" != v[1] ? (0 != v.length && (this.j = b.call(this, v), v = ""), x = "relative path start") : x = "relative path";continue; } else "\t" == n || "\n" == n || "\r" == n ? N("Invalid whitespace in file host.") : v += n;break;case "host":case "hostname": if (":" != n || fa) { if (void 0 == n || "/" == n || "\\" == n || "?" == n || "#" == n) { this.j = b.call(this, v);v = "";x = "relative path start";if (F) break a;continue; } else "\t" != n && "\n" != n && "\r" != n ? ("[" == n ? fa = !0 : "]" == n && (fa = !1), v += n) : N("Invalid code point in host/hostname: " + n); } else if (this.j = b.call(this, v), v = "", x = "port", "hostname" == F) break a;break;case "port": if (/[0-9]/.test(n)) v += n;else if (void 0 == n || "/" == n || "\\" == n || "?" == n || "#" == n || F) { "" != v && (v = parseInt(v, 10), v != l[this.h] && (this.m = v + ""), v = "");if (F) break a;x = "relative path start";continue; } else "\t" == n || "\n" == n || "\r" == n ? N("Invalid code point in port: " + n) : (f.call(this), this.i = !0);break;case "relative path start": "\\" == n && N("'\\' not allowed in path.");x = "relative path";if ("/" != n && "\\" != n) continue;break;case "relative path": if (void 0 != n && "/" != n && "\\" != n && (F || "?" != n && "#" != n)) "\t" != n && "\n" != n && "\r" != n && (v += c(n));else { "\\" == n && N("\\ not allowed in relative path.");if (I = m[v.toLowerCase()]) v = I;".." == v ? (this.l.pop(), "/" != n && "\\" != n && this.l.push("")) : "." == v && "/" != n && "\\" != n ? this.l.push("") : "." != v && ("file" == this.h && 0 == this.l.length && 2 == v.length && q.test(v[0]) && "|" == v[1] && (v = v[0] + ":"), this.l.push(v));v = "";"?" == n ? (this.o = "?", x = "query") : "#" == n && (this.v = "#", x = "fragment"); }break;case "query": F || "#" != n ? void 0 != n && "\t" != n && "\n" != n && "\r" != n && (this.o += d(n)) : (this.v = "#", x = "fragment");break;case "fragment": void 0 != n && "\t" != n && "\n" != n && "\r" != n && (this.v += n);}X++; } }function f() { this.s = this.ha = this.h = "";this.g = null;this.m = this.j = "";this.l = [];this.v = this.o = "";this.C = this.i = !1; }function g(r, F) { void 0 === F || F instanceof g || (F = new g(String(F)));this.a = r;f.call(this);e.call(this, this.a.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g, ""), null, F); }var h = !1;try { var k = new URL("b", "http://a");k.pathname = "c%20d";h = "http://a/c%20d" === k.href; } catch (r) {}if (!h) { var l = Object.create(null); l.ftp = 21;l.file = 0;l.gopher = 70;l.http = 80;l.https = 443;l.ws = 80;l.wss = 443;var m = Object.create(null);m["%2e"] = ".";m[".%2e"] = "..";m["%2e."] = "..";m["%2e%2e"] = "..";var q = /[a-zA-Z]/, H = /[a-zA-Z0-9\+\-\.]/;g.prototype = { toString: function toString() { return this.href; }, get href() { if (this.i) return this.a;var r = "";if ("" != this.s || null != this.g) r = this.s + (null != this.g ? ":" + this.g : "") + "@";return this.protocol + (this.C ? "//" + r + this.host : "") + this.pathname + this.o + this.v; }, set href(r) { f.call(this);e.call(this, r); }, get protocol() { return this.h + ":"; }, set protocol(r) { this.i || e.call(this, r + ":", "scheme start"); }, get host() { return this.i ? "" : this.m ? this.j + ":" + this.m : this.j; }, set host(r) { !this.i && this.C && e.call(this, r, "host"); }, get hostname() { return this.j; }, set hostname(r) { !this.i && this.C && e.call(this, r, "hostname"); }, get port() { return this.m; }, set port(r) { !this.i && this.C && e.call(this, r, "port"); }, get pathname() { return this.i ? "" : this.C ? "/" + this.l.join("/") : this.ha; }, set pathname(r) { !this.i && this.C && (this.l = [], e.call(this, r, "relative path start")); }, get search() { return this.i || !this.o || "?" == this.o ? "" : this.o; }, set search(r) { !this.i && this.C && (this.o = "?", "?" == r[0] && (r = r.slice(1)), e.call(this, r, "query")); }, get hash() { return this.i || !this.v || "#" == this.v ? "" : this.v; }, set hash(r) { this.i || (r ? (this.v = "#", "#" == r[0] && (r = r.slice(1)), e.call(this, r, "fragment")) : this.v = ""); }, get origin() { var r;if (this.i || !this.h) return "";switch (this.h) {case "data":case "file":case "javascript":case "mailto": return "null";}return (r = this.host) ? this.h + "://" + r : ""; } };var E = a.URL;E && (g.createObjectURL = function (r) { return E.createObjectURL.apply(E, arguments); }, g.revokeObjectURL = function (r) { E.revokeObjectURL(r); });a.URL = g; } })(window);Object.getOwnPropertyDescriptor(Node.prototype, "baseURI") || Object.defineProperty(Node.prototype, "baseURI", { get: function get() { var a = (this.ownerDocument || this).querySelector("base[href]");return a && a.href || window.location.href; }, configurable: !0, enumerable: !0 });var Kh = document.createElement("style");Kh.textContent = "body {transition: opacity ease-in 0.2s; } \nbody[unresolved] {opacity: 0; display: block; overflow: hidden; position: relative; } \n";var Lh = document.querySelector("head");Lh.insertBefore(Kh, Lh.firstChild);var Mh = window.customElements, Nh = !1, Oh = null;Mh.polyfillWrapFlushCallback && Mh.polyfillWrapFlushCallback(function (a) { Oh = a;Nh && a(); });function Ph() { window.HTMLTemplateElement.bootstrap && window.HTMLTemplateElement.bootstrap(window.document);Oh && Oh();Nh = !0;window.WebComponents.ready = !0;document.dispatchEvent(new CustomEvent("WebComponentsReady", { bubbles: !0 })); } "complete" !== document.readyState ? (window.addEventListener("load", Ph), window.addEventListener("DOMContentLoaded", function () { window.removeEventListener("load", Ph);Ph(); })) : Ph(); }).call(this); //# sourceMappingURL=webcomponents-bundle.js.map /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(15), __webpack_require__(301).setImmediate)) /***/ }), /* 301 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {var scope = typeof global !== "undefined" && global || typeof self !== "undefined" && self || window; var apply = Function.prototype.apply; // DOM APIs, for completeness exports.setTimeout = function () { return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout); }; exports.setInterval = function () { return new Timeout(apply.call(setInterval, scope, arguments), clearInterval); }; exports.clearTimeout = exports.clearInterval = function (timeout) { if (timeout) { timeout.close(); } }; function Timeout(id, clearFn) { this._id = id; this._clearFn = clearFn; } Timeout.prototype.unref = Timeout.prototype.ref = function () {}; Timeout.prototype.close = function () { this._clearFn.call(scope, this._id); }; // Does not start the time, just sets up the members needed. exports.enroll = function (item, msecs) { clearTimeout(item._idleTimeoutId); item._idleTimeout = msecs; }; exports.unenroll = function (item) { clearTimeout(item._idleTimeoutId); item._idleTimeout = -1; }; exports._unrefActive = exports.active = function (item) { clearTimeout(item._idleTimeoutId); var msecs = item._idleTimeout; if (msecs >= 0) { item._idleTimeoutId = setTimeout(function onTimeout() { if (item._onTimeout) item._onTimeout(); }, msecs); } }; // setimmediate attaches itself to the global object __webpack_require__(302); // On some exotic environments, it's not clear which object `setimmediate` was // able to install onto. Search each possibility in the same order as the // `setimmediate` library. exports.setImmediate = typeof self !== "undefined" && self.setImmediate || typeof global !== "undefined" && global.setImmediate || this && this.setImmediate; exports.clearImmediate = typeof self !== "undefined" && self.clearImmediate || typeof global !== "undefined" && global.clearImmediate || this && this.clearImmediate; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(15))) /***/ }), /* 302 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) { "use strict"; if (global.setImmediate) { return; } var nextHandle = 1; // Spec says greater than zero var tasksByHandle = {}; var currentlyRunningATask = false; var doc = global.document; var registerImmediate; function setImmediate(callback) { // Callback can either be a function or a string if (typeof callback !== "function") { callback = new Function("" + callback); } // Copy function arguments var args = new Array(arguments.length - 1); for (var i = 0; i < args.length; i++) { args[i] = arguments[i + 1]; } // Store and register the task var task = { callback: callback, args: args }; tasksByHandle[nextHandle] = task; registerImmediate(nextHandle); return nextHandle++; } function clearImmediate(handle) { delete tasksByHandle[handle]; } function run(task) { var callback = task.callback; var args = task.args; switch (args.length) { case 0: callback(); break; case 1: callback(args[0]); break; case 2: callback(args[0], args[1]); break; case 3: callback(args[0], args[1], args[2]); break; default: callback.apply(undefined, args); break; } } function runIfPresent(handle) { // From the spec: "Wait until any invocations of this algorithm started before this one have completed." // So if we're currently running a task, we'll need to delay this invocation. if (currentlyRunningATask) { // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a // "too much recursion" error. setTimeout(runIfPresent, 0, handle); } else { var task = tasksByHandle[handle]; if (task) { currentlyRunningATask = true; try { run(task); } finally { clearImmediate(handle); currentlyRunningATask = false; } } } } function installNextTickImplementation() { registerImmediate = function registerImmediate(handle) { process.nextTick(function () { runIfPresent(handle); }); }; } function canUsePostMessage() { // The test against `importScripts` prevents this implementation from being installed inside a web worker, // where `global.postMessage` means something completely different and can't be used for this purpose. if (global.postMessage && !global.importScripts) { var postMessageIsAsynchronous = true; var oldOnMessage = global.onmessage; global.onmessage = function () { postMessageIsAsynchronous = false; }; global.postMessage("", "*"); global.onmessage = oldOnMessage; return postMessageIsAsynchronous; } } function installPostMessageImplementation() { // Installs an event handler on `global` for the `message` event: see // * https://developer.mozilla.org/en/DOM/window.postMessage // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages var messagePrefix = "setImmediate$" + Math.random() + "$"; var onGlobalMessage = function onGlobalMessage(event) { if (event.source === global && typeof event.data === "string" && event.data.indexOf(messagePrefix) === 0) { runIfPresent(+event.data.slice(messagePrefix.length)); } }; if (global.addEventListener) { global.addEventListener("message", onGlobalMessage, false); } else { global.attachEvent("onmessage", onGlobalMessage); } registerImmediate = function registerImmediate(handle) { global.postMessage(messagePrefix + handle, "*"); }; } function installMessageChannelImplementation() { var channel = new MessageChannel(); channel.port1.onmessage = function (event) { var handle = event.data; runIfPresent(handle); }; registerImmediate = function registerImmediate(handle) { channel.port2.postMessage(handle); }; } function installReadyStateChangeImplementation() { var html = doc.documentElement; registerImmediate = function registerImmediate(handle) { // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called. var script = doc.createElement("script"); script.onreadystatechange = function () { runIfPresent(handle); script.onreadystatechange = null; html.removeChild(script); script = null; }; html.appendChild(script); }; } function installSetTimeoutImplementation() { registerImmediate = function registerImmediate(handle) { setTimeout(runIfPresent, 0, handle); }; } // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live. var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global); attachTo = attachTo && attachTo.setTimeout ? attachTo : global; // Don't get fooled by e.g. browserify environments. if ({}.toString.call(global.process) === "[object process]") { // For Node.js before 0.9 installNextTickImplementation(); } else if (canUsePostMessage()) { // For non-IE10 modern browsers installPostMessageImplementation(); } else if (global.MessageChannel) { // For web workers, where supported installMessageChannelImplementation(); } else if (doc && "onreadystatechange" in doc.createElement("script")) { // For IE 6–8 installReadyStateChangeImplementation(); } else { // For older browsers installSetTimeoutImplementation(); } attachTo.setImmediate = setImmediate; attachTo.clearImmediate = clearImmediate; })(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self); /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(15), __webpack_require__(303))) /***/ }), /* 303 */ /***/ (function(module, exports) { // shim for using process in browser var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it // don't break things. But we need to wrap it in a try catch in case it is // wrapped in strict mode code which doesn't define any globals. It's inside a // function because try/catches deoptimize in certain engines. var cachedSetTimeout; var cachedClearTimeout; function defaultSetTimout() { throw new Error('setTimeout has not been defined'); } function defaultClearTimeout() { throw new Error('clearTimeout has not been defined'); } (function () { try { if (typeof setTimeout === 'function') { cachedSetTimeout = setTimeout; } else { cachedSetTimeout = defaultSetTimout; } } catch (e) { cachedSetTimeout = defaultSetTimout; } try { if (typeof clearTimeout === 'function') { cachedClearTimeout = clearTimeout; } else { cachedClearTimeout = defaultClearTimeout; } } catch (e) { cachedClearTimeout = defaultClearTimeout; } })(); function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { //normal enviroments in sane situations return setTimeout(fun, 0); } // if setTimeout wasn't available but was latter defined if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0); } catch (e) { try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedSetTimeout.call(null, fun, 0); } catch (e) { // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { //normal enviroments in sane situations return clearTimeout(marker); } // if clearTimeout wasn't available but was latter defined if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker); } catch (e) { try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedClearTimeout.call(null, marker); } catch (e) { // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. // Some versions of I.E. have different rules for clearTimeout vs setTimeout return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while (len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } process.nextTick = function (fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } }; // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.prependListener = noop; process.prependOnceListener = noop; process.listeners = function (name) { return []; }; process.binding = function (name) { throw new Error('process.binding is not supported'); }; process.cwd = function () { return '/'; }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; process.umask = function () { return 0; }; /***/ }), /* 304 */ /***/ (function(module, exports) { ;(function() { "use strict"; /** * @license * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * A component handler interface using the revealing module design pattern. * More details on this design pattern here: * https://github.com/jasonmayes/mdl-component-design-pattern * * @author Jason Mayes. */ /* exported componentHandler */ // Pre-defining the componentHandler interface, for closure documentation and // static verification. var componentHandler = { /** * Searches existing DOM for elements of our component type and upgrades them * if they have not already been upgraded. * * @param {string=} optJsClass the programatic name of the element class we * need to create a new instance of. * @param {string=} optCssClass the name of the CSS class elements of this * type will have. */ upgradeDom: function(optJsClass, optCssClass) {}, /** * Upgrades a specific element rather than all in the DOM. * * @param {!Element} element The element we wish to upgrade. * @param {string=} optJsClass Optional name of the class we want to upgrade * the element to. */ upgradeElement: function(element, optJsClass) {}, /** * Upgrades a specific list of elements rather than all in the DOM. * * @param {!Element|!Array<!Element>|!NodeList|!HTMLCollection} elements * The elements we wish to upgrade. */ upgradeElements: function(elements) {}, /** * Upgrades all registered components found in the current DOM. This is * automatically called on window load. */ upgradeAllRegistered: function() {}, /** * Allows user to be alerted to any upgrades that are performed for a given * component type * * @param {string} jsClass The class name of the MDL component we wish * to hook into for any upgrades performed. * @param {function(!HTMLElement)} callback The function to call upon an * upgrade. This function should expect 1 parameter - the HTMLElement which * got upgraded. */ registerUpgradedCallback: function(jsClass, callback) {}, /** * Registers a class for future use and attempts to upgrade existing DOM. * * @param {componentHandler.ComponentConfigPublic} config the registration configuration */ register: function(config) {}, /** * Downgrade either a given node, an array of nodes, or a NodeList. * * @param {!Node|!Array<!Node>|!NodeList} nodes */ downgradeElements: function(nodes) {} }; componentHandler = (function() { 'use strict'; /** @type {!Array<componentHandler.ComponentConfig>} */ var registeredComponents_ = []; /** @type {!Array<componentHandler.Component>} */ var createdComponents_ = []; var componentConfigProperty_ = 'mdlComponentConfigInternal_'; /** * Searches registered components for a class we are interested in using. * Optionally replaces a match with passed object if specified. * * @param {string} name The name of a class we want to use. * @param {componentHandler.ComponentConfig=} optReplace Optional object to replace match with. * @return {!Object|boolean} * @private */ function findRegisteredClass_(name, optReplace) { for (var i = 0; i < registeredComponents_.length; i++) { if (registeredComponents_[i].className === name) { if (typeof optReplace !== 'undefined') { registeredComponents_[i] = optReplace; } return registeredComponents_[i]; } } return false; } /** * Returns an array of the classNames of the upgraded classes on the element. * * @param {!Element} element The element to fetch data from. * @return {!Array<string>} * @private */ function getUpgradedListOfElement_(element) { var dataUpgraded = element.getAttribute('data-upgraded'); // Use `['']` as default value to conform the `,name,name...` style. return dataUpgraded === null ? [''] : dataUpgraded.split(','); } /** * Returns true if the given element has already been upgraded for the given * class. * * @param {!Element} element The element we want to check. * @param {string} jsClass The class to check for. * @returns {boolean} * @private */ function isElementUpgraded_(element, jsClass) { var upgradedList = getUpgradedListOfElement_(element); return upgradedList.indexOf(jsClass) !== -1; } /** * Create an event object. * * @param {string} eventType The type name of the event. * @param {boolean} bubbles Whether the event should bubble up the DOM. * @param {boolean} cancelable Whether the event can be canceled. * @returns {!Event} */ function createEvent_(eventType, bubbles, cancelable) { if ('CustomEvent' in window && typeof window.CustomEvent === 'function') { return new CustomEvent(eventType, { bubbles: bubbles, cancelable: cancelable }); } else { var ev = document.createEvent('Events'); ev.initEvent(eventType, bubbles, cancelable); return ev; } } /** * Searches existing DOM for elements of our component type and upgrades them * if they have not already been upgraded. * * @param {string=} optJsClass the programatic name of the element class we * need to create a new instance of. * @param {string=} optCssClass the name of the CSS class elements of this * type will have. */ function upgradeDomInternal(optJsClass, optCssClass) { if (typeof optJsClass === 'undefined' && typeof optCssClass === 'undefined') { for (var i = 0; i < registeredComponents_.length; i++) { upgradeDomInternal(registeredComponents_[i].className, registeredComponents_[i].cssClass); } } else { var jsClass = /** @type {string} */ (optJsClass); if (typeof optCssClass === 'undefined') { var registeredClass = findRegisteredClass_(jsClass); if (registeredClass) { optCssClass = registeredClass.cssClass; } } var elements = document.querySelectorAll('.' + optCssClass); for (var n = 0; n < elements.length; n++) { upgradeElementInternal(elements[n], jsClass); } } } /** * Upgrades a specific element rather than all in the DOM. * * @param {!Element} element The element we wish to upgrade. * @param {string=} optJsClass Optional name of the class we want to upgrade * the element to. */ function upgradeElementInternal(element, optJsClass) { // Verify argument type. if (!(typeof element === 'object' && element instanceof Element)) { throw new Error('Invalid argument provided to upgrade MDL element.'); } // Allow upgrade to be canceled by canceling emitted event. var upgradingEv = createEvent_('mdl-componentupgrading', true, true); element.dispatchEvent(upgradingEv); if (upgradingEv.defaultPrevented) { return; } var upgradedList = getUpgradedListOfElement_(element); var classesToUpgrade = []; // If jsClass is not provided scan the registered components to find the // ones matching the element's CSS classList. if (!optJsClass) { var classList = element.classList; registeredComponents_.forEach(function(component) { // Match CSS & Not to be upgraded & Not upgraded. if (classList.contains(component.cssClass) && classesToUpgrade.indexOf(component) === -1 && !isElementUpgraded_(element, component.className)) { classesToUpgrade.push(component); } }); } else if (!isElementUpgraded_(element, optJsClass)) { classesToUpgrade.push(findRegisteredClass_(optJsClass)); } // Upgrade the element for each classes. for (var i = 0, n = classesToUpgrade.length, registeredClass; i < n; i++) { registeredClass = classesToUpgrade[i]; if (registeredClass) { // Mark element as upgraded. upgradedList.push(registeredClass.className); element.setAttribute('data-upgraded', upgradedList.join(',')); var instance = new registeredClass.classConstructor(element); instance[componentConfigProperty_] = registeredClass; createdComponents_.push(instance); // Call any callbacks the user has registered with this component type. for (var j = 0, m = registeredClass.callbacks.length; j < m; j++) { registeredClass.callbacks[j](element); } if (registeredClass.widget) { // Assign per element instance for control over API element[registeredClass.className] = instance; } } else { throw new Error( 'Unable to find a registered component for the given class.'); } var upgradedEv = createEvent_('mdl-componentupgraded', true, false); element.dispatchEvent(upgradedEv); } } /** * Upgrades a specific list of elements rather than all in the DOM. * * @param {!Element|!Array<!Element>|!NodeList|!HTMLCollection} elements * The elements we wish to upgrade. */ function upgradeElementsInternal(elements) { if (!Array.isArray(elements)) { if (elements instanceof Element) { elements = [elements]; } else { elements = Array.prototype.slice.call(elements); } } for (var i = 0, n = elements.length, element; i < n; i++) { element = elements[i]; if (element instanceof HTMLElement) { upgradeElementInternal(element); if (element.children.length > 0) { upgradeElementsInternal(element.children); } } } } /** * Registers a class for future use and attempts to upgrade existing DOM. * * @param {componentHandler.ComponentConfigPublic} config */ function registerInternal(config) { // In order to support both Closure-compiled and uncompiled code accessing // this method, we need to allow for both the dot and array syntax for // property access. You'll therefore see the `foo.bar || foo['bar']` // pattern repeated across this method. var widgetMissing = (typeof config.widget === 'undefined' && typeof config['widget'] === 'undefined'); var widget = true; if (!widgetMissing) { widget = config.widget || config['widget']; } var newConfig = /** @type {componentHandler.ComponentConfig} */ ({ classConstructor: config.constructor || config['constructor'], className: config.classAsString || config['classAsString'], cssClass: config.cssClass || config['cssClass'], widget: widget, callbacks: [] }); registeredComponents_.forEach(function(item) { if (item.cssClass === newConfig.cssClass) { throw new Error('The provided cssClass has already been registered: ' + item.cssClass); } if (item.className === newConfig.className) { throw new Error('The provided className has already been registered'); } }); if (config.constructor.prototype .hasOwnProperty(componentConfigProperty_)) { throw new Error( 'MDL component classes must not have ' + componentConfigProperty_ + ' defined as a property.'); } var found = findRegisteredClass_(config.classAsString, newConfig); if (!found) { registeredComponents_.push(newConfig); } } /** * Allows user to be alerted to any upgrades that are performed for a given * component type * * @param {string} jsClass The class name of the MDL component we wish * to hook into for any upgrades performed. * @param {function(!HTMLElement)} callback The function to call upon an * upgrade. This function should expect 1 parameter - the HTMLElement which * got upgraded. */ function registerUpgradedCallbackInternal(jsClass, callback) { var regClass = findRegisteredClass_(jsClass); if (regClass) { regClass.callbacks.push(callback); } } /** * Upgrades all registered components found in the current DOM. This is * automatically called on window load. */ function upgradeAllRegisteredInternal() { for (var n = 0; n < registeredComponents_.length; n++) { upgradeDomInternal(registeredComponents_[n].className); } } /** * Check the component for the downgrade method. * Execute if found. * Remove component from createdComponents list. * * @param {?componentHandler.Component} component */ function deconstructComponentInternal(component) { if (component) { var componentIndex = createdComponents_.indexOf(component); createdComponents_.splice(componentIndex, 1); var upgrades = component.element_.getAttribute('data-upgraded').split(','); var componentPlace = upgrades.indexOf(component[componentConfigProperty_].classAsString); upgrades.splice(componentPlace, 1); component.element_.setAttribute('data-upgraded', upgrades.join(',')); var ev = createEvent_('mdl-componentdowngraded', true, false); component.element_.dispatchEvent(ev); } } /** * Downgrade either a given node, an array of nodes, or a NodeList. * * @param {!Node|!Array<!Node>|!NodeList} nodes */ function downgradeNodesInternal(nodes) { /** * Auxiliary function to downgrade a single node. * @param {!Node} node the node to be downgraded */ var downgradeNode = function(node) { createdComponents_.filter(function(item) { return item.element_ === node; }).forEach(deconstructComponentInternal); }; if (nodes instanceof Array || nodes instanceof NodeList) { for (var n = 0; n < nodes.length; n++) { downgradeNode(nodes[n]); } } else if (nodes instanceof Node) { downgradeNode(nodes); } else { throw new Error('Invalid argument provided to downgrade MDL nodes.'); } } // Now return the functions that should be made public with their publicly // facing names... return { upgradeDom: upgradeDomInternal, upgradeElement: upgradeElementInternal, upgradeElements: upgradeElementsInternal, upgradeAllRegistered: upgradeAllRegisteredInternal, registerUpgradedCallback: registerUpgradedCallbackInternal, register: registerInternal, downgradeElements: downgradeNodesInternal }; })(); /** * Describes the type of a registered component type managed by * componentHandler. Provided for benefit of the Closure compiler. * * @typedef {{ * constructor: Function, * classAsString: string, * cssClass: string, * widget: (string|boolean|undefined) * }} */ componentHandler.ComponentConfigPublic; // jshint ignore:line /** * Describes the type of a registered component type managed by * componentHandler. Provided for benefit of the Closure compiler. * * @typedef {{ * constructor: !Function, * className: string, * cssClass: string, * widget: (string|boolean), * callbacks: !Array<function(!HTMLElement)> * }} */ componentHandler.ComponentConfig; // jshint ignore:line /** * Created component (i.e., upgraded element) type as managed by * componentHandler. Provided for benefit of the Closure compiler. * * @typedef {{ * element_: !HTMLElement, * className: string, * classAsString: string, * cssClass: string, * widget: string * }} */ componentHandler.Component; // jshint ignore:line // Export all symbols, for the benefit of Closure compiler. // No effect on uncompiled code. componentHandler['upgradeDom'] = componentHandler.upgradeDom; componentHandler['upgradeElement'] = componentHandler.upgradeElement; componentHandler['upgradeElements'] = componentHandler.upgradeElements; componentHandler['upgradeAllRegistered'] = componentHandler.upgradeAllRegistered; componentHandler['registerUpgradedCallback'] = componentHandler.registerUpgradedCallback; componentHandler['register'] = componentHandler.register; componentHandler['downgradeElements'] = componentHandler.downgradeElements; window.componentHandler = componentHandler; window['componentHandler'] = componentHandler; window.addEventListener('load', function() { 'use strict'; /** * Performs a "Cutting the mustard" test. If the browser supports the features * tested, adds a mdl-js class to the <html> element. It then upgrades all MDL * components requiring JavaScript. */ if ('classList' in document.createElement('div') && 'querySelector' in document && 'addEventListener' in window && Array.prototype.forEach) { document.documentElement.classList.add('mdl-js'); componentHandler.upgradeAllRegistered(); } else { /** * Dummy function to avoid JS errors. */ componentHandler.upgradeElement = function() {}; /** * Dummy function to avoid JS errors. */ componentHandler.register = function() {}; } }); // Source: https://github.com/darius/requestAnimationFrame/blob/master/requestAnimationFrame.js // Adapted from https://gist.github.com/paulirish/1579671 which derived from // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating // requestAnimationFrame polyfill by Erik Möller. // Fixes from Paul Irish, Tino Zijdel, Andrew Mao, Klemen Slavič, Darius Bacon // MIT license if (!Date.now) { /** * Date.now polyfill. * @return {number} the current Date */ Date.now = function () { return new Date().getTime(); }; Date['now'] = Date.now; } var vendors = [ 'webkit', 'moz' ]; for (var i = 0; i < vendors.length && !window.requestAnimationFrame; ++i) { var vp = vendors[i]; window.requestAnimationFrame = window[vp + 'RequestAnimationFrame']; window.cancelAnimationFrame = window[vp + 'CancelAnimationFrame'] || window[vp + 'CancelRequestAnimationFrame']; window['requestAnimationFrame'] = window.requestAnimationFrame; window['cancelAnimationFrame'] = window.cancelAnimationFrame; } if (/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent) || !window.requestAnimationFrame || !window.cancelAnimationFrame) { var lastTime = 0; /** * requestAnimationFrame polyfill. * @param {!Function} callback the callback function. */ window.requestAnimationFrame = function (callback) { var now = Date.now(); var nextTime = Math.max(lastTime + 16, now); return setTimeout(function () { callback(lastTime = nextTime); }, nextTime - now); }; window.cancelAnimationFrame = clearTimeout; window['requestAnimationFrame'] = window.requestAnimationFrame; window['cancelAnimationFrame'] = window.cancelAnimationFrame; } /** * @license * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Class constructor for Button MDL component. * Implements MDL component design pattern defined at: * https://github.com/jasonmayes/mdl-component-design-pattern * * @param {HTMLElement} element The element that will be upgraded. */ var MaterialButton = function MaterialButton(element) { this.element_ = element; // Initialize instance. this.init(); }; window['MaterialButton'] = MaterialButton; /** * Store constants in one place so they can be updated easily. * * @enum {string | number} * @private */ MaterialButton.prototype.Constant_ = {}; /** * Store strings for class names defined by this component that are used in * JavaScript. This allows us to simply change it in one place should we * decide to modify at a later date. * * @enum {string} * @private */ MaterialButton.prototype.CssClasses_ = { RIPPLE_EFFECT: 'mdl-js-ripple-effect', RIPPLE_CONTAINER: 'mdl-button__ripple-container', RIPPLE: 'mdl-ripple' }; /** * Handle blur of element. * * @param {Event} event The event that fired. * @private */ MaterialButton.prototype.blurHandler_ = function (event) { if (event) { this.element_.blur(); } }; // Public methods. /** * Disable button. * * @public */ MaterialButton.prototype.disable = function () { this.element_.disabled = true; }; MaterialButton.prototype['disable'] = MaterialButton.prototype.disable; /** * Enable button. * * @public */ MaterialButton.prototype.enable = function () { this.element_.disabled = false; }; MaterialButton.prototype['enable'] = MaterialButton.prototype.enable; /** * Initialize element. */ MaterialButton.prototype.init = function () { if (this.element_) { if (this.element_.classList.contains(this.CssClasses_.RIPPLE_EFFECT)) { var rippleContainer = document.createElement('span'); rippleContainer.classList.add(this.CssClasses_.RIPPLE_CONTAINER); this.rippleElement_ = document.createElement('span'); this.rippleElement_.classList.add(this.CssClasses_.RIPPLE); rippleContainer.appendChild(this.rippleElement_); this.boundRippleBlurHandler = this.blurHandler_.bind(this); this.rippleElement_.addEventListener('mouseup', this.boundRippleBlurHandler); this.element_.appendChild(rippleContainer); } this.boundButtonBlurHandler = this.blurHandler_.bind(this); this.element_.addEventListener('mouseup', this.boundButtonBlurHandler); this.element_.addEventListener('mouseleave', this.boundButtonBlurHandler); } }; // The component registers itself. It can assume componentHandler is available // in the global scope. componentHandler.register({ constructor: MaterialButton, classAsString: 'MaterialButton', cssClass: 'mdl-js-button', widget: true }); /** * @license * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Class constructor for Checkbox MDL component. * Implements MDL component design pattern defined at: * https://github.com/jasonmayes/mdl-component-design-pattern * * @constructor * @param {HTMLElement} element The element that will be upgraded. */ var MaterialCheckbox = function MaterialCheckbox(element) { this.element_ = element; // Initialize instance. this.init(); }; window['MaterialCheckbox'] = MaterialCheckbox; /** * Store constants in one place so they can be updated easily. * * @enum {string | number} * @private */ MaterialCheckbox.prototype.Constant_ = { TINY_TIMEOUT: 0.001 }; /** * Store strings for class names defined by this component that are used in * JavaScript. This allows us to simply change it in one place should we * decide to modify at a later date. * * @enum {string} * @private */ MaterialCheckbox.prototype.CssClasses_ = { INPUT: 'mdl-checkbox__input', BOX_OUTLINE: 'mdl-checkbox__box-outline', FOCUS_HELPER: 'mdl-checkbox__focus-helper', TICK_OUTLINE: 'mdl-checkbox__tick-outline', RIPPLE_EFFECT: 'mdl-js-ripple-effect', RIPPLE_IGNORE_EVENTS: 'mdl-js-ripple-effect--ignore-events', RIPPLE_CONTAINER: 'mdl-checkbox__ripple-container', RIPPLE_CENTER: 'mdl-ripple--center', RIPPLE: 'mdl-ripple', IS_FOCUSED: 'is-focused', IS_DISABLED: 'is-disabled', IS_CHECKED: 'is-checked', IS_UPGRADED: 'is-upgraded' }; /** * Handle change of state. * * @param {Event} event The event that fired. * @private */ MaterialCheckbox.prototype.onChange_ = function (event) { this.updateClasses_(); }; /** * Handle focus of element. * * @param {Event} event The event that fired. * @private */ MaterialCheckbox.prototype.onFocus_ = function (event) { this.element_.classList.add(this.CssClasses_.IS_FOCUSED); }; /** * Handle lost focus of element. * * @param {Event} event The event that fired. * @private */ MaterialCheckbox.prototype.onBlur_ = function (event) { this.element_.classList.remove(this.CssClasses_.IS_FOCUSED); }; /** * Handle mouseup. * * @param {Event} event The event that fired. * @private */ MaterialCheckbox.prototype.onMouseUp_ = function (event) { this.blur_(); }; /** * Handle class updates. * * @private */ MaterialCheckbox.prototype.updateClasses_ = function () { this.checkDisabled(); this.checkToggleState(); }; /** * Add blur. * * @private */ MaterialCheckbox.prototype.blur_ = function () { // TODO: figure out why there's a focus event being fired after our blur, // so that we can avoid this hack. window.setTimeout(function () { this.inputElement_.blur(); }.bind(this), this.Constant_.TINY_TIMEOUT); }; // Public methods. /** * Check the inputs toggle state and update display. * * @public */ MaterialCheckbox.prototype.checkToggleState = function () { if (this.inputElement_.checked) { this.element_.classList.add(this.CssClasses_.IS_CHECKED); } else { this.element_.classList.remove(this.CssClasses_.IS_CHECKED); } }; MaterialCheckbox.prototype['checkToggleState'] = MaterialCheckbox.prototype.checkToggleState; /** * Check the inputs disabled state and update display. * * @public */ MaterialCheckbox.prototype.checkDisabled = function () { if (this.inputElement_.disabled) { this.element_.classList.add(this.CssClasses_.IS_DISABLED); } else { this.element_.classList.remove(this.CssClasses_.IS_DISABLED); } }; MaterialCheckbox.prototype['checkDisabled'] = MaterialCheckbox.prototype.checkDisabled; /** * Disable checkbox. * * @public */ MaterialCheckbox.prototype.disable = function () { this.inputElement_.disabled = true; this.updateClasses_(); }; MaterialCheckbox.prototype['disable'] = MaterialCheckbox.prototype.disable; /** * Enable checkbox. * * @public */ MaterialCheckbox.prototype.enable = function () { this.inputElement_.disabled = false; this.updateClasses_(); }; MaterialCheckbox.prototype['enable'] = MaterialCheckbox.prototype.enable; /** * Check checkbox. * * @public */ MaterialCheckbox.prototype.check = function () { this.inputElement_.checked = true; this.updateClasses_(); }; MaterialCheckbox.prototype['check'] = MaterialCheckbox.prototype.check; /** * Uncheck checkbox. * * @public */ MaterialCheckbox.prototype.uncheck = function () { this.inputElement_.checked = false; this.updateClasses_(); }; MaterialCheckbox.prototype['uncheck'] = MaterialCheckbox.prototype.uncheck; /** * Initialize element. */ MaterialCheckbox.prototype.init = function () { if (this.element_) { this.inputElement_ = this.element_.querySelector('.' + this.CssClasses_.INPUT); var boxOutline = document.createElement('span'); boxOutline.classList.add(this.CssClasses_.BOX_OUTLINE); var tickContainer = document.createElement('span'); tickContainer.classList.add(this.CssClasses_.FOCUS_HELPER); var tickOutline = document.createElement('span'); tickOutline.classList.add(this.CssClasses_.TICK_OUTLINE); boxOutline.appendChild(tickOutline); this.element_.appendChild(tickContainer); this.element_.appendChild(boxOutline); if (this.element_.classList.contains(this.CssClasses_.RIPPLE_EFFECT)) { this.element_.classList.add(this.CssClasses_.RIPPLE_IGNORE_EVENTS); this.rippleContainerElement_ = document.createElement('span'); this.rippleContainerElement_.classList.add(this.CssClasses_.RIPPLE_CONTAINER); this.rippleContainerElement_.classList.add(this.CssClasses_.RIPPLE_EFFECT); this.rippleContainerElement_.classList.add(this.CssClasses_.RIPPLE_CENTER); this.boundRippleMouseUp = this.onMouseUp_.bind(this); this.rippleContainerElement_.addEventListener('mouseup', this.boundRippleMouseUp); var ripple = document.createElement('span'); ripple.classList.add(this.CssClasses_.RIPPLE); this.rippleContainerElement_.appendChild(ripple); this.element_.appendChild(this.rippleContainerElement_); } this.boundInputOnChange = this.onChange_.bind(this); this.boundInputOnFocus = this.onFocus_.bind(this); this.boundInputOnBlur = this.onBlur_.bind(this); this.boundElementMouseUp = this.onMouseUp_.bind(this); this.inputElement_.addEventListener('change', this.boundInputOnChange); this.inputElement_.addEventListener('focus', this.boundInputOnFocus); this.inputElement_.addEventListener('blur', this.boundInputOnBlur); this.element_.addEventListener('mouseup', this.boundElementMouseUp); this.updateClasses_(); this.element_.classList.add(this.CssClasses_.IS_UPGRADED); } }; // The component registers itself. It can assume componentHandler is available // in the global scope. componentHandler.register({ constructor: MaterialCheckbox, classAsString: 'MaterialCheckbox', cssClass: 'mdl-js-checkbox', widget: true }); /** * @license * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Class constructor for icon toggle MDL component. * Implements MDL component design pattern defined at: * https://github.com/jasonmayes/mdl-component-design-pattern * * @constructor * @param {HTMLElement} element The element that will be upgraded. */ var MaterialIconToggle = function MaterialIconToggle(element) { this.element_ = element; // Initialize instance. this.init(); }; window['MaterialIconToggle'] = MaterialIconToggle; /** * Store constants in one place so they can be updated easily. * * @enum {string | number} * @private */ MaterialIconToggle.prototype.Constant_ = { TINY_TIMEOUT: 0.001 }; /** * Store strings for class names defined by this component that are used in * JavaScript. This allows us to simply change it in one place should we * decide to modify at a later date. * * @enum {string} * @private */ MaterialIconToggle.prototype.CssClasses_ = { INPUT: 'mdl-icon-toggle__input', JS_RIPPLE_EFFECT: 'mdl-js-ripple-effect', RIPPLE_IGNORE_EVENTS: 'mdl-js-ripple-effect--ignore-events', RIPPLE_CONTAINER: 'mdl-icon-toggle__ripple-container', RIPPLE_CENTER: 'mdl-ripple--center', RIPPLE: 'mdl-ripple', IS_FOCUSED: 'is-focused', IS_DISABLED: 'is-disabled', IS_CHECKED: 'is-checked' }; /** * Handle change of state. * * @param {Event} event The event that fired. * @private */ MaterialIconToggle.prototype.onChange_ = function (event) { this.updateClasses_(); }; /** * Handle focus of element. * * @param {Event} event The event that fired. * @private */ MaterialIconToggle.prototype.onFocus_ = function (event) { this.element_.classList.add(this.CssClasses_.IS_FOCUSED); }; /** * Handle lost focus of element. * * @param {Event} event The event that fired. * @private */ MaterialIconToggle.prototype.onBlur_ = function (event) { this.element_.classList.remove(this.CssClasses_.IS_FOCUSED); }; /** * Handle mouseup. * * @param {Event} event The event that fired. * @private */ MaterialIconToggle.prototype.onMouseUp_ = function (event) { this.blur_(); }; /** * Handle class updates. * * @private */ MaterialIconToggle.prototype.updateClasses_ = function () { this.checkDisabled(); this.checkToggleState(); }; /** * Add blur. * * @private */ MaterialIconToggle.prototype.blur_ = function () { // TODO: figure out why there's a focus event being fired after our blur, // so that we can avoid this hack. window.setTimeout(function () { this.inputElement_.blur(); }.bind(this), this.Constant_.TINY_TIMEOUT); }; // Public methods. /** * Check the inputs toggle state and update display. * * @public */ MaterialIconToggle.prototype.checkToggleState = function () { if (this.inputElement_.checked) { this.element_.classList.add(this.CssClasses_.IS_CHECKED); } else { this.element_.classList.remove(this.CssClasses_.IS_CHECKED); } }; MaterialIconToggle.prototype['checkToggleState'] = MaterialIconToggle.prototype.checkToggleState; /** * Check the inputs disabled state and update display. * * @public */ MaterialIconToggle.prototype.checkDisabled = function () { if (this.inputElement_.disabled) { this.element_.classList.add(this.CssClasses_.IS_DISABLED); } else { this.element_.classList.remove(this.CssClasses_.IS_DISABLED); } }; MaterialIconToggle.prototype['checkDisabled'] = MaterialIconToggle.prototype.checkDisabled; /** * Disable icon toggle. * * @public */ MaterialIconToggle.prototype.disable = function () { this.inputElement_.disabled = true; this.updateClasses_(); }; MaterialIconToggle.prototype['disable'] = MaterialIconToggle.prototype.disable; /** * Enable icon toggle. * * @public */ MaterialIconToggle.prototype.enable = function () { this.inputElement_.disabled = false; this.updateClasses_(); }; MaterialIconToggle.prototype['enable'] = MaterialIconToggle.prototype.enable; /** * Check icon toggle. * * @public */ MaterialIconToggle.prototype.check = function () { this.inputElement_.checked = true; this.updateClasses_(); }; MaterialIconToggle.prototype['check'] = MaterialIconToggle.prototype.check; /** * Uncheck icon toggle. * * @public */ MaterialIconToggle.prototype.uncheck = function () { this.inputElement_.checked = false; this.updateClasses_(); }; MaterialIconToggle.prototype['uncheck'] = MaterialIconToggle.prototype.uncheck; /** * Initialize element. */ MaterialIconToggle.prototype.init = function () { if (this.element_) { this.inputElement_ = this.element_.querySelector('.' + this.CssClasses_.INPUT); if (this.element_.classList.contains(this.CssClasses_.JS_RIPPLE_EFFECT)) { this.element_.classList.add(this.CssClasses_.RIPPLE_IGNORE_EVENTS); this.rippleContainerElement_ = document.createElement('span'); this.rippleContainerElement_.classList.add(this.CssClasses_.RIPPLE_CONTAINER); this.rippleContainerElement_.classList.add(this.CssClasses_.JS_RIPPLE_EFFECT); this.rippleContainerElement_.classList.add(this.CssClasses_.RIPPLE_CENTER); this.boundRippleMouseUp = this.onMouseUp_.bind(this); this.rippleContainerElement_.addEventListener('mouseup', this.boundRippleMouseUp); var ripple = document.createElement('span'); ripple.classList.add(this.CssClasses_.RIPPLE); this.rippleContainerElement_.appendChild(ripple); this.element_.appendChild(this.rippleContainerElement_); } this.boundInputOnChange = this.onChange_.bind(this); this.boundInputOnFocus = this.onFocus_.bind(this); this.boundInputOnBlur = this.onBlur_.bind(this); this.boundElementOnMouseUp = this.onMouseUp_.bind(this); this.inputElement_.addEventListener('change', this.boundInputOnChange); this.inputElement_.addEventListener('focus', this.boundInputOnFocus); this.inputElement_.addEventListener('blur', this.boundInputOnBlur); this.element_.addEventListener('mouseup', this.boundElementOnMouseUp); this.updateClasses_(); this.element_.classList.add('is-upgraded'); } }; // The component registers itself. It can assume componentHandler is available // in the global scope. componentHandler.register({ constructor: MaterialIconToggle, classAsString: 'MaterialIconToggle', cssClass: 'mdl-js-icon-toggle', widget: true }); /** * @license * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Class constructor for dropdown MDL component. * Implements MDL component design pattern defined at: * https://github.com/jasonmayes/mdl-component-design-pattern * * @constructor * @param {HTMLElement} element The element that will be upgraded. */ var MaterialMenu = function MaterialMenu(element) { this.element_ = element; // Initialize instance. this.init(); }; window['MaterialMenu'] = MaterialMenu; /** * Store constants in one place so they can be updated easily. * * @enum {string | number} * @private */ MaterialMenu.prototype.Constant_ = { // Total duration of the menu animation. TRANSITION_DURATION_SECONDS: 0.3, // The fraction of the total duration we want to use for menu item animations. TRANSITION_DURATION_FRACTION: 0.8, // How long the menu stays open after choosing an option (so the user can see // the ripple). CLOSE_TIMEOUT: 150 }; /** * Keycodes, for code readability. * * @enum {number} * @private */ MaterialMenu.prototype.Keycodes_ = { ENTER: 13, ESCAPE: 27, SPACE: 32, UP_ARROW: 38, DOWN_ARROW: 40 }; /** * Store strings for class names defined by this component that are used in * JavaScript. This allows us to simply change it in one place should we * decide to modify at a later date. * * @enum {string} * @private */ MaterialMenu.prototype.CssClasses_ = { CONTAINER: 'mdl-menu__container', OUTLINE: 'mdl-menu__outline', ITEM: 'mdl-menu__item', ITEM_RIPPLE_CONTAINER: 'mdl-menu__item-ripple-container', RIPPLE_EFFECT: 'mdl-js-ripple-effect', RIPPLE_IGNORE_EVENTS: 'mdl-js-ripple-effect--ignore-events', RIPPLE: 'mdl-ripple', // Statuses IS_UPGRADED: 'is-upgraded', IS_VISIBLE: 'is-visible', IS_ANIMATING: 'is-animating', // Alignment options BOTTOM_LEFT: 'mdl-menu--bottom-left', // This is the default. BOTTOM_RIGHT: 'mdl-menu--bottom-right', TOP_LEFT: 'mdl-menu--top-left', TOP_RIGHT: 'mdl-menu--top-right', UNALIGNED: 'mdl-menu--unaligned' }; /** * Initialize element. */ MaterialMenu.prototype.init = function () { if (this.element_) { // Create container for the menu. var container = document.createElement('div'); container.classList.add(this.CssClasses_.CONTAINER); this.element_.parentElement.insertBefore(container, this.element_); this.element_.parentElement.removeChild(this.element_); container.appendChild(this.element_); this.container_ = container; // Create outline for the menu (shadow and background). var outline = document.createElement('div'); outline.classList.add(this.CssClasses_.OUTLINE); this.outline_ = outline; container.insertBefore(outline, this.element_); // Find the "for" element and bind events to it. var forElId = this.element_.getAttribute('for') || this.element_.getAttribute('data-mdl-for'); var forEl = null; if (forElId) { forEl = document.getElementById(forElId); if (forEl) { this.forElement_ = forEl; forEl.addEventListener('click', this.handleForClick_.bind(this)); forEl.addEventListener('keydown', this.handleForKeyboardEvent_.bind(this)); } } var items = this.element_.querySelectorAll('.' + this.CssClasses_.ITEM); this.boundItemKeydown_ = this.handleItemKeyboardEvent_.bind(this); this.boundItemClick_ = this.handleItemClick_.bind(this); for (var i = 0; i < items.length; i++) { // Add a listener to each menu item. items[i].addEventListener('click', this.boundItemClick_); // Add a tab index to each menu item. items[i].tabIndex = '-1'; // Add a keyboard listener to each menu item. items[i].addEventListener('keydown', this.boundItemKeydown_); } // Add ripple classes to each item, if the user has enabled ripples. if (this.element_.classList.contains(this.CssClasses_.RIPPLE_EFFECT)) { this.element_.classList.add(this.CssClasses_.RIPPLE_IGNORE_EVENTS); for (i = 0; i < items.length; i++) { var item = items[i]; var rippleContainer = document.createElement('span'); rippleContainer.classList.add(this.CssClasses_.ITEM_RIPPLE_CONTAINER); var ripple = document.createElement('span'); ripple.classList.add(this.CssClasses_.RIPPLE); rippleContainer.appendChild(ripple); item.appendChild(rippleContainer); item.classList.add(this.CssClasses_.RIPPLE_EFFECT); } } // Copy alignment classes to the container, so the outline can use them. if (this.element_.classList.contains(this.CssClasses_.BOTTOM_LEFT)) { this.outline_.classList.add(this.CssClasses_.BOTTOM_LEFT); } if (this.element_.classList.contains(this.CssClasses_.BOTTOM_RIGHT)) { this.outline_.classList.add(this.CssClasses_.BOTTOM_RIGHT); } if (this.element_.classList.contains(this.CssClasses_.TOP_LEFT)) { this.outline_.classList.add(this.CssClasses_.TOP_LEFT); } if (this.element_.classList.contains(this.CssClasses_.TOP_RIGHT)) { this.outline_.classList.add(this.CssClasses_.TOP_RIGHT); } if (this.element_.classList.contains(this.CssClasses_.UNALIGNED)) { this.outline_.classList.add(this.CssClasses_.UNALIGNED); } container.classList.add(this.CssClasses_.IS_UPGRADED); } }; /** * Handles a click on the "for" element, by positioning the menu and then * toggling it. * * @param {Event} evt The event that fired. * @private */ MaterialMenu.prototype.handleForClick_ = function (evt) { if (this.element_ && this.forElement_) { var rect = this.forElement_.getBoundingClientRect(); var forRect = this.forElement_.parentElement.getBoundingClientRect(); if (this.element_.classList.contains(this.CssClasses_.UNALIGNED)) { } else if (this.element_.classList.contains(this.CssClasses_.BOTTOM_RIGHT)) { // Position below the "for" element, aligned to its right. this.container_.style.right = forRect.right - rect.right + 'px'; this.container_.style.top = this.forElement_.offsetTop + this.forElement_.offsetHeight + 'px'; } else if (this.element_.classList.contains(this.CssClasses_.TOP_LEFT)) { // Position above the "for" element, aligned to its left. this.container_.style.left = this.forElement_.offsetLeft + 'px'; this.container_.style.bottom = forRect.bottom - rect.top + 'px'; } else if (this.element_.classList.contains(this.CssClasses_.TOP_RIGHT)) { // Position above the "for" element, aligned to its right. this.container_.style.right = forRect.right - rect.right + 'px'; this.container_.style.bottom = forRect.bottom - rect.top + 'px'; } else { // Default: position below the "for" element, aligned to its left. this.container_.style.left = this.forElement_.offsetLeft + 'px'; this.container_.style.top = this.forElement_.offsetTop + this.forElement_.offsetHeight + 'px'; } } this.toggle(evt); }; /** * Handles a keyboard event on the "for" element. * * @param {Event} evt The event that fired. * @private */ MaterialMenu.prototype.handleForKeyboardEvent_ = function (evt) { if (this.element_ && this.container_ && this.forElement_) { var items = this.element_.querySelectorAll('.' + this.CssClasses_.ITEM + ':not([disabled])'); if (items && items.length > 0 && this.container_.classList.contains(this.CssClasses_.IS_VISIBLE)) { if (evt.keyCode === this.Keycodes_.UP_ARROW) { evt.preventDefault(); items[items.length - 1].focus(); } else if (evt.keyCode === this.Keycodes_.DOWN_ARROW) { evt.preventDefault(); items[0].focus(); } } } }; /** * Handles a keyboard event on an item. * * @param {Event} evt The event that fired. * @private */ MaterialMenu.prototype.handleItemKeyboardEvent_ = function (evt) { if (this.element_ && this.container_) { var items = this.element_.querySelectorAll('.' + this.CssClasses_.ITEM + ':not([disabled])'); if (items && items.length > 0 && this.container_.classList.contains(this.CssClasses_.IS_VISIBLE)) { var currentIndex = Array.prototype.slice.call(items).indexOf(evt.target); if (evt.keyCode === this.Keycodes_.UP_ARROW) { evt.preventDefault(); if (currentIndex > 0) { items[currentIndex - 1].focus(); } else { items[items.length - 1].focus(); } } else if (evt.keyCode === this.Keycodes_.DOWN_ARROW) { evt.preventDefault(); if (items.length > currentIndex + 1) { items[currentIndex + 1].focus(); } else { items[0].focus(); } } else if (evt.keyCode === this.Keycodes_.SPACE || evt.keyCode === this.Keycodes_.ENTER) { evt.preventDefault(); // Send mousedown and mouseup to trigger ripple. var e = new MouseEvent('mousedown'); evt.target.dispatchEvent(e); e = new MouseEvent('mouseup'); evt.target.dispatchEvent(e); // Send click. evt.target.click(); } else if (evt.keyCode === this.Keycodes_.ESCAPE) { evt.preventDefault(); this.hide(); } } } }; /** * Handles a click event on an item. * * @param {Event} evt The event that fired. * @private */ MaterialMenu.prototype.handleItemClick_ = function (evt) { if (evt.target.hasAttribute('disabled')) { evt.stopPropagation(); } else { // Wait some time before closing menu, so the user can see the ripple. this.closing_ = true; window.setTimeout(function (evt) { this.hide(); this.closing_ = false; }.bind(this), this.Constant_.CLOSE_TIMEOUT); } }; /** * Calculates the initial clip (for opening the menu) or final clip (for closing * it), and applies it. This allows us to animate from or to the correct point, * that is, the point it's aligned to in the "for" element. * * @param {number} height Height of the clip rectangle * @param {number} width Width of the clip rectangle * @private */ MaterialMenu.prototype.applyClip_ = function (height, width) { if (this.element_.classList.contains(this.CssClasses_.UNALIGNED)) { // Do not clip. this.element_.style.clip = ''; } else if (this.element_.classList.contains(this.CssClasses_.BOTTOM_RIGHT)) { // Clip to the top right corner of the menu. this.element_.style.clip = 'rect(0 ' + width + 'px ' + '0 ' + width + 'px)'; } else if (this.element_.classList.contains(this.CssClasses_.TOP_LEFT)) { // Clip to the bottom left corner of the menu. this.element_.style.clip = 'rect(' + height + 'px 0 ' + height + 'px 0)'; } else if (this.element_.classList.contains(this.CssClasses_.TOP_RIGHT)) { // Clip to the bottom right corner of the menu. this.element_.style.clip = 'rect(' + height + 'px ' + width + 'px ' + height + 'px ' + width + 'px)'; } else { // Default: do not clip (same as clipping to the top left corner). this.element_.style.clip = ''; } }; /** * Cleanup function to remove animation listeners. * * @param {Event} evt * @private */ MaterialMenu.prototype.removeAnimationEndListener_ = function (evt) { evt.target.classList.remove(MaterialMenu.prototype.CssClasses_.IS_ANIMATING); }; /** * Adds an event listener to clean up after the animation ends. * * @private */ MaterialMenu.prototype.addAnimationEndListener_ = function () { this.element_.addEventListener('transitionend', this.removeAnimationEndListener_); this.element_.addEventListener('webkitTransitionEnd', this.removeAnimationEndListener_); }; /** * Displays the menu. * * @public */ MaterialMenu.prototype.show = function (evt) { if (this.element_ && this.container_ && this.outline_) { // Measure the inner element. var height = this.element_.getBoundingClientRect().height; var width = this.element_.getBoundingClientRect().width; // Apply the inner element's size to the container and outline. this.container_.style.width = width + 'px'; this.container_.style.height = height + 'px'; this.outline_.style.width = width + 'px'; this.outline_.style.height = height + 'px'; var transitionDuration = this.Constant_.TRANSITION_DURATION_SECONDS * this.Constant_.TRANSITION_DURATION_FRACTION; // Calculate transition delays for individual menu items, so that they fade // in one at a time. var items = this.element_.querySelectorAll('.' + this.CssClasses_.ITEM); for (var i = 0; i < items.length; i++) { var itemDelay = null; if (this.element_.classList.contains(this.CssClasses_.TOP_LEFT) || this.element_.classList.contains(this.CssClasses_.TOP_RIGHT)) { itemDelay = (height - items[i].offsetTop - items[i].offsetHeight) / height * transitionDuration + 's'; } else { itemDelay = items[i].offsetTop / height * transitionDuration + 's'; } items[i].style.transitionDelay = itemDelay; } // Apply the initial clip to the text before we start animating. this.applyClip_(height, width); // Wait for the next frame, turn on animation, and apply the final clip. // Also make it visible. This triggers the transitions. window.requestAnimationFrame(function () { this.element_.classList.add(this.CssClasses_.IS_ANIMATING); this.element_.style.clip = 'rect(0 ' + width + 'px ' + height + 'px 0)'; this.container_.classList.add(this.CssClasses_.IS_VISIBLE); }.bind(this)); // Clean up after the animation is complete. this.addAnimationEndListener_(); // Add a click listener to the document, to close the menu. var callback = function (e) { // Check to see if the document is processing the same event that // displayed the menu in the first place. If so, do nothing. // Also check to see if the menu is in the process of closing itself, and // do nothing in that case. // Also check if the clicked element is a menu item // if so, do nothing. if (e !== evt && !this.closing_ && e.target.parentNode !== this.element_) { document.removeEventListener('click', callback); this.hide(); } }.bind(this); document.addEventListener('click', callback); } }; MaterialMenu.prototype['show'] = MaterialMenu.prototype.show; /** * Hides the menu. * * @public */ MaterialMenu.prototype.hide = function () { if (this.element_ && this.container_ && this.outline_) { var items = this.element_.querySelectorAll('.' + this.CssClasses_.ITEM); // Remove all transition delays; menu items fade out concurrently. for (var i = 0; i < items.length; i++) { items[i].style.removeProperty('transition-delay'); } // Measure the inner element. var rect = this.element_.getBoundingClientRect(); var height = rect.height; var width = rect.width; // Turn on animation, and apply the final clip. Also make invisible. // This triggers the transitions. this.element_.classList.add(this.CssClasses_.IS_ANIMATING); this.applyClip_(height, width); this.container_.classList.remove(this.CssClasses_.IS_VISIBLE); // Clean up after the animation is complete. this.addAnimationEndListener_(); } }; MaterialMenu.prototype['hide'] = MaterialMenu.prototype.hide; /** * Displays or hides the menu, depending on current state. * * @public */ MaterialMenu.prototype.toggle = function (evt) { if (this.container_.classList.contains(this.CssClasses_.IS_VISIBLE)) { this.hide(); } else { this.show(evt); } }; MaterialMenu.prototype['toggle'] = MaterialMenu.prototype.toggle; // The component registers itself. It can assume componentHandler is available // in the global scope. componentHandler.register({ constructor: MaterialMenu, classAsString: 'MaterialMenu', cssClass: 'mdl-js-menu', widget: true }); /** * @license * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Class constructor for Progress MDL component. * Implements MDL component design pattern defined at: * https://github.com/jasonmayes/mdl-component-design-pattern * * @constructor * @param {HTMLElement} element The element that will be upgraded. */ var MaterialProgress = function MaterialProgress(element) { this.element_ = element; // Initialize instance. this.init(); }; window['MaterialProgress'] = MaterialProgress; /** * Store constants in one place so they can be updated easily. * * @enum {string | number} * @private */ MaterialProgress.prototype.Constant_ = {}; /** * Store strings for class names defined by this component that are used in * JavaScript. This allows us to simply change it in one place should we * decide to modify at a later date. * * @enum {string} * @private */ MaterialProgress.prototype.CssClasses_ = { INDETERMINATE_CLASS: 'mdl-progress__indeterminate' }; /** * Set the current progress of the progressbar. * * @param {number} p Percentage of the progress (0-100) * @public */ MaterialProgress.prototype.setProgress = function (p) { if (this.element_.classList.contains(this.CssClasses_.INDETERMINATE_CLASS)) { return; } this.progressbar_.style.width = p + '%'; }; MaterialProgress.prototype['setProgress'] = MaterialProgress.prototype.setProgress; /** * Set the current progress of the buffer. * * @param {number} p Percentage of the buffer (0-100) * @public */ MaterialProgress.prototype.setBuffer = function (p) { this.bufferbar_.style.width = p + '%'; this.auxbar_.style.width = 100 - p + '%'; }; MaterialProgress.prototype['setBuffer'] = MaterialProgress.prototype.setBuffer; /** * Initialize element. */ MaterialProgress.prototype.init = function () { if (this.element_) { var el = document.createElement('div'); el.className = 'progressbar bar bar1'; this.element_.appendChild(el); this.progressbar_ = el; el = document.createElement('div'); el.className = 'bufferbar bar bar2'; this.element_.appendChild(el); this.bufferbar_ = el; el = document.createElement('div'); el.className = 'auxbar bar bar3'; this.element_.appendChild(el); this.auxbar_ = el; this.progressbar_.style.width = '0%'; this.bufferbar_.style.width = '100%'; this.auxbar_.style.width = '0%'; this.element_.classList.add('is-upgraded'); } }; // The component registers itself. It can assume componentHandler is available // in the global scope. componentHandler.register({ constructor: MaterialProgress, classAsString: 'MaterialProgress', cssClass: 'mdl-js-progress', widget: true }); /** * @license * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Class constructor for Radio MDL component. * Implements MDL component design pattern defined at: * https://github.com/jasonmayes/mdl-component-design-pattern * * @constructor * @param {HTMLElement} element The element that will be upgraded. */ var MaterialRadio = function MaterialRadio(element) { this.element_ = element; // Initialize instance. this.init(); }; window['MaterialRadio'] = MaterialRadio; /** * Store constants in one place so they can be updated easily. * * @enum {string | number} * @private */ MaterialRadio.prototype.Constant_ = { TINY_TIMEOUT: 0.001 }; /** * Store strings for class names defined by this component that are used in * JavaScript. This allows us to simply change it in one place should we * decide to modify at a later date. * * @enum {string} * @private */ MaterialRadio.prototype.CssClasses_ = { IS_FOCUSED: 'is-focused', IS_DISABLED: 'is-disabled', IS_CHECKED: 'is-checked', IS_UPGRADED: 'is-upgraded', JS_RADIO: 'mdl-js-radio', RADIO_BTN: 'mdl-radio__button', RADIO_OUTER_CIRCLE: 'mdl-radio__outer-circle', RADIO_INNER_CIRCLE: 'mdl-radio__inner-circle', RIPPLE_EFFECT: 'mdl-js-ripple-effect', RIPPLE_IGNORE_EVENTS: 'mdl-js-ripple-effect--ignore-events', RIPPLE_CONTAINER: 'mdl-radio__ripple-container', RIPPLE_CENTER: 'mdl-ripple--center', RIPPLE: 'mdl-ripple' }; /** * Handle change of state. * * @param {Event} event The event that fired. * @private */ MaterialRadio.prototype.onChange_ = function (event) { // Since other radio buttons don't get change events, we need to look for // them to update their classes. var radios = document.getElementsByClassName(this.CssClasses_.JS_RADIO); for (var i = 0; i < radios.length; i++) { var button = radios[i].querySelector('.' + this.CssClasses_.RADIO_BTN); // Different name == different group, so no point updating those. if (button.getAttribute('name') === this.btnElement_.getAttribute('name')) { if (typeof radios[i]['MaterialRadio'] !== 'undefined') { radios[i]['MaterialRadio'].updateClasses_(); } } } }; /** * Handle focus. * * @param {Event} event The event that fired. * @private */ MaterialRadio.prototype.onFocus_ = function (event) { this.element_.classList.add(this.CssClasses_.IS_FOCUSED); }; /** * Handle lost focus. * * @param {Event} event The event that fired. * @private */ MaterialRadio.prototype.onBlur_ = function (event) { this.element_.classList.remove(this.CssClasses_.IS_FOCUSED); }; /** * Handle mouseup. * * @param {Event} event The event that fired. * @private */ MaterialRadio.prototype.onMouseup_ = function (event) { this.blur_(); }; /** * Update classes. * * @private */ MaterialRadio.prototype.updateClasses_ = function () { this.checkDisabled(); this.checkToggleState(); }; /** * Add blur. * * @private */ MaterialRadio.prototype.blur_ = function () { // TODO: figure out why there's a focus event being fired after our blur, // so that we can avoid this hack. window.setTimeout(function () { this.btnElement_.blur(); }.bind(this), this.Constant_.TINY_TIMEOUT); }; // Public methods. /** * Check the components disabled state. * * @public */ MaterialRadio.prototype.checkDisabled = function () { if (this.btnElement_.disabled) { this.element_.classList.add(this.CssClasses_.IS_DISABLED); } else { this.element_.classList.remove(this.CssClasses_.IS_DISABLED); } }; MaterialRadio.prototype['checkDisabled'] = MaterialRadio.prototype.checkDisabled; /** * Check the components toggled state. * * @public */ MaterialRadio.prototype.checkToggleState = function () { if (this.btnElement_.checked) { this.element_.classList.add(this.CssClasses_.IS_CHECKED); } else { this.element_.classList.remove(this.CssClasses_.IS_CHECKED); } }; MaterialRadio.prototype['checkToggleState'] = MaterialRadio.prototype.checkToggleState; /** * Disable radio. * * @public */ MaterialRadio.prototype.disable = function () { this.btnElement_.disabled = true; this.updateClasses_(); }; MaterialRadio.prototype['disable'] = MaterialRadio.prototype.disable; /** * Enable radio. * * @public */ MaterialRadio.prototype.enable = function () { this.btnElement_.disabled = false; this.updateClasses_(); }; MaterialRadio.prototype['enable'] = MaterialRadio.prototype.enable; /** * Check radio. * * @public */ MaterialRadio.prototype.check = function () { this.btnElement_.checked = true; this.onChange_(null); }; MaterialRadio.prototype['check'] = MaterialRadio.prototype.check; /** * Uncheck radio. * * @public */ MaterialRadio.prototype.uncheck = function () { this.btnElement_.checked = false; this.onChange_(null); }; MaterialRadio.prototype['uncheck'] = MaterialRadio.prototype.uncheck; /** * Initialize element. */ MaterialRadio.prototype.init = function () { if (this.element_) { this.btnElement_ = this.element_.querySelector('.' + this.CssClasses_.RADIO_BTN); this.boundChangeHandler_ = this.onChange_.bind(this); this.boundFocusHandler_ = this.onChange_.bind(this); this.boundBlurHandler_ = this.onBlur_.bind(this); this.boundMouseUpHandler_ = this.onMouseup_.bind(this); var outerCircle = document.createElement('span'); outerCircle.classList.add(this.CssClasses_.RADIO_OUTER_CIRCLE); var innerCircle = document.createElement('span'); innerCircle.classList.add(this.CssClasses_.RADIO_INNER_CIRCLE); this.element_.appendChild(outerCircle); this.element_.appendChild(innerCircle); var rippleContainer; if (this.element_.classList.contains(this.CssClasses_.RIPPLE_EFFECT)) { this.element_.classList.add(this.CssClasses_.RIPPLE_IGNORE_EVENTS); rippleContainer = document.createElement('span'); rippleContainer.classList.add(this.CssClasses_.RIPPLE_CONTAINER); rippleContainer.classList.add(this.CssClasses_.RIPPLE_EFFECT); rippleContainer.classList.add(this.CssClasses_.RIPPLE_CENTER); rippleContainer.addEventListener('mouseup', this.boundMouseUpHandler_); var ripple = document.createElement('span'); ripple.classList.add(this.CssClasses_.RIPPLE); rippleContainer.appendChild(ripple); this.element_.appendChild(rippleContainer); } this.btnElement_.addEventListener('change', this.boundChangeHandler_); this.btnElement_.addEventListener('focus', this.boundFocusHandler_); this.btnElement_.addEventListener('blur', this.boundBlurHandler_); this.element_.addEventListener('mouseup', this.boundMouseUpHandler_); this.updateClasses_(); this.element_.classList.add(this.CssClasses_.IS_UPGRADED); } }; // The component registers itself. It can assume componentHandler is available // in the global scope. componentHandler.register({ constructor: MaterialRadio, classAsString: 'MaterialRadio', cssClass: 'mdl-js-radio', widget: true }); /** * @license * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Class constructor for Slider MDL component. * Implements MDL component design pattern defined at: * https://github.com/jasonmayes/mdl-component-design-pattern * * @constructor * @param {HTMLElement} element The element that will be upgraded. */ var MaterialSlider = function MaterialSlider(element) { this.element_ = element; // Browser feature detection. this.isIE_ = window.navigator.msPointerEnabled; // Initialize instance. this.init(); }; window['MaterialSlider'] = MaterialSlider; /** * Store constants in one place so they can be updated easily. * * @enum {string | number} * @private */ MaterialSlider.prototype.Constant_ = {}; /** * Store strings for class names defined by this component that are used in * JavaScript. This allows us to simply change it in one place should we * decide to modify at a later date. * * @enum {string} * @private */ MaterialSlider.prototype.CssClasses_ = { IE_CONTAINER: 'mdl-slider__ie-container', SLIDER_CONTAINER: 'mdl-slider__container', BACKGROUND_FLEX: 'mdl-slider__background-flex', BACKGROUND_LOWER: 'mdl-slider__background-lower', BACKGROUND_UPPER: 'mdl-slider__background-upper', IS_LOWEST_VALUE: 'is-lowest-value', IS_UPGRADED: 'is-upgraded' }; /** * Handle input on element. * * @param {Event} event The event that fired. * @private */ MaterialSlider.prototype.onInput_ = function (event) { this.updateValueStyles_(); }; /** * Handle change on element. * * @param {Event} event The event that fired. * @private */ MaterialSlider.prototype.onChange_ = function (event) { this.updateValueStyles_(); }; /** * Handle mouseup on element. * * @param {Event} event The event that fired. * @private */ MaterialSlider.prototype.onMouseUp_ = function (event) { event.target.blur(); }; /** * Handle mousedown on container element. * This handler is purpose is to not require the use to click * exactly on the 2px slider element, as FireFox seems to be very * strict about this. * * @param {Event} event The event that fired. * @private * @suppress {missingProperties} */ MaterialSlider.prototype.onContainerMouseDown_ = function (event) { // If this click is not on the parent element (but rather some child) // ignore. It may still bubble up. if (event.target !== this.element_.parentElement) { return; } // Discard the original event and create a new event that // is on the slider element. event.preventDefault(); var newEvent = new MouseEvent('mousedown', { target: event.target, buttons: event.buttons, clientX: event.clientX, clientY: this.element_.getBoundingClientRect().y }); this.element_.dispatchEvent(newEvent); }; /** * Handle updating of values. * * @private */ MaterialSlider.prototype.updateValueStyles_ = function () { // Calculate and apply percentages to div structure behind slider. var fraction = (this.element_.value - this.element_.min) / (this.element_.max - this.element_.min); if (fraction === 0) { this.element_.classList.add(this.CssClasses_.IS_LOWEST_VALUE); } else { this.element_.classList.remove(this.CssClasses_.IS_LOWEST_VALUE); } if (!this.isIE_) { this.backgroundLower_.style.flex = fraction; this.backgroundLower_.style.webkitFlex = fraction; this.backgroundUpper_.style.flex = 1 - fraction; this.backgroundUpper_.style.webkitFlex = 1 - fraction; } }; // Public methods. /** * Disable slider. * * @public */ MaterialSlider.prototype.disable = function () { this.element_.disabled = true; }; MaterialSlider.prototype['disable'] = MaterialSlider.prototype.disable; /** * Enable slider. * * @public */ MaterialSlider.prototype.enable = function () { this.element_.disabled = false; }; MaterialSlider.prototype['enable'] = MaterialSlider.prototype.enable; /** * Update slider value. * * @param {number} value The value to which to set the control (optional). * @public */ MaterialSlider.prototype.change = function (value) { if (typeof value !== 'undefined') { this.element_.value = value; } this.updateValueStyles_(); }; MaterialSlider.prototype['change'] = MaterialSlider.prototype.change; /** * Initialize element. */ MaterialSlider.prototype.init = function () { if (this.element_) { if (this.isIE_) { // Since we need to specify a very large height in IE due to // implementation limitations, we add a parent here that trims it down to // a reasonable size. var containerIE = document.createElement('div'); containerIE.classList.add(this.CssClasses_.IE_CONTAINER); this.element_.parentElement.insertBefore(containerIE, this.element_); this.element_.parentElement.removeChild(this.element_); containerIE.appendChild(this.element_); } else { // For non-IE browsers, we need a div structure that sits behind the // slider and allows us to style the left and right sides of it with // different colors. var container = document.createElement('div'); container.classList.add(this.CssClasses_.SLIDER_CONTAINER); this.element_.parentElement.insertBefore(container, this.element_); this.element_.parentElement.removeChild(this.element_); container.appendChild(this.element_); var backgroundFlex = document.createElement('div'); backgroundFlex.classList.add(this.CssClasses_.BACKGROUND_FLEX); container.appendChild(backgroundFlex); this.backgroundLower_ = document.createElement('div'); this.backgroundLower_.classList.add(this.CssClasses_.BACKGROUND_LOWER); backgroundFlex.appendChild(this.backgroundLower_); this.backgroundUpper_ = document.createElement('div'); this.backgroundUpper_.classList.add(this.CssClasses_.BACKGROUND_UPPER); backgroundFlex.appendChild(this.backgroundUpper_); } this.boundInputHandler = this.onInput_.bind(this); this.boundChangeHandler = this.onChange_.bind(this); this.boundMouseUpHandler = this.onMouseUp_.bind(this); this.boundContainerMouseDownHandler = this.onContainerMouseDown_.bind(this); this.element_.addEventListener('input', this.boundInputHandler); this.element_.addEventListener('change', this.boundChangeHandler); this.element_.addEventListener('mouseup', this.boundMouseUpHandler); this.element_.parentElement.addEventListener('mousedown', this.boundContainerMouseDownHandler); this.updateValueStyles_(); this.element_.classList.add(this.CssClasses_.IS_UPGRADED); } }; // The component registers itself. It can assume componentHandler is available // in the global scope. componentHandler.register({ constructor: MaterialSlider, classAsString: 'MaterialSlider', cssClass: 'mdl-js-slider', widget: true }); /** * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Class constructor for Snackbar MDL component. * Implements MDL component design pattern defined at: * https://github.com/jasonmayes/mdl-component-design-pattern * * @constructor * @param {HTMLElement} element The element that will be upgraded. */ var MaterialSnackbar = function MaterialSnackbar(element) { this.element_ = element; this.textElement_ = this.element_.querySelector('.' + this.cssClasses_.MESSAGE); this.actionElement_ = this.element_.querySelector('.' + this.cssClasses_.ACTION); if (!this.textElement_) { throw new Error('There must be a message element for a snackbar.'); } if (!this.actionElement_) { throw new Error('There must be an action element for a snackbar.'); } this.active = false; this.actionHandler_ = undefined; this.message_ = undefined; this.actionText_ = undefined; this.queuedNotifications_ = []; this.setActionHidden_(true); }; window['MaterialSnackbar'] = MaterialSnackbar; /** * Store constants in one place so they can be updated easily. * * @enum {string | number} * @private */ MaterialSnackbar.prototype.Constant_ = { // The duration of the snackbar show/hide animation, in ms. ANIMATION_LENGTH: 250 }; /** * Store strings for class names defined by this component that are used in * JavaScript. This allows us to simply change it in one place should we * decide to modify at a later date. * * @enum {string} * @private */ MaterialSnackbar.prototype.cssClasses_ = { SNACKBAR: 'mdl-snackbar', MESSAGE: 'mdl-snackbar__text', ACTION: 'mdl-snackbar__action', ACTIVE: 'mdl-snackbar--active' }; /** * Display the snackbar. * * @private */ MaterialSnackbar.prototype.displaySnackbar_ = function () { this.element_.setAttribute('aria-hidden', 'true'); if (this.actionHandler_) { this.actionElement_.textContent = this.actionText_; this.actionElement_.addEventListener('click', this.actionHandler_); this.setActionHidden_(false); } this.textElement_.textContent = this.message_; this.element_.classList.add(this.cssClasses_.ACTIVE); this.element_.setAttribute('aria-hidden', 'false'); setTimeout(this.cleanup_.bind(this), this.timeout_); }; /** * Show the snackbar. * * @param {Object} data The data for the notification. * @public */ MaterialSnackbar.prototype.showSnackbar = function (data) { if (data === undefined) { throw new Error('Please provide a data object with at least a message to display.'); } if (data['message'] === undefined) { throw new Error('Please provide a message to be displayed.'); } if (data['actionHandler'] && !data['actionText']) { throw new Error('Please provide action text with the handler.'); } if (this.active) { this.queuedNotifications_.push(data); } else { this.active = true; this.message_ = data['message']; if (data['timeout']) { this.timeout_ = data['timeout']; } else { this.timeout_ = 2750; } if (data['actionHandler']) { this.actionHandler_ = data['actionHandler']; } if (data['actionText']) { this.actionText_ = data['actionText']; } this.displaySnackbar_(); } }; MaterialSnackbar.prototype['showSnackbar'] = MaterialSnackbar.prototype.showSnackbar; /** * Check if the queue has items within it. * If it does, display the next entry. * * @private */ MaterialSnackbar.prototype.checkQueue_ = function () { if (this.queuedNotifications_.length > 0) { this.showSnackbar(this.queuedNotifications_.shift()); } }; /** * Cleanup the snackbar event listeners and accessiblity attributes. * * @private */ MaterialSnackbar.prototype.cleanup_ = function () { this.element_.classList.remove(this.cssClasses_.ACTIVE); setTimeout(function () { this.element_.setAttribute('aria-hidden', 'true'); this.textElement_.textContent = ''; if (!Boolean(this.actionElement_.getAttribute('aria-hidden'))) { this.setActionHidden_(true); this.actionElement_.textContent = ''; this.actionElement_.removeEventListener('click', this.actionHandler_); } this.actionHandler_ = undefined; this.message_ = undefined; this.actionText_ = undefined; this.active = false; this.checkQueue_(); }.bind(this), this.Constant_.ANIMATION_LENGTH); }; /** * Set the action handler hidden state. * * @param {boolean} value * @private */ MaterialSnackbar.prototype.setActionHidden_ = function (value) { if (value) { this.actionElement_.setAttribute('aria-hidden', 'true'); } else { this.actionElement_.removeAttribute('aria-hidden'); } }; // The component registers itself. It can assume componentHandler is available // in the global scope. componentHandler.register({ constructor: MaterialSnackbar, classAsString: 'MaterialSnackbar', cssClass: 'mdl-js-snackbar', widget: true }); /** * @license * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Class constructor for Spinner MDL component. * Implements MDL component design pattern defined at: * https://github.com/jasonmayes/mdl-component-design-pattern * * @param {HTMLElement} element The element that will be upgraded. * @constructor */ var MaterialSpinner = function MaterialSpinner(element) { this.element_ = element; // Initialize instance. this.init(); }; window['MaterialSpinner'] = MaterialSpinner; /** * Store constants in one place so they can be updated easily. * * @enum {string | number} * @private */ MaterialSpinner.prototype.Constant_ = { MDL_SPINNER_LAYER_COUNT: 4 }; /** * Store strings for class names defined by this component that are used in * JavaScript. This allows us to simply change it in one place should we * decide to modify at a later date. * * @enum {string} * @private */ MaterialSpinner.prototype.CssClasses_ = { MDL_SPINNER_LAYER: 'mdl-spinner__layer', MDL_SPINNER_CIRCLE_CLIPPER: 'mdl-spinner__circle-clipper', MDL_SPINNER_CIRCLE: 'mdl-spinner__circle', MDL_SPINNER_GAP_PATCH: 'mdl-spinner__gap-patch', MDL_SPINNER_LEFT: 'mdl-spinner__left', MDL_SPINNER_RIGHT: 'mdl-spinner__right' }; /** * Auxiliary method to create a spinner layer. * * @param {number} index Index of the layer to be created. * @public */ MaterialSpinner.prototype.createLayer = function (index) { var layer = document.createElement('div'); layer.classList.add(this.CssClasses_.MDL_SPINNER_LAYER); layer.classList.add(this.CssClasses_.MDL_SPINNER_LAYER + '-' + index); var leftClipper = document.createElement('div'); leftClipper.classList.add(this.CssClasses_.MDL_SPINNER_CIRCLE_CLIPPER); leftClipper.classList.add(this.CssClasses_.MDL_SPINNER_LEFT); var gapPatch = document.createElement('div'); gapPatch.classList.add(this.CssClasses_.MDL_SPINNER_GAP_PATCH); var rightClipper = document.createElement('div'); rightClipper.classList.add(this.CssClasses_.MDL_SPINNER_CIRCLE_CLIPPER); rightClipper.classList.add(this.CssClasses_.MDL_SPINNER_RIGHT); var circleOwners = [ leftClipper, gapPatch, rightClipper ]; for (var i = 0; i < circleOwners.length; i++) { var circle = document.createElement('div'); circle.classList.add(this.CssClasses_.MDL_SPINNER_CIRCLE); circleOwners[i].appendChild(circle); } layer.appendChild(leftClipper); layer.appendChild(gapPatch); layer.appendChild(rightClipper); this.element_.appendChild(layer); }; MaterialSpinner.prototype['createLayer'] = MaterialSpinner.prototype.createLayer; /** * Stops the spinner animation. * Public method for users who need to stop the spinner for any reason. * * @public */ MaterialSpinner.prototype.stop = function () { this.element_.classList.remove('is-active'); }; MaterialSpinner.prototype['stop'] = MaterialSpinner.prototype.stop; /** * Starts the spinner animation. * Public method for users who need to manually start the spinner for any reason * (instead of just adding the 'is-active' class to their markup). * * @public */ MaterialSpinner.prototype.start = function () { this.element_.classList.add('is-active'); }; MaterialSpinner.prototype['start'] = MaterialSpinner.prototype.start; /** * Initialize element. */ MaterialSpinner.prototype.init = function () { if (this.element_) { for (var i = 1; i <= this.Constant_.MDL_SPINNER_LAYER_COUNT; i++) { this.createLayer(i); } this.element_.classList.add('is-upgraded'); } }; // The component registers itself. It can assume componentHandler is available // in the global scope. componentHandler.register({ constructor: MaterialSpinner, classAsString: 'MaterialSpinner', cssClass: 'mdl-js-spinner', widget: true }); /** * @license * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Class constructor for Checkbox MDL component. * Implements MDL component design pattern defined at: * https://github.com/jasonmayes/mdl-component-design-pattern * * @constructor * @param {HTMLElement} element The element that will be upgraded. */ var MaterialSwitch = function MaterialSwitch(element) { this.element_ = element; // Initialize instance. this.init(); }; window['MaterialSwitch'] = MaterialSwitch; /** * Store constants in one place so they can be updated easily. * * @enum {string | number} * @private */ MaterialSwitch.prototype.Constant_ = { TINY_TIMEOUT: 0.001 }; /** * Store strings for class names defined by this component that are used in * JavaScript. This allows us to simply change it in one place should we * decide to modify at a later date. * * @enum {string} * @private */ MaterialSwitch.prototype.CssClasses_ = { INPUT: 'mdl-switch__input', TRACK: 'mdl-switch__track', THUMB: 'mdl-switch__thumb', FOCUS_HELPER: 'mdl-switch__focus-helper', RIPPLE_EFFECT: 'mdl-js-ripple-effect', RIPPLE_IGNORE_EVENTS: 'mdl-js-ripple-effect--ignore-events', RIPPLE_CONTAINER: 'mdl-switch__ripple-container', RIPPLE_CENTER: 'mdl-ripple--center', RIPPLE: 'mdl-ripple', IS_FOCUSED: 'is-focused', IS_DISABLED: 'is-disabled', IS_CHECKED: 'is-checked' }; /** * Handle change of state. * * @param {Event} event The event that fired. * @private */ MaterialSwitch.prototype.onChange_ = function (event) { this.updateClasses_(); }; /** * Handle focus of element. * * @param {Event} event The event that fired. * @private */ MaterialSwitch.prototype.onFocus_ = function (event) { this.element_.classList.add(this.CssClasses_.IS_FOCUSED); }; /** * Handle lost focus of element. * * @param {Event} event The event that fired. * @private */ MaterialSwitch.prototype.onBlur_ = function (event) { this.element_.classList.remove(this.CssClasses_.IS_FOCUSED); }; /** * Handle mouseup. * * @param {Event} event The event that fired. * @private */ MaterialSwitch.prototype.onMouseUp_ = function (event) { this.blur_(); }; /** * Handle class updates. * * @private */ MaterialSwitch.prototype.updateClasses_ = function () { this.checkDisabled(); this.checkToggleState(); }; /** * Add blur. * * @private */ MaterialSwitch.prototype.blur_ = function () { // TODO: figure out why there's a focus event being fired after our blur, // so that we can avoid this hack. window.setTimeout(function () { this.inputElement_.blur(); }.bind(this), this.Constant_.TINY_TIMEOUT); }; // Public methods. /** * Check the components disabled state. * * @public */ MaterialSwitch.prototype.checkDisabled = function () { if (this.inputElement_.disabled) { this.element_.classList.add(this.CssClasses_.IS_DISABLED); } else { this.element_.classList.remove(this.CssClasses_.IS_DISABLED); } }; MaterialSwitch.prototype['checkDisabled'] = MaterialSwitch.prototype.checkDisabled; /** * Check the components toggled state. * * @public */ MaterialSwitch.prototype.checkToggleState = function () { if (this.inputElement_.checked) { this.element_.classList.add(this.CssClasses_.IS_CHECKED); } else { this.element_.classList.remove(this.CssClasses_.IS_CHECKED); } }; MaterialSwitch.prototype['checkToggleState'] = MaterialSwitch.prototype.checkToggleState; /** * Disable switch. * * @public */ MaterialSwitch.prototype.disable = function () { this.inputElement_.disabled = true; this.updateClasses_(); }; MaterialSwitch.prototype['disable'] = MaterialSwitch.prototype.disable; /** * Enable switch. * * @public */ MaterialSwitch.prototype.enable = function () { this.inputElement_.disabled = false; this.updateClasses_(); }; MaterialSwitch.prototype['enable'] = MaterialSwitch.prototype.enable; /** * Activate switch. * * @public */ MaterialSwitch.prototype.on = function () { this.inputElement_.checked = true; this.updateClasses_(); }; MaterialSwitch.prototype['on'] = MaterialSwitch.prototype.on; /** * Deactivate switch. * * @public */ MaterialSwitch.prototype.off = function () { this.inputElement_.checked = false; this.updateClasses_(); }; MaterialSwitch.prototype['off'] = MaterialSwitch.prototype.off; /** * Initialize element. */ MaterialSwitch.prototype.init = function () { if (this.element_) { this.inputElement_ = this.element_.querySelector('.' + this.CssClasses_.INPUT); var track = document.createElement('div'); track.classList.add(this.CssClasses_.TRACK); var thumb = document.createElement('div'); thumb.classList.add(this.CssClasses_.THUMB); var focusHelper = document.createElement('span'); focusHelper.classList.add(this.CssClasses_.FOCUS_HELPER); thumb.appendChild(focusHelper); this.element_.appendChild(track); this.element_.appendChild(thumb); this.boundMouseUpHandler = this.onMouseUp_.bind(this); if (this.element_.classList.contains(this.CssClasses_.RIPPLE_EFFECT)) { this.element_.classList.add(this.CssClasses_.RIPPLE_IGNORE_EVENTS); this.rippleContainerElement_ = document.createElement('span'); this.rippleContainerElement_.classList.add(this.CssClasses_.RIPPLE_CONTAINER); this.rippleContainerElement_.classList.add(this.CssClasses_.RIPPLE_EFFECT); this.rippleContainerElement_.classList.add(this.CssClasses_.RIPPLE_CENTER); this.rippleContainerElement_.addEventListener('mouseup', this.boundMouseUpHandler); var ripple = document.createElement('span'); ripple.classList.add(this.CssClasses_.RIPPLE); this.rippleContainerElement_.appendChild(ripple); this.element_.appendChild(this.rippleContainerElement_); } this.boundChangeHandler = this.onChange_.bind(this); this.boundFocusHandler = this.onFocus_.bind(this); this.boundBlurHandler = this.onBlur_.bind(this); this.inputElement_.addEventListener('change', this.boundChangeHandler); this.inputElement_.addEventListener('focus', this.boundFocusHandler); this.inputElement_.addEventListener('blur', this.boundBlurHandler); this.element_.addEventListener('mouseup', this.boundMouseUpHandler); this.updateClasses_(); this.element_.classList.add('is-upgraded'); } }; // The component registers itself. It can assume componentHandler is available // in the global scope. componentHandler.register({ constructor: MaterialSwitch, classAsString: 'MaterialSwitch', cssClass: 'mdl-js-switch', widget: true }); /** * @license * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Class constructor for Tabs MDL component. * Implements MDL component design pattern defined at: * https://github.com/jasonmayes/mdl-component-design-pattern * * @constructor * @param {Element} element The element that will be upgraded. */ var MaterialTabs = function MaterialTabs(element) { // Stores the HTML element. this.element_ = element; // Initialize instance. this.init(); }; window['MaterialTabs'] = MaterialTabs; /** * Store constants in one place so they can be updated easily. * * @enum {string} * @private */ MaterialTabs.prototype.Constant_ = {}; /** * Store strings for class names defined by this component that are used in * JavaScript. This allows us to simply change it in one place should we * decide to modify at a later date. * * @enum {string} * @private */ MaterialTabs.prototype.CssClasses_ = { TAB_CLASS: 'mdl-tabs__tab', PANEL_CLASS: 'mdl-tabs__panel', ACTIVE_CLASS: 'is-active', UPGRADED_CLASS: 'is-upgraded', MDL_JS_RIPPLE_EFFECT: 'mdl-js-ripple-effect', MDL_RIPPLE_CONTAINER: 'mdl-tabs__ripple-container', MDL_RIPPLE: 'mdl-ripple', MDL_JS_RIPPLE_EFFECT_IGNORE_EVENTS: 'mdl-js-ripple-effect--ignore-events' }; /** * Handle clicks to a tabs component * * @private */ MaterialTabs.prototype.initTabs_ = function () { if (this.element_.classList.contains(this.CssClasses_.MDL_JS_RIPPLE_EFFECT)) { this.element_.classList.add(this.CssClasses_.MDL_JS_RIPPLE_EFFECT_IGNORE_EVENTS); } // Select element tabs, document panels this.tabs_ = this.element_.querySelectorAll('.' + this.CssClasses_.TAB_CLASS); this.panels_ = this.element_.querySelectorAll('.' + this.CssClasses_.PANEL_CLASS); // Create new tabs for each tab element for (var i = 0; i < this.tabs_.length; i++) { new MaterialTab(this.tabs_[i], this); } this.element_.classList.add(this.CssClasses_.UPGRADED_CLASS); }; /** * Reset tab state, dropping active classes * * @private */ MaterialTabs.prototype.resetTabState_ = function () { for (var k = 0; k < this.tabs_.length; k++) { this.tabs_[k].classList.remove(this.CssClasses_.ACTIVE_CLASS); } }; /** * Reset panel state, droping active classes * * @private */ MaterialTabs.prototype.resetPanelState_ = function () { for (var j = 0; j < this.panels_.length; j++) { this.panels_[j].classList.remove(this.CssClasses_.ACTIVE_CLASS); } }; /** * Initialize element. */ MaterialTabs.prototype.init = function () { if (this.element_) { this.initTabs_(); } }; /** * Constructor for an individual tab. * * @constructor * @param {Element} tab The HTML element for the tab. * @param {MaterialTabs} ctx The MaterialTabs object that owns the tab. */ function MaterialTab(tab, ctx) { if (tab) { if (ctx.element_.classList.contains(ctx.CssClasses_.MDL_JS_RIPPLE_EFFECT)) { var rippleContainer = document.createElement('span'); rippleContainer.classList.add(ctx.CssClasses_.MDL_RIPPLE_CONTAINER); rippleContainer.classList.add(ctx.CssClasses_.MDL_JS_RIPPLE_EFFECT); var ripple = document.createElement('span'); ripple.classList.add(ctx.CssClasses_.MDL_RIPPLE); rippleContainer.appendChild(ripple); tab.appendChild(rippleContainer); } tab.addEventListener('click', function (e) { if (tab.getAttribute('href').charAt(0) === '#') { e.preventDefault(); var href = tab.href.split('#')[1]; var panel = ctx.element_.querySelector('#' + href); ctx.resetTabState_(); ctx.resetPanelState_(); tab.classList.add(ctx.CssClasses_.ACTIVE_CLASS); panel.classList.add(ctx.CssClasses_.ACTIVE_CLASS); } }); } } // The component registers itself. It can assume componentHandler is available // in the global scope. componentHandler.register({ constructor: MaterialTabs, classAsString: 'MaterialTabs', cssClass: 'mdl-js-tabs' }); /** * @license * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Class constructor for Textfield MDL component. * Implements MDL component design pattern defined at: * https://github.com/jasonmayes/mdl-component-design-pattern * * @constructor * @param {HTMLElement} element The element that will be upgraded. */ var MaterialTextfield = function MaterialTextfield(element) { this.element_ = element; this.maxRows = this.Constant_.NO_MAX_ROWS; // Initialize instance. this.init(); }; window['MaterialTextfield'] = MaterialTextfield; /** * Store constants in one place so they can be updated easily. * * @enum {string | number} * @private */ MaterialTextfield.prototype.Constant_ = { NO_MAX_ROWS: -1, MAX_ROWS_ATTRIBUTE: 'maxrows' }; /** * Store strings for class names defined by this component that are used in * JavaScript. This allows us to simply change it in one place should we * decide to modify at a later date. * * @enum {string} * @private */ MaterialTextfield.prototype.CssClasses_ = { LABEL: 'mdl-textfield__label', INPUT: 'mdl-textfield__input', IS_DIRTY: 'is-dirty', IS_FOCUSED: 'is-focused', IS_DISABLED: 'is-disabled', IS_INVALID: 'is-invalid', IS_UPGRADED: 'is-upgraded', HAS_PLACEHOLDER: 'has-placeholder' }; /** * Handle input being entered. * * @param {Event} event The event that fired. * @private */ MaterialTextfield.prototype.onKeyDown_ = function (event) { var currentRowCount = event.target.value.split('\n').length; if (event.keyCode === 13) { if (currentRowCount >= this.maxRows) { event.preventDefault(); } } }; /** * Handle focus. * * @param {Event} event The event that fired. * @private */ MaterialTextfield.prototype.onFocus_ = function (event) { this.element_.classList.add(this.CssClasses_.IS_FOCUSED); }; /** * Handle lost focus. * * @param {Event} event The event that fired. * @private */ MaterialTextfield.prototype.onBlur_ = function (event) { this.element_.classList.remove(this.CssClasses_.IS_FOCUSED); }; /** * Handle reset event from out side. * * @param {Event} event The event that fired. * @private */ MaterialTextfield.prototype.onReset_ = function (event) { this.updateClasses_(); }; /** * Handle class updates. * * @private */ MaterialTextfield.prototype.updateClasses_ = function () { this.checkDisabled(); this.checkValidity(); this.checkDirty(); this.checkFocus(); }; // Public methods. /** * Check the disabled state and update field accordingly. * * @public */ MaterialTextfield.prototype.checkDisabled = function () { if (this.input_.disabled) { this.element_.classList.add(this.CssClasses_.IS_DISABLED); } else { this.element_.classList.remove(this.CssClasses_.IS_DISABLED); } }; MaterialTextfield.prototype['checkDisabled'] = MaterialTextfield.prototype.checkDisabled; /** * Check the focus state and update field accordingly. * * @public */ MaterialTextfield.prototype.checkFocus = function () { if (Boolean(this.element_.querySelector(':focus'))) { this.element_.classList.add(this.CssClasses_.IS_FOCUSED); } else { this.element_.classList.remove(this.CssClasses_.IS_FOCUSED); } }; MaterialTextfield.prototype['checkFocus'] = MaterialTextfield.prototype.checkFocus; /** * Check the validity state and update field accordingly. * * @public */ MaterialTextfield.prototype.checkValidity = function () { if (this.input_.validity) { if (this.input_.validity.valid) { this.element_.classList.remove(this.CssClasses_.IS_INVALID); } else { this.element_.classList.add(this.CssClasses_.IS_INVALID); } } }; MaterialTextfield.prototype['checkValidity'] = MaterialTextfield.prototype.checkValidity; /** * Check the dirty state and update field accordingly. * * @public */ MaterialTextfield.prototype.checkDirty = function () { if (this.input_.value && this.input_.value.length > 0) { this.element_.classList.add(this.CssClasses_.IS_DIRTY); } else { this.element_.classList.remove(this.CssClasses_.IS_DIRTY); } }; MaterialTextfield.prototype['checkDirty'] = MaterialTextfield.prototype.checkDirty; /** * Disable text field. * * @public */ MaterialTextfield.prototype.disable = function () { this.input_.disabled = true; this.updateClasses_(); }; MaterialTextfield.prototype['disable'] = MaterialTextfield.prototype.disable; /** * Enable text field. * * @public */ MaterialTextfield.prototype.enable = function () { this.input_.disabled = false; this.updateClasses_(); }; MaterialTextfield.prototype['enable'] = MaterialTextfield.prototype.enable; /** * Update text field value. * * @param {string} value The value to which to set the control (optional). * @public */ MaterialTextfield.prototype.change = function (value) { this.input_.value = value || ''; this.updateClasses_(); }; MaterialTextfield.prototype['change'] = MaterialTextfield.prototype.change; /** * Initialize element. */ MaterialTextfield.prototype.init = function () { if (this.element_) { this.label_ = this.element_.querySelector('.' + this.CssClasses_.LABEL); this.input_ = this.element_.querySelector('.' + this.CssClasses_.INPUT); if (this.input_) { if (this.input_.hasAttribute(this.Constant_.MAX_ROWS_ATTRIBUTE)) { this.maxRows = parseInt(this.input_.getAttribute(this.Constant_.MAX_ROWS_ATTRIBUTE), 10); if (isNaN(this.maxRows)) { this.maxRows = this.Constant_.NO_MAX_ROWS; } } if (this.input_.hasAttribute('placeholder')) { this.element_.classList.add(this.CssClasses_.HAS_PLACEHOLDER); } this.boundUpdateClassesHandler = this.updateClasses_.bind(this); this.boundFocusHandler = this.onFocus_.bind(this); this.boundBlurHandler = this.onBlur_.bind(this); this.boundResetHandler = this.onReset_.bind(this); this.input_.addEventListener('input', this.boundUpdateClassesHandler); this.input_.addEventListener('focus', this.boundFocusHandler); this.input_.addEventListener('blur', this.boundBlurHandler); this.input_.addEventListener('reset', this.boundResetHandler); if (this.maxRows !== this.Constant_.NO_MAX_ROWS) { // TODO: This should handle pasting multi line text. // Currently doesn't. this.boundKeyDownHandler = this.onKeyDown_.bind(this); this.input_.addEventListener('keydown', this.boundKeyDownHandler); } var invalid = this.element_.classList.contains(this.CssClasses_.IS_INVALID); this.updateClasses_(); this.element_.classList.add(this.CssClasses_.IS_UPGRADED); if (invalid) { this.element_.classList.add(this.CssClasses_.IS_INVALID); } if (this.input_.hasAttribute('autofocus')) { this.element_.focus(); this.checkFocus(); } } } }; // The component registers itself. It can assume componentHandler is available // in the global scope. componentHandler.register({ constructor: MaterialTextfield, classAsString: 'MaterialTextfield', cssClass: 'mdl-js-textfield', widget: true }); /** * @license * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Class constructor for Tooltip MDL component. * Implements MDL component design pattern defined at: * https://github.com/jasonmayes/mdl-component-design-pattern * * @constructor * @param {HTMLElement} element The element that will be upgraded. */ var MaterialTooltip = function MaterialTooltip(element) { this.element_ = element; // Initialize instance. this.init(); }; window['MaterialTooltip'] = MaterialTooltip; /** * Store constants in one place so they can be updated easily. * * @enum {string | number} * @private */ MaterialTooltip.prototype.Constant_ = {}; /** * Store strings for class names defined by this component that are used in * JavaScript. This allows us to simply change it in one place should we * decide to modify at a later date. * * @enum {string} * @private */ MaterialTooltip.prototype.CssClasses_ = { IS_ACTIVE: 'is-active', BOTTOM: 'mdl-tooltip--bottom', LEFT: 'mdl-tooltip--left', RIGHT: 'mdl-tooltip--right', TOP: 'mdl-tooltip--top' }; /** * Handle mouseenter for tooltip. * * @param {Event} event The event that fired. * @private */ MaterialTooltip.prototype.handleMouseEnter_ = function (event) { var props = event.target.getBoundingClientRect(); var left = props.left + props.width / 2; var top = props.top + props.height / 2; var marginLeft = -1 * (this.element_.offsetWidth / 2); var marginTop = -1 * (this.element_.offsetHeight / 2); if (this.element_.classList.contains(this.CssClasses_.LEFT) || this.element_.classList.contains(this.CssClasses_.RIGHT)) { left = props.width / 2; if (top + marginTop < 0) { this.element_.style.top = '0'; this.element_.style.marginTop = '0'; } else { this.element_.style.top = top + 'px'; this.element_.style.marginTop = marginTop + 'px'; } } else { if (left + marginLeft < 0) { this.element_.style.left = '0'; this.element_.style.marginLeft = '0'; } else { this.element_.style.left = left + 'px'; this.element_.style.marginLeft = marginLeft + 'px'; } } if (this.element_.classList.contains(this.CssClasses_.TOP)) { this.element_.style.top = props.top - this.element_.offsetHeight - 10 + 'px'; } else if (this.element_.classList.contains(this.CssClasses_.RIGHT)) { this.element_.style.left = props.left + props.width + 10 + 'px'; } else if (this.element_.classList.contains(this.CssClasses_.LEFT)) { this.element_.style.left = props.left - this.element_.offsetWidth - 10 + 'px'; } else { this.element_.style.top = props.top + props.height + 10 + 'px'; } this.element_.classList.add(this.CssClasses_.IS_ACTIVE); }; /** * Hide tooltip on mouseleave or scroll * * @private */ MaterialTooltip.prototype.hideTooltip_ = function () { this.element_.classList.remove(this.CssClasses_.IS_ACTIVE); }; /** * Initialize element. */ MaterialTooltip.prototype.init = function () { if (this.element_) { var forElId = this.element_.getAttribute('for') || this.element_.getAttribute('data-mdl-for'); if (forElId) { this.forElement_ = document.getElementById(forElId); } if (this.forElement_) { // It's left here because it prevents accidental text selection on Android if (!this.forElement_.hasAttribute('tabindex')) { this.forElement_.setAttribute('tabindex', '0'); } this.boundMouseEnterHandler = this.handleMouseEnter_.bind(this); this.boundMouseLeaveAndScrollHandler = this.hideTooltip_.bind(this); this.forElement_.addEventListener('mouseenter', this.boundMouseEnterHandler, false); this.forElement_.addEventListener('touchend', this.boundMouseEnterHandler, false); this.forElement_.addEventListener('mouseleave', this.boundMouseLeaveAndScrollHandler, false); window.addEventListener('scroll', this.boundMouseLeaveAndScrollHandler, true); window.addEventListener('touchstart', this.boundMouseLeaveAndScrollHandler); } } }; // The component registers itself. It can assume componentHandler is available // in the global scope. componentHandler.register({ constructor: MaterialTooltip, classAsString: 'MaterialTooltip', cssClass: 'mdl-tooltip' }); /** * @license * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Class constructor for Layout MDL component. * Implements MDL component design pattern defined at: * https://github.com/jasonmayes/mdl-component-design-pattern * * @constructor * @param {HTMLElement} element The element that will be upgraded. */ var MaterialLayout = function MaterialLayout(element) { this.element_ = element; // Initialize instance. this.init(); }; window['MaterialLayout'] = MaterialLayout; /** * Store constants in one place so they can be updated easily. * * @enum {string | number} * @private */ MaterialLayout.prototype.Constant_ = { MAX_WIDTH: '(max-width: 1024px)', TAB_SCROLL_PIXELS: 100, RESIZE_TIMEOUT: 100, MENU_ICON: '', CHEVRON_LEFT: 'chevron_left', CHEVRON_RIGHT: 'chevron_right' }; /** * Keycodes, for code readability. * * @enum {number} * @private */ MaterialLayout.prototype.Keycodes_ = { ENTER: 13, ESCAPE: 27, SPACE: 32 }; /** * Modes. * * @enum {number} * @private */ MaterialLayout.prototype.Mode_ = { STANDARD: 0, SEAMED: 1, WATERFALL: 2, SCROLL: 3 }; /** * Store strings for class names defined by this component that are used in * JavaScript. This allows us to simply change it in one place should we * decide to modify at a later date. * * @enum {string} * @private */ MaterialLayout.prototype.CssClasses_ = { CONTAINER: 'mdl-layout__container', HEADER: 'mdl-layout__header', DRAWER: 'mdl-layout__drawer', CONTENT: 'mdl-layout__content', DRAWER_BTN: 'mdl-layout__drawer-button', ICON: 'material-icons', JS_RIPPLE_EFFECT: 'mdl-js-ripple-effect', RIPPLE_CONTAINER: 'mdl-layout__tab-ripple-container', RIPPLE: 'mdl-ripple', RIPPLE_IGNORE_EVENTS: 'mdl-js-ripple-effect--ignore-events', HEADER_SEAMED: 'mdl-layout__header--seamed', HEADER_WATERFALL: 'mdl-layout__header--waterfall', HEADER_SCROLL: 'mdl-layout__header--scroll', FIXED_HEADER: 'mdl-layout--fixed-header', OBFUSCATOR: 'mdl-layout__obfuscator', TAB_BAR: 'mdl-layout__tab-bar', TAB_CONTAINER: 'mdl-layout__tab-bar-container', TAB: 'mdl-layout__tab', TAB_BAR_BUTTON: 'mdl-layout__tab-bar-button', TAB_BAR_LEFT_BUTTON: 'mdl-layout__tab-bar-left-button', TAB_BAR_RIGHT_BUTTON: 'mdl-layout__tab-bar-right-button', TAB_MANUAL_SWITCH: 'mdl-layout__tab-manual-switch', PANEL: 'mdl-layout__tab-panel', HAS_DRAWER: 'has-drawer', HAS_TABS: 'has-tabs', HAS_SCROLLING_HEADER: 'has-scrolling-header', CASTING_SHADOW: 'is-casting-shadow', IS_COMPACT: 'is-compact', IS_SMALL_SCREEN: 'is-small-screen', IS_DRAWER_OPEN: 'is-visible', IS_ACTIVE: 'is-active', IS_UPGRADED: 'is-upgraded', IS_ANIMATING: 'is-animating', ON_LARGE_SCREEN: 'mdl-layout--large-screen-only', ON_SMALL_SCREEN: 'mdl-layout--small-screen-only' }; /** * Handles scrolling on the content. * * @private */ MaterialLayout.prototype.contentScrollHandler_ = function () { if (this.header_.classList.contains(this.CssClasses_.IS_ANIMATING)) { return; } var headerVisible = !this.element_.classList.contains(this.CssClasses_.IS_SMALL_SCREEN) || this.element_.classList.contains(this.CssClasses_.FIXED_HEADER); if (this.content_.scrollTop > 0 && !this.header_.classList.contains(this.CssClasses_.IS_COMPACT)) { this.header_.classList.add(this.CssClasses_.CASTING_SHADOW); this.header_.classList.add(this.CssClasses_.IS_COMPACT); if (headerVisible) { this.header_.classList.add(this.CssClasses_.IS_ANIMATING); } } else if (this.content_.scrollTop <= 0 && this.header_.classList.contains(this.CssClasses_.IS_COMPACT)) { this.header_.classList.remove(this.CssClasses_.CASTING_SHADOW); this.header_.classList.remove(this.CssClasses_.IS_COMPACT); if (headerVisible) { this.header_.classList.add(this.CssClasses_.IS_ANIMATING); } } }; /** * Handles a keyboard event on the drawer. * * @param {Event} evt The event that fired. * @private */ MaterialLayout.prototype.keyboardEventHandler_ = function (evt) { // Only react when the drawer is open. if (evt.keyCode === this.Keycodes_.ESCAPE && this.drawer_.classList.contains(this.CssClasses_.IS_DRAWER_OPEN)) { this.toggleDrawer(); } }; /** * Handles changes in screen size. * * @private */ MaterialLayout.prototype.screenSizeHandler_ = function () { if (this.screenSizeMediaQuery_.matches) { this.element_.classList.add(this.CssClasses_.IS_SMALL_SCREEN); } else { this.element_.classList.remove(this.CssClasses_.IS_SMALL_SCREEN); // Collapse drawer (if any) when moving to a large screen size. if (this.drawer_) { this.drawer_.classList.remove(this.CssClasses_.IS_DRAWER_OPEN); this.obfuscator_.classList.remove(this.CssClasses_.IS_DRAWER_OPEN); } } }; /** * Handles events of drawer button. * * @param {Event} evt The event that fired. * @private */ MaterialLayout.prototype.drawerToggleHandler_ = function (evt) { if (evt && evt.type === 'keydown') { if (evt.keyCode === this.Keycodes_.SPACE || evt.keyCode === this.Keycodes_.ENTER) { // prevent scrolling in drawer nav evt.preventDefault(); } else { // prevent other keys return; } } this.toggleDrawer(); }; /** * Handles (un)setting the `is-animating` class * * @private */ MaterialLayout.prototype.headerTransitionEndHandler_ = function () { this.header_.classList.remove(this.CssClasses_.IS_ANIMATING); }; /** * Handles expanding the header on click * * @private */ MaterialLayout.prototype.headerClickHandler_ = function () { if (this.header_.classList.contains(this.CssClasses_.IS_COMPACT)) { this.header_.classList.remove(this.CssClasses_.IS_COMPACT); this.header_.classList.add(this.CssClasses_.IS_ANIMATING); } }; /** * Reset tab state, dropping active classes * * @private */ MaterialLayout.prototype.resetTabState_ = function (tabBar) { for (var k = 0; k < tabBar.length; k++) { tabBar[k].classList.remove(this.CssClasses_.IS_ACTIVE); } }; /** * Reset panel state, droping active classes * * @private */ MaterialLayout.prototype.resetPanelState_ = function (panels) { for (var j = 0; j < panels.length; j++) { panels[j].classList.remove(this.CssClasses_.IS_ACTIVE); } }; /** * Toggle drawer state * * @public */ MaterialLayout.prototype.toggleDrawer = function () { var drawerButton = this.element_.querySelector('.' + this.CssClasses_.DRAWER_BTN); this.drawer_.classList.toggle(this.CssClasses_.IS_DRAWER_OPEN); this.obfuscator_.classList.toggle(this.CssClasses_.IS_DRAWER_OPEN); // Set accessibility properties. if (this.drawer_.classList.contains(this.CssClasses_.IS_DRAWER_OPEN)) { this.drawer_.setAttribute('aria-hidden', 'false'); drawerButton.setAttribute('aria-expanded', 'true'); } else { this.drawer_.setAttribute('aria-hidden', 'true'); drawerButton.setAttribute('aria-expanded', 'false'); } }; MaterialLayout.prototype['toggleDrawer'] = MaterialLayout.prototype.toggleDrawer; /** * Initialize element. */ MaterialLayout.prototype.init = function () { if (this.element_) { var container = document.createElement('div'); container.classList.add(this.CssClasses_.CONTAINER); var focusedElement = this.element_.querySelector(':focus'); this.element_.parentElement.insertBefore(container, this.element_); this.element_.parentElement.removeChild(this.element_); container.appendChild(this.element_); if (focusedElement) { focusedElement.focus(); } var directChildren = this.element_.childNodes; var numChildren = directChildren.length; for (var c = 0; c < numChildren; c++) { var child = directChildren[c]; if (child.classList && child.classList.contains(this.CssClasses_.HEADER)) { this.header_ = child; } if (child.classList && child.classList.contains(this.CssClasses_.DRAWER)) { this.drawer_ = child; } if (child.classList && child.classList.contains(this.CssClasses_.CONTENT)) { this.content_ = child; } } window.addEventListener('pageshow', function (e) { if (e.persisted) { // when page is loaded from back/forward cache // trigger repaint to let layout scroll in safari this.element_.style.overflowY = 'hidden'; requestAnimationFrame(function () { this.element_.style.overflowY = ''; }.bind(this)); } }.bind(this), false); if (this.header_) { this.tabBar_ = this.header_.querySelector('.' + this.CssClasses_.TAB_BAR); } var mode = this.Mode_.STANDARD; if (this.header_) { if (this.header_.classList.contains(this.CssClasses_.HEADER_SEAMED)) { mode = this.Mode_.SEAMED; } else if (this.header_.classList.contains(this.CssClasses_.HEADER_WATERFALL)) { mode = this.Mode_.WATERFALL; this.header_.addEventListener('transitionend', this.headerTransitionEndHandler_.bind(this)); this.header_.addEventListener('click', this.headerClickHandler_.bind(this)); } else if (this.header_.classList.contains(this.CssClasses_.HEADER_SCROLL)) { mode = this.Mode_.SCROLL; container.classList.add(this.CssClasses_.HAS_SCROLLING_HEADER); } if (mode === this.Mode_.STANDARD) { this.header_.classList.add(this.CssClasses_.CASTING_SHADOW); if (this.tabBar_) { this.tabBar_.classList.add(this.CssClasses_.CASTING_SHADOW); } } else if (mode === this.Mode_.SEAMED || mode === this.Mode_.SCROLL) { this.header_.classList.remove(this.CssClasses_.CASTING_SHADOW); if (this.tabBar_) { this.tabBar_.classList.remove(this.CssClasses_.CASTING_SHADOW); } } else if (mode === this.Mode_.WATERFALL) { // Add and remove shadows depending on scroll position. // Also add/remove auxiliary class for styling of the compact version of // the header. this.content_.addEventListener('scroll', this.contentScrollHandler_.bind(this)); this.contentScrollHandler_(); } } // Add drawer toggling button to our layout, if we have an openable drawer. if (this.drawer_) { var drawerButton = this.element_.querySelector('.' + this.CssClasses_.DRAWER_BTN); if (!drawerButton) { drawerButton = document.createElement('div'); drawerButton.setAttribute('aria-expanded', 'false'); drawerButton.setAttribute('role', 'button'); drawerButton.setAttribute('tabindex', '0'); drawerButton.classList.add(this.CssClasses_.DRAWER_BTN); var drawerButtonIcon = document.createElement('i'); drawerButtonIcon.classList.add(this.CssClasses_.ICON); drawerButtonIcon.innerHTML = this.Constant_.MENU_ICON; drawerButton.appendChild(drawerButtonIcon); } if (this.drawer_.classList.contains(this.CssClasses_.ON_LARGE_SCREEN)) { //If drawer has ON_LARGE_SCREEN class then add it to the drawer toggle button as well. drawerButton.classList.add(this.CssClasses_.ON_LARGE_SCREEN); } else if (this.drawer_.classList.contains(this.CssClasses_.ON_SMALL_SCREEN)) { //If drawer has ON_SMALL_SCREEN class then add it to the drawer toggle button as well. drawerButton.classList.add(this.CssClasses_.ON_SMALL_SCREEN); } drawerButton.addEventListener('click', this.drawerToggleHandler_.bind(this)); drawerButton.addEventListener('keydown', this.drawerToggleHandler_.bind(this)); // Add a class if the layout has a drawer, for altering the left padding. // Adds the HAS_DRAWER to the elements since this.header_ may or may // not be present. this.element_.classList.add(this.CssClasses_.HAS_DRAWER); // If we have a fixed header, add the button to the header rather than // the layout. if (this.element_.classList.contains(this.CssClasses_.FIXED_HEADER)) { this.header_.insertBefore(drawerButton, this.header_.firstChild); } else { this.element_.insertBefore(drawerButton, this.content_); } var obfuscator = document.createElement('div'); obfuscator.classList.add(this.CssClasses_.OBFUSCATOR); this.element_.appendChild(obfuscator); obfuscator.addEventListener('click', this.drawerToggleHandler_.bind(this)); this.obfuscator_ = obfuscator; this.drawer_.addEventListener('keydown', this.keyboardEventHandler_.bind(this)); this.drawer_.setAttribute('aria-hidden', 'true'); } // Keep an eye on screen size, and add/remove auxiliary class for styling // of small screens. this.screenSizeMediaQuery_ = window.matchMedia(this.Constant_.MAX_WIDTH); this.screenSizeMediaQuery_.addListener(this.screenSizeHandler_.bind(this)); this.screenSizeHandler_(); // Initialize tabs, if any. if (this.header_ && this.tabBar_) { this.element_.classList.add(this.CssClasses_.HAS_TABS); var tabContainer = document.createElement('div'); tabContainer.classList.add(this.CssClasses_.TAB_CONTAINER); this.header_.insertBefore(tabContainer, this.tabBar_); this.header_.removeChild(this.tabBar_); var leftButton = document.createElement('div'); leftButton.classList.add(this.CssClasses_.TAB_BAR_BUTTON); leftButton.classList.add(this.CssClasses_.TAB_BAR_LEFT_BUTTON); var leftButtonIcon = document.createElement('i'); leftButtonIcon.classList.add(this.CssClasses_.ICON); leftButtonIcon.textContent = this.Constant_.CHEVRON_LEFT; leftButton.appendChild(leftButtonIcon); leftButton.addEventListener('click', function () { this.tabBar_.scrollLeft -= this.Constant_.TAB_SCROLL_PIXELS; }.bind(this)); var rightButton = document.createElement('div'); rightButton.classList.add(this.CssClasses_.TAB_BAR_BUTTON); rightButton.classList.add(this.CssClasses_.TAB_BAR_RIGHT_BUTTON); var rightButtonIcon = document.createElement('i'); rightButtonIcon.classList.add(this.CssClasses_.ICON); rightButtonIcon.textContent = this.Constant_.CHEVRON_RIGHT; rightButton.appendChild(rightButtonIcon); rightButton.addEventListener('click', function () { this.tabBar_.scrollLeft += this.Constant_.TAB_SCROLL_PIXELS; }.bind(this)); tabContainer.appendChild(leftButton); tabContainer.appendChild(this.tabBar_); tabContainer.appendChild(rightButton); // Add and remove tab buttons depending on scroll position and total // window size. var tabUpdateHandler = function () { if (this.tabBar_.scrollLeft > 0) { leftButton.classList.add(this.CssClasses_.IS_ACTIVE); } else { leftButton.classList.remove(this.CssClasses_.IS_ACTIVE); } if (this.tabBar_.scrollLeft < this.tabBar_.scrollWidth - this.tabBar_.offsetWidth) { rightButton.classList.add(this.CssClasses_.IS_ACTIVE); } else { rightButton.classList.remove(this.CssClasses_.IS_ACTIVE); } }.bind(this); this.tabBar_.addEventListener('scroll', tabUpdateHandler); tabUpdateHandler(); // Update tabs when the window resizes. var windowResizeHandler = function () { // Use timeouts to make sure it doesn't happen too often. if (this.resizeTimeoutId_) { clearTimeout(this.resizeTimeoutId_); } this.resizeTimeoutId_ = setTimeout(function () { tabUpdateHandler(); this.resizeTimeoutId_ = null; }.bind(this), this.Constant_.RESIZE_TIMEOUT); }.bind(this); window.addEventListener('resize', windowResizeHandler); if (this.tabBar_.classList.contains(this.CssClasses_.JS_RIPPLE_EFFECT)) { this.tabBar_.classList.add(this.CssClasses_.RIPPLE_IGNORE_EVENTS); } // Select element tabs, document panels var tabs = this.tabBar_.querySelectorAll('.' + this.CssClasses_.TAB); var panels = this.content_.querySelectorAll('.' + this.CssClasses_.PANEL); // Create new tabs for each tab element for (var i = 0; i < tabs.length; i++) { new MaterialLayoutTab(tabs[i], tabs, panels, this); } } this.element_.classList.add(this.CssClasses_.IS_UPGRADED); } }; /** * Constructor for an individual tab. * * @constructor * @param {HTMLElement} tab The HTML element for the tab. * @param {!Array<HTMLElement>} tabs Array with HTML elements for all tabs. * @param {!Array<HTMLElement>} panels Array with HTML elements for all panels. * @param {MaterialLayout} layout The MaterialLayout object that owns the tab. */ function MaterialLayoutTab(tab, tabs, panels, layout) { /** * Auxiliary method to programmatically select a tab in the UI. */ function selectTab() { var href = tab.href.split('#')[1]; var panel = layout.content_.querySelector('#' + href); layout.resetTabState_(tabs); layout.resetPanelState_(panels); tab.classList.add(layout.CssClasses_.IS_ACTIVE); panel.classList.add(layout.CssClasses_.IS_ACTIVE); } if (layout.tabBar_.classList.contains(layout.CssClasses_.JS_RIPPLE_EFFECT)) { var rippleContainer = document.createElement('span'); rippleContainer.classList.add(layout.CssClasses_.RIPPLE_CONTAINER); rippleContainer.classList.add(layout.CssClasses_.JS_RIPPLE_EFFECT); var ripple = document.createElement('span'); ripple.classList.add(layout.CssClasses_.RIPPLE); rippleContainer.appendChild(ripple); tab.appendChild(rippleContainer); } if (!layout.tabBar_.classList.contains(layout.CssClasses_.TAB_MANUAL_SWITCH)) { tab.addEventListener('click', function (e) { if (tab.getAttribute('href').charAt(0) === '#') { e.preventDefault(); selectTab(); } }); } tab.show = selectTab; } window['MaterialLayoutTab'] = MaterialLayoutTab; // The component registers itself. It can assume componentHandler is available // in the global scope. componentHandler.register({ constructor: MaterialLayout, classAsString: 'MaterialLayout', cssClass: 'mdl-js-layout' }); /** * @license * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Class constructor for Data Table Card MDL component. * Implements MDL component design pattern defined at: * https://github.com/jasonmayes/mdl-component-design-pattern * * @constructor * @param {Element} element The element that will be upgraded. */ var MaterialDataTable = function MaterialDataTable(element) { this.element_ = element; // Initialize instance. this.init(); }; window['MaterialDataTable'] = MaterialDataTable; /** * Store constants in one place so they can be updated easily. * * @enum {string | number} * @private */ MaterialDataTable.prototype.Constant_ = {}; /** * Store strings for class names defined by this component that are used in * JavaScript. This allows us to simply change it in one place should we * decide to modify at a later date. * * @enum {string} * @private */ MaterialDataTable.prototype.CssClasses_ = { DATA_TABLE: 'mdl-data-table', SELECTABLE: 'mdl-data-table--selectable', SELECT_ELEMENT: 'mdl-data-table__select', IS_SELECTED: 'is-selected', IS_UPGRADED: 'is-upgraded' }; /** * Generates and returns a function that toggles the selection state of a * single row (or multiple rows). * * @param {Element} checkbox Checkbox that toggles the selection state. * @param {Element} row Row to toggle when checkbox changes. * @param {(Array<Object>|NodeList)=} opt_rows Rows to toggle when checkbox changes. * @private */ MaterialDataTable.prototype.selectRow_ = function (checkbox, row, opt_rows) { if (row) { return function () { if (checkbox.checked) { row.classList.add(this.CssClasses_.IS_SELECTED); } else { row.classList.remove(this.CssClasses_.IS_SELECTED); } }.bind(this); } if (opt_rows) { return function () { var i; var el; if (checkbox.checked) { for (i = 0; i < opt_rows.length; i++) { el = opt_rows[i].querySelector('td').querySelector('.mdl-checkbox'); el['MaterialCheckbox'].check(); opt_rows[i].classList.add(this.CssClasses_.IS_SELECTED); } } else { for (i = 0; i < opt_rows.length; i++) { el = opt_rows[i].querySelector('td').querySelector('.mdl-checkbox'); el['MaterialCheckbox'].uncheck(); opt_rows[i].classList.remove(this.CssClasses_.IS_SELECTED); } } }.bind(this); } }; /** * Creates a checkbox for a single or or multiple rows and hooks up the * event handling. * * @param {Element} row Row to toggle when checkbox changes. * @param {(Array<Object>|NodeList)=} opt_rows Rows to toggle when checkbox changes. * @private */ MaterialDataTable.prototype.createCheckbox_ = function (row, opt_rows) { var label = document.createElement('label'); var labelClasses = [ 'mdl-checkbox', 'mdl-js-checkbox', 'mdl-js-ripple-effect', this.CssClasses_.SELECT_ELEMENT ]; label.className = labelClasses.join(' '); var checkbox = document.createElement('input'); checkbox.type = 'checkbox'; checkbox.classList.add('mdl-checkbox__input'); if (row) { checkbox.checked = row.classList.contains(this.CssClasses_.IS_SELECTED); checkbox.addEventListener('change', this.selectRow_(checkbox, row)); } else if (opt_rows) { checkbox.addEventListener('change', this.selectRow_(checkbox, null, opt_rows)); } label.appendChild(checkbox); componentHandler.upgradeElement(label, 'MaterialCheckbox'); return label; }; /** * Initialize element. */ MaterialDataTable.prototype.init = function () { if (this.element_) { var firstHeader = this.element_.querySelector('th'); var bodyRows = Array.prototype.slice.call(this.element_.querySelectorAll('tbody tr')); var footRows = Array.prototype.slice.call(this.element_.querySelectorAll('tfoot tr')); var rows = bodyRows.concat(footRows); if (this.element_.classList.contains(this.CssClasses_.SELECTABLE)) { var th = document.createElement('th'); var headerCheckbox = this.createCheckbox_(null, rows); th.appendChild(headerCheckbox); firstHeader.parentElement.insertBefore(th, firstHeader); for (var i = 0; i < rows.length; i++) { var firstCell = rows[i].querySelector('td'); if (firstCell) { var td = document.createElement('td'); if (rows[i].parentNode.nodeName.toUpperCase() === 'TBODY') { var rowCheckbox = this.createCheckbox_(rows[i]); td.appendChild(rowCheckbox); } rows[i].insertBefore(td, firstCell); } } this.element_.classList.add(this.CssClasses_.IS_UPGRADED); } } }; // The component registers itself. It can assume componentHandler is available // in the global scope. componentHandler.register({ constructor: MaterialDataTable, classAsString: 'MaterialDataTable', cssClass: 'mdl-js-data-table' }); /** * @license * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Class constructor for Ripple MDL component. * Implements MDL component design pattern defined at: * https://github.com/jasonmayes/mdl-component-design-pattern * * @constructor * @param {HTMLElement} element The element that will be upgraded. */ var MaterialRipple = function MaterialRipple(element) { this.element_ = element; // Initialize instance. this.init(); }; window['MaterialRipple'] = MaterialRipple; /** * Store constants in one place so they can be updated easily. * * @enum {string | number} * @private */ MaterialRipple.prototype.Constant_ = { INITIAL_SCALE: 'scale(0.0001, 0.0001)', INITIAL_SIZE: '1px', INITIAL_OPACITY: '0.4', FINAL_OPACITY: '0', FINAL_SCALE: '' }; /** * Store strings for class names defined by this component that are used in * JavaScript. This allows us to simply change it in one place should we * decide to modify at a later date. * * @enum {string} * @private */ MaterialRipple.prototype.CssClasses_ = { RIPPLE_CENTER: 'mdl-ripple--center', RIPPLE_EFFECT_IGNORE_EVENTS: 'mdl-js-ripple-effect--ignore-events', RIPPLE: 'mdl-ripple', IS_ANIMATING: 'is-animating', IS_VISIBLE: 'is-visible' }; /** * Handle mouse / finger down on element. * * @param {Event} event The event that fired. * @private */ MaterialRipple.prototype.downHandler_ = function (event) { if (!this.rippleElement_.style.width && !this.rippleElement_.style.height) { var rect = this.element_.getBoundingClientRect(); this.boundHeight = rect.height; this.boundWidth = rect.width; this.rippleSize_ = Math.sqrt(rect.width * rect.width + rect.height * rect.height) * 2 + 2; this.rippleElement_.style.width = this.rippleSize_ + 'px'; this.rippleElement_.style.height = this.rippleSize_ + 'px'; } this.rippleElement_.classList.add(this.CssClasses_.IS_VISIBLE); if (event.type === 'mousedown' && this.ignoringMouseDown_) { this.ignoringMouseDown_ = false; } else { if (event.type === 'touchstart') { this.ignoringMouseDown_ = true; } var frameCount = this.getFrameCount(); if (frameCount > 0) { return; } this.setFrameCount(1); var bound = event.currentTarget.getBoundingClientRect(); var x; var y; // Check if we are handling a keyboard click. if (event.clientX === 0 && event.clientY === 0) { x = Math.round(bound.width / 2); y = Math.round(bound.height / 2); } else { var clientX = event.clientX !== undefined ? event.clientX : event.touches[0].clientX; var clientY = event.clientY !== undefined ? event.clientY : event.touches[0].clientY; x = Math.round(clientX - bound.left); y = Math.round(clientY - bound.top); } this.setRippleXY(x, y); this.setRippleStyles(true); window.requestAnimationFrame(this.animFrameHandler.bind(this)); } }; /** * Handle mouse / finger up on element. * * @param {Event} event The event that fired. * @private */ MaterialRipple.prototype.upHandler_ = function (event) { // Don't fire for the artificial "mouseup" generated by a double-click. if (event && event.detail !== 2) { // Allow a repaint to occur before removing this class, so the animation // shows for tap events, which seem to trigger a mouseup too soon after // mousedown. window.setTimeout(function () { this.rippleElement_.classList.remove(this.CssClasses_.IS_VISIBLE); }.bind(this), 0); } }; /** * Initialize element. */ MaterialRipple.prototype.init = function () { if (this.element_) { var recentering = this.element_.classList.contains(this.CssClasses_.RIPPLE_CENTER); if (!this.element_.classList.contains(this.CssClasses_.RIPPLE_EFFECT_IGNORE_EVENTS)) { this.rippleElement_ = this.element_.querySelector('.' + this.CssClasses_.RIPPLE); this.frameCount_ = 0; this.rippleSize_ = 0; this.x_ = 0; this.y_ = 0; // Touch start produces a compat mouse down event, which would cause a // second ripples. To avoid that, we use this property to ignore the first // mouse down after a touch start. this.ignoringMouseDown_ = false; this.boundDownHandler = this.downHandler_.bind(this); this.element_.addEventListener('mousedown', this.boundDownHandler); this.element_.addEventListener('touchstart', this.boundDownHandler); this.boundUpHandler = this.upHandler_.bind(this); this.element_.addEventListener('mouseup', this.boundUpHandler); this.element_.addEventListener('mouseleave', this.boundUpHandler); this.element_.addEventListener('touchend', this.boundUpHandler); this.element_.addEventListener('blur', this.boundUpHandler); /** * Getter for frameCount_. * @return {number} the frame count. */ this.getFrameCount = function () { return this.frameCount_; }; /** * Setter for frameCount_. * @param {number} fC the frame count. */ this.setFrameCount = function (fC) { this.frameCount_ = fC; }; /** * Getter for rippleElement_. * @return {Element} the ripple element. */ this.getRippleElement = function () { return this.rippleElement_; }; /** * Sets the ripple X and Y coordinates. * @param {number} newX the new X coordinate * @param {number} newY the new Y coordinate */ this.setRippleXY = function (newX, newY) { this.x_ = newX; this.y_ = newY; }; /** * Sets the ripple styles. * @param {boolean} start whether or not this is the start frame. */ this.setRippleStyles = function (start) { if (this.rippleElement_ !== null) { var transformString; var scale; var size; var offset = 'translate(' + this.x_ + 'px, ' + this.y_ + 'px)'; if (start) { scale = this.Constant_.INITIAL_SCALE; size = this.Constant_.INITIAL_SIZE; } else { scale = this.Constant_.FINAL_SCALE; size = this.rippleSize_ + 'px'; if (recentering) { offset = 'translate(' + this.boundWidth / 2 + 'px, ' + this.boundHeight / 2 + 'px)'; } } transformString = 'translate(-50%, -50%) ' + offset + scale; this.rippleElement_.style.webkitTransform = transformString; this.rippleElement_.style.msTransform = transformString; this.rippleElement_.style.transform = transformString; if (start) { this.rippleElement_.classList.remove(this.CssClasses_.IS_ANIMATING); } else { this.rippleElement_.classList.add(this.CssClasses_.IS_ANIMATING); } } }; /** * Handles an animation frame. */ this.animFrameHandler = function () { if (this.frameCount_-- > 0) { window.requestAnimationFrame(this.animFrameHandler.bind(this)); } else { this.setRippleStyles(false); } }; } } }; // The component registers itself. It can assume componentHandler is available // in the global scope. componentHandler.register({ constructor: MaterialRipple, classAsString: 'MaterialRipple', cssClass: 'mdl-js-ripple-effect', widget: false }); }()); /***/ }) /******/ ]);